Skip to content

Commit

Permalink
Merge pull request #198 from microsoft/dotliquid
Browse files Browse the repository at this point in the history
Update v3.3.1 to main branch
  • Loading branch information
BoyaWu10 authored Jan 29, 2021
2 parents d6e9246 + 13bf527 commit 0f4e373
Show file tree
Hide file tree
Showing 22 changed files with 97 additions and 744 deletions.
26 changes: 3 additions & 23 deletions data/Templates/Hl7v2/ADT_A01.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,11 @@
{% 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, Organization_ID_MSH_4: organizationId4, Organization_ID_MSH_6: organizationId6, ID: messageHeaderID -%}
{% include 'Resource/MessageHeader' MSH: firstSegments.MSH, ID: messageHeaderID -%}
{% endif -%}

{% evaluate patientId using 'ID/Patient' PID: firstSegments.PID, type: 'First' -%}
{% if patientId -%}
{% assign fullPatientId = patientId | prepend: 'Patient/' -%}
Expand Down Expand Up @@ -54,19 +39,14 @@
{% endif -%}

{% if 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 -%}
{% include 'Resource/Provenance' MSH: firstSegments.MSH, ORC: firstSegments.ORC, 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 -%}
{% if accountId -%}
{% include 'Resource/Account' PID: firstSegments.PID, ID: accountId -%}
{% endif -%}

{% evaluate organizationId using 'ID/Organization' HD: firstSegments.MSH.6 -%}
{% if organizationId -%}
{% include 'Resource/Organization' MSH: firstSegments.MSH, ID: organizationId -%}
{% endif -%}

