From a98e69fdd00ffaa95cf6a8cf96361caaf521c9d7 Mon Sep 17 00:00:00 2001 From: tjohnson7021 <86614374+tjohnson7021@users.noreply.github.com> Date: Fri, 10 May 2024 11:25:02 -0400 Subject: [PATCH 1/7] Modified FHIR Path Mapping enum to include HL7v2 values - Updated references to fhir paths in other places - created placeholders for HL7v2 values --- .../external/hapi/HapiMessageHelper.java | 28 ++++++------ .../path/{FhirPath.java => MappingPath.java} | 45 +++++++++++-------- 2 files changed, 40 insertions(+), 33 deletions(-) rename etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/{FhirPath.java => MappingPath.java} (83%) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiMessageHelper.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiMessageHelper.java index d117e4d33..8c0a3cedc 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiMessageHelper.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiMessageHelper.java @@ -1,6 +1,6 @@ package gov.hhs.cdc.trustedintermediary.external.hapi; -import gov.hhs.cdc.trustedintermediary.plugin.path.FhirPath; +import gov.hhs.cdc.trustedintermediary.plugin.path.MappingPath; import gov.hhs.cdc.trustedintermediary.wrappers.HapiFhir; import javax.inject.Inject; import org.hl7.fhir.r4.model.Bundle; @@ -24,66 +24,66 @@ private HapiMessageHelper() {} public String extractPlacerOrderNumber(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, FhirPath.PLACER_ORDER_NUMBER.getPath()); + messageBundle, MappingPath.PLACER_ORDER_NUMBER.getFhirPath()); } public String extractSendingApplicationNamespace(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, FhirPath.SENDING_APPLICATION_NAMESPACE.getPath()); + messageBundle, MappingPath.SENDING_APPLICATION_NAMESPACE.getFhirPath()); } public String extractSendingApplicationUniversalId(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, FhirPath.SENDING_APPLICATION_UNIVERSAL_ID.getPath()); + messageBundle, MappingPath.SENDING_APPLICATION_UNIVERSAL_ID.getFhirPath()); } public String extractSendingApplicationUniversalIdType(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, FhirPath.SENDING_APPLICATION_UNIVERSAL_ID_TYPE.getPath()); + messageBundle, MappingPath.SENDING_APPLICATION_UNIVERSAL_ID_TYPE.getFhirPath()); } public String extractSendingFacilityNamespace(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, FhirPath.SENDING_FACILITY_NAMESPACE.getPath()); + messageBundle, MappingPath.SENDING_FACILITY_NAMESPACE.getFhirPath()); } public String extractSendingFacilityUniversalId(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, FhirPath.SENDING_FACILITY_UNIVERSAL_ID.getPath()); + messageBundle, MappingPath.SENDING_FACILITY_UNIVERSAL_ID.getFhirPath()); } public String extractSendingFacilityUniversalIdType(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, FhirPath.SENDING_FACILITY_UNIVERSAL_ID_TYPE.getPath()); + messageBundle, MappingPath.SENDING_FACILITY_UNIVERSAL_ID_TYPE.getFhirPath()); } public String extractReceivingApplicationNamespace(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, FhirPath.RECEIVING_APPLICATION_NAMESPACE.getPath()); + messageBundle, MappingPath.RECEIVING_APPLICATION_NAMESPACE.getFhirPath()); } public String extractReceivingApplicationUniversalId(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, FhirPath.RECEIVING_APPLICATION_UNIVERSAL_ID.getPath()); + messageBundle, MappingPath.RECEIVING_APPLICATION_UNIVERSAL_ID.getFhirPath()); } public String extractReceivingApplicationUniversalIdType(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, FhirPath.RECEIVING_APPLICATION_UNIVERSAL_ID_TYPE.getPath()); + messageBundle, MappingPath.RECEIVING_APPLICATION_UNIVERSAL_ID_TYPE.getFhirPath()); } public String extractReceivingFacilityNamespace(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, FhirPath.RECEIVING_FACILITY_NAMESPACE.getPath()); + messageBundle, MappingPath.RECEIVING_FACILITY_NAMESPACE.getFhirPath()); } public String extractReceivingFacilityUniversalId(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, FhirPath.RECEIVING_FACILITY_UNIVERSAL_ID.getPath()); + messageBundle, MappingPath.RECEIVING_FACILITY_UNIVERSAL_ID.getFhirPath()); } public String extractReceivingFacilityUniversalIdType(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, FhirPath.RECEIVING_FACILITY_UNIVERSAL_ID_TYPE.getPath()); + messageBundle, MappingPath.RECEIVING_FACILITY_UNIVERSAL_ID_TYPE.getFhirPath()); } } diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/FhirPath.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/MappingPath.java similarity index 83% rename from etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/FhirPath.java rename to etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/MappingPath.java index c28bbf6e8..7efa44c36 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/FhirPath.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/MappingPath.java @@ -5,85 +5,92 @@ * be used to extract specific pieces of data from a FHIR message, such as identifiers, namespaces, * and codes related to sending and receiving facilities and applications. */ -public enum FhirPath { +public enum MappingPath { PLACER_ORDER_NUMBER( - """ + "ORC-2", """ Bundle.entry.resource.ofType(ServiceRequest).identifier.where(type.coding.code = 'PLAC').value """), SENDING_FACILITY_NAMESPACE( - """ + "?-?", """ Bundle.entry.resource.ofType(MessageHeader).sender.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.1' ).value """), SENDING_FACILITY_UNIVERSAL_ID( - """ + "?-?",""" Bundle.entry.resource.ofType(MessageHeader).sender.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.2,HD.3' ).value """), SENDING_FACILITY_UNIVERSAL_ID_TYPE( - """ + "?-?",""" Bundle.entry.resource.ofType(MessageHeader).sender.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.2,HD.3' ).type.coding.code """), SENDING_APPLICATION_NAMESPACE( - """ + "?-?",""" Bundle.entry.resource.ofType(MessageHeader).source.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/namespace-id').value """), SENDING_APPLICATION_UNIVERSAL_ID( - """ + "?-?",""" Bundle.entry.resource.ofType(MessageHeader).source.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id').value """), SENDING_APPLICATION_UNIVERSAL_ID_TYPE( - """ + "?-?",""" Bundle.entry.resource.ofType(MessageHeader).source.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id-type').value """), RECEIVING_FACILITY_NAMESPACE( - """ + "?-?",""" Bundle.entry.resource.ofType(MessageHeader).destination.receiver.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.1' ).value """), RECEIVING_FACILITY_UNIVERSAL_ID( - """ + "?-?",""" Bundle.entry.resource.ofType(MessageHeader).destination.receiver.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.2,HD.3' ).value """), RECEIVING_FACILITY_UNIVERSAL_ID_TYPE( - """ + "?-?",""" Bundle.entry.resource.ofType(MessageHeader).destination.receiver.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.2,HD.3' ).type.coding.code """), RECEIVING_APPLICATION_NAMESPACE( - """ + "?-?",""" Bundle.entry.resource.ofType(MessageHeader).destination.name """), RECEIVING_APPLICATION_UNIVERSAL_ID( - """ + "?-?",""" Bundle.entry.resource.ofType(MessageHeader).destination.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id').value """), RECEIVING_APPLICATION_UNIVERSAL_ID_TYPE( - """ + "?-?",""" Bundle.entry.resource.ofType(MessageHeader).destination.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id-type').value """); - private final String path; + private final String fhirPath; + private final String hl7v2Path; - FhirPath(String path) { - this.path = path; + MappingPath(String hl7v2Path, String fhirPath) { + this.hl7v2Path = hl7v2Path; + this.fhirPath = fhirPath; } - public String getPath() { - return path; + public String getHl7v2Path() { + return hl7v2Path; } + + public String getFhirPath() { + return fhirPath; + } +} } From 5a7e138e33e088f725daa6cec0066a0cc82d9999 Mon Sep 17 00:00:00 2001 From: tjohnson7021 <86614374+tjohnson7021@users.noreply.github.com> Date: Fri, 10 May 2024 11:54:07 -0400 Subject: [PATCH 2/7] Rename file --- .../hhs/cdc/trustedintermediary/plugin/path/MappingPath.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/MappingPath.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/MappingPath.java index 7efa44c36..cb36fd13c 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/MappingPath.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/MappingPath.java @@ -93,4 +93,4 @@ public String getFhirPath() { return fhirPath; } } -} + From c9ae7034eac0f99b608946b204bb96e135a5dd28 Mon Sep 17 00:00:00 2001 From: tjohnson7021 <86614374+tjohnson7021@users.noreply.github.com> Date: Fri, 10 May 2024 12:06:43 -0400 Subject: [PATCH 3/7] Update class - update class name - removed hl7 placeholders --- .../external/hapi/HapiMessageHelper.java | 28 +++++++-------- ...ppingPath.java => Hl7FhirMappingPath.java} | 36 +++++++++---------- 2 files changed, 32 insertions(+), 32 deletions(-) rename etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/{MappingPath.java => Hl7FhirMappingPath.java} (87%) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiMessageHelper.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiMessageHelper.java index 8c0a3cedc..43055f56d 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiMessageHelper.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiMessageHelper.java @@ -1,6 +1,6 @@ package gov.hhs.cdc.trustedintermediary.external.hapi; -import gov.hhs.cdc.trustedintermediary.plugin.path.MappingPath; +import gov.hhs.cdc.trustedintermediary.plugin.path.Hl7FhirMappingPath; import gov.hhs.cdc.trustedintermediary.wrappers.HapiFhir; import javax.inject.Inject; import org.hl7.fhir.r4.model.Bundle; @@ -24,66 +24,66 @@ private HapiMessageHelper() {} public String extractPlacerOrderNumber(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, MappingPath.PLACER_ORDER_NUMBER.getFhirPath()); + messageBundle, Hl7FhirMappingPath.PLACER_ORDER_NUMBER.getFhirPath()); } public String extractSendingApplicationNamespace(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, MappingPath.SENDING_APPLICATION_NAMESPACE.getFhirPath()); + messageBundle, Hl7FhirMappingPath.SENDING_APPLICATION_NAMESPACE.getFhirPath()); } public String extractSendingApplicationUniversalId(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, MappingPath.SENDING_APPLICATION_UNIVERSAL_ID.getFhirPath()); + messageBundle, Hl7FhirMappingPath.SENDING_APPLICATION_UNIVERSAL_ID.getFhirPath()); } public String extractSendingApplicationUniversalIdType(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, MappingPath.SENDING_APPLICATION_UNIVERSAL_ID_TYPE.getFhirPath()); + messageBundle, Hl7FhirMappingPath.SENDING_APPLICATION_UNIVERSAL_ID_TYPE.getFhirPath()); } public String extractSendingFacilityNamespace(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, MappingPath.SENDING_FACILITY_NAMESPACE.getFhirPath()); + messageBundle, Hl7FhirMappingPath.SENDING_FACILITY_NAMESPACE.getFhirPath()); } public String extractSendingFacilityUniversalId(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, MappingPath.SENDING_FACILITY_UNIVERSAL_ID.getFhirPath()); + messageBundle, Hl7FhirMappingPath.SENDING_FACILITY_UNIVERSAL_ID.getFhirPath()); } public String extractSendingFacilityUniversalIdType(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, MappingPath.SENDING_FACILITY_UNIVERSAL_ID_TYPE.getFhirPath()); + messageBundle, Hl7FhirMappingPath.SENDING_FACILITY_UNIVERSAL_ID_TYPE.getFhirPath()); } public String extractReceivingApplicationNamespace(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, MappingPath.RECEIVING_APPLICATION_NAMESPACE.getFhirPath()); + messageBundle, Hl7FhirMappingPath.RECEIVING_APPLICATION_NAMESPACE.getFhirPath()); } public String extractReceivingApplicationUniversalId(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, MappingPath.RECEIVING_APPLICATION_UNIVERSAL_ID.getFhirPath()); + messageBundle, Hl7FhirMappingPath.RECEIVING_APPLICATION_UNIVERSAL_ID.getFhirPath()); } public String extractReceivingApplicationUniversalIdType(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, MappingPath.RECEIVING_APPLICATION_UNIVERSAL_ID_TYPE.getFhirPath()); + messageBundle, Hl7FhirMappingPath.RECEIVING_APPLICATION_UNIVERSAL_ID_TYPE.getFhirPath()); } public String extractReceivingFacilityNamespace(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, MappingPath.RECEIVING_FACILITY_NAMESPACE.getFhirPath()); + messageBundle, Hl7FhirMappingPath.RECEIVING_FACILITY_NAMESPACE.getFhirPath()); } public String extractReceivingFacilityUniversalId(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, MappingPath.RECEIVING_FACILITY_UNIVERSAL_ID.getFhirPath()); + messageBundle, Hl7FhirMappingPath.RECEIVING_FACILITY_UNIVERSAL_ID.getFhirPath()); } public String extractReceivingFacilityUniversalIdType(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, MappingPath.RECEIVING_FACILITY_UNIVERSAL_ID_TYPE.getFhirPath()); + messageBundle, Hl7FhirMappingPath.RECEIVING_FACILITY_UNIVERSAL_ID_TYPE.getFhirPath()); } } diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/MappingPath.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java similarity index 87% rename from etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/MappingPath.java rename to etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java index cb36fd13c..976971432 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/MappingPath.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java @@ -5,88 +5,88 @@ * be used to extract specific pieces of data from a FHIR message, such as identifiers, namespaces, * and codes related to sending and receiving facilities and applications. */ -public enum MappingPath { +public enum Hl7FhirMappingPath { PLACER_ORDER_NUMBER( - "ORC-2", """ + "ORC.2", """ Bundle.entry.resource.ofType(ServiceRequest).identifier.where(type.coding.code = 'PLAC').value """), SENDING_FACILITY_NAMESPACE( - "?-?", """ + "", """ Bundle.entry.resource.ofType(MessageHeader).sender.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.1' ).value """), SENDING_FACILITY_UNIVERSAL_ID( - "?-?",""" + "",""" Bundle.entry.resource.ofType(MessageHeader).sender.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.2,HD.3' ).value """), SENDING_FACILITY_UNIVERSAL_ID_TYPE( - "?-?",""" + "",""" Bundle.entry.resource.ofType(MessageHeader).sender.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.2,HD.3' ).type.coding.code """), SENDING_APPLICATION_NAMESPACE( - "?-?",""" + "",""" Bundle.entry.resource.ofType(MessageHeader).source.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/namespace-id').value """), SENDING_APPLICATION_UNIVERSAL_ID( - "?-?",""" + "",""" Bundle.entry.resource.ofType(MessageHeader).source.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id').value """), SENDING_APPLICATION_UNIVERSAL_ID_TYPE( - "?-?",""" + "",""" Bundle.entry.resource.ofType(MessageHeader).source.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id-type').value """), RECEIVING_FACILITY_NAMESPACE( - "?-?",""" + "",""" Bundle.entry.resource.ofType(MessageHeader).destination.receiver.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.1' ).value """), RECEIVING_FACILITY_UNIVERSAL_ID( - "?-?",""" + "",""" Bundle.entry.resource.ofType(MessageHeader).destination.receiver.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.2,HD.3' ).value """), RECEIVING_FACILITY_UNIVERSAL_ID_TYPE( - "?-?",""" + "",""" Bundle.entry.resource.ofType(MessageHeader).destination.receiver.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.2,HD.3' ).type.coding.code """), RECEIVING_APPLICATION_NAMESPACE( - "?-?",""" + "",""" Bundle.entry.resource.ofType(MessageHeader).destination.name """), RECEIVING_APPLICATION_UNIVERSAL_ID( - "?-?",""" + "",""" Bundle.entry.resource.ofType(MessageHeader).destination.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id').value """), RECEIVING_APPLICATION_UNIVERSAL_ID_TYPE( - "?-?",""" + "",""" Bundle.entry.resource.ofType(MessageHeader).destination.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id-type').value """); private final String fhirPath; - private final String hl7v2Path; + private final String hl7Path; - MappingPath(String hl7v2Path, String fhirPath) { - this.hl7v2Path = hl7v2Path; + Hl7FhirMappingPath(String hl7Path, String fhirPath) { + this.hl7Path = hl7Path; this.fhirPath = fhirPath; } public String getHl7v2Path() { - return hl7v2Path; + return hl7Path; } public String getFhirPath() { From 3605aa4cd6d78d4a2b8d0ab9ee5462184d5606e3 Mon Sep 17 00:00:00 2001 From: tjohnson7021 <86614374+tjohnson7021@users.noreply.github.com> Date: Fri, 10 May 2024 12:10:18 -0400 Subject: [PATCH 4/7] Spotless Apply --- .../external/hapi/HapiMessageHelper.java | 9 +++-- .../plugin/path/Hl7FhirMappingPath.java | 39 ++++++++++++------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiMessageHelper.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiMessageHelper.java index 43055f56d..9c9dacf68 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiMessageHelper.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiMessageHelper.java @@ -39,7 +39,8 @@ public String extractSendingApplicationUniversalId(Bundle messageBundle) { public String extractSendingApplicationUniversalIdType(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, Hl7FhirMappingPath.SENDING_APPLICATION_UNIVERSAL_ID_TYPE.getFhirPath()); + messageBundle, + Hl7FhirMappingPath.SENDING_APPLICATION_UNIVERSAL_ID_TYPE.getFhirPath()); } public String extractSendingFacilityNamespace(Bundle messageBundle) { @@ -69,7 +70,8 @@ public String extractReceivingApplicationUniversalId(Bundle messageBundle) { public String extractReceivingApplicationUniversalIdType(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, Hl7FhirMappingPath.RECEIVING_APPLICATION_UNIVERSAL_ID_TYPE.getFhirPath()); + messageBundle, + Hl7FhirMappingPath.RECEIVING_APPLICATION_UNIVERSAL_ID_TYPE.getFhirPath()); } public String extractReceivingFacilityNamespace(Bundle messageBundle) { @@ -84,6 +86,7 @@ public String extractReceivingFacilityUniversalId(Bundle messageBundle) { public String extractReceivingFacilityUniversalIdType(Bundle messageBundle) { return fhirEngine.getStringFromFhirPath( - messageBundle, Hl7FhirMappingPath.RECEIVING_FACILITY_UNIVERSAL_ID_TYPE.getFhirPath()); + messageBundle, + Hl7FhirMappingPath.RECEIVING_FACILITY_UNIVERSAL_ID_TYPE.getFhirPath()); } } diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java index 976971432..5261b370e 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java @@ -7,73 +7,85 @@ */ public enum Hl7FhirMappingPath { PLACER_ORDER_NUMBER( - "ORC.2", """ + "ORC.2", + """ Bundle.entry.resource.ofType(ServiceRequest).identifier.where(type.coding.code = 'PLAC').value """), SENDING_FACILITY_NAMESPACE( - "", """ + "", + """ Bundle.entry.resource.ofType(MessageHeader).sender.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.1' ).value """), SENDING_FACILITY_UNIVERSAL_ID( - "",""" + "", + """ Bundle.entry.resource.ofType(MessageHeader).sender.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.2,HD.3' ).value """), SENDING_FACILITY_UNIVERSAL_ID_TYPE( - "",""" + "", + """ Bundle.entry.resource.ofType(MessageHeader).sender.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.2,HD.3' ).type.coding.code """), SENDING_APPLICATION_NAMESPACE( - "",""" + "", + """ Bundle.entry.resource.ofType(MessageHeader).source.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/namespace-id').value """), SENDING_APPLICATION_UNIVERSAL_ID( - "",""" + "", + """ Bundle.entry.resource.ofType(MessageHeader).source.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id').value """), SENDING_APPLICATION_UNIVERSAL_ID_TYPE( - "",""" + "", + """ Bundle.entry.resource.ofType(MessageHeader).source.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id-type').value """), RECEIVING_FACILITY_NAMESPACE( - "",""" + "", + """ Bundle.entry.resource.ofType(MessageHeader).destination.receiver.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.1' ).value """), RECEIVING_FACILITY_UNIVERSAL_ID( - "",""" + "", + """ Bundle.entry.resource.ofType(MessageHeader).destination.receiver.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.2,HD.3' ).value """), RECEIVING_FACILITY_UNIVERSAL_ID_TYPE( - "",""" + "", + """ Bundle.entry.resource.ofType(MessageHeader).destination.receiver.resolve().identifier.where( extension.url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/hl7v2Field' and extension.value = 'HD.2,HD.3' ).type.coding.code """), RECEIVING_APPLICATION_NAMESPACE( - "",""" + "", """ Bundle.entry.resource.ofType(MessageHeader).destination.name """), RECEIVING_APPLICATION_UNIVERSAL_ID( - "",""" + "", + """ Bundle.entry.resource.ofType(MessageHeader).destination.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id').value """), RECEIVING_APPLICATION_UNIVERSAL_ID_TYPE( - "",""" + "", + """ Bundle.entry.resource.ofType(MessageHeader).destination.extension.where(url = 'https://reportstream.cdc.gov/fhir/StructureDefinition/universal-id-type').value """); @@ -93,4 +105,3 @@ public String getFhirPath() { return fhirPath; } } - From 39df799062d22c9e80d0bf4c9fda8af7e00d8d6b Mon Sep 17 00:00:00 2001 From: tjohnson7021 <86614374+tjohnson7021@users.noreply.github.com> Date: Fri, 10 May 2024 12:15:14 -0400 Subject: [PATCH 5/7] Updated getter name --- .../cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java index 5261b370e..c071c26f0 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java @@ -97,7 +97,7 @@ public enum Hl7FhirMappingPath { this.fhirPath = fhirPath; } - public String getHl7v2Path() { + public String getHl7Path() { return hl7Path; } From c75e18a11ca4cd877ed7d30c29a0dbe67c5c7de2 Mon Sep 17 00:00:00 2001 From: tjohnson7021 <86614374+tjohnson7021@users.noreply.github.com> Date: Fri, 10 May 2024 12:21:54 -0400 Subject: [PATCH 6/7] Update java docs --- .../trustedintermediary/plugin/path/Hl7FhirMappingPath.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java index c071c26f0..dbabd88aa 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java @@ -1,9 +1,9 @@ package gov.hhs.cdc.trustedintermediary.plugin.path; /** - * Enumerates FHIR path expressions for various data elements within a FHIR message. These paths can + * Enumerates FHIR and HL7 path expressions for various data elements within a FHIR message. These paths can * be used to extract specific pieces of data from a FHIR message, such as identifiers, namespaces, - * and codes related to sending and receiving facilities and applications. + * and codes related to sending and receiving facilities and applications. It also defines the HL7 field names. */ public enum Hl7FhirMappingPath { PLACER_ORDER_NUMBER( From 1d66c2018ff234b980115a0a74c3b7df53c1b96d Mon Sep 17 00:00:00 2001 From: tjohnson7021 <86614374+tjohnson7021@users.noreply.github.com> Date: Fri, 10 May 2024 12:23:49 -0400 Subject: [PATCH 7/7] Spotless apply --- .../plugin/path/Hl7FhirMappingPath.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java index dbabd88aa..5d0336e30 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/plugin/path/Hl7FhirMappingPath.java @@ -1,9 +1,10 @@ package gov.hhs.cdc.trustedintermediary.plugin.path; /** - * Enumerates FHIR and HL7 path expressions for various data elements within a FHIR message. These paths can - * be used to extract specific pieces of data from a FHIR message, such as identifiers, namespaces, - * and codes related to sending and receiving facilities and applications. It also defines the HL7 field names. + * Enumerates FHIR and HL7 path expressions for various data elements within a FHIR message. These + * paths can be used to extract specific pieces of data from a FHIR message, such as identifiers, + * namespaces, and codes related to sending and receiving facilities and applications. It also + * defines the HL7 field names. */ public enum Hl7FhirMappingPath { PLACER_ORDER_NUMBER(