Unit Test Results.

Designed for use with JUnit and Ant.

Class org.openhealthtools.mdht.uml.cda.consol.tests.ConsultationNoteTest

NameTestsErrorsFailuresTime(s)Time StampHost
ConsultationNoteTest64002.0632013-01-31T13:34:45JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateConsultationNoteHistoryOfPresentIllness

Constraint

Consol Consultation Note SHALL contain exactly one [1..1] component (CONF:9493) Contains exactly one [1..1] History Of Present Illness Section (templateId: 1.3.6.1.4.1.19376.1.5.3.1.3.4)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::HistoryOfPresentIllnessSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section/>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.026
testValidateConsultationNoteImmunizationsSection

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9519) Contains exactly one [1..1] Immunizations Section (templateId: 2.16.840.1.113883.10.20.22.2.2.1)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::ImmunizationsSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.2.1"/>
<templateId root="2.16.840.1.113883.10.20.22.2.2"/>
<code code="11369-6" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.020
testValidateConsultationNoteSocialHistorySection

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9531) Contains exactly one [1..1] Social History Section (templateId: 2.16.840.1.113883.10.20.22.2.17)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::SocialHistorySection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.17"/>
<code code="29762-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Social history"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.019
testValidateConsultationNoteFamilyHistorySection

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9513) Contains exactly one [1..1] Family History Section (templateId: 2.16.840.1.113883.10.20.22.2.15)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::FamilyHistorySection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.15"/>
<code code="10157-6" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Family History"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.019
testValidateConsultationNoteReviewOfSystemsSection

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9529) Contains exactly one [1..1] Review Of Systems Section (templateId: 1.3.6.1.4.1.19376.1.5.3.1.3.18)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::ReviewOfSystemsSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.18"/>
<code code="10187-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="REVIEW OF SYSTEMS"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.018
testValidateConsultationNoteGeneralStatusSection

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9515) Contains exactly one [1..1] General Status Section (templateId: 2.16.840.1.113883.10.20.2.5)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::GeneralStatusSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.2.5"/>
<code code="10210-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="GENERAL STATUS"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.017
testGetHistoryOfPresentIllness

Constraint

OCL

SuccessInvalid XML

Valid XML

0.021
testGetImmunizationsSection

Constraint

OCL

SuccessInvalid XML

Valid XML

0.021
testGetSocialHistorySection

Constraint

OCL

SuccessInvalid XML

Valid XML

0.022
testGetFamilyHistorySection

Constraint

OCL

SuccessInvalid XML

Valid XML

0.022
testGetReviewOfSystemsSection

Constraint

OCL

SuccessInvalid XML

Valid XML

0.022
testGetGeneralStatusSection

Constraint

OCL

SuccessInvalid XML

Valid XML

0.022
testValidateGeneralHeaderConstraintsCode

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] code (CONF:5253)

OCL

NO OCL FOUND FOR PROPERTY VALIDATE_GENERAL_HEADER_CONSTRAINTS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.9"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code code="code" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

0.023
testGetAssessmentAndPlanSection

Constraint

OCL

SuccessInvalid XML

Valid XML

0.022
testGetAssessmentSection

Constraint

OCL

SuccessInvalid XML

Valid XML

0.022
testGetChiefComplaintSection

Constraint

OCL

SuccessInvalid XML

Valid XML

0.023
testGetPlanOfCareSection

Constraint

OCL

SuccessInvalid XML

Valid XML

0.022
testGetPhysicalExamSection

Constraint

OCL

SuccessInvalid XML

Valid XML

0.021
testGetHistoryOfPastIllnessSection

Constraint

OCL

SuccessInvalid XML

Valid XML

0.021
testValidateConsultationNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections

Constraint

Consol Consultation Note SHALL include an Assessment and Plan Section, or an Assessment Section and a Plan Section (CONF:9501)

OCL

(self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::PlanOfCareSection)) and self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::AssessmentSection))) xor self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::AssessmentAndPlanSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.8"/>
<code code="51848-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Assessments"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.10"/>
<code code="18776-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Treatment plan"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.9"/>
<code code="51847-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="ASSESSMENT AND PLAN"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.8"/>
<code code="51848-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Assessments"/>
</section>
</component>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.10"/>
<code code="18776-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Treatment plan"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.061
testValidateConsultationNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent

Constraint

