Skwerl / hs-util

0 stars 0 forks source link

CCD Export: Validation still failing #51

Closed ejancic closed 11 years ago

ejancic commented 11 years ago

The CCD export below is still failing validation. There are three labs associated to the patient and all three labs have type set.

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="cda.xsl" ?>
<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 http://xreg2.nist.gov:8080/hitspValidation/schema/cdar2c32/infrastructure/cda/C32_CDA.xsd"><realmCode code="US"/><typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/><templateId root="2.16.840.1.113883.3.27.1776" assigningAuthorityName="CDA/R2"/><templateId root="2.16.840.1.113883.10.20.3" assigningAuthorityName="HL7/CDT Header"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.1" assigningAuthorityName="IHE/PCC"/><templateId root="2.16.840.1.113883.3.88.11.32.1" assigningAuthorityName="HITSP/C32"/><id root="2.16.840.1.113883.3.72" extension="MU_Rev2_HITSP_C32C83" assigningAuthorityName="NIST Healthcare Project"/><code code="34133-9" displayName="Summarization of episode note" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/><title/><effectiveTime value="20130404000000"/><confidentialityCode/><languageCode code="en-US"/><recordTarget><patientRole><id root="2.16.840.1.113883.4.1" extension="345-34-3456"/><addr use="HP"><streetAddressLine>101 main street</streetAddressLine><streetAddressLine></streetAddressLine><city>new york</city><state>NY</state><postalCode>00876</postalCode><country>US</country></addr><telecom use="WP" value="tel:(686)969-8698"/><patient><name><given>Michael</given><family>Charles</family></name><administrativeGenderCode code="M" displayName="Male" codeSystem="2.16.840.1.113883.5.1" codeSystemName="HL7 AdministrativeGender"/><birthTime value="19800715"/><languageCommunication><templateId root="2.16.840.1.113883.3.88.11.83.2" assigningAuthorityName="HITSP/C83"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.2.1" assigningAuthorityName="IHE/PCC"/><languageCode code="en-US"/></languageCommunication></patient></patientRole></recordTarget><author><time value="20130404000000"/><assignedAuthor><id/><addr/><telecom/><assignedPerson><name>Staff</name></assignedPerson><representedOrganization><name>NIST Healthcare Testing Laboratory</name><telecom></telecom><addr></addr></representedOrganization></assignedAuthor></author><custodian><assignedCustodian><representedCustodianOrganization><id></id><name></name><telecom></telecom><addr></addr></representedCustodianOrganization></assignedCustodian></custodian><component><structuredBody><component><section><templateId root="2.16.840.1.113883.3.88.11.83.102" assigningAuthorityName="HITSP/C83"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.13" assigningAuthorityName="IHE PCC"/><templateId root="2.16.840.1.113883.10.20.1.2" assigningAuthorityName="HL7 CCD"/><code code="48765-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Allergies"/><title>Allergies and Adverse Reactions</title><text><table border="1" width="100%"><thead><tr><th>SNOMED</th><th>RxNorm</th><th>Type</th><th>Substance</th><th>Reaction</th><th>Status</th><th>Adverse Event Date</th></tr></thead><tbody><tr ID="ALGSUMMARY_1"><td ID="SNOMED_1">416098002</td><td ID="ALGRXN_1">200801</td><td ID="ALGTYPE_1">Drug Allergy</td><td ID="ALGSUB_1">Lasix Allergy</td><td ID="ALGREACT_1">Rash</td><td ID="ALGSTATUS_1">active</td><td ID="ALGDATE_1">1999-04-15</td></tr></tbody></table></text><entry typeCode="DRIV"><act classCode="ACT" moodCode="EVN"><templateId root="2.16.840.1.113883.3.88.11.83.6" assigningAuthorityName="HITSP/C83"/><templateId root="2.16.840.1.113883.10.20.1.27" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.1" assigningAuthorityName="IHE PCC"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.3" assigningAuthorityName="IHE PCC"/><id root="36e3e930-7b14-11db-9fe1-0800200c9a66"/><code nullFlavor="NA"/><statusCode code="completed"/><effectiveTime><low nullFlavor="UNK"/><high nullFlavor="UNK"/></effectiveTime><entryRelationship typeCode="SUBJ" inversionInd="false"><observation classCode="OBS" moodCode="EVN"><templateId root="2.16.840.1.113883.10.20.1.18" assigningAuthorityName="CCD"/><templateId root="2.16.840.1.113883.10.20.1.28" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5" assigningAuthorityName="IHE PCC"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.6" assigningAuthorityName="IHE PCC"/><templateId root="2.16.840.1.113883.10.20.1.18"/><id root="4adc1020-7b14-11db-9fe1-0800200c9a66"/><code code="416098002" codeSystem="2.16.840.1.113883.6.96" displayName="drug allergy" codeSystemName="SNOMED CT"/><text><reference value="#ALGSUMMARY_1"/></text><statusCode code="completed"/><effectiveTime><low value="19990415"/></effectiveTime><value code="416098002" codeSystem="2.16.840.1.113883.6.96" displayName="Lasix Allergy" codeSystemName="SNOMED CT" xsi:type="CD"><originalText><reference value="#ALGSUB_1"/></originalText></value><participant typeCode="CSM"><participantRole classCode="MANU"><addr/><telecom/><playingEntity classCode="MMAT"><code code="416098002" codeSystem="2.16.840.1.113883.6.96" displayName="Lasix Allergy" codeSystemName="SNOMED CT"><originalText><reference value="#ALGSUB_1"/></originalText></code><name>Lasix Allergy</name></playingEntity></participantRole></participant></observation></entryRelationship></act></entry></section></component><component><section><templateId root="2.16.840.1.113883.3.88.11.83.103" assigningAuthorityName="HITSP/C83"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.6" assigningAuthorityName="IHE PCC"/><templateId root="2.16.840.1.113883.10.20.1.11" assigningAuthorityName="HL7 CCD"/><code code="11450-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Problem list"/><title>Problems</title><text><table border="1" width="100%"><thead><tr><th>ICD9</th><th>Problem</th><th>Effective Dates</th><th>Problem Status</th></tr></thead><tbody><tr ID="PROBSUMMARY_1"><td ID="PROBICD9_1">401.9</td><td ID="PROBKIND_1">Unspecified essential hypertension</td><td ID="PROBDATE_1">20080115</td><td ID="PROBSTATUS_1">active</td></tr><tr ID="PROBSUMMARY_2"><td ID="PROBICD9_2">250.02</td><td ID="PROBKIND_2">Diabetes mellitus without mention of complication, type II or unspecified type, uncontrolled</td><td ID="PROBDATE_2">20080115</td><td ID="PROBSTATUS_2">active</td></tr></tbody></table></text><entry typeCode="DRIV"><act classCode="ACT" moodCode="EVN"><templateId root="2.16.840.1.113883.3.88.11.83.7" assigningAuthorityName="HITSP/C83"/><templateId root="2.16.840.1.113883.10.20.1.27" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.1" assigningAuthorityName="IHE PCC"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.2" assigningAuthorityName="IHE PCC"/><id root="6a2fa88d-4174-4909-aece-db44b60a3abb"/><code nullFlavor="NA"/><statusCode code="completed"/><effectiveTime><low value="20080115"/><high nullFlavor="UNK"/></effectiveTime><entryRelationship typeCode="SUBJ" inversionInd="false"><observation classCode="OBS" moodCode="EVN"><templateId root="2.16.840.1.113883.10.20.1.28" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5" assigningAuthorityName="IHE PCC"/><id root="d11275e7-67ae-11db-bd13-0800200c9a66"/><code code="64572001" codeSystem="2.16.840.1.113883.6.96" displayName="Condition" codeSystemName="SNOMED CT"/><text><reference value="#PROBSUMMARY_1"/></text><statusCode code="completed"/><effectiveTime><low value="20080115"/></effectiveTime><value xsi:type="CD" displayName="Unspecified essential hypertension"/></observation></entryRelationship></act></entry><entry typeCode="DRIV"><act classCode="ACT" moodCode="EVN"><templateId root="2.16.840.1.113883.3.88.11.83.7" assigningAuthorityName="HITSP/C83"/><templateId root="2.16.840.1.113883.10.20.1.27" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.1" assigningAuthorityName="IHE PCC"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.2" assigningAuthorityName="IHE PCC"/><id root="6a2fa88d-4174-4909-aece-db44b60a3abb"/><code nullFlavor="NA"/><statusCode code="completed"/><effectiveTime><low value="20080115"/><high nullFlavor="UNK"/></effectiveTime><entryRelationship typeCode="SUBJ" inversionInd="false"><observation classCode="OBS" moodCode="EVN"><templateId root="2.16.840.1.113883.10.20.1.28" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5" assigningAuthorityName="IHE PCC"/><id root="d11275e7-67ae-11db-bd13-0800200c9a66"/><code code="64572001" codeSystem="2.16.840.1.113883.6.96" displayName="Condition" codeSystemName="SNOMED CT"/><text><reference value="#PROBSUMMARY_2"/></text><statusCode code="completed"/><effectiveTime><low value="20080115"/></effectiveTime><value xsi:type="CD" displayName="Diabetes mellitus without mention of complication, type II or unspecified type, uncontrolled"/></observation></entryRelationship></act></entry></section></component><component><section><templateId root="2.16.840.1.113883.3.88.11.83.112" assigningAuthorityName="HITSP/C83"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.19" assigningAuthorityName="IHE PCC"/><templateId root="2.16.840.1.113883.10.20.1.8" assigningAuthorityName="HL7 CCD"/><code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medication use"/><title>Medications</title><text><table border="1" width="100%"><thead><tr><th>NDCID</th><th>RxNorm</th><th>Generic Name</th><th>Brand Name</th><th>Strength</th><th>Dose</th><th>Form</th><th>Route</th><th>Sig Text</th><th>Dates</th><th>Status</th></tr></thead><tbody><tr ID="MEDSUMMARY_1"><td ID="NDCID_1">00039005110</td><td ID="RXNORM_1">205875</td><td ID="GENNAME_1">glyburide</td><td ID="MEDNAME_1">Diabeta</td><td ID="MEDSTRENGTH_1">2.5 mg</td><td ID="MEDDOSE_1">1 tablet</td><td ID="MEDFORM_1">tablet</td><td ID="MEDROUTE_1">by mouth</td><td ID="SIGTXT_1">once a day</td><td ID="MEDDATES_1">20130404</td><td ID="MEDSTATUS_1">active</td></tr><tr ID="MEDSUMMARY_2"><td ID="NDCID_2">00039006710</td><td ID="RXNORM_2">200801</td><td ID="GENNAME_2">furosemide</td><td ID="MEDNAME_2">Lasix</td><td ID="MEDSTRENGTH_2">20 mg</td><td ID="MEDDOSE_2">1 tablet</td><td ID="MEDFORM_2">tablet</td><td ID="MEDROUTE_2">by mouth</td><td ID="SIGTXT_2">once a day</td><td ID="MEDDATES_2">20130404</td><td ID="MEDSTATUS_2">active</td></tr><tr ID="MEDSUMMARY_3"><td ID="NDCID_3">00245004115</td><td ID="RXNORM_3">628958</td><td ID="GENNAME_3">potassium chloride</td><td ID="MEDNAME_3">Klor-Con 10</td><td ID="MEDSTRENGTH_3">10 mEq</td><td ID="MEDDOSE_3">1 tablet</td><td ID="MEDFORM_3">tablet extended release</td><td ID="MEDROUTE_3">by mouth</td><td ID="SIGTXT_3">once a day</td><td ID="MEDDATES_3">20130404</td><td ID="MEDSTATUS_3">active</td></tr></tbody></table></text><entry typeCode="DRIV"><substanceAdministration classCode="SBADM" moodCode="EVN"><templateId root="2.16.840.1.113883.3.88.11.83.8" assigningAuthorityName="HITSP/C83"/><templateId root="2.16.840.1.113883.10.20.1.24" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7" assigningAuthorityName="IHE PCC"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1" assigningAuthorityName="IHE PCC"/><id root="cdbd33f0-6cde-11db-9fe1-0800200c9a66"/><text><reference value="#SIGTEXT_1"/></text><statusCode code="completed"/><effectiveTime xsi:type="IVL_TS"><low value="19691231"/><high nullFlavor="UNK"/></effectiveTime><effectiveTime xsi:type="PIVL_TS"><period value="6" unit="h"/></effectiveTime><routeCode><originalText>by mouth</originalText></routeCode><doseQuantity value="1" unit="tablet"/><rateQuantity value="2.5" unit="mg"/><administrationUnitCode><originalText>by mouth</originalText></administrationUnitCode><consumable><manufacturedProduct><templateId root="2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName="HITSP/C83"/><templateId root="2.16.840.1.113883.10.20.1.53" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName="IHE PCC"/><manufacturedMaterial><code code="205875" codeSystem="2.16.840.1.113883.6.88" displayName="glyburide" codeSystemName="RxNorm"><originalText>Diabeta<reference/></originalText></code></manufacturedMaterial></manufacturedProduct></consumable></substanceAdministration></entry><entry typeCode="DRIV"><substanceAdministration classCode="SBADM" moodCode="EVN"><templateId root="2.16.840.1.113883.3.88.11.83.8" assigningAuthorityName="HITSP/C83"/><templateId root="2.16.840.1.113883.10.20.1.24" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7" assigningAuthorityName="IHE PCC"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1" assigningAuthorityName="IHE PCC"/><id root="cdbd33f0-6cde-11db-9fe1-0800200c9a66"/><text><reference value="#SIGTEXT_2"/></text><statusCode code="completed"/><effectiveTime xsi:type="IVL_TS"><low value="19691231"/><high nullFlavor="UNK"/></effectiveTime><effectiveTime xsi:type="PIVL_TS"><period value="6" unit="h"/></effectiveTime><routeCode><originalText>by mouth</originalText></routeCode><doseQuantity value="1" unit="tablet"/><rateQuantity value="20" unit="mg"/><administrationUnitCode><originalText>by mouth</originalText></administrationUnitCode><consumable><manufacturedProduct><templateId root="2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName="HITSP/C83"/><templateId root="2.16.840.1.113883.10.20.1.53" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName="IHE PCC"/><manufacturedMaterial><code code="200801" codeSystem="2.16.840.1.113883.6.88" displayName="furosemide" codeSystemName="RxNorm"><originalText>Lasix<reference/></originalText></code></manufacturedMaterial></manufacturedProduct></consumable></substanceAdministration></entry><entry typeCode="DRIV"><substanceAdministration classCode="SBADM" moodCode="EVN"><templateId root="2.16.840.1.113883.3.88.11.83.8" assigningAuthorityName="HITSP/C83"/><templateId root="2.16.840.1.113883.10.20.1.24" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7" assigningAuthorityName="IHE PCC"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1" assigningAuthorityName="IHE PCC"/><id root="cdbd33f0-6cde-11db-9fe1-0800200c9a66"/><text><reference value="#SIGTEXT_3"/></text><statusCode code="completed"/><effectiveTime xsi:type="IVL_TS"><low value="19691231"/><high nullFlavor="UNK"/></effectiveTime><effectiveTime xsi:type="PIVL_TS"><period value="6" unit="h"/></effectiveTime><routeCode><originalText>by mouth</originalText></routeCode><doseQuantity value="1" unit="tablet"/><rateQuantity value="10" unit="mEq"/><administrationUnitCode><originalText>by mouth</originalText></administrationUnitCode><consumable><manufacturedProduct><templateId root="2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName="HITSP/C83"/><templateId root="2.16.840.1.113883.10.20.1.53" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName="IHE PCC"/><manufacturedMaterial><code code="628958" codeSystem="2.16.840.1.113883.6.88" displayName="potassium chloride" codeSystemName="RxNorm"><originalText>Klor-Con 10<reference/></originalText></code></manufacturedMaterial></manufacturedProduct></consumable></substanceAdministration></entry></section></component><component><section><templateId root="2.16.840.1.113883.3.88.11.83.122" assigningAuthorityName="HITSP/C83"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.28" assigningAuthorityName="IHE PCC"/><code code="30954-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Results"/><title>Diagnostic Results</title><text><table border="1" width="100%"><thead><tr><th>LOINC</th><th>Description</th><th>Measure</th><th>Abnormal</th></tr></thead><tbody><tr><td colspan="2"><content styleCode="BoldItalics">Blood Glucose</content></td><td colspan="2"><content styleCode="BoldItalics">2009-07-17</content></td></tr><tr><td>14771-0</td><td>Fasting Blood Glucose (70-100 mg/dl)</td><td>145 mg/dl</td><td>Above High Normal</td></tr><tr><td colspan="2"><content styleCode="BoldItalics">Triglycerides</content></td><td colspan="2"><content styleCode="BoldItalics">2009-07-17</content></td></tr><tr><td>14927-8</td><td>Triglycerides (&lt;150 mg/dl)</td><td>187 mg/dl</td><td>Above High Normal</td></tr><tr><td colspan="2"><content styleCode="BoldItalics">Potassium</content></td><td colspan="2"><content styleCode="BoldItalics">2009-07-17</content></td></tr><tr><td>2823-3</td><td>Potassium (3.5-5.3 mEq/L)</td><td>4.5 mEq/L</td><td>Normal</td></tr></tbody></table></text><entry typeCode="DRIV"><organizer classCode="BATTERY" moodCode="EVN"><id root="7d5a02b0-67a4-11db-bd13-0800200c9a66"/><code code="14771-0" codeSystem="2.16.840.1.113883.6.96" displayName=""/><statusCode code="completed"/><effectiveTime value="20090717"/><component><procedure classCode="PROC" moodCode="EVN"><templateId root="2.16.840.1.113883.3.88.11.83.17" assigningAuthorityName="HITSP/C83"/><templateId root="2.16.840.1.113883.10.20.1.29" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.19" assigningAuthorityName="IHE PCC"/><id/><code code="14771-0" codeSystem="2.16.840.1.113883.6.96" displayName=""><originalText>Obtain sample for Blood Glucose<reference value="Ptr to text in parent Section"/></originalText></code><text>Obtain sample for Blood Glucose<reference value="PtrToParentInsectionText"/></text><statusCode code="completed"/><effectiveTime value="20090717"/></procedure></component><component><observation classCode="OBS" moodCode="EVN"><templateId root="2.16.840.1.113883.3.88.11.83.15.1" assigningAuthorityName="HITSP/C83"/><templateId root="2.16.840.1.113883.10.20.1.31" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13" assigningAuthorityName="IHE PCC"/><id root="107c2dc0-67a5-11db-bd13-0800200c9a66"/><code code="14771-0" codeSystem="2.16.840.1.113883.6.1" displayName="Fasting Blood Glucose (70-100 mg/dl)"/><text><reference value="PtrToValueInsectionText"/></text><statusCode code="completed"/><effectiveTime value="20090717"/><value xsi:type="PQ" value="145" unit="mg/dl"/><interpretationCode code="H" codeSystem="2.16.840.1.113883.5.83"/></observation></component></organizer></entry><entry typeCode="DRIV"><organizer classCode="BATTERY" moodCode="EVN"><id root="7d5a02b0-67a4-11db-bd13-0800200c9a66"/><code code="14927-8" codeSystem="2.16.840.1.113883.6.96" displayName=""/><statusCode code="completed"/><effectiveTime value="20090717"/><component><procedure classCode="PROC" moodCode="EVN"><templateId root="2.16.840.1.113883.3.88.11.83.17" assigningAuthorityName="HITSP/C83"/><templateId root="2.16.840.1.113883.10.20.1.29" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.19" assigningAuthorityName="IHE PCC"/><id/><code code="14927-8" codeSystem="2.16.840.1.113883.6.96" displayName=""><originalText>Obtain sample for Triglycerides<reference value="Ptr to text in parent Section"/></originalText></code><text>Obtain sample for Triglycerides<reference value="PtrToParentInsectionText"/></text><statusCode code="completed"/><effectiveTime value="20090717"/></procedure></component><component><observation classCode="OBS" moodCode="EVN"><templateId root="2.16.840.1.113883.3.88.11.83.15.1" assigningAuthorityName="HITSP/C83"/><templateId root="2.16.840.1.113883.10.20.1.31" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13" assigningAuthorityName="IHE PCC"/><id root="107c2dc0-67a5-11db-bd13-0800200c9a66"/><code code="14927-8" codeSystem="2.16.840.1.113883.6.1" displayName="Triglycerides (&lt;150 mg/dl)"/><text><reference value="PtrToValueInsectionText"/></text><statusCode code="completed"/><effectiveTime value="20090717"/><value xsi:type="PQ" value="187" unit="mg/dl"/><interpretationCode code="H" codeSystem="2.16.840.1.113883.5.83"/></observation></component></organizer></entry><entry typeCode="DRIV"><organizer classCode="BATTERY" moodCode="EVN"><id root="7d5a02b0-67a4-11db-bd13-0800200c9a66"/><code code="2823-3" codeSystem="2.16.840.1.113883.6.96" displayName=""/><statusCode code="completed"/><effectiveTime value="20090717"/><component><procedure classCode="PROC" moodCode="EVN"><templateId root="2.16.840.1.113883.3.88.11.83.17" assigningAuthorityName="HITSP/C83"/><templateId root="2.16.840.1.113883.10.20.1.29" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.19" assigningAuthorityName="IHE PCC"/><id/><code code="2823-3" codeSystem="2.16.840.1.113883.6.96" displayName=""><originalText>Obtain sample for Potassium<reference value="Ptr to text in parent Section"/></originalText></code><text>Obtain sample for Potassium<reference value="PtrToParentInsectionText"/></text><statusCode code="completed"/><effectiveTime value="20090717"/></procedure></component><component><observation classCode="OBS" moodCode="EVN"><templateId root="2.16.840.1.113883.3.88.11.83.15.1" assigningAuthorityName="HITSP/C83"/><templateId root="2.16.840.1.113883.10.20.1.31" assigningAuthorityName="CCD"/><templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13" assigningAuthorityName="IHE PCC"/><id root="107c2dc0-67a5-11db-bd13-0800200c9a66"/><code code="2823-3" codeSystem="2.16.840.1.113883.6.1" displayName="Potassium (3.5-5.3 mEq/L)"/><text><reference value="PtrToValueInsectionText"/></text><statusCode code="completed"/><effectiveTime value="20090717"/><value xsi:type="PQ" value="4.5" unit="mEq/L"/><interpretationCode code="N" codeSystem="2.16.840.1.113883.5.83"/></observation></component></organizer></entry></section></component></structuredBody></component></ClinicalDocument>
Skwerl commented 11 years ago

