onc-healthit / ccda-scorecard

Source code for the C-CDA Scorecard
https://www.healthit.gov/scorecard
BSD 2-Clause "Simplified" License
21 stars 7 forks source link

Immunizations section involving Medication Dispense reports a false conformance error? #142

Open jlubke opened 5 years ago

jlubke commented 5 years ago

When validating a CCDA, the immunizations section reports the following conformance error:

image

This error comes from the entry/substanceAdministration/medicationDispense subsection. In the example below, I included one mocked product immunization medication information subsection to show a difference between the two medication entries.

Search for the the following tag to directly go to the concern:

<entryRelationship typeCode="REFR">

<component>
  <section nullFlavor="NI">
    <templateId root="2.16.840.1.113883.10.20.22.2.2.1" extension="2015-08-01"/>
    <templateId root="2.16.840.1.113883.10.20.22.2.2.1"/>
    <code code="11369-6" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of immunizations"/>
    <title>IMMUNIZATIONS</title>
    <text>
      <table>
        <thead>
          <tr>
            <th>Vaccine</th>
            <th>Date</th>
            <th>Status</th>
          </tr>
        </thead>
        <tbody>
          <tr ID="immunization1">
            <td>Flu, shot</td>
            <td>2018-10-26</td>
            <td>completed</td>
          </tr>
        </tbody>
      </table>
      <content ID="immunization2">None recorded</content>
    </text>
    <entry>
      <substanceAdministration classCode="SBADM" moodCode="INT" negationInd="false">
        <templateId root="2.16.840.1.113883.10.20.22.4.52" extension="2015-08-01"/>
        <templateId root="2.16.840.1.113883.10.20.22.4.52"/>
        <id root="immunizationActivity1"/>
        <statusCode code="completed"/>
        <effectiveTime xsi:type="IVL_TS">
          <low value="20181026"/>
        </effectiveTime>
        <consumable>
          <manufacturedProduct classCode="MANU">
            <templateId root="2.16.840.1.113883.10.20.22.4.54" extension="2014-06-09"/>
            <templateId root="2.16.840.1.113883.10.20.22.4.54"/>
            <manufacturedMaterial>
              <code code="141" codeSystem="2.16.840.1.113883.12.292" codeSystemName="CVX" displayName="Influenza, seasonal, injectable"/>
              <lotNumberText>1</lotNumberText>
            </manufacturedMaterial>
          </manufacturedProduct>
        </consumable>
        <performer>
          <assignedEntity>
            <id extension="1710972880" root="2.16.840.1.113883.4.6"/>
            <code code="207R00000X" codeSystem="2.16.840.1.113883.6.101" codeSystemName="Health Care Provider Taxonomy" displayName="Internal Medicine"/>
            <addr use="WP">
              <streetAddressLine>9392 Merry Lake Niche </streetAddressLine>
              <city>LaVernia</city>
              <state>TX</state>
              <postalCode>78121-4282</postalCode>
            </addr>
            <telecom use="WP" value="tel:+1-605-204-4282"/>
            <assignedPerson>
              <name use="L">
                <family>Guillory</family>
                <given>Derek</given>
                <suffix qualifier="PR">MD</suffix>
              </name>
            </assignedPerson>
          </assignedEntity>
        </performer>
        <author>
          <templateId root="2.16.840.1.113883.10.20.22.4.119"/>
          <time value="201811272000+0000"/>
          <assignedAuthor>
            <id root="2.16.840.1.113883.4.6" extension="1710972880" assigningAuthorityName="National Provider ID"/>
            <addr use="WP">
              <streetAddressLine>9392 Merry Lake Niche </streetAddressLine>
              <city>LaVernia</city>
              <state>TX</state>
              <postalCode>78121-4282</postalCode>
            </addr>
            <telecom nullFlavor="UNK"/>
            <assignedPerson>
              <name use="L">
                <family>Guillory</family>
                <given>Derek</given>
                <suffix qualifier="PR">MD</suffix>
              </name>
            </assignedPerson>
          </assignedAuthor>
        </author>
        <entryRelationship typeCode="SUBJ" inversionInd="true">
          <act classCode="ACT" moodCode="INT">
            <templateId root="2.16.840.1.113883.10.20.22.4.20" extension="2014-06-09"/>
            <templateId root="2.16.840.1.113883.10.20.22.4.20"/>
            <code code="311401005" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Patient Education"/>
            <statusCode code="completed"/>
          </act>
        </entryRelationship>
        <entryRelationship typeCode="RSON">
          <observation classCode="OBS" moodCode="EVN">
            <templateId root="2.16.840.1.113883.10.20.22.4.53"/>
            <id root="immunizationRefusal1"/>
            <code code="OSTOCK" codeSystem="2.16.840.1.113883.5.8" codeSystemName="HL7 ActNoImmunizationReason" displayName="Out of stock"/>
            <statusCode code="completed"/>
          </observation>
        </entryRelationship>
        <entryRelationship typeCode="REFR">
          <supply classCode="SPLY" moodCode="EVN">
            <templateId root="2.16.840.1.113883.10.20.22.4.18" extension="2014-06-09"/>
            <templateId root="2.16.840.1.113883.10.20.22.4.18"/>
            <id root="immunizationMedicationDispense1"/>
            <statusCode code="completed"/>
          </supply>
        </entryRelationship>
      </substanceAdministration>
    </entry>
    <entry>
      <substanceAdministration classCode="SBADM" moodCode="INT" negationInd="false">
        <templateId root="2.16.840.1.113883.10.20.22.4.52" extension="2015-08-01"/>
        <templateId root="2.16.840.1.113883.10.20.22.4.52"/>
        <id root="immunizationActivity2"/>
        <statusCode code="completed"/>
        <effectiveTime xsi:type="IVL_TS">
          <low value="20181026"/>
        </effectiveTime>
        <consumable>
          <manufacturedProduct classCode="MANU">
            <templateId root="2.16.840.1.113883.10.20.22.4.54" extension="2014-06-09"/>
            <templateId root="2.16.840.1.113883.10.20.22.4.54"/>
            <manufacturedMaterial>
              <code code="999" codeSystem="2.16.840.1.113883.12.292" codeSystemName="CVX" displayName="Unknown"/>
              <lotNumberText>1</lotNumberText>
            </manufacturedMaterial>
            <manufacturerOrganization>
              <name>Lupin Limited</name>
            </manufacturerOrganization>
          </manufacturedProduct>
        </consumable>
        <entryRelationship typeCode="RSON">
          <observation classCode="OBS" moodCode="EVN">
            <templateId root="2.16.840.1.113883.10.20.22.4.53"/>
            <id root="immunizationRefusal2"/>
            <code nullFlavor="NI"/>
            <statusCode code="completed"/>
          </observation>
        </entryRelationship>
        <entryRelationship typeCode="REFR">
          <supply classCode="SPLY" moodCode="EVN">
            <templateId root="2.16.840.1.113883.10.20.22.4.18" extension="2014-06-09"/>
            <templateId root="2.16.840.1.113883.10.20.22.4.18"/>
            <id root="immunizationMedicationDispense2"/>
            <statusCode code="completed"/>
            <product>
              <manufacturedProduct classCode="MANU">
                <templateId root="2.16.840.1.113883.10.20.22.4.54" extension="2014-06-09"/>
                <templateId root="2.16.840.1.113883.10.20.22.4.54"/>
                <manufacturedMaterial>
                  <code code="999" codeSystem="2.16.840.1.113883.12.292" codeSystemName="CVX" displayName="Unknown"/>
                  <lotNumberText>1</lotNumberText>
                </manufacturedMaterial>
                <manufacturerOrganization>
                  <name>Lupin Limited</name>
                </manufacturerOrganization>
              </manufacturedProduct>
            </product>
          </supply>
        </entryRelationship>
      </substanceAdministration>
    </entry>
  </section>
