Skip to content

Commit bb2b83d

Browse files
authored
Fix filters in if tag (#385)
* Remove filters in if * Update name to templateIdString * Update expect test file * Revert DateTimeOffset
1 parent e705a11 commit bb2b83d

15 files changed

+3058
-3239
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
{% if relationship.observation.templateId | to_json_string | contains: '"2.16.840.1.113883.10.20.22.4.7"' -%}
1+
{% assign templateIdString = relationship.observation.templateId | to_json_string -%}
2+
{% if templateIdString contains '"2.16.840.1.113883.10.20.22.4.7"' -%}
23
{% assign allergyId = relationship.observation | to_json_string | generate_uuid -%}
34
{% include 'Resource/AllergyIntolerance' allergyStatus: statusCode, allergyEntry: relationship.observation, ID: allergyId -%}
45
{% include 'Reference/AllergyIntolerance/Patient' ID: allergyId, REF: fullPatientId -%}

data/Templates/Ccda/Entry/Encounter/_entry_encounter_participant.liquid

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{% if participant.typeCode == 'LOC' -%}
2-
{% if participant.participantRole.templateId | to_json_string | contains: '"2.16.840.1.113883.10.20.22.4.32"'-%}
2+
{% assign templateIdString = participant.participantRole.templateId | to_json_string -%}
3+
{% if templateIdString contains '"2.16.840.1.113883.10.20.22.4.32"'-%}
34
{% assign locationId = participant.participantRole | to_json_string | generate_uuid -%}
45
{% include 'Resource/Location' location: participant.participantRole, ID: locationId -%}
56
{% assign fullLocationId = locationId | prepend: 'Location/' -%}

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
{% assign observationId = entryRelationship.observation | to_json_string | generate_uuid -%}
2-
{% if entryRelationship.observation.templateId | to_json_string | contains '"2.16.840.1.113883.10.20.22.4.19"' -%}
2+
{% assign templateIdString = entryRelationship.observation.templateId | to_json_string -%}
3+
4+
{% if templateIdString contains '"2.16.840.1.113883.10.20.22.4.19"' -%}
35
{% include 'Resource/Condition' conditionEntry: entryRelationship.observation, ID: observationId -%}
46
{% assign fullObservationId = observationId | prepend: 'Condition/' -%}
57
{% include 'Reference/MedicationAdministration/ReasonReference' ID: substanceAdministrationId, REF: fullObservationId-%}
68
{% endif -%}
79

8-
{% if entryRelationship.supply.templateId | to_json_string | contains '"2.16.840.1.113883.10.20.22.4.17"' -%}
10+
{% assign templateIdString = entryRelationship.supply.templateId | to_json_string -%}
11+
{% if templateIdString contains '"2.16.840.1.113883.10.20.22.4.17"' -%}
912
{% if entryRelationship.supply.author.assignedAuthor -%}
1013
{% evaluate practitionerId using 'Utils/GenerateId' obj: entryRelationship.supply.author.assignedAuthor -%}
1114
{% include 'Resource/Practitioner', practitioner: entryRelationship.supply.author.assignedAuthor, ID: practitionerId -%}
@@ -14,7 +17,7 @@
1417
{% endif -%}
1518
{% endif -%}
1619

17-
{% if entryRelationship.supply.templateId | to_json_string | contains '"2.16.840.1.113883.10.20.22.4.18"' -%}
20+
{% if templateIdString contains '"2.16.840.1.113883.10.20.22.4.18"' -%}
1821
{% assign supplyId = entryRelationship.supply | to_json_string | generate_uuid -%}
1922
{% include 'Resource/MedicationDispense' medicationDispense: entryRelationship.supply, ID: supplyId -%}
2023
{% evaluate practitionerId using 'Utils/GenerateId' obj: entryRelationship.supply.performer.assignedEntity -%}

data/Templates/Ccda/Entry/Payer/_entry_act_entryRelationship_act_performer.liquid

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
{% if entry.templateId | to_json_string | contains: '"2.16.840.1.113883.10.20.22.4.87"' -%}
1+
{% assign templateIdString = entry.templateId | to_json_string -%}
2+
{% if templateIdString contains '"2.16.840.1.113883.10.20.22.4.87"' -%}
23
{% if entry.assignedEntity.representedOrganization.name._ -%}
34
{% assign organizationId = entry.assignedEntity.representedOrganization | to_json_string | generate_uuid -%}
45
{% include 'Resource/Organization' organization: entry.assignedEntity.representedOrganization ID: organizationId -%}

data/Templates/Ccda/Resource/_AllergyIntolerance.liquid

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"substance":{ {% include 'DataType/CodeableConcept' CodeableConcept: allergyEntry.participant.participantRole.playingEntity.code -%} },
3232
{% endif -%}
3333

34-
{% if r.observation.templateId | to_json_string | contains: '"2.16.840.1.113883.10.20.22.4.9"' -%}
34+
{% assign templateIdString = r.observation.templateId | to_json_string -%}
35+
{% if templateIdString contains '"2.16.840.1.113883.10.20.22.4.9"' -%}
3536
"manifestation":
3637
[
3738
{% if r.observation.value.translation -%}
@@ -42,7 +43,7 @@
4243
],
4344
"onset": "{{ r.observation.effectiveTime.low.value | format_as_date_time }}",
4445
{% endif -%}
45-
{% if r.observation.templateId | to_json_string | contains: '"2.16.840.1.113883.10.20.22.4.8"' -%}
46+
{% if templateIdString contains '"2.16.840.1.113883.10.20.22.4.8"' -%}
4647
{% if r.observation.value.translation -%}
4748
"severity":"{{ r.observation.value.translation.displayName | downcase | get_property: 'ValueSet/AllergySeverity' }}",
4849
{% else -%}

data/Templates/Ccda/Resource/_Condition.liquid

+8-6
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
{
1515
{% assign entryRelationships = conditionEntry.entryRelationship | to_array -%}
1616
{% for entryRelationship in entryRelationships -%}
17-
{% if entryRelationship.observation.templateId | to_json_string | contains: '"2.16.840.1.113883.10.20.22.4.5"' -%}
18-
{% include 'DataType/CodeableConcept' CodeableConcept: entryRelationship.observation.value -%}
19-
{% endif -%}
17+
{% assign templateIdString = entryRelationship.observation.templateId | to_json_string -%}
18+
{% if templateIdString contains '"2.16.840.1.113883.10.20.22.4.5"' -%}
19+
{% include 'DataType/CodeableConcept' CodeableConcept: entryRelationship.observation.value -%}
20+
{% endif -%}
2021
{% endfor -%}
2122
},
2223
"code":
@@ -36,9 +37,10 @@
3637
{
3738
{% assign entryRelationships = conditionEntry.entryRelationship | to_array -%}
3839
{% for entryRelationship in entryRelationships -%}
39-
{% if entryRelationship.observation.templateId | to_json_string | contains: '"2.16.840.1.113883.10.20.22.4.31"' -%}
40-
{% include 'DataType/CodeableConcept' CodeableConcept: entryRelationship.observation.value.value -%}
41-
{% endif -%}
40+
{% assign templateIdString = entryRelationship.observation.templateId | to_json_string -%}
41+
{% if templateIdString contains '"2.16.840.1.113883.10.20.22.4.31"' -%}
42+
{% include 'DataType/CodeableConcept' CodeableConcept: entryRelationship.observation.value.value -%}
43+
{% endif -%}
4244
{% endfor -%}
4345
},
4446
},