Consol Consultation Note SHALL NOT include an Assessment/Plan Section when an Assessment Section and a Plan of Care Section are present (CONF:10028)

OCL

(self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::PlanOfCareSection)) or self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::AssessmentSection))) xor self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::AssessmentAndPlanSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.9"/>
<code code="51847-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="ASSESSMENT AND PLAN"/>
</section>
</component>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.10"/>
<code code="18776-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Treatment plan"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.9"/>
<code code="51847-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="ASSESSMENT AND PLAN"/>
</section>
</component>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.8"/>
<code code="51848-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Assessments"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.9"/>
<code code="51847-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="ASSESSMENT AND PLAN"/>
</section>
</component>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.8"/>
<code code="51848-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Assessments"/>
</section>
</component>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.10"/>
<code code="18776-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Treatment plan"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.9"/>
<code code="51847-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="ASSESSMENT AND PLAN"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.8"/>
<code code="51848-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Assessments"/>
</section>
</component>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.10"/>
<code code="18776-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Treatment plan"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.062
testValidateConsultationNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection

Constraint

Consol Consultation Note SHALL NOT include a Chief Complaint and Reason for Visit Section with either a Chief Complaint Section or a Reason for Visit Section.

OCL

(self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::ChiefComplaintSection)) or self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::ReasonForVisitSection))) xor self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::ChiefComplaintAndReasonForVisitSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.13"/>
<code code="46239-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Chief Complaint and Reason for Visit"/>
</section>
</component>
<component>
<section>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.13.2.1"/>
<code code="10154-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="CHIEF COMPLAINT"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.13"/>
<code code="46239-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Chief Complaint and Reason for Visit"/>
</section>
</component>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.12"/>
<code code="29299-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Reason for Visit"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.13"/>
<code code="46239-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Chief Complaint and Reason for Visit"/>
</section>
</component>
<component>
<section>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.13.2.1"/>
<code code="10154-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="CHIEF COMPLAINT"/>
</section>
</component>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.12"/>
<code code="29299-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Reason for Visit"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.13"/>
<code code="46239-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Chief Complaint and Reason for Visit"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.13.2.1"/>
<code code="10154-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="CHIEF COMPLAINT"/>
</section>
</component>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.12"/>
<code code="29299-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Reason for Visit"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.063
testValidateConsultationNoteHasReasonForReferralOrReasonForVisit

Constraint

Consol Consultation Note SHALL include a Reason for Referral or Reason for Visit section (CONF:9504)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::ReasonForReferralSection)) xor self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::ReasonForVisitSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.1"/>
<code code="42349-1" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="REASON FOR REFERRAL"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.12"/>
<code code="29299-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Reason for Visit"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.041
testValidateConsultationNoteTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:8375, CONF:10040 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.1.4"

OCL

self.templateId->exists(id : datatypes::II | id.root = '2.16.840.1.113883.10.20.22.1.4')

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

0.008
testValidateConsultationNoteCodeP

Constraint

Consol Consultation Note SHALL contain exactly one [1..1] code (CONF:17176), where the @code SHALL be selected from ValueSet ConsultDocumentType 2.16.840.1.113883.11.20.9.31 STATIC (CONF:17177)

OCL

(self.code.oclIsUndefined() or self.code.isNullFlavorUndefined()) implies (not self.code.oclIsUndefined())

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

0.023
testValidateConsultationNoteCode

Constraint

Consol Consultation Note SHALL contain exactly one [1..1] code (CONF:17176), where the @code SHALL be selected from ValueSet ConsultDocumentType 2.16.840.1.113883.11.20.9.31 STATIC (CONF:17177)

OCL

