Skip to content

Commit 0a7363e

Browse files
authored
Merge pull request #274 from microsoft/dotliquid
Improve CCDA Template and small update for converter engine
2 parents a2460a7 + f968bf7 commit 0a7363e

File tree

105 files changed

+1141
-1357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1141
-1357
lines changed

data/SampleData/Ccda/170.314B2_Amb_CCD.ccda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@
10271027
<originalText>
10281028
<reference value="#ID0EBALACA"/>
10291029
</originalText>
1030-
<translation xsi:type="CD" code="2670" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Codeine"/>
1030+
<translation xsi:type="CD" code="261000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Codeine phosphate"/>
10311031
</code>
10321032
<name>Codeine</name>
10331033
</playingEntity>

data/SampleData/Ccda/C-CDA_R2-1_CCD.xml.ccda

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@
692692
<participant typeCode="CSM">
693693
<participantRole classCode="MANU">
694694
<playingEntity classCode="MMAT">
695-
<code code="70618" displayName="Penicillin" codeSystem="2.16.840.1.113883.6.88" codeSystemName="RxNorm"/>
695+
<code code="7980" displayName="Penicillin" codeSystem="2.16.840.1.113883.6.88" codeSystemName="RxNorm"/>
696696
</playingEntity>
697697
</participantRole>
698698
</participant>
@@ -2626,7 +2626,7 @@
26262626
<statusCode code="completed"/>
26272627
<effectiveTime value="20120512"/>
26282628
<methodCode nullFlavor="UNK"/>
2629-
<targetSiteCode code="appropriate_code" displayName="colon" codeSystem="2.16.840.1.113883.3.88.12.3221.8.9" codeSystemName="Body Site Value Set"/>
2629+
<targetSiteCode code="485005" displayName="colon" codeSystem="2.16.840.1.113883.3.88.12.3221.8.9" codeSystemName="Body Site Value Set"/>
26302630
<specimen typeCode="SPC">
26312631
<specimenRole classCode="SPEC">
26322632
<id root="c2ee9ee9-ae31-4628-a919-fec1cbb58683"/>

data/SampleData/Ccda/Consultation_Note.ccda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ ALLERGIES AND INTOLERANCES SECTION (ENTRIES REQUIRED) V2
398398
<participant typeCode="CSM">
399399
<participantRole classCode="MANU">
400400
<playingEntity classCode="MMAT">
401-
<code code="70618" displayName="Penicillin" codeSystem="2.16.840.1.113883.6.88" codeSystemName="RxNorm"/>
401+
<code code="7980" displayName="Penicillin" codeSystem="2.16.840.1.113883.6.88" codeSystemName="RxNorm"/>
402402
</playingEntity>
403403
</participantRole>
404404
</participant>

data/SampleData/Ccda/Discharge_Summary.ccda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@
737737
<section>
738738
<templateId root="2.16.840.1.113883.10.20.22.2.24" extension="2014-06-09"/>
739739
<id extension="9937012" root="2.16.840.1.113883.19"/>
740-
<code code="C-CDAV2-DDN" displayName="Hospital Discharge Diagnosis" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
740+
<code code="11535-2" displayName="Hospital Discharge Diagnosis" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
741741
<title>DISCHARGE DIAGNOSIS</title>
742742
<text>
743743
<content ID="DschDx">Appendicitis</content>

data/SampleData/Ccda/Progress_Note.ccda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ Allergies, Adverse Reactions, Alerts
475475
<participant typeCode="CSM">
476476
<participantRole classCode="MANU">
477477
<playingEntity classCode="MMAT">
478-
<code code="70618" displayName="Penicillin" codeSystem="2.16.840.1.113883.6.88" codeSystemName="RxNorm"/>
478+
<code code="7980" displayName="Penicillin" codeSystem="2.16.840.1.113883.6.88" codeSystemName="RxNorm"/>
479479
</playingEntity>
480480
</participantRole>
481481
</participant>

