Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/SampleData/eCR/eCR_full.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@
<!-- ** Immunizations** -->
<component>
<section>
<templateId extension="2015-08-01" root="2.16.840.1.113883.10.20.22.2.1" />
<templateId extension="2015-08-01" root="2.16.840.1.113883.10.20.22.2.2.1" />
<!-- ******** Immunizations section template ******** -->
<code code="11369-6" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"
displayName="History of immunizations" />
Expand Down
9 changes: 5 additions & 4 deletions data/Templates/eCR/Resource/_Composition.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
{% assign components = composition.component.structuredBody.component | to_array -%}
{% for component in components -%}
{
{% if component.section -%}
{% comment %} Section will be created if 1) section exists, AND 2) either null Flavor DNE OR section has entries {% endcomment %}
{% if component.section and component.section.nullFlavor == null or component.section.entry -%}
{% assign templateIds = component.section.templateId | to_array %}
{% for templateId in templateIds -%}
{% assign templatesInComp = templatesInComp | append: templateId.root | append: "|" %}
Expand Down Expand Up @@ -105,7 +106,7 @@
},
{% endfor %}
{% endif %}
{% if component.section.templateId.root == "2.16.840.1.113883.10.20.22.2.44" or component.section.templateId[0].root == "2.16.840.1.113883.10.20.22.2.44" %}
{% if component.section.templateId.root == "2.16.840.1.113883.10.20.22.2.44" or component.section.templateId[0].root == "2.16.840.1.113883.10.20.22.2.44" %}
{% assign entries = component.section.entry | to_array -%}
{% for entry in entries -%}
{% assign medicationAdministrationId = entry.act.entryRelationship.substanceAdministration | to_json_string | generate_uuid -%}
Expand All @@ -115,7 +116,7 @@
},
{% endfor %}
{% endif %}
{% if component.section.templateId.root == "2.16.840.1.113883.10.20.22.2.2.1" %}
{% if component.section.templateId.root == "2.16.840.1.113883.10.20.22.2.2.1" or component.section.templateId[0].root == "2.16.840.1.113883.10.20.22.2.2.1" or component.section.templateId.root == "2.16.840.1.113883.10.20.22.2.2" or component.section.templateId[0].root == "2.16.840.1.113883.10.20.22.2.2" %}
{% assign entries = component.section.entry | to_array -%}
{% for entry in entries -%}
{%- if entry.substanceAdministration -%}
Expand Down Expand Up @@ -249,7 +250,7 @@
{% endif -%}
},
{% endfor -%}
{% assign templatesInComp = templatesInComp | split: "|" | uniq | join: "|" %}
{% assign templatesInComp = templatesInComp | split: "|" | uniq %}
{% include 'Utils/AddMissingRequiredSections' | templatesInComp: templatesInComp %}

{% comment %} Reportability Response Information Section (from RR) {% endcomment %}
Expand Down
6 changes: 3 additions & 3 deletions data/Templates/eCR/Utils/_AddMissingRequiredSections.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
{% comment %} For template OIDs, see HL7 CDA® R2 Implementation Guide: Public Health Case Report – the Electronic Initial Case Report (eICR) Release 2, STU Release 3.1 - US Realm {% endcomment %}

{% assign requiredSections = "2.16.840.1.113883.10.20.22.2.12|1.3.6.1.4.1.19376.1.5.3.1.1.13.2.1|1.3.6.1.4.1.19376.1.5.3.1.3.4|2.16.840.1.113883.10.20.22.2.5.1|2.16.840.1.113883.10.20.22.2.38|2.16.840.1.113883.10.20.22.2.3.1|2.16.840.1.113883.10.20.22.2.17" | split: "|" %}
{% assign missingSections = "" %}
{% assign missingSectionIds = "" %}

{% for req in requiredSections %}
{% unless templatesInComp contains req %}
{% assign missingSectionIds = missingSections | append: req | append: "|" %}
{% assign missingSectionIds = missingSectionIds | append: req | append: "|" %}
{% endunless %}
{% endfor %}