(self.code.oclIsUndefined() or self.code.isNullFlavorUndefined()) implies (not self.code.oclIsUndefined() and self.code.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = self.code.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.6.1' and (value.code = '11488-4' or value.code = '34100-8' or value.code = '34104-0' or value.code = '51845-6' or value.code = '51853-0' or value.code = '51846-4' or value.code = '34101-6' or value.code = '34749-2' or value.code = '34102-4' or value.code = '34099-2' or value.code = '34756-7' or value.code = '34758-3' or value.code = '34760-9' or value.code = '34879-7' or value.code = '34761-7' or value.code = '34764-1' or value.code = '34771-6' or value.code = '34776-5' or value.code = '34777-3' or value.code = '34779-9' or value.code = '34781-5' or value.code = '34783-1' or value.code = '34785-6' or value.code = '34795-5' or value.code = '34797-1' or value.code = '34798-9' or value.code = '34800-3' or value.code = '34803-7' or value.code = '34855-7' or value.code = '34805-2' or value.code = '34807-8' or value.code = '34810-2' or value.code = '34812-8' or value.code = '34814-4' or value.code = '34816-9' or value.code = '34820-1' or value.code = '34822-7' or value.code = '34824-3' or value.code = '34826-8' or value.code = '34828-4' or value.code = '34788-0' or value.code = '34791-4' or value.code = '34103-2' or value.code = '34831-8' or value.code = '34833-4' or value.code = '34835-9' or value.code = '34837-5' or value.code = '34839-1' or value.code = '34841-7' or value.code = '34845-8' or value.code = '34847-4' or value.code = '34849-0' or value.code = '34851-6' or value.code = '34853-2'))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code code="11488-4" codeSystem="2.16.840.1.113883.6.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

0.494
testValidateConsultationNoteInFulfillmentOf

Constraint

Consol Consultation Note SHALL contain at least one [1..*] inFulfillmentOf (CONF:8382)

OCL

self.inFulfillmentOf->exists(inFulfillmentOf : cda::InFulfillmentOf | not inFulfillmentOf.oclIsUndefined() and inFulfillmentOf.oclIsKindOf(cda::InFulfillmentOf))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<inFulfillmentOf/>
</ClinicalDocument>

0.018
testValidateConsultationNoteComponentOf

Constraint

Consol Consultation Note SHALL contain exactly one [1..1] componentOf (CONF:8386)

OCL

self.componentOf->one(componentOf : cda::Component1 | not componentOf.oclIsUndefined() and componentOf.oclIsKindOf(cda::Component1))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf/>
</ClinicalDocument>

0.016
testValidateConsultationNoteAssessmentSection

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9487) Contains exactly one [1..1] Assessment Section (templateId: 2.16.840.1.113883.10.20.22.2.8)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::AssessmentSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.8"/>
<code code="51848-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Assessments"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.018
testValidateConsultationNoteAssessmentAndPlanSection

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9491) Contains exactly one [1..1] Assessment And Plan Section (templateId: 2.16.840.1.113883.10.20.22.2.9)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::AssessmentAndPlanSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.9"/>
<code code="51847-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="ASSESSMENT AND PLAN"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.018
testValidateConsultationNotePlanOfCareSection

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9489) Contains exactly one [1..1] Plan Of Care Section (templateId: 2.16.840.1.113883.10.20.22.2.10)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::PlanOfCareSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.10"/>
<code code="18776-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Treatment plan"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.018
testValidateConsultationNotePhysicalExamSection

Constraint