data/Templates/Ccda/Resource/_FamilyMemberHistory.liquid

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727
"code":{ {% include 'DataType/CodeableConcept' CodeableConcept: component.observation.value -%} },
2828
{% assign entryRelationships = component.observation.entryRelationship | to_array -%}
2929
{% for entryRelationship in entryRelationships -%}
30-
{% if entryRelationship.observation.templateId | to_json_string | contains: '"2.16.840.1.113883.10.20.22.4.47"' -%}
30+
{% assign templateIdString = entryRelationship.observation.templateId | to_json_string -%}
31+
{% if templateIdString contains '"2.16.840.1.113883.10.20.22.4.47"' -%}
3132
"contributedToDeath":true,
3233
{% endif -%}
33-
{% if entryRelationship.observation.templateId | to_json_string | contains: '"2.16.840.1.113883.10.20.22.4.31"' -%}
34+
{% if templateIdString contains '"2.16.840.1.113883.10.20.22.4.31"' -%}
3435
{% if entryRelationship.observation.value.value -%}
3536
"onsetAge":{
3637
"value": {{entryRelationship.observation.value.value}},

data/Templates/Ccda/Resource/_Immunization.liquid

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
{% assign entryRelationships = immunization.entryRelationship | to_array -%}
1515
{% for entryRelationship in entryRelationships -%}
16-
{% if entryRelationship.observation.templateId | to_json_string | contains: '"2.16.840.1.113883.10.20.22.4.53"' -%}
16+
{% assign templateIdString = entryRelationship.observation.templateId | to_json_string -%}
17+
{% if templateIdString contains '"2.16.840.1.113883.10.20.22.4.53"' -%}
1718
"statusReason": { {% include 'DataType/CodeableConcept' CodeableConcept: entryRelationship.observation.code -%} },
1819
{% endif -%}
1920
{% endfor -%}
@@ -28,7 +29,8 @@
2829
{% for consumable in consumables -%}
2930
{% assign manufacturedProducts = consumable.manufacturedProduct | to_array -%}
3031
{% for manufacturedProduct in manufacturedProducts -%}
31-
{% if manufacturedProduct.templateId | to_json_string | contains '"2.16.840.1.113883.10.20.22.4.54"' -%}
32+
{% assign templateIdString = manufacturedProduct.templateId | to_json_string -%}
33+
{% if templateIdString contains '"2.16.840.1.113883.10.20.22.4.54"' -%}
3234
{% if manufacturedProduct.manufacturedMaterial.code.translation -%}
3335
"vaccineCode":{ {% include 'DataType/CodeableConcept' CodeableConcept: manufacturedProduct.manufacturedMaterial.code.translation -%} },
3436
{% else -%}

0 commit comments

Comments
 (0)