</component>

But according to this ~900 page CCDA doc that I provided below, the doc claims on page 599 that the product/medicationInformation and product/immunizationMedicationInformation subsections are of verb-type MAY; they are optional.

CCDA_MASTER_DOCS.pdf

Here is a screenshot of the section that I am looking at:

image


and here are further notes on those two subsections, which can also be found on page 600. I'm not seeing that you must have one or the other:

image

Does the validation tool have a small bug in it? Or does someone happen to have a more up-to-date ccda doc/spec that we could look at? If you would like to use our complete CCDA.xml file to run through your validator on this issue, let me know and I'll provide that.

drbgfc commented 5 years ago

I haven't had time to read all of this but just responding to let you know i've seen it. And, as a note, from a quick scan, the rule this is based off of is from the IG, a few rules down from the 2 you have outlined:

  1. A supply act SHALL contain one product/Medication Information OR one product/Immunization Medication Information template (CONF:1098-9333).
drbgfc commented 5 years ago

Also, great work on the documentation in this report! Will be very useful for when I have more time to address.

drbgfc commented 5 years ago

I am very sorry this got away from me - and someone else may still yet have to address it - but - has the issue been resolved?

swmuir commented 3 years ago

While cleaning up open issues - we confirmed the validation is correct as per previous comments and agree the structure is confusing

  1. MAY contain zero or one [0..1] entryRelationship (CONF:1098-7473) such that it

a. SHALL contain exactly one [1..1] @typeCode="REFR" (CodeSystem:

HL7ActRelationshipType urn:oid:2.16.840.1.113883.5.1002 STATIC) (CONF:1098-7474).

b. SHALL contain exactly one [1..1] Medication Supply Order (V2) (identifier:

urn:hl7ii:2.16.840.1.113883.10.20.22.4.17:2014-06-09) (CONF:109815606).

  1. A supply act SHALL contain one product/Medication Information OR one product/Immunization Medication Information template (CONF:1098-9333).
jsarunas commented 2 years ago

Hi all, I am trying to validate a ccda file from HL7 examples: https://github.com/HL7/C-CDA-Examples/blob/master/Medications/Withdrawn%20Anitbiotics%20with%20varied%20dosing/Withdrawn%20Antibiotics%20with%20varied%20dosing(C-CDA2.1).xml

This example defines a medication entry that is divided into two components to support multiple frequencies of medication usage. Unfortunately, I am getting a schema error: image File used for validation: Withdrawn Antibiotics with varied dosing(C-CDA2.1).txt

Question: does ccda validator supports ccda files having multiple components defined in medication entry?

Thanks a lot