Skip to content

Commit

Permalink
Merge pull request #191 from microsoft/dotliquid
Browse files Browse the repository at this point in the history
Merge v3.3 to main branch
  • Loading branch information
BoyaWu10 authored Jan 25, 2021
2 parents cbe5eab + 0bb471e commit 4d3903d
Show file tree
Hide file tree
Showing 847 changed files with 2,217 additions and 1,086 deletions.
63 changes: 58 additions & 5 deletions data/Templates/Hl7v2/ADT_A01.liquid
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
{
{
"resourceType": "Bundle",
"type": "batch",
"entry": [
{% assign firstSegments = hl7v2Data | get_first_segments: 'PID|PD1|PV1|PV2|AVR|MSH' -%}

{% evaluate messageHeaderId using 'ID/MessageHeader' MSH: firstSegments.MSH -%}
{% evaluate organizationId4 using 'ID/Organization' HD: firstSegments.MSH.4 -%}
{% evaluate organizationId6 using 'ID/Organization' HD: firstSegments.MSH.6 -%}
{% evaluate organizationId22 using 'ID/Organization' XON: firstSegments.MSH.22 -%}

{% if organizationId4 -%}
{% include 'Resource/Organization' MSH: firstSegments.MSH, ID: organizationId4 -%}
{% endif -%}

{% if organizationId6 -%}
{% include 'Resource/Organization' MSH: firstSegments.MSH, ID: organizationId6 -%}
{% endif -%}

{% if organizationId22 -%}
{% include 'Resource/Organization' MSH: firstSegments.MSH, ID: organizationId22 -%}
{% endif -%}

{% if messageHeaderId -%}
{% include 'Resource/MessageHeader' MSH: firstSegments.MSH, ID: messageHeaderID -%}
{% include 'Resource/MessageHeader' MSH: firstSegments.MSH, Organization_ID_MSH_4: organizationId4, Organization_ID_MSH_6: organizationId6, ID: messageHeaderID -%}
{% endif -%}

{% evaluate patientId using 'ID/Patient' PID: firstSegments.PID, type: 'First' -%}
Expand All @@ -16,8 +32,29 @@
{% endif -%}

{% evaluate provenanceId using 'ID/Provenance' MSH: firstSegments.MSH, baseId: patientId -%}
{% evaluate practitionerId10 using 'ID/Practitioner' XCN: firstSegments.ORC.10 -%}
{% evaluate practitionerId11 using 'ID/Practitioner' XCN: firstSegments.ORC.11 -%}
{% evaluate practitionerId12 using 'ID/Practitioner' XCN: firstSegments.ORC.12 -%}
{% evaluate locationId using 'ID/Location' XON: firstSegments.ORC.21 -%}

{% if practitionerId10 -%}
{% include 'Resource/Practitioner' ORC: firstSegments.ORC, ID: practitionerId10 -%}
{% endif %}

{% if practitionerId11 -%}
{% include 'Resource/Practitioner' ORC: firstSegments.ORC, ID: practitionerId11 -%}
{% endif %}

{% if practitionerId12 -%}
{% include 'Resource/Practitioner' ORC: firstSegments.ORC, ID: practitionerId12 -%}
{% endif %}

{% if locationId -%}
{% include 'Resource/Location' ORC: firstSegments.ORC, ID: locationId -%}
{% endif -%}

{% if provenanceId -%}
{% include 'Resource/Provenance' MSH: firstSegments.MSH, ORC: firstSegments.ORC, ID: provenanceId -%}
{% include 'Resource/Provenance' MSH: firstSegments.MSH, ORC: firstSegments.ORC, Organization_ID_MSH_4organizationId4, Organization_ID_MSH_22organizationId22, Practitioner_ID_ORC_10: practitionerId10, Practitioner_ID_ORC_11: practitionerId11, Practitioner_ID_ORC_12: practitionerId12, Location_ID_ORC_21: locationId, ID: provenanceId -%}
{% endif -%}

{% evaluate accountId using 'ID/Account' CX: firstSegments.PID.3 -%}
Expand Down Expand Up @@ -84,8 +121,19 @@
{% assign obxSegmentLists = hl7v2Data | get_segment_lists: 'OBX' -%}
{% for obxSegment in obxSegmentLists.OBX -%}
{% evaluate observationId using 'ID/Observation' OBX: obxSegment, baseId: patientId -%}
{% evaluate practitionerId using 'ID/Practitioner' XCN: obxSegment.16 -%}
{% evaluate practitionerRoleId using 'ID/PractitionerRole' XCN: obxSegment.25 -%}

{% if practitionerId -%}
{% include 'Resource/Practitioner' OBX: obxSegment, ID: practitionerId -%}
{% endif -%}

{% if practitionerRoleId -%}
{% include 'Resource/PractitionerRole' OBX: obxSegment, ID: practitionerRoleId -%}
{% endif %}

{% if observationId -%}
{% include 'Resource/Observation' OBX: obxSegment, ID: observationId -%}
{% include 'Resource/Observation' OBX: obxSegment, Practitioner_ID_OBX_16: practitionerId, PractitionerRole_ID_OBX_25: practitionerRoleId, ID: observationId -%}
{% if patientId -%}
{% include 'Reference/Observation/Subject' ID: observationId, REF: fullPatientId -%}
{% endif -%}
Expand All @@ -105,10 +153,15 @@

{% assign dg1SegmentLists = hl7v2Data | get_segment_lists: 'DG1' -%}
{% for dg1Segment in dg1SegmentLists.DG1 -%}
{% evaluate practitionerId using 'ID/Practitioner' XCN: dg1Segment.16 -%}
{% if practitionerId -%}
{% include 'Resource/Practitioner' DG1: dg1Segment, ID: practitionerId -%}
{% endif -%}

{% evaluate conditionId using 'ID/Condition' DG1: dg1Segment, baseId: patientId -%}
{% if conditionId -%}
{% assign fullConditionId = conditionId | prepend: 'Condition/' -%}
{% include 'Resource/Condition' DG1: dg1Segment, ID: conditionId -%}
{% include 'Resource/Condition' DG1: dg1Segment, Practitioner_ID_DG1_16: practitionerId, ID: conditionId -%}
{% if patientId -%}
{% include 'Reference/Condition/Subject' ID: conditionId, REF: fullPatientId -%}
{% endif -%}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"code" : "",
"display" : "",
"system" : "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'PersDEID' -%}
"code" : "",
"display" : "",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_Acknowledgements.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'AL' -%}
"code" : "always",
"display" : "Always",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_AddressType.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'BA' -%}
"code" : "",
"display" : "",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_AdmissionType.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'A' -%}
"code" : "A",
"display" : "Accident",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_AllergyCategory.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'DA' -%}
"code" : "medication",
"display" : "Medication",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_AllergyType.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'DA' -%}
"code" : "allergy",
"display" : "Allergy",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_CodeSystemUrl.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'I9' -%}
"system" : "http://hl7.org/fhir/sid/icd-9-cm",
{% elsif inCode == 'I10' -%}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'F' -%}
"code" : "FROZ",
"display" : "Frozen",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_CompletionStatus.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'CP' -%}
"code" : "completed",
"display" : "Completed",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"code" : "",
"display" : "",
"system" : "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == '2' -%}
"code" : "PRN",
"display" : "Parent",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_ConsentStatus.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'A' -%}
"code" : "active",
"display" : "Active",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_ContactRole.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'E' -%}
"code" : "E",
"display" : "Employer",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_Countries.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == '' -%}
"code" : "",
"display" : "",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_DurationUnit.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == '' -%}
"code" : "s",
"display" : "second",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_EncounterClass.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'E' -%}
"code" : "EMER",
"display" : "emergency",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_EncounterPriority.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == '1' -%}
"code" : "EM",
"display" : "emergency",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_EncounterType.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'E' -%}
"code" : "in-progress",
"display" : "",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_Gender.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'F' -%}
"code" : "female",
"display" : "Female",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_IDType.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'ACSN' -%}
"code" : "ACSN",
"display" : "Accession ID",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_InterpretationCode.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == '< ' -%}
"code" : "<",
"display" : "Off scale low",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_Language.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == '' -%}
"code" : "ar",
"display" : "Arabic",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_LivingWill.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'Y' -%}
"code" : "Y",
"display" : "Yes, patient has a living will",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_MaritalStatus.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'A' -%}
"code" : "L",
"display" : "Legally Separated",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_ModeofArrival.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'A' -%}
"code" : "A",
"display" : "Ambulance",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_NameAssemblyOrder.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'G' -%}
"code" : "G",
"display" : "Prefix Given Family Suffix",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_NameType.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'A' -%}
"code" : "",
"display" : "",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_ObservationStatus.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'A' -%}
"code" : "ammended",
"display" : "Ammended",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_Operation.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'A' -%}
"code" : "POST",
"display" : "Create",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_OrderStatus.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'CA' -%}
"code" : "revoked",
"display" : "Revoked",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_OrderType.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'I' -%}
"code" : "HOSP",
"display" : "Hospital",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'H' -%}
"code" : "H",
"display" : "Home",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'B' -%}
"code" : "B",
"display" : "Beeper Number",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_Priority.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'S' -%}
"code" : "stat",
"display" : "STAT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'R' -%}
"code" : "R",
"display" : "Re-admission",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_RegistryStatus.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'A' -%}
"code" : "true",
"display" : "",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_Relationship.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'SEL' -%}
"code" : "ONESELF",
"display" : "self",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_Religion.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == '' -%}
"code" : "1001",
"display" : "Adventist",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_ResultStatus.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'O' -%}
"code" : "registered",
"display" : "Registered",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_Role.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'AD' -%}
"code" : "ADM",
"display" : "admitter",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"code" : "",
"display" : "",
"system" : "",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_SegmentActionCode.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'A' -%}
"code" : "POST",
"display" : "Create",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'Y' -%}
"code" : "available",
"display" : "Available",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_StudentStatus.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'F' -%}
"code" : "F",
"display" : "Full-time student",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_TelecomUseCode.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'PRN' -%}
"code" : "home",
"display" : "Home",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_UniversalIDType.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'DNS' -%}
"code" : "DNS",
"display" : "An Internet host name, in accordance with RFC 1035; or an IP address. Either in ASCII or as integers, with periods between components (“dotted” notation).",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_ValueType.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'AUI' -%}
"code" : "",
"display" : "",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/CodeSystem/_Yes_No.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
{% if inCode == 'Y' -%}
"code" : "true",
"display" : "",
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/DataType/_CNN.liquid
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"identifier":
"identifier":
[
{
"value":"{{ CNN.1.Value }}",
Expand Down
Loading

0 comments on commit 4d3903d

Please sign in to comment.