Skip to content

Commit

Permalink
Bump io.github.microutils:kotlin-logging from 1.12.0 to 2.0.5 (#139)
Browse files Browse the repository at this point in the history
Bumps io.github.microutils:kotlin-logging from 1.12.0 to 6.0.4.


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=io.github.microutils:kotlin-logging&package-manager=maven&previous-version=1.12.0&new-version=2.0.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Anthony Brown <[email protected]>
  • Loading branch information
dependabot[bot] and anthony-nhs authored Apr 9, 2024
1 parent 7789def commit d0268a4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@
<version>${fhir.version}</version>
</dependency>
<dependency>
<groupId>io.github.microutils</groupId>
<artifactId>kotlin-logging</artifactId>
<version>1.12.0</version>
<groupId>io.github.oshai</groupId>
<artifactId>kotlin-logging-jvm</artifactId>
<version>6.0.4</version>
</dependency>
</dependencies>
<pluginRepositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.example.fhirvalidator.configuration

import com.example.fhirvalidator.model.SimplifierPackage
import com.fasterxml.jackson.databind.ObjectMapper
import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.hl7.fhir.utilities.npm.NpmPackage
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
Expand All @@ -12,7 +12,7 @@ import kotlin.streams.toList

@Configuration
class PackageConfiguration(val objectMapper: ObjectMapper) {
companion object : KLogging()
private val logger = KotlinLogging.logger {}

@Bean
fun getPackages(): List<NpmPackage> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ca.uhn.fhir.context.support.IValidationSupport
import ca.uhn.fhir.context.support.ValidationSupportContext
import ca.uhn.fhir.validation.FhirValidator
import com.example.fhirvalidator.service.ImplementationGuideParser
import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.hl7.fhir.common.hapi.validation.support.CommonCodeSystemsTerminologyService
import org.hl7.fhir.common.hapi.validation.support.InMemoryTerminologyServerValidationSupport
import org.hl7.fhir.common.hapi.validation.support.SnapshotGeneratingValidationSupport
Expand All @@ -21,7 +21,7 @@ import org.springframework.context.annotation.Configuration

@Configuration
class ValidationConfiguration(private val implementationGuideParser: ImplementationGuideParser) {
companion object : KLogging()
private val logger = KotlinLogging.logger {}

@Bean
fun validator(fhirContext: FhirContext, instanceValidator: FhirInstanceValidator): FhirValidator {
Expand Down Expand Up @@ -95,7 +95,7 @@ class ValidationConfiguration(private val implementationGuideParser: Implementat
try {
circularReferenceCheck(it,supportChain)
} catch (e: Exception) {
logger.error("Failed to generate snapshot for $it", e)
logger.error(e) { "Failed to generate snapshot for $it" }
}
}
structureDefinitions
Expand All @@ -104,13 +104,13 @@ class ValidationConfiguration(private val implementationGuideParser: Implementat
try {
supportChain.generateSnapshot(context, it, it.url, "https://fhir.nhs.uk/R4", it.name)
} catch (e: Exception) {
logger.error("Failed to generate snapshot for $it", e)
logger.error(e) { "Failed to generate snapshot for $it" }
}
}
}

private fun circularReferenceCheck(structureDefinition: StructureDefinition, supportChain: IValidationSupport): StructureDefinition {
if (structureDefinition.hasSnapshot()) logger.error(structureDefinition.url + " has snapshot!!")
if (structureDefinition.hasSnapshot()) logger.error { structureDefinition.url + " has snapshot!!" }
structureDefinition.differential.element.forEach{
// ||
if ((
Expand All @@ -129,7 +129,7 @@ class ValidationConfiguration(private val implementationGuideParser: Implementat
it.id.contains("Encounter.reasonReference") ||
it.id.contains("Encounter.appointment")
) && it.hasType()) {
logger.warn(structureDefinition.url + " has circular references ("+ it.id + ")")
logger.warn { structureDefinition.url + " has circular references ("+ it.id + ")" }
it.type.forEach{
if (it.hasTargetProfile())
it.targetProfile.forEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ca.uhn.fhir.validation.FhirValidator
import com.example.fhirvalidator.service.CapabilityStatementApplier
import com.example.fhirvalidator.service.MessageDefinitionApplier
import com.example.fhirvalidator.util.createOperationOutcome
import mu.KLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import org.hl7.fhir.instance.model.api.IBaseResource
import org.hl7.fhir.r4.model.Bundle
import org.hl7.fhir.r4.model.OperationOutcome
Expand All @@ -23,16 +23,16 @@ class ValidateController(
private val messageDefinitionApplier: MessageDefinitionApplier,
private val capabilityStatementApplier: CapabilityStatementApplier
) {
companion object : KLogging()
private val logger = KotlinLogging.logger {}

@PostMapping("/\$validate", produces = ["application/json", "application/fhir+json"])
fun validate(
@RequestBody input: String,
@RequestHeader("x-request-id", required = false) requestId: String?
): String {
requestId?.let { logger.info("started processing message $it") }
requestId?.let { logger.info { "started processing message $it" } }
val result = parseAndValidateResource(input)
requestId?.let { logger.info("finished processing message $it") }
requestId?.let { logger.info { "finished processing message $it"} }
return fhirContext.newJsonParser().encodeResourceToString(result)
}

Expand All @@ -44,7 +44,7 @@ class ValidateController(
val operationOutcomeIssues = operationOutcomeList.filterNotNull().flatMap { it.issue }
return createOperationOutcome(operationOutcomeIssues)
} catch (e: DataFormatException) {
logger.error("Caught parser error", e)
logger.error(e) { "Caught parser error" }
createOperationOutcome(e.message ?: "Invalid JSON", null)
}
}
Expand Down

0 comments on commit d0268a4

Please sign in to comment.