Consol Consultation Note SHOULD contain zero or one [0..1] component (CONF:9495) Contains exactly one [1..1] Physical Exam Section (templateId: 2.16.840.1.113883.10.20.2.10)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::PhysicalExamSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.2.10"/>
<code code="29545-1" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="PHYSICAL EXAMINATION"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.018
testValidateConsultationNoteReasonForReferralSection

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9498) Contains exactly one [1..1] Reason For Referral Section (templateId: 1.3.6.1.4.1.19376.1.5.3.1.3.1)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::ReasonForReferralSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.1"/>
<code code="42349-1" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="REASON FOR REFERRAL"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.017
testValidateConsultationNoteReasonForVisitSection

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9500) Contains exactly one [1..1] Reason For Visit Section (templateId: 2.16.840.1.113883.10.20.22.2.12)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::ReasonForVisitSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.12"/>
<code code="29299-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Reason for Visit"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.018
testValidateConsultationNoteAllergiesSection

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9507) Contains exactly one [1..1] Allergies Section Entries Optional (templateId: 2.16.840.1.113883.10.20.22.2.6)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::AllergiesSectionEntriesOptional))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.6.1"/>
<templateId root="2.16.840.1.113883.10.20.22.2.6"/>
<code code="48765-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Allergies, adverse reactions, alerts"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.018
testValidateConsultationNoteChiefComplaintSection

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9509) Contains exactly one [1..1] Chief Complaint Section (templateId: 1.3.6.1.4.1.19376.1.5.3.1.1.13.2.1)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::ChiefComplaintSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.13.2.1"/>
<code code="10154-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="CHIEF COMPLAINT"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.018
testValidateConsultationNoteChiefComplaintAndReasonForVisitSection

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:10029) Contains exactly one [1..1] Chief Complaint And Reason For Visit Section (templateId: 2.16.840.1.113883.10.20.22.2.13)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::ChiefComplaintAndReasonForVisitSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.13"/>
<code code="46239-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Chief Complaint and Reason for Visit"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.017
testValidateConsultationNoteHistoryOfPastIllnessSection

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9517) Contains exactly one [1..1] History Of Past Illness Section (templateId: 2.16.840.1.113883.10.20.22.2.20)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::HistoryOfPastIllnessSection))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.20"/>
<code code="11348-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="HISTORY OF PAST ILLNESS"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.018
testValidateConsultationNoteMedicationsSectionEntriesOptional

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9521)) Contains exactly one [1..1] Medications Section Entries Optional (templateId: 2.16.840.1.113883.10.20.22.2.1)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::MedicationsSectionEntriesOptional))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.1"/>
<code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medication use"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.019
testValidateConsultationNoteProblemSectionEntriesOptional

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9523) Contains exactly one [1..1] Problem Section Entries Optional (templateId: 2.16.840.1.113883.10.20.22.2.5)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::ProblemSectionEntriesOptional))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.5"/>
<code code="11450-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Problem List"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.018
testValidateConsultationNoteProceduresSectionEntriesOptional

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9525) Contains exactly one [1..1] Procedures Section Entries Optional (templateId: 2.16.840.1.113883.10.20.22.2.7)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::ProceduresSectionEntriesOptional))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.7"/>
<code code="47519-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of Procedures"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.019
testValidateConsultationNoteResultsSectionEntriesOptional

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9527) Contains exactly one [1..1] Results Section Entries Optional (templateId: 2.16.840.1.113883.10.20.22.2.3)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::ResultsSectionEntriesOptional))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.3"/>
<code code="30954-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Relevant diagnostic tests and/or laboratory data"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.019
testValidateConsultationNoteVitalSignsSectionEntriesOptional

Constraint

Consol Consultation Note MAY contain zero or one [0..1] component (CONF:9533) Contains exactly one [1..1] Vital Signs Section Entries Optional (templateId: 2.16.840.1.113883.10.20.22.2.4)

OCL

self.getAllSections()->one(section : cda::Section | not section.oclIsUndefined() and section.oclIsKindOf(consol::VitalSignsSectionEntriesOptional))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<component>
<structuredBody>
<component>
<section>
<templateId root="2.16.840.1.113883.10.20.22.2.4"/>
<code code="8716-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Vital Signs"/>
</section>
</component>
</structuredBody>
</component>
</ClinicalDocument>

0.019
testValidateConsultationNoteInFulfillmentOfOrderId

Constraint

Consol Consultation Note SHALL contain at least one [1..*] inFulfillmentOf (CONF:8382) each SHALL contain exactly one [1..1] order, where (CONF:8385) order SHALL contain at least one [1..*] id (CONF:9102)

OCL

self.inFulfillmentOf->excluding(null).order->excluding(null)->reject((id->isEmpty() or id->exists(element | element.isNullFlavorUndefined())) implies (not id->isEmpty()))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<inFulfillmentOf>
<order/>
</inFulfillmentOf>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<inFulfillmentOf>
<order>
<id/>
</order>
</inFulfillmentOf>
</ClinicalDocument>

0.041
testValidateConsultationNoteInFulfillmentOfOrder

Constraint

Consol Consultation Note SHALL contain at least one [1..*] inFulfillmentOf (CONF:8382) inFulfillmentOf SHALL contain exactly one [1..1] order, where its type is Order (CONF:8385)

OCL

self.inFulfillmentOf->excluding(null)->reject(order->one(order : cda::Order | not order.oclIsUndefined() and order.oclIsKindOf(cda::Order)))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<inFulfillmentOf/>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<inFulfillmentOf>
<order/>
</inFulfillmentOf>
</ClinicalDocument>

0.026
testValidateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantAssignedEntityHasPersonOrganizationOrBoth

Constraint

