generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1087 from CDCgov/story1024/task-results-transform…
…ation-mapping-path-refactor Modified FHIR Path Mapping enum to include HL7v2 values
- Loading branch information
Showing
2 changed files
with
46 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 29 additions & 10 deletions
39
...tedintermediary/plugin/path/FhirPath.java → ...diary/plugin/path/Hl7FhirMappingPath.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,108 @@ | ||
package gov.hhs.cdc.trustedintermediary.plugin.path; | ||
|
||
/** | ||
* Enumerates FHIR 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. | ||
* 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 FhirPath { | ||
public enum Hl7FhirMappingPath { | ||
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 hl7Path; | ||
|
||
Hl7FhirMappingPath(String hl7Path, String fhirPath) { | ||
this.hl7Path = hl7Path; | ||
this.fhirPath = fhirPath; | ||
} | ||
|
||
FhirPath(String path) { | ||
this.path = path; | ||
public String getHl7Path() { | ||
return hl7Path; | ||
} | ||
|
||
public String getPath() { | ||
return path; | ||
public String getFhirPath() { | ||
return fhirPath; | ||
} | ||
} |