data/SampleData/Ccda/Referral_Note.ccda

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<!-- DocumentID: unique ID for the document -->
2828
<id root="6f1bd58b-c58f-40b7-b314-caf1294ed98b"/>
2929
<!-- Referral Note -->
30-
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" code="57113-1" displayName="Referral Note"/>
30+
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" code="57133-1" displayName="Referral Note"/>
3131
<!-- Use the name of the code as the title -->
3232
<title>Referral Note</title>
3333
<effectiveTime value="201309210500-0800"/>
@@ -560,7 +560,7 @@ ALLERGIES AND INTOLERANCES SECTION V2
560560
<participant typeCode="CSM">
561561
<participantRole classCode="MANU">
562562
<playingEntity classCode="MMAT">
563-
<code code="70618" displayName="Penicillin" codeSystem="2.16.840.1.113883.6.88" codeSystemName="RxNorm"/>
563+
<code code="7980" displayName="Penicillin" codeSystem="2.16.840.1.113883.6.88" codeSystemName="RxNorm"/>
564564
</playingEntity>
565565
</participantRole>
566566
</participant>

data/SampleData/Ccda/Transfer_Summary.ccda

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ ALLERGIES AND INTOLERANCES SECTION (ENTRIES REQUIRED) V2
532532
<participant typeCode="CSM">
533533
<participantRole classCode="MANU">
534534
<playingEntity classCode="MMAT">
535-
<code code="70618" displayName="Penicillin" codeSystem="2.16.840.1.113883.6.88"
535+
<code code="7980" displayName="Penicillin" codeSystem="2.16.840.1.113883.6.88"
536536
codeSystemName="RxNorm" />
537537
</playingEntity>
538538
</participantRole>
@@ -1321,7 +1321,7 @@ HOSPITAL DISCHARGE DIAGNOSIS SECTION V2
13211321
<section>
13221322
<!-- Discharge Summary Hospital Discharge Diagnosis Template Id -->
13231323
<templateId root="2.16.840.1.113883.10.20.22.2.24" extension="2014-06-09" />
1324-
<code code="C-CDAV2-DDN" displayName="Discharge diagnosis narritive" codeSystem="2.16.840.1.113883.6.1"
1324+
<code code="11535-2" displayName="Discharge diagnosis narritive" codeSystem="2.16.840.1.113883.6.1"
13251325
codeSystemName="LOINC" />
13261326
<title>Hospital Discharge Diagnosis</title>
13271327
<text>.Kidney Malrotation. Discharged August 1, 2013</text>

data/Templates/Ccda/Entry/HospitalDischargeMedication/_entry_act_entryRelationship.liquid

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
{% include 'Resource/MedicationAdministration' medicationAdministration: relationship.substanceAdministration, ID: substanceAdministrationId -%}
33
{% assign manufacturedMaterialId = relationship.substanceAdministration.consumable.manufacturedProduct.manufacturedMaterial | to_json_string | generate_uuid -%}
44
{% include 'Resource/Medication' medication: relationship.substanceAdministration.consumable.manufacturedProduct.manufacturedMaterial, ID: manufacturedMaterialId -%}
5-
{% assign organizationId = relationship.substanceAdministration.performer.assignedEntity.representedOrganization | to_json_string | generate_uuid -%}
6-
{% include 'Resource/Organization' organization: relationship.substanceAdministration.performer.assignedEntity.representedOrganization, ID: organizationId -%}
5+
{% if relationship.substanceAdministration.performer.assignedEntity.representedOrganization -%}
6+
{% assign organizationId = relationship.substanceAdministration.performer.assignedEntity.representedOrganization | to_json_string | generate_uuid -%}
7+
{% include 'Resource/Organization' organization: relationship.substanceAdministration.performer.assignedEntity.representedOrganization, ID: organizationId -%}
8+
{% endif -%}
79
{% include 'Reference/MedicationAdministration/Subject' ID: substanceAdministrationId, REF: fullPatientId -%}
810
{% assign fullManufacturedMaterialId = manufacturedMaterialId | prepend: 'Medication/' -%}
911
{% include 'Reference/MedicationAdministration/MedicationReference' ID: substanceAdministrationId, REF: fullManufacturedMaterialId -%}