OK, what's missing is the lab set name. I'm pulling that from the summary field of the lab order section, which must be missing from the JSON you're exporting from. Can you populate the summary field and try again?

ejancic commented 11 years ago

It is non-trivial to associate a lab order right.. will probably take me 30 mins or so to try to fake it. It's also weird that we would need to have a lab name from the lab order because nothing else has used lab orders with lab results up to this point. Can you use the name field from the lab results if there's no summary field in the lab order?

Skwerl commented 11 years ago

Well there's a fundamental issue there. The structure of labs is like this:

There's a set of labs, with an order (optional) and results. Within the results are individual tests. This is how the JSON is structured basically.

Now I have a whole slew of concerns for after certification. For example, I believe each test should/could have its own LOINC code, in addition to the battery of tests (set of labs) having one as well. But that's not an issue that's being brought up so I'm just going to save it all for later.

However, one of them has been twisting my brain for awhile now. I have a LOINC code in the labResult object, but no corresponding descriptor. This has been pretty troublesome, because whenever I have to export a LOINC code, I almost always have to include a corresponding descriptor that is never right next to it.

But it was possible to work around that case. When I'm looping through each individual test in the labTestResult objects, I'm just pulling the LOINC code from the parent labResult object. It's a little messy/redundant, but we're getting by. Each test has exactly one LOINC code in the parent object they all share. It's a many-to-one relationship.

