forked from microsoft/FHIR-Converter
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathEICR.liquid
More file actions
49 lines (48 loc) · 1.93 KB
/
EICR.liquid
File metadata and controls
49 lines (48 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{% assign eicrDocumentId = msg._originalData | generate_uuid -%}
{% if msg.ClinicalDocument.id -%}
{% if msg.ClinicalDocument.id.extension -%}
{% comment %} If extension exists, use that {% endcomment %}
{% assign eicrDocumentId = msg.ClinicalDocument.id.extension -%}
{% elsif msg.ClinicalDocument.id.root -%}
{% comment %} If extension does not exist and root does, use that {% endcomment %}
{% assign eicrDocumentId = msg.ClinicalDocument.id.root -%}
{% endif -%}
{% else -%}
{% assign eicrDocumentId = msg._originalData | generate_uuid -%}
{% endif -%}
{
"resourceType": "Bundle",
"type": "document",
"meta": {
"profile": [
"http://hl7.org/fhir/us/ecr/StructureDefinition/eicr-document-bundle"
]
},
"id": "{{eicrDocumentId}}",
"identifier": {% include 'DataType/IdentifierEcr', Identifier: msg.ClinicalDocument.id -%}
"timestamp": {%- include 'DataType/Instant', dateTime: msg.ClinicalDocument.effectiveTime -%}
"entry": [{% evaluate patientId using 'Utils/GenerateId' obj: msg.ClinicalDocument.recordTarget.patientRole -%}
{% assign fullPatientId = patientId | prepend: 'Patient/' -%}
{% include 'Header' -%}
{% include 'Section/AllergiesAndAdverseReaction' -%}
{% include 'Section/Medication' -%}
{% include 'Section/Problem' -%}
{% include 'Section/Pregnancy' -%}
{% include 'Section/Result' -%}
{% include 'Section/SocialHistory' -%}
{% include 'Section/VitalSign' -%}
{% include 'Section/Encounter' -%}
{% include 'Section/PlanOfTreatment' -%}
{% include 'Section/AdmissionMedication' -%}
{% include 'Section/Procedure' -%}
{% include 'Section/Immunization' -%}
{% include 'Section/FunctionalStatus' -%}
{% include 'Section/FamilyHistory' -%}
{% include 'Section/AdvanceDirective' -%}
{% include 'Section/MedicalEquipment' -%}
{% include 'Section/MentalStatus' -%}
{% include 'Section/Nutrition' -%}
{% include 'Section/Payer' -%}
{% include 'Section/EmergencyOutbreakInformation' %}
]
}