Skip to content
This repository was archived by the owner on Jan 21, 2023. It is now read-only.
Merged
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
18 changes: 18 additions & 0 deletions lib/parser/ccda/sections/immunizations.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ var exportImmunizationsSection = function (version) {
["value", "0..1", "h:value", shared.ConceptDescriptor]
]);

var ImmunizationSeverityObservation = component.define("immunizationSeverityObservation")
.fields([
["code", "0..1", "h:value", shared.ConceptDescriptor],
["interpretation", "0..1", "h:interpretationCode", shared.ConceptDescriptor]
]);

var ImmunizationReaction = component.define("immunizationReaction");
ImmunizationReaction.templateRoot(["2.16.840.1.113883.10.20.22.4.9"]);
ImmunizationReaction.fields([
["identifiers", "0..*", "h:id", shared.Identifier],
["date_time", "1..1", "h:effectiveTime", shared.EffectiveTime],
["reaction", "1..1", "h:value", shared.ConceptDescriptor],
["free_text_reaction", "0..1", "h:text", shared.TextWithReference],
["severity", "0..1", "h:entryRelationship/h:observation", ImmunizationSeverityObservation]
]);
ImmunizationReaction.cleanupStep(cleanup.promoteFreeTextIfNoReaction);

var ImmunizationActivity = component.define("ImmunizationActivity")
.templateRoot([clinicalStatementsIDs.ImmunizationActivity, clinicalStatementsIDs.MedicationActivity])
.fields([
Expand All @@ -72,6 +89,7 @@ var exportImmunizationsSection = function (version) {
["instructions", "0..1", "h:entryRelationship[@typeCode='SUBJ']/h:act", ImmunizationInstructions],
["refusal_reason", "0..1", "h:entryRelationship/h:observation/h:code/@code", shared.SimpleCode("2.16.840.1.113883.5.8")],
["indications", "0..*", "h:entryRelationship[@typeCode='RSON']/h:observation", Indication],
["reaction", "0..1", "h:entryRelationship[@typeCode='CAUS']/h:observation", ImmunizationReaction],
]).cleanupStep(function () { // Quick and dirty fix for when refusal_reason catches other observations in Vitera.
if (this.js) { // Refusal reason should use the template id
if (this.js.refusal_reason && (!_.get(this, "js.refusal_reason.js"))) {
Expand Down
4 changes: 2 additions & 2 deletions test/parser-ccda/ccd-immunizations/no-indications.xml
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ Immunizations section
</text>
<entry>

<!-- Begin Immunuzation activity that contains 1 indication -->
<!-- Begin Immunuzation activity -->

<substanceAdministration classCode="SBADM" moodCode="EVN" negationInd="false">
<!-- ** Immunization activity ** -->
Expand Down Expand Up @@ -959,7 +959,7 @@ Immunizations section
</performer>
</substanceAdministration>

<!-- End Immunuzation activity that contains 1 indication -->
<!-- End Immunuzation activity -->

</entry>
</section>
Expand Down
Loading