However, in this case here, it's not as simple. The only english descriptor for any result is in the object for the individual test, buried two levels deep. And there can be more than one of them, with different names. So when I have to give a set of labs a name, I have my one single LOINC code, but no single description. The only thing I could go on was the order summary.

TL;DR: In the JSON, I need one field for each lab (as in the set of labs, as opposed to each individual lab test) that can provide me with a description. It doesn't need to be the order summary necessarily, but there has to be exactly one for each item in the JSON's lab array.

Skwerl commented 11 years ago

Another way I could have put it would have been to ask how possible it'd be to add a description/summary on the same level in the hierarchy as the loincCode... with that, I wouldn't need to look at the order object.

ejancic commented 11 years ago

What did we use for this previously?  I know this was passing yesterday  — Sent from Mailbox for iPhone

On Thu, Apr 4, 2013 at 7:49 PM, Skwerl notifications@github.com wrote:

Another way I could have put it would have been to ask how possible it'd be to add a description/summary on the same level in the hierarchy as the loincCode... with that, I wouldn't need to look at the order object.

Reply to this email directly or view it on GitHub: https://github.com/reyinteractive/hs-util/issues/51#issuecomment-15936546

Skwerl commented 11 years ago

odd, i've always been using order summary.

ejancic commented 11 years ago