data/Templates/Ccda/Header.liquid

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@
1212
{% include 'Resource/Encounter' encounter: msg.ClinicalDocument.componentOf.encompassingEncounter ID: encounterId -%}
1313
{% assign fullEncounterId = encounterId | prepend: 'Encounter/' -%}
1414
{% include 'Reference/Composition/Encounter' ID: compositionId, REF: fullEncounterId -%}
15-
{% endif -%}
16-
17-
{% if msg.ClinicalDocument.componentOf.encompassingEncounter.location -%}
18-
{% assign locationId = msg.ClinicalDocument.componentOf.encompassingEncounter.location | to_json_string | generate_uuid -%}
19-
{% include 'Resource/Location' location: msg.ClinicalDocument.componentOf.encompassingEncounter.location ID: locationId -%}
20-
{% assign fullLocationId = locationId | prepend: 'Location/' -%}
21-
{% include 'Reference/Encounter/Location_Location' ID: encounterId, REF: fullLocationId -%}
15+
{% if msg.ClinicalDocument.componentOf.encompassingEncounter.location -%}
16+
{% assign locationId = msg.ClinicalDocument.componentOf.encompassingEncounter.location | to_json_string | generate_uuid -%}
17+
{% include 'Resource/Location' location: msg.ClinicalDocument.componentOf.encompassingEncounter.location ID: locationId -%}
18+
{% assign fullLocationId = locationId | prepend: 'Location/' -%}
19+
{% include 'Reference/Encounter/Location_Location' ID: encounterId, REF: fullLocationId -%}
20+
{% endif -%}
2221
{% endif -%}
2322

2423
{% if msg.ClinicalDocument.custodian.assignedCustodian.representedCustodianOrganization.name._ -%}
@@ -46,7 +45,7 @@
4645
{% endif -%}
4746
{% endif -%}
4847

49-
{% if author.assignedAuthor -%}
48+
{% if author.assignedAuthor.assignedPerson -%}
5049
{% evaluate practitionerId using 'Utils/GenerateId' obj: author.assignedAuthor -%}
5150
{% include 'Resource/Practitioner' practitioner: author.assignedAuthor ID: practitionerId -%}
5251
{% assign fullPractitionerId = practitionerId | prepend: 'Practitioner/' -%}

data/Templates/Ccda/Resource/_AllergyIntolerance.liquid

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
[
1717
{
1818
"system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
19-
"code":{% include 'ValueSet/AllergyStatus' code: allergyStatus.code -%},
19+
"code":"{{ allergyStatus.code | get_property: 'ValueSet/AllergyStatus' }}",
2020
}
2121
]
2222
},
@@ -31,7 +31,6 @@
3131
"substance":{ {% include 'DataType/CodeableConcept' CodeableConcept: allergyEntry.participant.participantRole.playingEntity.code -%} },
3232
{% endif -%}
3333

34-
3534
{% if r.observation.templateId | to_json_string | contains: '"2.16.840.1.113883.10.20.22.4.9"' -%}
3635
"manifestation":
3736
[
@@ -43,14 +42,15 @@
4342
],
4443
"onset": "{{ r.observation.effectiveTime.low.value | format_as_date_time }}",
4544
{% endif -%}
46-
47-
{% if r.observation.templateId | to_json_string | contains: '"2.16.840.1.113883.10.20.22.4.8"' -%}
48-
{% if r.observation.value.translation -%}
49-
"severity":{% include 'ValueSet/AllergySeverity' code: r.observation.value.translation.displayName -%},
50-
{% else -%}
51-
"severity":{% include 'ValueSet/AllergySeverity' code: r.observation.value.displayName -%},
45+
{% for templateId in r.observation.templateId -%}
46+
{% if templateId.root == "2.16.840.1.113883.10.20.22.4.8" -%}
47+
{% if r.observation.value.translation -%}
48+
"severity":"{{ r.observation.value.translation.displayName | downcase | get_property: 'ValueSet/AllergySeverity' }}",
49+
{% else -%}
50+
"severity":"{{ r.observation.value.displayName | downcase | get_property: 'ValueSet/AllergySeverity' }}",
51+
{% endif -%}
5252
{% endif -%}
53-
{% endif -%}
53+
{% endfor -%}
5454
},
5555
{% endfor -%}
5656

0 commit comments

Comments
 (0)