From bb85cfccec734735cfad26348ad949d5f253cffd Mon Sep 17 00:00:00 2001 From: tjohnson7021 Date: Mon, 2 Sep 2024 16:09:07 -0400 Subject: [PATCH 1/5] modified coding system in transformation_definitions.json --- etor/src/main/resources/transformation_definitions.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/etor/src/main/resources/transformation_definitions.json b/etor/src/main/resources/transformation_definitions.json index 9bd59f526..1499601d6 100644 --- a/etor/src/main/resources/transformation_definitions.json +++ b/etor/src/main/resources/transformation_definitions.json @@ -181,8 +181,7 @@ "name": "UpdateUniversalServiceIdentifier", "args": { "checkValue": "54089-8", - "codingSystem": "LN", - "alternateId": "CDPHGSPEAP" + "codingSystem": "CDPHGSPEAP" } } ] From f804448ed0e25c620f0da8609afcb6cec6a60523 Mon Sep 17 00:00:00 2001 From: tjohnson7021 Date: Mon, 2 Sep 2024 16:33:59 -0400 Subject: [PATCH 2/5] Re-added alternateId in case it is needed --- etor/src/main/resources/transformation_definitions.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etor/src/main/resources/transformation_definitions.json b/etor/src/main/resources/transformation_definitions.json index 1499601d6..4dc58c11f 100644 --- a/etor/src/main/resources/transformation_definitions.json +++ b/etor/src/main/resources/transformation_definitions.json @@ -181,7 +181,8 @@ "name": "UpdateUniversalServiceIdentifier", "args": { "checkValue": "54089-8", - "codingSystem": "CDPHGSPEAP" + "codingSystem": "CDPHGSPEAP", + "alternateId": "" } } ] From d3a51bdaab8663d90c9fce0241bf55aebe462bbb Mon Sep 17 00:00:00 2001 From: tjohnson7021 Date: Mon, 2 Sep 2024 16:36:44 -0400 Subject: [PATCH 3/5] Modified test class and example message to match expectations --- .../custom/UpdateUniversalServiceIdentifierTest.groovy | 8 ++++---- .../005_AL_ORU_R01_NBS_Simplified_1_hl7_translation.fhir | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/ruleengine/transformation/custom/UpdateUniversalServiceIdentifierTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/ruleengine/transformation/custom/UpdateUniversalServiceIdentifierTest.groovy index d14fa947f..01e5d9c1b 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/ruleengine/transformation/custom/UpdateUniversalServiceIdentifierTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/ruleengine/transformation/custom/UpdateUniversalServiceIdentifierTest.groovy @@ -12,7 +12,7 @@ class UpdateUniversalServiceIdentifierTest extends Specification { def fhirResource def args = Map.of( "checkValue", "54089-8", - "codingSystem", "LN", + "codingSystem", "CDPHGSPEAP", "alternateId", "CDPHGSPEAP" ) @@ -102,7 +102,7 @@ class UpdateUniversalServiceIdentifierTest extends Specification { then: transformedObr4_1 == obr4_1 - transformedObr4_3 == "LN" + transformedObr4_3 == "CDPHGSPEAP" transformedObr4_4 == "CDPHGSPEAP" } @@ -116,7 +116,7 @@ class UpdateUniversalServiceIdentifierTest extends Specification { expect: obr4_1 == "54089-8" - obr4_3 == "LN" + obr4_3 == "CDPHGSPEAP" obr4_4 == "CDPHGSPEAP" when: @@ -156,7 +156,7 @@ class UpdateUniversalServiceIdentifierTest extends Specification { then: transformedObr4_1 == obr4_1 - transformedObr4_3 == "LN" + transformedObr4_3 == "CDPHGSPEAP" transformedObr4_4 == "CDPHGSPEAP" } diff --git a/examples/Test/Results/005_AL_ORU_R01_NBS_Simplified_1_hl7_translation.fhir b/examples/Test/Results/005_AL_ORU_R01_NBS_Simplified_1_hl7_translation.fhir index 15813b9e1..940dc9d77 100644 --- a/examples/Test/Results/005_AL_ORU_R01_NBS_Simplified_1_hl7_translation.fhir +++ b/examples/Test/Results/005_AL_ORU_R01_NBS_Simplified_1_hl7_translation.fhir @@ -3090,7 +3090,7 @@ }, { "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/cwe-coding-system", - "valueString": "LN" + "valueString": "CDPHGSPEAP" } ], "system": "http://loinc.org", @@ -4267,7 +4267,7 @@ }, { "url": "https://reportstream.cdc.gov/fhir/StructureDefinition/cwe-coding-system", - "valueString": "LN" + "valueString": "CDPHGSPEAP" } ], "system": "http://loinc.org", From e1ba00417083332ffec27227dfb3d31fcef037ba Mon Sep 17 00:00:00 2001 From: Luis Pabon Date: Wed, 4 Sep 2024 12:28:59 -0400 Subject: [PATCH 4/5] Update transformation_definitions.json Remove unused alternateId value --- etor/src/main/resources/transformation_definitions.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/etor/src/main/resources/transformation_definitions.json b/etor/src/main/resources/transformation_definitions.json index 4dc58c11f..1499601d6 100644 --- a/etor/src/main/resources/transformation_definitions.json +++ b/etor/src/main/resources/transformation_definitions.json @@ -181,8 +181,7 @@ "name": "UpdateUniversalServiceIdentifier", "args": { "checkValue": "54089-8", - "codingSystem": "CDPHGSPEAP", - "alternateId": "" + "codingSystem": "CDPHGSPEAP" } } ] From e9adaf3b674c8ea24f6f95df14df096bacd6718d Mon Sep 17 00:00:00 2001 From: Joel Biskie Date: Mon, 9 Sep 2024 17:07:35 -0500 Subject: [PATCH 5/5] Add test for empty obr-4.4 value and update transform to ignore when null --- .../UpdateUniversalServiceIdentifier.java | 18 +++++++--- ...pdateUniversalServiceIdentifierTest.groovy | 35 +++++++++++++++++-- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/ruleengine/transformation/custom/UpdateUniversalServiceIdentifier.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/ruleengine/transformation/custom/UpdateUniversalServiceIdentifier.java index 2194a969b..a80b65416 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/ruleengine/transformation/custom/UpdateUniversalServiceIdentifier.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/ruleengine/transformation/custom/UpdateUniversalServiceIdentifier.java @@ -17,6 +17,11 @@ * Service Identifier (OBR-4) */ public class UpdateUniversalServiceIdentifier implements CustomFhirTransformation { + + public static final String CHECK_VALUE_NAME = "checkValue"; + public static final String CODING_SYSTEM_NAME = "codingSystem"; + public static final String ALTERNATE_ID_NAME = "alternateId"; + @Override public void transform(FhirResource resource, Map args) { Bundle bundle = (Bundle) resource.getUnderlyingResource(); @@ -26,7 +31,7 @@ public void transform(FhirResource resource, Map args) { it -> { var allCodings = it.getCode().getCoding(); var codingSystemContainer = - getCodingSystemContainer(allCodings, args.get("checkValue")); + getCodingSystemContainer(allCodings, args.get(CHECK_VALUE_NAME)); if (codingSystemContainer == null) { // we're only interested in coding that matches the checkValue argument @@ -34,11 +39,14 @@ public void transform(FhirResource resource, Map args) { } // check for the coding system label and create or override it - updateCodingSystemLabel(codingSystemContainer, args.get("codingSystem")); + updateCodingSystemLabel(codingSystemContainer, args.get(CODING_SYSTEM_NAME)); // the alt id is stored on a separate coding object, so we need to filter // for it - updateAlternateCodingId(allCodings, args); + String alternateId = args.get(ALTERNATE_ID_NAME); + if (alternateId != null) { + updateAlternateCodingId(allCodings, alternateId); + } }); } @@ -81,7 +89,7 @@ private Coding getAltCodingContainer(List allCodings) { } /** Find and create or update the "Alternate Id" object in a given List */ - private void updateAlternateCodingId(List allCodings, Map args) { + private void updateAlternateCodingId(List allCodings, String alternateId) { var altCodingContainer = getAltCodingContainer(allCodings); if (altCodingContainer == null) { @@ -93,6 +101,6 @@ private void updateAlternateCodingId(List allCodings, Map