Skip to content

Commit

Permalink
Adding some missing transforms from azure and fixing Message Testing …
Browse files Browse the repository at this point in the history
…API (#16777)
  • Loading branch information
victor-chaparro authored Dec 11, 2024
1 parent 164926e commit e8025be
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion prime-router/settings/organizations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@
conditionFilter:
# Accept all conditions except Covid results in the LIVD look up table
# Covid flows through the Covid pipeline
- "%resource.livdTableLookup('Component').contains('coronavirus').not()"
- "%resource.interpretation.coding.code = 'A' and (%resource.code.coding.extension('https://reportstream.cdc.gov/fhir/StructureDefinition/condition-code').value.where(code in ('840539006')).exists())"
timing:
operation: MERGE
numberPerDay: 1440 # Every minute
Expand Down
2 changes: 1 addition & 1 deletion prime-router/src/main/kotlin/azure/ReportFunction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class ReportFunction(
null
}
val bundle = if (result.bundle != null) {
result.bundle.toString()
FhirTranscoder.encode(result.bundle!!)
} else {
null
}
Expand Down
12 changes: 6 additions & 6 deletions prime-router/src/main/kotlin/cli/ProcessFhirCommands.kt
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class ProcessFhirCommands : CliktCommand(

val senderSchemaName = when {
senderSchema != null -> senderSchema
senderSchemaParam != null -> senderSchemaParam
isCli && senderSchemaParam != null -> senderSchemaParam
else -> null
}

Expand All @@ -272,7 +272,7 @@ class ProcessFhirCommands : CliktCommand(
receiver != null && receiver.enrichmentSchemaNames.isNotEmpty() -> {
receiver.enrichmentSchemaNames.joinToString(",")
}
enrichmentSchemaNames != null -> enrichmentSchemaNames
isCli && enrichmentSchemaNames != null -> enrichmentSchemaNames
else -> null
}

Expand Down Expand Up @@ -470,19 +470,19 @@ class ProcessFhirCommands : CliktCommand(
}

val receiverTransformSchemaName = when {
receiver != null && receiver.schemaName.isNotEmpty() -> receiver.enrichmentSchemaNames.joinToString(",")
receiverSchema != null -> receiverSchema
receiver != null && receiver.schemaName.isNotEmpty() -> receiver.schemaName
isCli && receiverSchema != null -> receiverSchema
else -> null
}

if (receiverTransformSchemaName != null) {
val message = FhirToHl7Converter(
receiverSchema!!,
receiverTransformSchemaName,
BlobAccess.BlobContainerMetadata.build("metadata", Environment.get().storageEnvVar),
context = FhirToHl7Context(
CustomFhirPathFunctions(),
config = HL7TranslationConfig(
hl7Configuration,
hl7Configuration = hl7Configuration,
receiver
),
translationFunctions = CustomTranslationFunctions(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ constants:
patient: 'Bundle.entry.resource.ofType(Patient)'
specimen: 'Bundle.entry.resource.ofType(Specimen)'
elements:
- name: sender-identifier
resource: 'Bundle.entry.resource.ofType(MessageHeader)'
bundleProperty: '%resource.extension("https://reportstream.cdc.gov/fhir/StructureDefinition/sender-id").value[x]'
value: [ '"SimpleReport"' ]

# MSH
- name: sending-application-target-msh3-extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,7 @@ elements:
resource: 'Bundle.entry.resource.ofType(Patient).extension("http://ibm.com/fhir/cdm/StructureDefinition/local-race-cd")'
condition: '%resource.value[x].coding[0].code = "UNK" or %resource.value.coding[0].code = "ASKU"'
value: [ '"U"' ]
hl7Spec: [ '%{PID}-10-1' ]
hl7Spec: [ '%{PID}-10-1' ]

- name: observation-result-with-aoe
resource: "Bundle.entry.resource.ofType(Observation).where(code.coding.extension('https://reportstream.cdc.gov/fhir/StructureDefinition/condition-code').value.where(code in ('AOE')).exists().not())"

0 comments on commit e8025be

Please sign in to comment.