Skip to content

Commit

Permalink
Merge pull request #1518 from CDCgov/remove-la-obr-except-54089-8
Browse files Browse the repository at this point in the history
Remove la obr except 54089 8
  • Loading branch information
saquino0827 authored Dec 6, 2024
2 parents 5e22325 + 553f315 commit 459735b
Show file tree
Hide file tree
Showing 7 changed files with 4,374 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
router:
build: .
environment:
REPORT_STREAM_URL_PREFIX: http://localhost:7071
REPORT_STREAM_URL_PREFIX: http://host.docker.internal:7071
ports:
- "8080:8080" # default api endpoint port
- "6006:6006" # Java debug port
Expand Down
18 changes: 18 additions & 0 deletions etor/src/main/resources/transformation_definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,24 @@
}
]
},
{
"name": "laOchsnerOruRemoveObservationRequests",
"description": "Removes all OBRs from an LA Ochsner ORU message except for the OBR with value '54089-8' in OBR-4.1. All OBXs are attached to the sole remaining OBR",
"message": "",
"conditions": [
"Bundle.entry.resource.ofType(MessageHeader).destination.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id').value = '1.2.840.114350.1.13.286.2.7.2.695071'",
"Bundle.entry.resource.ofType(MessageHeader).event.code = 'R01'",
"Bundle.entry.resource.ofType(ServiceRequest).code.coding.where(code = '54089-8').exists()"
],
"rules": [
{
"name": "RemoveObservationRequests",
"args": {
"universalServiceIdentifier": "54089-8"
}
}
]
},
{
"name": "ucsdOruUpdateUniversalServiceIdentifier",
"description": "Updates the coding system name (OBR-4.3) for ORU orders to the expected value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,36 @@ class RemoveObservationRequestsTest extends Specification {
thrown(ClassCastException)
}

def "remove all LA Ochsner's OBRs except for the one with OBR-4.1 = '54089-8'"() {
given:
def fhirResource = ExamplesHelper.getExampleFhirResource("../LA/002_LA_ORU_R01_ORU_removal_test_file.fhir")
def bundle = fhirResource.getUnderlyingData() as Bundle

def initialDiagnosticReports = HapiHelper.resourcesInBundle(bundle, DiagnosticReport).toList()
def initialServiceRequests = HapiHelper.resourcesInBundle(bundle, ServiceRequest).toList()
def initialObservations = HapiHelper.resourcesInBundle(bundle, Observation).toList()
def obr4_1Values = initialServiceRequests.collect { HapiHelper.getOBR4_1Value(it) }

expect:
initialDiagnosticReports.size() > 1
initialServiceRequests.size() > 1
initialObservations.size() > 1
obr4_1 in obr4_1Values

when:
transformClass.transform(fhirResource, args)
def diagnosticReports = HapiHelper.resourcesInBundle(bundle, DiagnosticReport).toList()
def serviceRequests = HapiHelper.resourcesInBundle(bundle, ServiceRequest).toList()
def dr = diagnosticReports.first() as DiagnosticReport
def sr = HapiHelper.getServiceRequest(dr)

then:
diagnosticReports.size() == 1
serviceRequests.size() == 1
HapiHelper.getOBR4_1Value(sr) == obr4_1
}

def "remove all OBRs except for the one with OBR-4.1 = '54089-8'"() {
def "remove all CA UCSD's OBRs except for the one with OBR-4.1 = '54089-8'"() {
given:
def fhirResource = ExamplesHelper.getExampleFhirResource("../CA/002_CA_ORU_R01_initial_translation.fhir")
def bundle = fhirResource.getUnderlyingData() as Bundle
Expand Down
Loading

0 comments on commit 459735b

Please sign in to comment.