Consol Consultation Note SHALL contain exactly one [1..1] componentOf (CONF:8386) each SHALL contain exactly one [1..1] encompassingEncounter, where (CONF:8387) each MAY contain zero or more [0..*] encounterParticipant, where (CONF:8392) encounterParticipant The responsibleParty element, if present, SHALL contain an assignedEntity element which SHALL contain an assignedPerson element, a representedOrganization element, or both. (CONF:8396)

OCL

self.componentOf->excluding(null).encompassingEncounter->excluding(null).encounterParticipant->excluding(null)->reject(not assignedEntity.assignedPerson.oclIsUndefined() or not assignedEntity.representedOrganization->isEmpty())

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter>
<encounterParticipant>
<assignedEntity/>
</encounterParticipant>
</encompassingEncounter>
</componentOf>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter>
<encounterParticipant>
<assignedEntity>
<assignedPerson/>
</assignedEntity>
</encounterParticipant>
</encompassingEncounter>
</componentOf>
</ClinicalDocument>

0.043
testValidateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantAssignedEntity

Constraint

Consol Consultation Note SHALL contain exactly one [1..1] componentOf (CONF:8386) each SHALL contain exactly one [1..1] encompassingEncounter, where (CONF:8387) each MAY contain zero or more [0..*] encounterParticipant, where (CONF:8392) encounterParticipant SHALL contain exactly one [1..1] assignedEntity, where its type is CDA Assigned Entity (CONF:8343)

OCL

self.componentOf->excluding(null).encompassingEncounter->excluding(null).encounterParticipant->excluding(null)->reject(assignedEntity->one(assignedEntity : cda::AssignedEntity | not assignedEntity.oclIsUndefined() and assignedEntity.oclIsKindOf(rim::Role)))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter>
<encounterParticipant/>
</encompassingEncounter>
</componentOf>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter>
<encounterParticipant>
<assignedEntity/>
</encounterParticipant>
</encompassingEncounter>
</componentOf>
</ClinicalDocument>

0.033
testValidateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyAssignedEntityHasPersonOrganizationOrBoth

Constraint

Consol Consultation Note SHALL contain exactly one [1..1] componentOf (CONF:8386) each SHALL contain exactly one [1..1] encompassingEncounter, where (CONF:8387) each MAY contain zero or one [0..1] responsibleParty, where (CONF:8391) responsibleParty The responsibleParty element, if present, SHALL contain an assignedEntity element which SHALL contain an assignedPerson element, a representedOrganization element, or both. (CONF:8394)

OCL

self.componentOf->excluding(null).encompassingEncounter->excluding(null).responsibleParty->excluding(null)->reject(not assignedEntity.assignedPerson.oclIsUndefined() or not assignedEntity.representedOrganization->isEmpty())

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter>
<responsibleParty>
<assignedEntity/>
</responsibleParty>
</encompassingEncounter>
</componentOf>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter>
<responsibleParty>
<assignedEntity>
<representedOrganization/>
</assignedEntity>
</responsibleParty>
</encompassingEncounter>
</componentOf>
</ClinicalDocument>

0.043
testValidateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyAssignedEntity

Constraint

Consol Consultation Note SHALL contain exactly one [1..1] componentOf (CONF:8386) each SHALL contain exactly one [1..1] encompassingEncounter, where (CONF:8387) each MAY contain zero or one [0..1] responsibleParty, where (CONF:8391) responsibleParty SHALL contain exactly one [1..1] assignedEntity, where its type is Assigned Entity (CONF:9407)

OCL

self.componentOf->excluding(null).encompassingEncounter->excluding(null).responsibleParty->excluding(null)->reject(assignedEntity->one(assignedEntity : cda::AssignedEntity | not assignedEntity.oclIsUndefined() and assignedEntity.oclIsKindOf(rim::Role)))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter>
<responsibleParty/>
</encompassingEncounter>
</componentOf>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter>
<responsibleParty>
<assignedEntity/>
</responsibleParty>
</encompassingEncounter>
</componentOf>
</ClinicalDocument>

0.033
testValidateConsultationNoteComponentOfEncompassingEncounter2EffectiveTime

Constraint

Consol Consultation Note SHALL contain exactly one [1..1] componentOf (CONF:8386) each SHALL contain exactly one [1..1] encompassingEncounter, where (CONF:8387) encompassingEncounter SHALL contain exactly one [1..1] effectiveTime (CONF:8389)

OCL