{% evaluate encounterId using 'ID/Encounter' PV1: firstSegments.PV1, baseId: patientId -%}
{% if encounterId -%}
{% include 'Resource/Encounter' PV1: firstSegments.PV1, PV2: firstSegments.PV2, ID: encounterId -%}
Expand Down
8 changes: 1 addition & 7 deletions data/Templates/Hl7v2/DataType/_HDMSH_3.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
"source":
{
"name":"{{ HD.1.Value }}",
{% if HD.3.Value == "URI" and MSH.24 == null -%}
"endpoint":"{{ HD.2.Value }}",
{% endif -%}
},
"name":"{{ HD.1.Value }}",
7 changes: 1 addition & 6 deletions data/Templates/Hl7v2/DataType/_HDMSH_5.liquid
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
"destination":
[
{
"name":"{{ HD.1.Value }}",
},
],
"name":"{{ HD.1.Value }}",
9 changes: 1 addition & 8 deletions data/Templates/Hl7v2/DataType/_HDMSH_6.liquid
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
"destination":
[
{
{% if MSH.25 == null -%}
"endpoint":"{{ HD.1.Value }}",
{% endif -%}
},
],
"endpoint":"{{ HD.1.Value }}",
26 changes: 10 additions & 16 deletions data/Templates/Hl7v2/DataType/_PT.liquid
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
"meta":
{
"tag":
[
{
"code":"{{ PT.1.Value }}",
{% if PT.1 -%}
"system":"http://terminology.hl7.org/CodeSystem/v2-0103",
{% endif -%}
},
{
"code":"{{ PT.2.Value }}",
{% if PT.2 -%}
"system":"http://terminology.hl7.org/CodeSystem/v2-0207",
{% endif -%}
},
],
"code":"{{ PT.1.Value }}",
{% if PT.1 -%}
"system":"http://terminology.hl7.org/CodeSystem/v2-0103",
{% endif -%}
},
{
"code":"{{ PT.2.Value }}",
{% if PT.2 -%}
"system":"http://terminology.hl7.org/CodeSystem/v2-0207",
{% endif -%}
},
24 changes: 2 additions & 22 deletions data/Templates/Hl7v2/OML_O21.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,9 @@
{% assign firstSegments = hl7v2Data | get_first_segments: 'PID|PD1|PV1|PV2|ORC|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, Organization_ID_MSH_4: organizationId4, Organization_ID_MSH_6: organizationId6, ID: messageHeaderID -%}
{% include 'Resource/MessageHeader' MSH: firstSegments.MSH, ID: messageHeaderID -%}
{% endif -%}

{% evaluate patientId using 'ID/Patient' PID: firstSegments.PID, type: 'First' -%}
Expand Down Expand Up @@ -54,19 +39,14 @@
{% endif -%}

{% if 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 -%}
{% include 'Resource/Provenance' MSH: firstSegments.MSH, ORC: firstSegments.ORC, 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 -%}
{% if accountId -%}
{% include 'Resource/Account' PID: firstSegments.PID, ID: accountId -%}
{% endif -%}

{% evaluate organizationId using 'ID/Organization' HD: firstSegments.MSH.6 -%}
{% if organizationId -%}
{% include 'Resource/Organization' MSH: firstSegments.MSH, ID: organizationId -%}
{% endif -%}

{% evaluate encounterId using 'ID/Encounter' PV1: firstSegments.PV1, baseId: patientId -%}
{% if encounterId -%}
{% assign fullEncounterId = encounterId | prepend: 'Encounter/' -%}
Expand Down
24 changes: 2 additions & 22 deletions data/Templates/Hl7v2/ORU_R01.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,9 @@
{% assign firstSegments = hl7v2Data | get_first_segments: 'PID|PD1|NK1|PV1|PV2|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, Organization_ID_MSH_4: organizationId4, Organization_ID_MSH_6: organizationId6, ID: messageHeaderID -%}
{% include 'Resource/MessageHeader' MSH: firstSegments.MSH, ID: messageHeaderID -%}
{% endif -%}

{% evaluate patientId using 'ID/Patient' PID: firstSegments.PID, type: 'First' -%}
Expand Down Expand Up @@ -54,19 +39,14 @@
{% endif -%}

{% if 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 -%}
{% include 'Resource/Provenance' MSH: firstSegments.MSH, ORC: firstSegments.ORC, 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 -%}
{% if accountId -%}
{% include 'Resource/Account' PID: firstSegments.PID, ID: accountId -%}
{% endif -%}

{% evaluate organizationId using 'ID/Organization' HD: firstSegments.MSH.6 -%}
{% if organizationId -%}
{% include 'Resource/Organization' MSH: firstSegments.MSH, ID: organizationId -%}
{% endif -%}

{% evaluate encounterId using 'ID/Encounter' PV1: firstSegments.PV1, baseId: patientId -%}
{% if encounterId -%}
{% assign fullEncounterId = encounterId | prepend: 'Encounter/' -%}
Expand Down
2 changes: 1 addition & 1 deletion data/Templates/Hl7v2/Resource/_MessageHeader.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
],
"tag":
[
{ {% include 'DataType/PT' PT: MSH.11 -%} },
{% include 'DataType/PT' PT: MSH.11 -%},
],
},
"language":"{{ MSH.19.Value | get_property: 'CodeSystem/Language', 'code' }}",
Expand Down
24 changes: 2 additions & 22 deletions data/Templates/Hl7v2/VXU_V04.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,9 @@
{% assign firstSegments = hl7v2Data | get_first_segments: 'PID|PD1|PV1|ORC|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, Organization_ID_MSH_4: organizationId4, Organization_ID_MSH_6: organizationId6, ID: messageHeaderID -%}
{% include 'Resource/MessageHeader' MSH: firstSegments.MSH, ID: messageHeaderID -%}
{% endif -%}

{% evaluate patientId using 'ID/Patient' PID: firstSegments.PID, type: 'First' -%}
Expand Down Expand Up @@ -54,19 +39,14 @@
{% endif -%}

{% if 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 -%}
{% include 'Resource/Provenance' MSH: firstSegments.MSH, ORC: firstSegments.ORC, 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 -%}
{% if accountId -%}
{% include 'Resource/Account' PID: firstSegments.PID, ID: accountId -%}
{% endif -%}

{% evaluate organizationId using 'ID/Organization' HD: firstSegments.MSH.6 -%}
{% if organizationId -%}
{% include 'Resource/Organization' MSH: firstSegments.MSH, ID: organizationId -%}
{% endif -%}

{% evaluate encounterId using 'ID/Encounter' PV1: firstSegments.PV1, baseId: patientId -%}
{% if encounterId -%}
{% include 'Resource/Encounter' PV1: firstSegments.PV1, ID: encounterId -%}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,49 +1,22 @@
{
{
"resourceType": "Bundle",
"type": "batch",
"entry": [
{
"fullUrl": "urn:uuid:3fa041fd-9a00-f9ae-30ba-4e3ad5585603",
"resource": {
"resourceType": "Organization",
"id": "3fa041fd-9a00-f9ae-30ba-4e3ad5585603",
"identifier": [
{
"value": "1"
}
]
},
"request": {
"method": "PUT",
"url": "Organization/3fa041fd-9a00-f9ae-30ba-4e3ad5585603"
}
},
{
"fullUrl": "urn:uuid:d3171c25-5db7-e705-140c-19d0972f1ba2",
"resource": {
"resourceType": "MessageHeader",
"id": "d3171c25-5db7-e705-140c-19d0972f1ba2",
"source": {
"source": {
"name": "AccMgr"
}
"name": "AccMgr"
},
"meta": {
"tag": [
{
"meta": {
"tag": [
{
"code": "P",
"system": "http://terminology.hl7.org/CodeSystem/v2-0103"
}
]
}
"code": "P",
"system": "http://terminology.hl7.org/CodeSystem/v2-0103"
}
]
},
"sender": {
"reference": "Organization/3fa041fd-9a00-f9ae-30ba-4e3ad5585603"
}
},
"request": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,66 +1,27 @@
{
{
"resourceType": "Bundle",
"type": "batch",
"entry": [
{
"fullUrl": "urn:uuid:2d7d77cd-0ca7-13a5-c9ed-6e70b739adb4",
"resource": {
"resourceType": "Organization",
"id": "2d7d77cd-0ca7-13a5-c9ed-6e70b739adb4",
"identifier": [
{
"value": "GOOD HEALTH HOSPITAL"
}
],
"destination": [
{
"endpoint": "GOOD HEALTH HOSPITAL"
}
]
},
"request": {
"method": "PUT",
"url": "Organization/2d7d77cd-0ca7-13a5-c9ed-6e70b739adb4"
}
},
{
"fullUrl": "urn:uuid:64c2d51b-34a4-e841-fb1c-03f1f7762d1a",
"resource": {
"resourceType": "MessageHeader",
"id": "64c2d51b-34a4-e841-fb1c-03f1f7762d1a",
"source": {
"source": {
"name": "ADT1"
}
"name": "ADT1"
},
"destination": [
{
"destination": [
{
"name": "GHH LAB, INC."
}
],
"receiver": {
"reference": "Organization/2d7d77cd-0ca7-13a5-c9ed-6e70b739adb4"
}
"name": "GHH LAB, INC."
}
],
"meta": {
"tag": [
{
"meta": {
"tag": [
{
"code": "P",
"system": "http://terminology.hl7.org/CodeSystem/v2-0103"
}
]
}
"code": "P",
"system": "http://terminology.hl7.org/CodeSystem/v2-0103"
}
]
},
"sender": {
"reference": "Organization/2d7d77cd-0ca7-13a5-c9ed-6e70b739adb4"
}
},
"request": {
Expand Down
Loading

0 comments on commit 0f4e373

Please sign in to comment.