{% if missingSectionIds %}
{% if missingSectionIds != "" %}
{% assign missingSectionIds = missingSectionIds | split: "|" %}
{% for missingSectionId in missingSectionIds %}
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,6 @@
},
"mode": "snapshot"
},
{
"id": "58d903bb-abb6-9ca8-944a-b434e5403814",
"title": "Encounters",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">No information</div>"
},
"code": {
"coding": [
{
"code": "46240-8",
"system": "http://loinc.org",
"display": "History of encounters"
}
]
},
"mode": "snapshot"
},
{
"id": "8c9db562-27fd-957c-e00a-ddc6373fec2e",
"title": "History of Present Illness",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,6 @@
},
"mode": "snapshot"
},
{
"id": "58d903bb-abb6-9ca8-944a-b434e5403814",
"title": "Encounters",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">No information</div>"
},
"code": {
"coding": [
{
"code": "46240-8",
"system": "http://loinc.org",
"display": "History of encounters"
}
]
},
"mode": "snapshot"
},
{
"id": "8c9db562-27fd-957c-e00a-ddc6373fec2e",
"title": "History of Present Illness",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,10 @@ public static IEnumerable<object[]> GetDataForEcr()
// 4. whether the file should fail at parsing or validation when testing if valid (if it is fully valid, "validation" is what should be there)
// 5. The number of expected failures at the step in (4) for the numFailures parameter
// ]
new[] { @"EICR", @"eCR_full.xml", @"eCR_full-expected.json", "validation", "4" },
new[] { @"EICR", @"eCR_RR_combined_3_1.xml", @"eCR_RR_combined_3_1-expected.json", "validation", "10" },
new[] { @"EICR", @"eCR_full.xml", @"eCR_full-expected.json", "validation", "2" },
new[] { @"EICR", @"eCR_RR_combined_3_1.xml", @"eCR_RR_combined_3_1-expected.json", "validation", "8" },
new[] { @"EICR", @"eCR_EveEverywoman.xml", @"eCR_EveEverywoman-expected.json", "validation", "32" },
new[] { @"EICR", @"eicr04152020.xml", @"eicr04152020-expected.json", "validation", "15" },
new[] { @"EICR", @"eicr04152020.xml", @"eicr04152020-expected.json", "validation", "14" },
new[] { @"EICR", @"CDAR2_IG_PHCASERPT_R2_D2_SAMPLE.xml", @"CDAR2_IG_PHCASERPT_R2_D2_SAMPLE-expected.json", "validation", "15" },
};
return data.Select(item => new[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,12 @@
}
]
},
"mode": "snapshot"
"mode": "snapshot",
"entry": [
{
"reference": "Immunization/c099eff8-da24-9e93-1961-f040da84ca62"
}
]
},
{
"id": "368CF1FF-DA66-11EF-B655-005056BE2511",
Expand Down Expand Up @@ -309,29 +314,6 @@
}
]
},
{
"id": "36C0CA42-DA66-11EF-B655-005056BE2511",
"title": "Admitting Diagnoses",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p id=\"nof31\">Not on file</p><small id=\"subTitle30\">documented in this encounter</small></div>"
},
"code": {
"coding": [
{
"code": "46241-6",
"system": "http://loinc.org",
"display": "Hospital admission diagnosis Narrative - Reported"
},
{
"code": "42347-5",
"system": "http://loinc.org",
"display": "Admission diagnosis (narrative)"
}
]
},
"mode": "snapshot"
},
{
"id": "cffd1a3b-142e-62cc-7d3d-621225bdf09c",
"title": "Reason for Visit",
Expand All @@ -350,24 +332,6 @@
},
"mode": "snapshot"
},
{
"id": "36C1EC28-DA66-11EF-B655-005056BE2511",
"title": "Medications",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p id=\"nof35\">Not on file</p><small id=\"subTitle34\">removed</small></div>"
},
"code": {
"coding": [
{
"code": "10160-0",
"system": "http://loinc.org",
"display": "History of Medication use Narrative"
}
]
},
"mode": "snapshot"
},
{
"id": "c7b2bb98-1a69-858a-0c94-fcb3f7959c70",
"title": "Encounter Details",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"timestamp": "2020-05-05T11:05:15-04:00",
"entry": [
{
"fullUrl": "urn:uuid:3dad2d9f-20c3-72a6-e9f6-37b9da3cf126",
"fullUrl": "urn:uuid:90be8ddc-f46c-6d22-3d92-4453e39d6efe",
"resource": {
"resourceType": "Composition",
"id": "3dad2d9f-20c3-72a6-e9f6-37b9da3cf126",
"id": "90be8ddc-f46c-6d22-3d92-4453e39d6efe",
"meta": {
"profile": [
"http://hl7.org/fhir/us/ecr/StructureDefinition/eicr-composition"
Expand Down Expand Up @@ -234,7 +234,7 @@
]
},
{
"id": "0e63823f-5012-8a41-fd2d-8ddbc94ed599",
"id": "b7609b19-9b48-8659-76b0-f2a1d4d076a5",
"title": "Immunizations",
"text": {
"status": "generated",
Expand All @@ -249,7 +249,12 @@
}
]
},
"mode": "snapshot"
"mode": "snapshot",
"entry": [
{
"reference": "Immunization/ad2218d0-6210-488e-c141-f5191e47d591"
}
]
},
{
"code": {
Expand Down Expand Up @@ -1038,6 +1043,55 @@
"reference": "Patient/44e595bb-fb0b-fe20-870e-7e03122722ef"
}
}
},
{
"fullUrl": "urn:uuid:ad2218d0-6210-488e-c141-f5191e47d591",
"resource": {
"resourceType": "Immunization",
"id": "ad2218d0-6210-488e-c141-f5191e47d591",
"identifier": [
{
"system": "urn:ietf:rfc:3986",
"value": "urn:uuid:e6f1ba43-c0ed-4b9b-9f12-f435d8ad8f92"
}
],
"occurrenceDateTime": "1998-12-15",
"vaccineCode": {
"coding": [
{
"code": "166",
"system": "http://hl7.org/fhir/sid/cvx",
"display": "influenza, intradermal, quadrivalent, preservative free, injectable"
}
]
},
"lotNumber": "LOT12345",
"manufacturer": {
"reference": "Organization/b5c77b86-2764-79f9-10bf-5da5e63eb7c1"
},
"status": "completed",
"primarySource": true,
"route": {
"coding": [
{
"code": "C28161",
"system": "urn:oid:2.16.840.1.113883.3.26.1.1",
"display": "Intramuscular injection"
}
]
},
"patient": {
"reference": "Patient/44e595bb-fb0b-fe20-870e-7e03122722ef"
}
}
},
{
"fullUrl": "urn:uuid:b5c77b86-2764-79f9-10bf-5da5e63eb7c1",
"resource": {
"resourceType": "Organization",
"id": "b5c77b86-2764-79f9-10bf-5da5e63eb7c1",
"name": "Sanofi Pasteur"
}
}
]
}
Loading
Loading