self.componentOf->excluding(null).encompassingEncounter->excluding(null)->reject((effectiveTime.oclIsUndefined() or effectiveTime.isNullFlavorUndefined()) implies (not effectiveTime.oclIsUndefined()))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter/>
</componentOf>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter>
<effectiveTime/>
</encompassingEncounter>
</componentOf>
</ClinicalDocument>

0.042
testValidateConsultationNoteComponentOfEncompassingEncounter2Id

Constraint

Consol Consultation Note SHALL contain exactly one [1..1] componentOf (CONF:8386) each SHALL contain exactly one [1..1] encompassingEncounter, where (CONF:8387) encompassingEncounter SHALL contain exactly one [1..1] id (CONF:8388)

OCL

self.componentOf->excluding(null).encompassingEncounter->excluding(null)->reject((id->isEmpty() or id->exists(element | element.isNullFlavorUndefined())) implies (id->size() = 1))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter/>
</componentOf>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter>
<id/>
</encompassingEncounter>
</componentOf>
</ClinicalDocument>

0.041
testValidateConsultationNoteComponentOfEncompassingEncounter2ResponsibleParty

Constraint

Consol Consultation Note SHALL contain exactly one [1..1] componentOf (CONF:8386) each SHALL contain exactly one [1..1] encompassingEncounter, where (CONF:8387) encompassingEncounter MAY contain zero or one [0..1] responsibleParty, where its type is Responsible Party (CONF:8391)

OCL

self.componentOf->excluding(null).encompassingEncounter->excluding(null)->reject(responsibleParty->one(responsibleParty : cda::ResponsibleParty | not responsibleParty.oclIsUndefined() and responsibleParty.oclIsKindOf(cda::ResponsibleParty)))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter/>
</componentOf>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter>
<responsibleParty/>
</encompassingEncounter>
</componentOf>
</ClinicalDocument>

0.028
testValidateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipant

Constraint

Consol Consultation Note SHALL contain exactly one [1..1] componentOf (CONF:8386) each SHALL contain exactly one [1..1] encompassingEncounter, where (CONF:8387) encompassingEncounter MAY contain zero or more [0..*] encounterParticipant, where its type is Encounter Participant (CONF:8392)

OCL

self.componentOf->excluding(null).encompassingEncounter->excluding(null)->reject(encounterParticipant->exists(encounterParticipant : cda::EncounterParticipant | not encounterParticipant.oclIsUndefined() and encounterParticipant.oclIsKindOf(cda::EncounterParticipant)))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter/>
</componentOf>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter>
<encounterParticipant/>
</encompassingEncounter>
</componentOf>
</ClinicalDocument>

0.028
testValidateConsultationNoteComponentOfEncompassingEncounter

Constraint

Consol Consultation Note SHALL contain exactly one [1..1] componentOf (CONF:8386) componentOf SHALL contain exactly one [1..1] encompassingEncounter, where its type is Encompassing Encounter7 (CONF:8449)

OCL

self.componentOf->excluding(null)->reject(encompassingEncounter->one(encompassingEncounter : cda::EncompassingEncounter | not encompassingEncounter.oclIsUndefined() and encompassingEncounter.oclIsKindOf(cda::EncompassingEncounter)))

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf/>
</ClinicalDocument>

Valid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.4"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter/>
</componentOf>
</ClinicalDocument>

0.023
testGetReasonForReferralSection

Constraint

OCL

SuccessInvalid XML

Valid XML

0.022
testGetReasonForVisitSection

Constraint

OCL

SuccessInvalid XML

Valid XML

0.023
testGetAllergiesSection

Constraint

OCL

SuccessInvalid XML

Valid XML

0.022
testGetChiefComplaintAndReasonForVisitSection

Constraint

OCL

SuccessInvalid XML

Valid XML

0.023
testGetMedicationsSectionEntriesOptional

Constraint

OCL

SuccessInvalid XML

Valid XML

0.022
testGetProblemSectionEntriesOptional

Constraint

OCL

SuccessInvalid XML

Valid XML

0.023
testGetProceduresSectionEntriesOptional

Constraint

OCL

SuccessInvalid XML

Valid XML

0.022
testGetResultsSectionEntriesOptional

Constraint

OCL

SuccessInvalid XML

Valid XML

0.023
testGetVitalSignsSectionEntriesOptional

Constraint

OCL

SuccessInvalid XML

Valid XML

0.022
Properties »