Adding a field to the API will also require a new app build. Any issue with reusing the name field from the lab results?

On Thursday, April 4, 2013, Skwerl wrote:

odd, i've always been using order summary.

— Reply to this email directly or view it on GitHubhttps://github.com/reyinteractive/hs-util/issues/51#issuecomment-15936923 .

Skwerl commented 11 years ago

More than one result = more than one name. Which do I use?

ejancic commented 11 years ago

Touché.. Can you take the first one?  The field doesn't show up on the human readable so I'm not super concerned as long as it validates — Sent from Mailbox for iPhone

On Thu, Apr 4, 2013 at 8:27 PM, Skwerl notifications@github.com wrote:

More than one result = more than one name. Which do I use?

Reply to this email directly or view it on GitHub: https://github.com/reyinteractive/hs-util/issues/51#issuecomment-15937356

Skwerl commented 11 years ago

gnarly hack, but can do. if that's the best option. at least i can make it the last resort if there's no order summary.

ejancic commented 11 years ago

Agreed.. Does it pass validation? — Sent from Mailbox for iPhone

On Thu, Apr 4, 2013 at 8:42 PM, Skwerl notifications@github.com wrote:

gnarly hack, but can do. if that's the best option. at least i can make it the last resort if there's no order summary.

Reply to this email directly or view it on GitHub: https://github.com/reyinteractive/hs-util/issues/51#issuecomment-15937650

Skwerl commented 11 years ago

Yeah, CCD export passes with my JSON, now even when I remove lab order summary. Give it a shot.