Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
GeneralHeaderConstraintsTest2620015.8132013-01-31T13:34:58JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateGeneralHeaderConstraintsTemplateId

Constraint

The 'GeneralHeaderConstraintsTemplateId' invariant is violated on 'org.openhealthtools.mdht.uml.cda.mu2consol.impl.GeneralHeaderConstraintsImpl@effc3e2{#//}'

OCL

self.templateId->exists(id : datatypes::II | id.root = '2.16.840.1.113883.10.20.22.1.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"/>

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.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

0.011
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.002
testValidateGeneralHeaderConstraintsTypeIdExtension

Constraint

Consol General Header Constraints typeId SHALL contain exactly one [1..1] @extension="POCD_HD000040" (CONF:5251)

OCL

not self.typeId.oclIsUndefined() and self.typeId.extension = 'POCD_HD000040'

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"/>
<typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

0.021
testValidateGeneralHeaderConstraintsEffectiveTime

Constraint

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

OCL

(self.effectiveTime.oclIsUndefined() or self.effectiveTime.isNullFlavorUndefined()) implies (not self.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"/>

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.1"/>
<effectiveTime xsi:type="IVL_TS"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

0.028
testValidateGeneralHeaderConstraintsId

Constraint

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

OCL

(self.id.oclIsUndefined() or self.id.isNullFlavorUndefined()) implies (not self.id.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.1"/>
<id/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

0.025
testValidateGeneralHeaderConstraintsLanguageCode

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] languageCode, where the @code SHALL be selected from ValueSet Language 2.16.840.1.113883.1.11.11526 DYNAMIC (CONF:5372)

OCL

(self.languageCode.oclIsUndefined() or self.languageCode.isNullFlavorUndefined()) implies (not self.languageCode.oclIsUndefined() and self.languageCode.oclIsKindOf(datatypes::CS) and let value : datatypes::CS = self.languageCode.oclAsType(datatypes::CS) in not value.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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<languageCode code="value"/>
</ClinicalDocument>

0.062
testValidateGeneralHeaderConstraintsRealmCode

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] realmCode/@code="US" (CONF:16791)

OCL

(self.realmCode->isEmpty() or self.realmCode->exists(element | element.isNullFlavorUndefined())) implies (self.realmCode->size() = 1 and self.realmCode->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(datatypes::CS) and let value : datatypes::CS = element.oclAsType(datatypes::CS) in value.code = 'US'))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

0.070
testValidateGeneralHeaderConstraintsTitle

Constraint

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

OCL

(self.title.oclIsUndefined() or self.title.isNullFlavorUndefined()) implies (not self.title.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.1"/>
<title>title</title>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

0.030
testValidateGeneralHeaderConstraintsTypeId

Constraint

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

OCL

(self.typeId.oclIsUndefined() or self.typeId.isNullFlavorUndefined()) implies (not self.typeId.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"/>
<typeId root="2.16.840.1.113883.1.3"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

0.027
testValidateGeneralHeaderConstraintsTypeIdRoot

Constraint

Consol General Header Constraints typeId SHALL contain exactly one [1..1] @root="2.16.840.1.113883.1.3" (CONF:5250)

OCL

not self.typeId.oclIsUndefined() and self.typeId.root = '2.16.840.1.113883.1.3'

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"/>
<typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
</ClinicalDocument>

0.021
testValidateGeneralHeaderConstraintsSetIdVersionNumber

Constraint

Consol General Header Constraints If setId is present versionNumber SHALL be present (CONF:6380)

OCL

not self.setId.oclIsUndefined() implies not self.versionNumber.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<setId/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<setId/>
<versionNumber/>
</ClinicalDocument>

0.023
testValidateGeneralHeaderConstraintsVersionNumberSetId

Constraint

Consol General Header Constraints If versionNumber is present setId SHALL be present (CONF:6387)

OCL

not self.versionNumber.oclIsUndefined() implies not self.setId.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<versionNumber/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<setId/>
<versionNumber/>
</ClinicalDocument>

0.023
testValidateGeneralHeaderConstraintsConfidentialityCode

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] confidentialityCode, where the @code SHALL be selected from ValueSet HL7 BasicConfidentialityKind 2.16.840.1.113883.1.11.16926 STATIC (CONF:5259)

OCL

(self.confidentialityCode.oclIsUndefined() or self.confidentialityCode.isNullFlavorUndefined()) implies (not self.confidentialityCode.oclIsUndefined() and self.confidentialityCode.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = self.confidentialityCode.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.5.25' and (value.code = 'N' or value.code = 'R' or value.code = 'V'))

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.1"/>
<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.1"/>
<confidentialityCode code="V" codeSystem="2.16.840.1.113883.5.25"/>
</ClinicalDocument>

0.082
testValidateGeneralHeaderConstraintsSetId

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] setId (CONF:5261)

OCL

(self.setId.oclIsUndefined() or self.setId.isNullFlavorUndefined()) implies (not self.setId.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<setId/>
</ClinicalDocument>

0.025
testValidateGeneralHeaderConstraintsVersionNumber

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] versionNumber (CONF:5264)

OCL

(self.versionNumber.oclIsUndefined() or self.versionNumber.isNullFlavorUndefined()) implies (not self.versionNumber.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<versionNumber/>
</ClinicalDocument>

0.028
testValidateGeneralHeaderConstraintsAuthor

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444)

OCL

self.author->exists(author : cda::Author | not author.oclIsUndefined() and author.oclIsKindOf(cda::Author))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author/>
</ClinicalDocument>

0.021
testValidateGeneralHeaderConstraintsDataEnterer

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441)

OCL

self.dataEnterer->one(dataEnterer : cda::DataEnterer | not dataEnterer.oclIsUndefined() and dataEnterer.oclIsKindOf(cda::DataEnterer))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer/>
</ClinicalDocument>

0.019
testValidateGeneralHeaderConstraintsCustodian

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519)

OCL

self.custodian->one(custodian : cda::Custodian | not custodian.oclIsUndefined() and custodian.oclIsKindOf(cda::Custodian))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian/>
</ClinicalDocument>

0.019
testValidateGeneralHeaderConstraintsInformationRecipient

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] informationRecipient (CONF:5565)

OCL

self.informationRecipient->exists(informationRecipient : cda::InformationRecipient | not informationRecipient.oclIsUndefined() and informationRecipient.oclIsKindOf(cda::InformationRecipient))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informationRecipient/>
</ClinicalDocument>

0.019
testValidateGeneralHeaderConstraintsLegalAuthenticator

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579)

OCL

self.legalAuthenticator->one(legalAuthenticator : cda::LegalAuthenticator | not legalAuthenticator.oclIsUndefined() and legalAuthenticator.oclIsKindOf(cda::LegalAuthenticator))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator/>
</ClinicalDocument>

0.019
testValidateGeneralHeaderConstraintsAuthenticator

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607)

OCL

self.authenticator->exists(authenticator : cda::Authenticator | not authenticator.oclIsUndefined() and authenticator.oclIsKindOf(cda::Authenticator))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator/>
</ClinicalDocument>

0.019
testValidateGeneralHeaderConstraintsRecordTarget

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266)

OCL

self.recordTarget->exists(recordTarget : cda::RecordTarget | not recordTarget.oclIsUndefined() and recordTarget.oclIsKindOf(cda::RecordTarget))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget/>
</ClinicalDocument>

0.019
testValidateGeneralHeaderConstraintsComponentOf

Constraint

Consol General Header Constraints MAY contain exactly one [1..1] componentOf (CONF:9955)

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"/>

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf/>
</ClinicalDocument>

0.019
testValidateGeneralHeaderConstraintsInformant

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001)

OCL

self.informant->one(informant : cda::Informant12 | not informant.oclIsUndefined() and informant.oclIsKindOf(cda::Informant12))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant/>
</ClinicalDocument>

0.019
testValidateGeneralHeaderConstraintsSupportParticipant

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] participant (CONF:10003)

OCL

self.participant->exists(participant : cda::Participant1 | not participant.oclIsUndefined() and participant.oclIsKindOf(cda::Participant1))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<participant/>
</ClinicalDocument>

0.019
testValidateGeneralHeaderConstraintsInFulfillmentOf

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] inFulfillmentOf (CONF:9952)

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"/>

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<inFulfillmentOf/>
</ClinicalDocument>

0.019
testValidateGeneralHeaderConstraintsDocumentationOf

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] documentationOf (CONF:14835)

OCL

self.documentationOf->exists(documentationOf : cda::DocumentationOf | not documentationOf.oclIsUndefined() and documentationOf.oclIsKindOf(cda::DocumentationOf))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf/>
</ClinicalDocument>

0.018
testValidateGeneralHeaderConstraintsAuthorization

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authorization (CONF:16792)

OCL

self.authorization->exists(authorization : cda::Authorization | not authorization.oclIsUndefined() and authorization.oclIsKindOf(cda::Authorization))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authorization/>
</ClinicalDocument>

0.019
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStreet

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5271) addr SHALL contain at least one and not more than 4 streetAddressLine (CONF:7291)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject(isNullFlavorUndefined() implies ( streetAddressLine->size() >=1 and streetAddressLine->size() <=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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine></addr>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr/>
</patientRole>
</recordTarget>
</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">
<recordTarget>
<patientRole>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.067
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressCity

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5271) addr SHALL contain exactly one [1..1] city (CONF:7292)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((city->isEmpty() or city->exists(element | element.isNullFlavorUndefined())) implies (city->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr nullFlavor="NA"/>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.067
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressCountry

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5271) addr SHOULD contain zero or one [0..1] country (CONF:7295)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((country->isEmpty() or country->exists(element | element.isNullFlavorUndefined())) implies (not country->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.067
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressPostalCode

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5271) addr SHOULD contain zero or one [0..1] postalCode (CONF:7294)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((postalCode->isEmpty() or postalCode->exists(element | element.isNullFlavorUndefined())) implies (not postalCode->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.066
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressState

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5271) addr SHOULD contain zero or one [0..1] state (CONF:7293)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((state->isEmpty() or state->exists(element | element.isNullFlavorUndefined())) implies (not state->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.067
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStreetAddressLine

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5271) addr SHALL contain at least one [1..*] streetAddressLine (CONF:7291)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((streetAddressLine->isEmpty() or streetAddressLine->exists(element | element.isNullFlavorUndefined())) implies (not streetAddressLine->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.067
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressUseP

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5271) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr use="HP"/>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.042
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressUse

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5271) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (use->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(vocab::PostalAddressUse) and let value : vocab::PostalAddressUse = element.oclAsType(vocab::PostalAddressUse) in value = vocab::PostalAddressUse::BAD or value = vocab::PostalAddressUse::DIR or value = vocab::PostalAddressUse::H or value = vocab::PostalAddressUse::HP or value = vocab::PostalAddressUse::HV or value = vocab::PostalAddressUse::PHYS or value = vocab::PostalAddressUse::PST or value = vocab::PostalAddressUse::PUB or value = vocab::PostalAddressUse::TMP or value = vocab::PostalAddressUse::WP) )))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr use=""/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr use="HP"/>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.116
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleTELUse

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each SHALL contain at least one [1..*] telecom with data type tel (CONF:5280) telecom SHOULD contain zero or one [0..1] @use (CONF:8000)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).telecom->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<telecom/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<telecom use="HP"/>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.047
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameMixedContent

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each SHALL contain exactly one [1..1] name with data type USRealmPatientName (CONF:5284) name US Realm Patient Name SHALL NOT contain any mixed content other than whitespace (CONF:7278)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).name->excluding(null)->select(isNullFlavorUndefined())->reject(getText(true)='')

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<name>12</name>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<name use="C"><given>Aaron</given><family>Rodgers</family><prefix>Mr.</prefix><suffix>QB</suffix></name>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.043
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameFamily

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each SHALL contain exactly one [1..1] name with data type USRealmPatientName (CONF:5284) name SHALL contain exactly one [1..1] family (CONF:7159, CONF:7160)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).name->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((family->isEmpty() or family->exists(element | element.isNullFlavorUndefined())) implies (family->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<name/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<name use="C"><given>Aaron</given><family>Rodgers</family><prefix>Mr.</prefix><suffix>QB</suffix></name>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.091
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameGiven

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each SHALL contain exactly one [1..1] name with data type USRealmPatientName (CONF:5284) name SHALL contain at least one [1..*] given (CONF:7157)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).name->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((given->isEmpty() or given->exists(element | element.isNullFlavorUndefined())) implies (not given->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<name/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<name use="C"><given>Aaron</given><family>Rodgers</family><prefix>Mr.</prefix><suffix>QB</suffix></name>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.076
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNamePrefix

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each SHALL contain exactly one [1..1] name with data type USRealmPatientName (CONF:5284) name MAY contain zero or more [0..*] prefix (CONF:7155)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).name->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((prefix->isEmpty() or prefix->exists(element | element.isNullFlavorUndefined())) implies (not prefix->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<name/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<name use="C"><given>Aaron</given><family>Rodgers</family><prefix>Mr.</prefix><suffix>QB</suffix></name>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.076
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameSuffix

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each SHALL contain exactly one [1..1] name with data type USRealmPatientName (CONF:5284) name MAY contain zero or one [0..1] suffix (CONF:7161)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).name->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((suffix->isEmpty() or suffix->exists(element | element.isNullFlavorUndefined())) implies (not suffix->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<name/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<name use="C"><given>Aaron</given><family>Rodgers</family><prefix>Mr.</prefix><suffix>QB</suffix></name>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.077
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameUseP

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each SHALL contain exactly one [1..1] name with data type USRealmPatientName (CONF:5284) name MAY contain zero or one [0..1] @use (CONF:7154), where the @code SHALL be selected from ValueSet EntityNameUse 2.16.840.1.113883.1.11.15913 STATIC

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).name->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<name/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<name use="C"><given>Aaron</given><family>Rodgers</family><prefix>Mr.</prefix><suffix>QB</suffix></name>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.052
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameUse

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each SHALL contain exactly one [1..1] name with data type USRealmPatientName (CONF:5284) name MAY contain zero or one [0..1] @use (CONF:7154), where the @code SHALL be selected from ValueSet EntityNameUse 2.16.840.1.113883.1.11.15913 STATIC

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).name->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (use->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(vocab::EntityNameUse) and let value : vocab::EntityNameUse = element.oclAsType(vocab::EntityNameUse) in value = vocab::EntityNameUse::A or value = vocab::EntityNameUse::ABC or value = vocab::EntityNameUse::ASGN or value = vocab::EntityNameUse::C or value = vocab::EntityNameUse::I or value = vocab::EntityNameUse::IDE or value = vocab::EntityNameUse::L or value = vocab::EntityNameUse::P or value = vocab::EntityNameUse::PHON or value = vocab::EntityNameUse::R or value = vocab::EntityNameUse::SNDX or value = vocab::EntityNameUse::SRCH or value = vocab::EntityNameUse::SYL) )))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<name use=""/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<name use="C"><given>Aaron</given><family>Rodgers</family><prefix>Mr.</prefix><suffix>QB</suffix></name>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.145
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStreet

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or more [0..*] guardian, where (CONF:5325) each SHOULD contain zero or more [0..*] addr with data type USRealmAddress addr SHALL contain at least one and not more than 4 streetAddressLine (CONF:7291)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).guardian->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject(isNullFlavorUndefined() implies ( streetAddressLine->size() >=1 and streetAddressLine->size() <=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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<addr><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine></addr>
</guardian>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<addr/>
</guardian>
</patient>
</patientRole>
</recordTarget>
</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">
<recordTarget>
<patientRole/>
</recordTarget>
</ClinicalDocument>

0.078
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressCity

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or more [0..*] guardian, where (CONF:5325) each SHOULD contain zero or more [0..*] addr with data type USRealmAddress addr SHALL contain exactly one [1..1] city (CONF:7292)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).guardian->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((city->isEmpty() or city->exists(element | element.isNullFlavorUndefined())) implies (city->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<addr/>
</guardian>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole/>
</recordTarget>
</ClinicalDocument>

0.079
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressCountry

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or more [0..*] guardian, where (CONF:5325) each SHOULD contain zero or more [0..*] addr with data type USRealmAddress addr SHOULD contain zero or one [0..1] country (CONF:7295)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).guardian->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((country->isEmpty() or country->exists(element | element.isNullFlavorUndefined())) implies (not country->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<addr/>
</guardian>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole/>
</recordTarget>
</ClinicalDocument>

0.077
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressPostalCode

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or more [0..*] guardian, where (CONF:5325) each SHOULD contain zero or more [0..*] addr with data type USRealmAddress addr SHOULD contain zero or one [0..1] postalCode (CONF:7294)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).guardian->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((postalCode->isEmpty() or postalCode->exists(element | element.isNullFlavorUndefined())) implies (not postalCode->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<addr/>
</guardian>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole/>
</recordTarget>
</ClinicalDocument>

0.078
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressState

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or more [0..*] guardian, where (CONF:5325) each SHOULD contain zero or more [0..*] addr with data type USRealmAddress addr SHOULD contain zero or one [0..1] state (CONF:7293)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).guardian->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((state->isEmpty() or state->exists(element | element.isNullFlavorUndefined())) implies (not state->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<addr/>
</guardian>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole/>
</recordTarget>
</ClinicalDocument>

0.077
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStreetAddressLine

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or more [0..*] guardian, where (CONF:5325) each SHOULD contain zero or more [0..*] addr with data type USRealmAddress addr SHALL contain at least one [1..*] streetAddressLine (CONF:7291)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).guardian->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((streetAddressLine->isEmpty() or streetAddressLine->exists(element | element.isNullFlavorUndefined())) implies (not streetAddressLine->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<addr/>
</guardian>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole/>
</recordTarget>
</ClinicalDocument>

0.078
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressUseP

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or more [0..*] guardian, where (CONF:5325) each SHOULD contain zero or more [0..*] addr with data type USRealmAddress addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).guardian->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<addr/>
</guardian>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole/>
</recordTarget>
</ClinicalDocument>

0.052
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressUse

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or more [0..*] guardian, where (CONF:5325) each SHOULD contain zero or more [0..*] addr with data type USRealmAddress addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).guardian->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (use->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(vocab::PostalAddressUse) and let value : vocab::PostalAddressUse = element.oclAsType(vocab::PostalAddressUse) in value = vocab::PostalAddressUse::BAD or value = vocab::PostalAddressUse::DIR or value = vocab::PostalAddressUse::H or value = vocab::PostalAddressUse::HP or value = vocab::PostalAddressUse::HV or value = vocab::PostalAddressUse::PHYS or value = vocab::PostalAddressUse::PST or value = vocab::PostalAddressUse::PUB or value = vocab::PostalAddressUse::TMP or value = vocab::PostalAddressUse::WP) )))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<addr use=""/>
</guardian>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole/>
</recordTarget>
</ClinicalDocument>

0.127
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTELUse

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or more [0..*] guardian, where (CONF:5325) each MAY contain zero or more [0..*] telecom with data type tel telecom SHOULD contain zero or one [0..1] @use (CONF:8000)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).guardian->excluding(null).telecom->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<telecom/>
</guardian>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole/>
</recordTarget>
</ClinicalDocument>

0.054
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorAuthoringDeviceManufacturerModelName

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) each SHOULD contain zero or one [0..1] assignedAuthoringDevice, where assignedAuthoringDevice SHALL contain exactly one [1..1] manufacturerModelName (CONF:16784)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).assignedAuthoringDevice->excluding(null)->reject((manufacturerModelName.oclIsUndefined() or manufacturerModelName.isNullFlavorUndefined()) implies (not manufacturerModelName.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<assignedAuthoringDevice/>
</assignedAuthor>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<assignedAuthoringDevice>
<manufacturerModelName/>
</assignedAuthoringDevice>
</assignedAuthor>
</author>
</ClinicalDocument>

0.056
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorAuthoringDeviceSoftwareName

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) each SHOULD contain zero or one [0..1] assignedAuthoringDevice, where assignedAuthoringDevice SHALL contain exactly one [1..1] softwareName (CONF:16785)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).assignedAuthoringDevice->excluding(null)->reject((softwareName.oclIsUndefined() or softwareName.isNullFlavorUndefined()) implies (not softwareName.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<assignedAuthoringDevice/>
</assignedAuthor>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<assignedAuthoringDevice>
<softwareName/>
</assignedAuthoringDevice>
</assignedAuthor>
</author>
</ClinicalDocument>

0.056
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorPersonName

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) each SHOULD contain zero or one [0..1] assignedperson, where assignedPerson SHALL contain exactly one [1..1] name (CONF:9406)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).assignedPerson->excluding(null)->reject((name->isEmpty() or name->exists(element | element.isNullFlavorUndefined())) implies (not name->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<assignedPerson/>
</assignedAuthor>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<assignedPerson>
<name/>
</assignedPerson>
</assignedAuthor>
</author>
</ClinicalDocument>

0.054
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorHasAssignedPersonOrAssignedAuthoringDevice

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) assignedAuthor This assignedAuthor SHALL contain exactly one [1..1] assignedPerson or assignedAuthoringDevice (CONF:16790)

OCL

self.author->excluding(null).assignedAuthor->excluding(null)->reject(not assignedPerson.oclIsUndefined() xor not assignedAuthoringDevice.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor/>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<assignedPerson/>
<assignedAuthoringDevice/>
</assignedAuthor>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<assignedPerson/>
</assignedAuthor>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<assignedAuthoringDevice/>
</assignedAuthor>
</author>
</ClinicalDocument>

0.044
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorHasNationalProviderIdentifier

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) assignedAuthor The id SHALL contain exactly one root ="2.16.840.1.113883.4.6" National Provider Identifier (CONF:9996) (CONF:16786)

OCL

self.author->excluding(null).assignedAuthor->excluding(null)->reject(not assignedPerson.oclIsUndefined() implies id->exists(id| id.isNullFlavorDefined() or id.root='2.16.840.1.113883.4.6' ))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<id root="111111"/>
<assignedPerson/>
</assignedAuthor>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<id root="2.16.840.1.113883.4.6"/>
</assignedAuthor>
</author>
</ClinicalDocument>

0.044
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorAddr

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) assignedAuthor SHALL contain exactly one [1..1] addr with data type USRealmAddress (CONF:9437)

OCL

self.author->excluding(null).assignedAuthor->excluding(null)->reject((addr->isEmpty() or addr->exists(element | element.isNullFlavorUndefined())) implies (not addr->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor/>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</ClinicalDocument>

0.049
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorCode

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) assignedAuthor SHOULD contain zero or one [0..1] code (CONF:16787), where the @code SHOULD be selected from ValueSet Healthcare Provider Taxonomy (NUCC - HIPAA) 2.16.840.1.114222.4.11.1066 DYNAMIC (CONF:16788)

OCL

self.author->excluding(null).assignedAuthor->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not code.oclIsUndefined() and code.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = code.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.6.101' and not value.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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor/>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<code code="test" codeSystem="2.16.840.1.113883.6.101"/>
</assignedAuthor>
</author>
</ClinicalDocument>

0.090
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorCodeP

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) assignedAuthor SHOULD contain zero or one [0..1] code (CONF:16787), where the @code SHOULD be selected from ValueSet Healthcare Provider Taxonomy (NUCC - HIPAA) 2.16.840.1.114222.4.11.1066 DYNAMIC (CONF:16788)

OCL

self.author->excluding(null).assignedAuthor->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not 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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor/>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<code codeSystem="2.16.840.1.113883.6.101"/>
</assignedAuthor>
</author>
</ClinicalDocument>

0.047
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorId

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) assignedAuthor SHALL contain at least one [1..*] id (CONF:9196)

OCL

self.author->excluding(null).assignedAuthor->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor/>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<id/>
</assignedAuthor>
</author>
</ClinicalDocument>

0.047
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorTelecom

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) assignedAuthor SHALL contain at least one [1..*] telecom with data type TEL (CONF:5428)

OCL

self.author->excluding(null).assignedAuthor->excluding(null)->reject((telecom->isEmpty() or telecom->exists(element | element.isNullFlavorUndefined())) implies (not telecom->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor/>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<telecom/>
</assignedAuthor>
</author>
</ClinicalDocument>

0.048
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorAssignedAuthoringDevice

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) assignedAuthor SHOULD contain zero or one [0..1] assignedAuthoringDevice, where its type is Authoring Device

OCL

self.author->excluding(null).assignedAuthor->excluding(null)->reject(assignedAuthoringDevice->one(assignedAuthoringDevice : cda::AuthoringDevice | not assignedAuthoringDevice.oclIsUndefined() and assignedAuthoringDevice.oclIsKindOf(cda::AuthoringDevice)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor/>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<assignedAuthoringDevice/>
</assignedAuthor>
</author>
</ClinicalDocument>

0.033
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorAssignedPerson

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) assignedAuthor SHOULD contain zero or one [0..1] assignedPerson, where its type is Person

OCL

self.author->excluding(null).assignedAuthor->excluding(null)->reject(assignedPerson->one(assignedPerson : cda::Person | not assignedPerson.oclIsUndefined() and assignedPerson.oclIsKindOf(cda::Person)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor/>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<assignedPerson/>
</assignedAuthor>
</author>
</ClinicalDocument>

0.034
testValidateGeneralHeaderConstraintsAuthorTime

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) author SHALL contain exactly one [1..1] time (CONF:9434)

OCL

self.author->excluding(null)->reject((time.oclIsUndefined() or time.isNullFlavorUndefined()) implies (not time.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<time/>
</author>
</ClinicalDocument>

0.042
testValidateGeneralHeaderConstraintsAuthorAssignedAuthor

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) author SHALL contain exactly one [1..1] assignedAuthor, where its type is Assigned Author (CONF:9435)

OCL

self.author->excluding(null)->reject(assignedAuthor->one(assignedAuthor : cda::AssignedAuthor | not assignedAuthor.oclIsUndefined() and assignedAuthor.oclIsKindOf(cda::AssignedAuthor)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor/>
</author>
</ClinicalDocument>

0.027
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStreet

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5460) addr SHALL contain at least one and not more than 4 streetAddressLine (CONF:7291)

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject(isNullFlavorUndefined() implies ( streetAddressLine->size() >=1 and streetAddressLine->size() <=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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine></addr>
</assignedEntity>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr/>
</assignedEntity>
</dataEnterer>
</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">
<dataEnterer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.067
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressCity

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5460) addr SHALL contain exactly one [1..1] city (CONF:7292)

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((city->isEmpty() or city->exists(element | element.isNullFlavorUndefined())) implies (city->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr/>
</assignedEntity>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.069
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressCountry

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5460) addr SHOULD contain zero or one [0..1] country (CONF:7295)

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((country->isEmpty() or country->exists(element | element.isNullFlavorUndefined())) implies (not country->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr/>
</assignedEntity>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.067
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressPostalCode

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5460) addr SHOULD contain zero or one [0..1] postalCode (CONF:7294)

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((postalCode->isEmpty() or postalCode->exists(element | element.isNullFlavorUndefined())) implies (not postalCode->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr/>
</assignedEntity>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.068
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressState

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5460) addr SHOULD contain zero or one [0..1] state (CONF:7293)

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((state->isEmpty() or state->exists(element | element.isNullFlavorUndefined())) implies (not state->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr/>
</assignedEntity>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.068
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStreetAddressLine

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5460) addr SHALL contain at least one [1..*] streetAddressLine (CONF:7291)

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((streetAddressLine->isEmpty() or streetAddressLine->exists(element | element.isNullFlavorUndefined())) implies (not streetAddressLine->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr/>
</assignedEntity>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.067
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressUseP

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5460) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr/>
</assignedEntity>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.041
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressUse

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5460) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (use->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(vocab::PostalAddressUse) and let value : vocab::PostalAddressUse = element.oclAsType(vocab::PostalAddressUse) in value = vocab::PostalAddressUse::BAD or value = vocab::PostalAddressUse::DIR or value = vocab::PostalAddressUse::H or value = vocab::PostalAddressUse::HP or value = vocab::PostalAddressUse::HV or value = vocab::PostalAddressUse::PHYS or value = vocab::PostalAddressUse::PST or value = vocab::PostalAddressUse::PUB or value = vocab::PostalAddressUse::TMP or value = vocab::PostalAddressUse::WP) )))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr use=""/>
</assignedEntity>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.118
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityTELUse

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) each SHALL contain at least one [1..*] telecom with data type tel (CONF:5466) telecom SHOULD contain zero or one [0..1] @use (CONF:8000)

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null).telecom->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<telecom/>
</assignedEntity>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<telecom use="HP"/>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.044
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityPersonName

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) each SHALL contain exactly one [1..1] assignedperson, where (CONF:5469) assignedPerson SHALL contain exactly one [1..1] name (CONF:9406)

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null).assignedPerson->excluding(null)->reject((name->isEmpty() or name->exists(element | element.isNullFlavorUndefined())) implies (not name->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<assignedPerson/>
</assignedEntity>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<assignedPerson>
<name/>
</assignedPerson>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.055
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityHasNationalProviderIdentifier

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) assignedEntity SHOULD include zero or one [0..1] id where id/@root ="2.16.840.1.113883.4.6" National Provider Identifier (CONF:10027)

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null)->reject(id->exists( root='2.16.840.1.113883.4.6' ))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity/>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<id root="2.16.840.1.113883.4.6"/>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.026
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityAddr

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) assignedEntity SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220)

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null)->reject((addr->isEmpty() or addr->exists(element | element.isNullFlavorUndefined())) implies (not addr->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity/>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<addr/>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.048
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityCode

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) assignedEntity SHALL contain exactly one [1..1] code (CONF:8888)

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not code.oclIsUndefined() and code.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = code.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.6.101'))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity/>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<code code="" codeSystem="2.16.840.1.113883.6.101"/>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.076
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityCodeP

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) assignedEntity SHOULD contain zero or one [0..1] code (CONF:14912), where the @code SHALL be selected from ValueSet Healthcare Provider Taxonomy (NUCC - HIPAA) 2.16.840.1.114222.4.11.1066 DYNAMIC (CONF:14913)

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not 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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity/>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<code code="" codeSystem="2.16.840.1.113883.6.101"/>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.047
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityId

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) assignedEntity SHALL contain at least one [1..*] id (CONF:8887)

OCL

self.dataEnterer->excluding(null).assignedEntity->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity/>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<id/>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.048
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityTelecom

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) assignedEntity SHALL contain at least one [1..*] telecom with data type TEL (CONF:5622)

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null)->reject((telecom->isEmpty() or telecom->exists(element | element.isNullFlavorUndefined())) implies (not telecom->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity/>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<telecom/>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.050
testValidateGeneralHeaderConstraintsDataEntererAssignedEntityAssignedPerson

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5442) assignedEntity SHALL contain exactly one [1..1] assignedPerson, where its type is Person (CONF:5624)

OCL

self.dataEnterer->excluding(null).assignedEntity->excluding(null)->reject(assignedPerson->one(assignedPerson : cda::Person | not assignedPerson.oclIsUndefined() and assignedPerson.oclIsKindOf(cda::Person)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity/>
</dataEnterer>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity>
<assignedPerson/>
</assignedEntity>
</dataEnterer>
</ClinicalDocument>

0.033
testValidateGeneralHeaderConstraintsDataEntererAssignedEntity

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] dataEnterer (CONF:5441) dataEnterer SHALL contain exactly one [1..1] assignedEntity, where its type is Assigned Entity (CONF:5442)

OCL

self.dataEnterer->excluding(null)->reject(assignedEntity->one(assignedEntity : cda::AssignedEntity | not assignedEntity.oclIsUndefined() and assignedEntity.oclIsKindOf(cda::AssignedEntity)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer/>
</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"/>
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<dataEnterer>
<assignedEntity/>
</dataEnterer>
</ClinicalDocument>

0.027
testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStreet

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) each SHALL contain exactly one [1..1] assignedCustodian, where (CONF:5520) each SHALL contain zero or one [0..1] representedCustodianOrganization, where (CONF:5521) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5559) addr SHALL contain at least one and not more than 4 streetAddressLine (CONF:7291)

OCL

self.custodian->excluding(null).assignedCustodian->excluding(null).representedCustodianOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject(isNullFlavorUndefined() implies ( streetAddressLine->size() >=1 and streetAddressLine->size() <=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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine></addr>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr/>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</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">
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</ClinicalDocument>

0.075
testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressCity

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) each SHALL contain exactly one [1..1] assignedCustodian, where (CONF:5520) each SHALL contain zero or one [0..1] representedCustodianOrganization, where (CONF:5521) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5559) addr SHALL contain exactly one [1..1] city (CONF:7292)

OCL

self.custodian->excluding(null).assignedCustodian->excluding(null).representedCustodianOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((city->isEmpty() or city->exists(element | element.isNullFlavorUndefined())) implies (city->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr/>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</ClinicalDocument>

0.076
testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressCountry

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) each SHALL contain exactly one [1..1] assignedCustodian, where (CONF:5520) each SHALL contain zero or one [0..1] representedCustodianOrganization, where (CONF:5521) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5559) addr SHOULD contain zero or one [0..1] country (CONF:7295)

OCL

self.custodian->excluding(null).assignedCustodian->excluding(null).representedCustodianOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((country->isEmpty() or country->exists(element | element.isNullFlavorUndefined())) implies (not country->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr/>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</ClinicalDocument>

0.074
testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressPostalCode

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) each SHALL contain exactly one [1..1] assignedCustodian, where (CONF:5520) each SHALL contain zero or one [0..1] representedCustodianOrganization, where (CONF:5521) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5559) addr SHOULD contain zero or one [0..1] postalCode (CONF:7294)

OCL

self.custodian->excluding(null).assignedCustodian->excluding(null).representedCustodianOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((postalCode->isEmpty() or postalCode->exists(element | element.isNullFlavorUndefined())) implies (not postalCode->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr/>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</ClinicalDocument>

0.076
testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressState

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) each SHALL contain exactly one [1..1] assignedCustodian, where (CONF:5520) each SHALL contain zero or one [0..1] representedCustodianOrganization, where (CONF:5521) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5559) addr SHOULD contain zero or one [0..1] state (CONF:7293)

OCL

self.custodian->excluding(null).assignedCustodian->excluding(null).representedCustodianOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((state->isEmpty() or state->exists(element | element.isNullFlavorUndefined())) implies (not state->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr/>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</ClinicalDocument>

0.075
testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStreetAddressLine

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) each SHALL contain exactly one [1..1] assignedCustodian, where (CONF:5520) each SHALL contain zero or one [0..1] representedCustodianOrganization, where (CONF:5521) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5559) addr SHALL contain at least one [1..*] streetAddressLine (CONF:7291)

OCL

self.custodian->excluding(null).assignedCustodian->excluding(null).representedCustodianOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((streetAddressLine->isEmpty() or streetAddressLine->exists(element | element.isNullFlavorUndefined())) implies (not streetAddressLine->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr/>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</ClinicalDocument>

0.075
testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressUseP

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) each SHALL contain exactly one [1..1] assignedCustodian, where (CONF:5520) each SHALL contain zero or one [0..1] representedCustodianOrganization, where (CONF:5521) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5559) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.custodian->excluding(null).assignedCustodian->excluding(null).representedCustodianOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr/>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</ClinicalDocument>

0.048
testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressUse

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) each SHALL contain exactly one [1..1] assignedCustodian, where (CONF:5520) each SHALL contain zero or one [0..1] representedCustodianOrganization, where (CONF:5521) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5559) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.custodian->excluding(null).assignedCustodian->excluding(null).representedCustodianOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (use->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(vocab::PostalAddressUse) and let value : vocab::PostalAddressUse = element.oclAsType(vocab::PostalAddressUse) in value = vocab::PostalAddressUse::BAD or value = vocab::PostalAddressUse::DIR or value = vocab::PostalAddressUse::H or value = vocab::PostalAddressUse::HP or value = vocab::PostalAddressUse::HV or value = vocab::PostalAddressUse::PHYS or value = vocab::PostalAddressUse::PST or value = vocab::PostalAddressUse::PUB or value = vocab::PostalAddressUse::TMP or value = vocab::PostalAddressUse::WP) )))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr use=""/>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</ClinicalDocument>

0.126
testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationTELUse

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) each SHALL contain exactly one [1..1] assignedCustodian, where (CONF:5520) each SHALL contain zero or one [0..1] representedCustodianOrganization, where (CONF:5521) each SHALL contain exactly one [1..1] telecom with data type tel (CONF:5525) telecom SHOULD contain zero or one [0..1] @use (CONF:8000)

OCL

self.custodian->excluding(null).assignedCustodian->excluding(null).representedCustodianOrganization->excluding(null).telecom->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<telecom/>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<telecom use="HP"/>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</ClinicalDocument>

0.051
testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationHasNationalProviderIdentifier

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) each SHALL contain exactly one [1..1] assignedCustodian, where (CONF:5520) each SHALL contain zero or one [0..1] representedCustodianOrganization, where (CONF:5521) representedCustodianOrganization The id SHOULD include zero or one [0..1] @root ="2.16.840.1.113883.4.6" National Provider Identifier (CONF:9996)

OCL

self.custodian->excluding(null).assignedCustodian->excluding(null).representedCustodianOrganization->excluding(null)->reject(id->exists( root='2.16.840.1.113883.4.6' ))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization/>
</assignedCustodian>
</custodian>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<id root="2.16.840.1.113883.4.6"/>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</ClinicalDocument>

0.032
testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationAddr

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) each SHALL contain exactly one [1..1] assignedCustodian, where (CONF:5520) each SHALL contain zero or one [0..1] representedCustodianOrganization, where (CONF:5521) representedCustodianOrganization SHALL contain exactly one [1..1] addr (CONF:7651)

OCL

self.custodian->excluding(null).assignedCustodian->excluding(null).representedCustodianOrganization->excluding(null)->reject((addr.oclIsUndefined() or addr.isNullFlavorUndefined()) implies (not addr.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization/>
</assignedCustodian>
</custodian>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<addr/>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</ClinicalDocument>

0.055
testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationId

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) each SHALL contain exactly one [1..1] assignedCustodian, where (CONF:5520) each SHALL contain zero or one [0..1] representedCustodianOrganization, where (CONF:5521) representedCustodianOrganization SHALL contain exactly one [1..1] id (CONF:7648)

OCL

self.custodian->excluding(null).assignedCustodian->excluding(null).representedCustodianOrganization->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization/>
</assignedCustodian>
</custodian>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<id/>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</ClinicalDocument>

0.055
testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationName

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) each SHALL contain exactly one [1..1] assignedCustodian, where (CONF:5520) each SHALL contain zero or one [0..1] representedCustodianOrganization, where (CONF:5521) representedCustodianOrganization SHALL contain exactly one [1..1] name (CONF:7649)

OCL

self.custodian->excluding(null).assignedCustodian->excluding(null).representedCustodianOrganization->excluding(null)->reject((name.oclIsUndefined() or name.isNullFlavorUndefined()) implies (not name.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization/>
</assignedCustodian>
</custodian>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<name/>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</ClinicalDocument>

0.054
testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationTelecom

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) each SHALL contain exactly one [1..1] assignedCustodian, where (CONF:5520) each SHALL contain zero or one [0..1] representedCustodianOrganization, where (CONF:5521) representedCustodianOrganization SHALL contain exactly one [1..1] telecom (CONF:7650)

OCL

self.custodian->excluding(null).assignedCustodian->excluding(null).representedCustodianOrganization->excluding(null)->reject((telecom.oclIsUndefined() or telecom.isNullFlavorUndefined()) implies (not telecom.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">
<custodian>
<assignedCustodian>
<representedCustodianOrganization/>
</assignedCustodian>
</custodian>
</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">
<custodian>
<assignedCustodian>
<representedCustodianOrganization>
<telecom/>
</representedCustodianOrganization>
</assignedCustodian>
</custodian>
</ClinicalDocument>

0.054
testValidateGeneralHeaderConstraintsCustodianAssignedCustodianRepresentedCustodianOrganization

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) each SHALL contain exactly one [1..1] assignedCustodian, where (CONF:5520) assignedCustodian SHALL contain zero or one [0..1] representedCustodianOrganization, where its type is Custodian Organization (CONF:5521)

OCL

self.custodian->excluding(null).assignedCustodian->excluding(null)->reject(representedCustodianOrganization->one(representedCustodianOrganization : cda::CustodianOrganization | not representedCustodianOrganization.oclIsUndefined() and representedCustodianOrganization.oclIsKindOf(cda::CustodianOrganization)))

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">
<custodian>
<assignedCustodian/>
</custodian>
</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">
<custodian>
<assignedCustodian>
<representedCustodianOrganization/>
</assignedCustodian>
</custodian>
</ClinicalDocument>

0.034
testValidateGeneralHeaderConstraintsCustodianAssignedCustodian

Constraint

Consol General Header Constraints SHALL contain exactly one [1..1] custodian (iv., CONF:5519) custodian SHALL contain exactly one [1..1] assignedCustodian, where its type is Assigned Custodian (CONF:5520)

OCL

self.custodian->excluding(null)->reject(assignedCustodian->one(assignedCustodian : cda::AssignedCustodian | not assignedCustodian.oclIsUndefined() and assignedCustodian.oclIsKindOf(cda::AssignedCustodian)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<custodian>
<assignedCustodian/>
</custodian>
</ClinicalDocument>

0.028
testValidateGeneralHeaderConstraintsInformationRecipientIntendedRecipientOrganizationName

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] informationRecipient (CONF:5565) each SHALL contain exactly one [1..1] intendedRecipient, where (CONF:5566) each MAY contain zero or one [0..1] receivedorganization, where (CONF:5577) recievedOrganization SHALL contain exactly one [1..1] name (CONF:5578)

OCL

self.informationRecipient->excluding(null).intendedRecipient->excluding(null).receivedOrganization->excluding(null)->reject((name->isEmpty() or name->exists(element | element.isNullFlavorUndefined())) implies (name->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informationRecipient>
<intendedRecipient>
<receivedOrganization/>
</intendedRecipient>
</informationRecipient>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informationRecipient>
<intendedRecipient>
<receivedOrganization>
<name/>
</receivedOrganization>
</intendedRecipient>
</informationRecipient>
</ClinicalDocument>

0.083
testValidateGeneralHeaderConstraintsInformationRecipientIntendedRecipientPersonName

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] informationRecipient (CONF:5565) each SHALL contain exactly one [1..1] intendedRecipient, where (CONF:5566) each MAY contain zero or one [0..1] informationRecipient, where (CONF:5568) informationRecipient SHALL contain exactly one [1..1] name (CONF:9406)

OCL

self.informationRecipient->excluding(null).intendedRecipient->excluding(null).informationRecipient->excluding(null)->reject((name->isEmpty() or name->exists(element | element.isNullFlavorUndefined())) implies (not name->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informationRecipient>
<intendedRecipient>
<informationRecipient/>
<receivedOrganization/>
</intendedRecipient>
</informationRecipient>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informationRecipient>
<intendedRecipient>
<informationRecipient>
<name/>
</informationRecipient>
<receivedOrganization/>
</intendedRecipient>
</informationRecipient>
</ClinicalDocument>

0.056
testValidateGeneralHeaderConstraintsInformationRecipientIntendedRecipientInformationRecipient

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] informationRecipient (CONF:5565) each SHALL contain exactly one [1..1] intendedRecipient, where (CONF:5566) intendedRecipient MAY contain zero or one [0..1] informationRecipient, where its type is Person (CONF:5568)

OCL

self.informationRecipient->excluding(null).intendedRecipient->excluding(null)->reject(informationRecipient->one(informationRecipient : cda::Person | not informationRecipient.oclIsUndefined() and informationRecipient.oclIsKindOf(cda::Person)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informationRecipient>
<intendedRecipient/>
</informationRecipient>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informationRecipient>
<intendedRecipient>
<informationRecipient/>
</intendedRecipient>
</informationRecipient>
</ClinicalDocument>

0.034
testValidateGeneralHeaderConstraintsInformationRecipientIntendedRecipientRecievedOrganization

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] informationRecipient (CONF:5565) each SHALL contain exactly one [1..1] intendedRecipient, where (CONF:5566) intendedRecipient MAY contain zero or one [0..1] receivedOrganization, where its type is Organization (CONF:5577)

OCL

self.informationRecipient->excluding(null).intendedRecipient->excluding(null)->reject(receivedOrganization->one(receivedOrganization : cda::Organization | not receivedOrganization.oclIsUndefined() and receivedOrganization.oclIsKindOf(cda::Organization)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informationRecipient>
<intendedRecipient/>
</informationRecipient>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informationRecipient>
<intendedRecipient>
<receivedOrganization/>
</intendedRecipient>
</informationRecipient>
</ClinicalDocument>

0.035
testValidateGeneralHeaderConstraintsInformationRecipientIntendedRecipient

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] informationRecipient (CONF:5565) informationRecipient SHALL contain exactly one [1..1] intendedRecipient, where its type is Intended Recipient (CONF:5566)

OCL

self.informationRecipient->excluding(null)->reject(intendedRecipient->one(intendedRecipient : cda::IntendedRecipient | not intendedRecipient.oclIsUndefined() and intendedRecipient.oclIsKindOf(cda::IntendedRecipient)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informationRecipient/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informationRecipient>
<intendedRecipient>
<receivedOrganization/>
</intendedRecipient>
</informationRecipient>
</ClinicalDocument>

0.028
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStreet

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5589) addr SHALL contain at least one and not more than 4 streetAddressLine (CONF:7291)

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject(isNullFlavorUndefined() implies ( streetAddressLine->size() >=1 and streetAddressLine->size() <=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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine></addr>
</assignedEntity>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</legalAuthenticator>
</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">
<legalAuthenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.068
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressCity

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5589) addr SHALL contain exactly one [1..1] city (CONF:7292)

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((city->isEmpty() or city->exists(element | element.isNullFlavorUndefined())) implies (city->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.070
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressCountry

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5589) addr SHOULD contain zero or one [0..1] country (CONF:7295)

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((country->isEmpty() or country->exists(element | element.isNullFlavorUndefined())) implies (not country->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.069
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressPostalCode

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5589) addr SHOULD contain zero or one [0..1] postalCode (CONF:7294)

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((postalCode->isEmpty() or postalCode->exists(element | element.isNullFlavorUndefined())) implies (not postalCode->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.069
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressState

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5589) addr SHOULD contain zero or one [0..1] state (CONF:7293)

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((state->isEmpty() or state->exists(element | element.isNullFlavorUndefined())) implies (not state->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.070
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStreetAddressLine

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5589) addr SHALL contain at least one [1..*] streetAddressLine (CONF:7291)

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((streetAddressLine->isEmpty() or streetAddressLine->exists(element | element.isNullFlavorUndefined())) implies (not streetAddressLine->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.072
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressUseP

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5589) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.042
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressUse

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5589) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (use->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(vocab::PostalAddressUse) and let value : vocab::PostalAddressUse = element.oclAsType(vocab::PostalAddressUse) in value = vocab::PostalAddressUse::BAD or value = vocab::PostalAddressUse::DIR or value = vocab::PostalAddressUse::H or value = vocab::PostalAddressUse::HP or value = vocab::PostalAddressUse::HV or value = vocab::PostalAddressUse::PHYS or value = vocab::PostalAddressUse::PST or value = vocab::PostalAddressUse::PUB or value = vocab::PostalAddressUse::TMP or value = vocab::PostalAddressUse::WP) )))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr use=""/>
</assignedEntity>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.121
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityTELUse

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where each SHALL contain at least one [1..*] telecom with data type tel (CONF:5595) telecom SHOULD contain zero or one [0..1] @use (CONF:8000)

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null).telecom->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<telecom/>
</assignedEntity>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<telecom use="HP"/>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.045
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityPersonName

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where each SHALL contain exactly one [1..1] assignedperson, where (CONF:5597) assignedPerson SHALL contain exactly one [1..1] name (CONF:9406)

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null).assignedPerson->excluding(null)->reject((name->isEmpty() or name->exists(element | element.isNullFlavorUndefined())) implies (not name->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<assignedPerson/>
</assignedEntity>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<assignedPerson>
<name/>
</assignedPerson>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.056
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityHasNationalProviderIdentifier

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where assignedEntity SHOULD include zero or one [0..1] id where id/@root ="2.16.840.1.113883.4.6" National Provider Identifier (CONF:10027)

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null)->reject(id->exists( root='2.16.840.1.113883.4.6' ))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity/>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<id root="2.16.840.1.113883.4.6"/>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.026
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAddr

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where assignedEntity SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220)

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null)->reject((addr->isEmpty() or addr->exists(element | element.isNullFlavorUndefined())) implies (not addr->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity/>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.049
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityCode

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where assignedEntity SHALL contain exactly one [1..1] code (CONF:8888)

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not code.oclIsUndefined() and code.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = code.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.6.101' and not value.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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity/>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<code code="207X00000X" codeSystem="2.16.840.1.113883.6.101"/>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.093
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityCodeP

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where assignedEntity SHOULD contain zero or one [0..1] code (CONF:14912), where the @code SHALL be selected from ValueSet Healthcare Provider Taxonomy (NUCC - HIPAA) 2.16.840.1.114222.4.11.1066 DYNAMIC (CONF:14913)

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not 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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity/>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<code code="207X00000X" codeSystem="2.16.840.1.113883.6.101"/>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.048
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityId

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where assignedEntity SHALL contain at least one [1..*] id (CONF:8887)

OCL

self.legalAuthenticator->excluding(null).assignedEntity->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity/>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<id/>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.049
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityTelecom

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where assignedEntity SHALL contain at least one [1..*] telecom with data type TEL (CONF:5622)

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null)->reject((telecom->isEmpty() or telecom->exists(element | element.isNullFlavorUndefined())) implies (not telecom->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity/>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<telecom/>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.051
testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAssignedPerson

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) each Contains zero or one [0..1] assignedEntity, where assignedEntity SHALL contain exactly one [1..1] assignedPerson, where its type is Person (CONF:5624)

OCL

self.legalAuthenticator->excluding(null).assignedEntity->excluding(null)->reject(assignedPerson->one(assignedPerson : cda::Person | not assignedPerson.oclIsUndefined() and assignedPerson.oclIsKindOf(cda::Person)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity/>
</legalAuthenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<assignedEntity>
<assignedPerson/>
</assignedEntity>
</legalAuthenticator>
</ClinicalDocument>

0.034
testValidateGeneralHeaderConstraintsLegalAuthenticatorTime

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) legalAuthenticator SHALL contain exactly one [1..1] time (CONF:5580)

OCL

self.legalAuthenticator->excluding(null)->reject((time.oclIsUndefined() or time.isNullFlavorUndefined()) implies (not time.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<time/>
</legalAuthenticator>
</ClinicalDocument>

0.043
testValidateGeneralHeaderConstraintsLegalAuthenticatorSignatureCodeP

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) legalAuthenticator SHALL contain exactly one [1..1] signatureCode/@code="S" (CodeSystem: 2.16.840.1.113883.5.89 Participationsignature) (CONF:5583, CONF:5584)

OCL

self.legalAuthenticator->excluding(null)->reject((signatureCode.oclIsUndefined() or signatureCode.isNullFlavorUndefined()) implies (not signatureCode.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<signatureCode code="S"/>
</legalAuthenticator>
</ClinicalDocument>

0.047
testValidateGeneralHeaderConstraintsLegalAuthenticatorSignatureCode

Constraint

Consol General Header Constraints SHOULD contain zero or one [0..1] legalAuthenticator (CONF:5579) legalAuthenticator SHALL contain exactly one [1..1] signatureCode/@code="S" (CodeSystem: 2.16.840.1.113883.5.89 Participationsignature) (CONF:5583, CONF:5584)

OCL

self.legalAuthenticator->excluding(null)->reject((signatureCode.oclIsUndefined() or signatureCode.isNullFlavorUndefined()) implies (not signatureCode.oclIsUndefined() and signatureCode.oclIsKindOf(datatypes::CS) and let value : datatypes::CS = signatureCode.oclAsType(datatypes::CS) in value.code = 'S'))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<legalAuthenticator>
<signatureCode code="S"/>
</legalAuthenticator>
</ClinicalDocument>

0.082
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStreet

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5616) addr SHALL contain at least one and not more than 4 streetAddressLine (CONF:7291)

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject(isNullFlavorUndefined() implies ( streetAddressLine->size() >=1 and streetAddressLine->size() <=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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine></addr>
</assignedEntity>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</authenticator>
</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">
<authenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.069
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressCity

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5616) addr SHALL contain exactly one [1..1] city (CONF:7292)

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((city->isEmpty() or city->exists(element | element.isNullFlavorUndefined())) implies (city->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.074
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressCountry

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5616) addr SHOULD contain zero or one [0..1] country (CONF:7295)

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((country->isEmpty() or country->exists(element | element.isNullFlavorUndefined())) implies (not country->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.069
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressPostalCode

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5616) addr SHOULD contain zero or one [0..1] postalCode (CONF:7294)

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((postalCode->isEmpty() or postalCode->exists(element | element.isNullFlavorUndefined())) implies (not postalCode->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.069
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressState

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5616) addr SHOULD contain zero or one [0..1] state (CONF:7293)

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((state->isEmpty() or state->exists(element | element.isNullFlavorUndefined())) implies (not state->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.070
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStreetAddressLine

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5616) addr SHALL contain at least one [1..*] streetAddressLine (CONF:7291)

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((streetAddressLine->isEmpty() or streetAddressLine->exists(element | element.isNullFlavorUndefined())) implies (not streetAddressLine->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.070
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressUseP

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5616) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.042
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressUse

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5616) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (use->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(vocab::PostalAddressUse) and let value : vocab::PostalAddressUse = element.oclAsType(vocab::PostalAddressUse) in value = vocab::PostalAddressUse::BAD or value = vocab::PostalAddressUse::DIR or value = vocab::PostalAddressUse::H or value = vocab::PostalAddressUse::HP or value = vocab::PostalAddressUse::HV or value = vocab::PostalAddressUse::PHYS or value = vocab::PostalAddressUse::PST or value = vocab::PostalAddressUse::PUB or value = vocab::PostalAddressUse::TMP or value = vocab::PostalAddressUse::WP) )))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr use=""/>
</assignedEntity>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.121
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityTELUse

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) each SHALL contain at least one [1..*] telecom with data type tel (CONF:5622) telecom SHOULD contain zero or one [0..1] @use (CONF:8000)

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null).telecom->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<telecom/>
</assignedEntity>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<telecom use="HP"/>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.045
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityPersonName

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) each SHALL contain exactly one [1..1] assignedperson, where (CONF:5624) assignedPerson SHALL contain exactly one [1..1] name (CONF:9406)

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null).assignedPerson->excluding(null)->reject((name->isEmpty() or name->exists(element | element.isNullFlavorUndefined())) implies (not name->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<assignedPerson/>
</assignedEntity>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity/>
</authenticator>
</ClinicalDocument>

0.056
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityHasNationalProviderIdentifier

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) assignedEntity SHOULD include zero or one [0..1] id where id/@root ="2.16.840.1.113883.4.6" National Provider Identifier (CONF:10027)

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null)->reject(id->exists( root='2.16.840.1.113883.4.6' ))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity/>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<id root="2.16.840.1.113883.4.6"/>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.026
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityAddr

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) assignedEntity SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220)

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null)->reject((addr->isEmpty() or addr->exists(element | element.isNullFlavorUndefined())) implies (not addr->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity/>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<addr/>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.050
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityCode

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) assignedEntity SHALL contain exactly one [1..1] code (CONF:8888)

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not code.oclIsUndefined() and code.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = code.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.6.101' and not value.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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity/>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<code code="" codeSystem="2.16.840.1.113883.6.101"/>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.094
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityCodeP

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) assignedEntity SHOULD contain zero or one [0..1] code (CONF:14912), where the @code SHALL be selected from ValueSet Healthcare Provider Taxonomy (NUCC - HIPAA) 2.16.840.1.114222.4.11.1066 DYNAMIC (CONF:14913)

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not 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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity/>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<code code="" codeSystem="2.16.840.1.113883.6.101"/>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.049
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityId

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) assignedEntity SHALL contain at least one [1..*] id (CONF:8887)

OCL

self.authenticator->excluding(null).assignedEntity->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity/>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<id/>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.049
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityTelecom

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) assignedEntity SHALL contain at least one [1..*] telecom with data type TEL (CONF:5622)

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null)->reject((telecom->isEmpty() or telecom->exists(element | element.isNullFlavorUndefined())) implies (not telecom->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity/>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<telecom/>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.051
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityAssignedPerson

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:5612) assignedEntity SHALL contain exactly one [1..1] assignedPerson, where its type is Person (CONF:5624)

OCL

self.authenticator->excluding(null).assignedEntity->excluding(null)->reject(assignedPerson->one(assignedPerson : cda::Person | not assignedPerson.oclIsUndefined() and assignedPerson.oclIsKindOf(cda::Person)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity/>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<assignedEntity>
<assignedPerson/>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.034
testValidateGeneralHeaderConstraintsAuthenticatorTime

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) authenticator SHALL contain exactly one [1..1] time (CONF:5608)

OCL

self.authenticator->excluding(null)->reject((time.oclIsUndefined() or time.isNullFlavorUndefined()) implies (not time.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<time/>
</authenticator>
</ClinicalDocument>

0.042
testValidateGeneralHeaderConstraintsAuthenticatorSignatureCode

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) authenticator SHALL contain exactly one [1..1] signatureCode/@code="S" (CodeSystem: 2.16.840.1.113883.5.89 Participationsignature) (CONF:5610)

OCL

self.authenticator->excluding(null)->reject((signatureCode.oclIsUndefined() or signatureCode.isNullFlavorUndefined()) implies (not signatureCode.oclIsUndefined() and signatureCode.oclIsKindOf(datatypes::CS) and let value : datatypes::CS = signatureCode.oclAsType(datatypes::CS) in value.code = 'S'))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<signatureCode code="S"/>
</authenticator>
</ClinicalDocument>

0.084
testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntity

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authenticator (CONF:5607) authenticator SHALL contain exactly one [1..1] assignedEntity, where its type is Assigned Entity (CONF:5612)

OCL

self.authenticator->excluding(null)->reject(assignedEntity->one(assignedEntity : cda::AssignedEntity | not assignedEntity.oclIsUndefined() and assignedEntity.oclIsKindOf(cda::AssignedEntity)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<signatureCode code="s"/>
</authenticator>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authenticator>
<signatureCode code="s"/>
<assignedEntity>
<telecom/>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.029
testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStreet

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] assignedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHALL contain at least one and not more than 4 streetAddressLine (CONF:7291)

OCL

self.informant->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject(isNullFlavorUndefined() implies ( streetAddressLine->size() >=1 and streetAddressLine->size() <=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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine></addr>
</assignedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr/>
</assignedEntity>
</informant>
</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">
<informant>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</informant>
</ClinicalDocument>

0.069
testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressCity

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] assignedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHALL contain exactly one [1..1] city (CONF:7292)

OCL

self.informant->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((city->isEmpty() or city->exists(element | element.isNullFlavorUndefined())) implies (city->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr/>
</assignedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</informant>
</ClinicalDocument>

0.072
testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressCountry

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] assignedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHOULD contain zero or one [0..1] country (CONF:7295)

OCL

self.informant->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((country->isEmpty() or country->exists(element | element.isNullFlavorUndefined())) implies (not country->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr/>
</assignedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</informant>
</ClinicalDocument>

0.070
testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressPostalCode

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] assignedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHOULD contain zero or one [0..1] postalCode (CONF:7294)

OCL

self.informant->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((postalCode->isEmpty() or postalCode->exists(element | element.isNullFlavorUndefined())) implies (not postalCode->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr/>
</assignedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</informant>
</ClinicalDocument>

0.070
testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressState

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] assignedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHOULD contain zero or one [0..1] state (CONF:7293)

OCL

self.informant->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((state->isEmpty() or state->exists(element | element.isNullFlavorUndefined())) implies (not state->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr/>
</assignedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</informant>
</ClinicalDocument>

0.070
testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStreetAddressLine

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] assignedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHALL contain at least one [1..*] streetAddressLine (CONF:7291)

OCL

self.informant->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((streetAddressLine->isEmpty() or streetAddressLine->exists(element | element.isNullFlavorUndefined())) implies (not streetAddressLine->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr/>
</assignedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</informant>
</ClinicalDocument>

0.070
testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressUseP

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] assignedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.informant->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr/>
</assignedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</informant>
</ClinicalDocument>

0.043
testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressUse

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] assignedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.informant->excluding(null).assignedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (use->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(vocab::PostalAddressUse) and let value : vocab::PostalAddressUse = element.oclAsType(vocab::PostalAddressUse) in value = vocab::PostalAddressUse::BAD or value = vocab::PostalAddressUse::DIR or value = vocab::PostalAddressUse::H or value = vocab::PostalAddressUse::HP or value = vocab::PostalAddressUse::HV or value = vocab::PostalAddressUse::PHYS or value = vocab::PostalAddressUse::PST or value = vocab::PostalAddressUse::PUB or value = vocab::PostalAddressUse::TMP or value = vocab::PostalAddressUse::WP) )))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr use=""/>
</assignedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedEntity>
</informant>
</ClinicalDocument>

0.123
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationHasNationalProviderIdentifier

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each MAY contain zero or one [0..1] providerOrganization, where (CONF:5416) providerOrganization The id SHOULD include zero or one [0..1] id where id/@root ="2.16.840.1.113883.4.6" National Provider Identifier (CONF:9996) (CONF:9996)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).providerOrganization->excluding(null)->reject(id->exists( root='2.16.840.1.113883.4.6' ))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<id root="2.16.840.1.113883.4.6"/>
</providerOrganization>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.032
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianAddr

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or more [0..*] guardian, where (CONF:5325) guardian SHOULD contain zero or more [0..*] addr with data type USRealmAddress

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).guardian->excluding(null)->reject((addr->isEmpty() or addr->exists(element | element.isNullFlavorUndefined())) implies (not addr->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<addr/>
</guardian>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.062
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianCode

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or more [0..*] guardian, where (CONF:5325) guardian SHOULD contain zero or one [0..1] code, where the @code SHALL be selected from ValueSet Personal Relationship Role Type 2.16.840.1.113883.1.11.19563 STATIC 1 (CONF:5326)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).guardian->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not code.oclIsUndefined() and code.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = code.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.5.111' and (value.code = 'ADOPT' or value.code = 'AUNT' or value.code = 'CHILD' or value.code = 'CHLDINLAW' or value.code = 'COUSN' or value.code = 'DOMPART' or value.code = 'FAMMEMB' or value.code = 'CHLDFOST' or value.code = 'GRNDCHILD' or value.code = 'GPARNT' or value.code = 'GRPRN' or value.code = 'GGRPRN' or value.code = 'HSIB' or value.code = 'MAUNT' or value.code = 'MCOUSN' or value.code = 'MGRPRN' or value.code = 'MGGRPRN' or value.code = 'MUNCLE' or value.code = 'NCHILD' or value.code = 'NPRN' or value.code = 'NSIB' or value.code = 'NBOR' or value.code = 'NIENEPH' or value.code = 'PRN' or value.code = 'PRNINLAW' or value.code = 'PAUNT' or value.code = 'PCOUSN' or value.code = 'PGRPRN' or value.code = 'PGGRPRN' or value.code = 'PUNCLE' or value.code = 'ROOM' or value.code = 'SIB' or value.code = 'SIBINLAW' or value.code = 'SIGOTHR' or value.code = 'SPS' or value.code = 'STEP' or value.code = 'STPPRN' or value.code = 'STPSIB' or value.code = 'UNCLE' or value.code = 'FRND')))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<code code="SPS" codeSystem="2.16.840.1.113883.5.111"/>
<addr/>
</guardian>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.541
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianCodeP

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or more [0..*] guardian, where (CONF:5325) guardian SHOULD contain zero or one [0..1] code, where the @code SHALL be selected from ValueSet Personal Relationship Role Type 2.16.840.1.113883.1.11.19563 STATIC 1 (CONF:5326)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).guardian->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not 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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<code code="HUSB" codeSystem="2.16.840.1.113883.5.111"/>
<addr/>
</guardian>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.061
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTelecom

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or more [0..*] guardian, where (CONF:5325) guardian MAY contain zero or more [0..*] telecom with data type TEL

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).guardian->excluding(null)->reject((telecom->isEmpty() or telecom->exists(element | element.isNullFlavorUndefined())) implies (not telecom->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<telecom/>
</guardian>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.065
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianGuardianPerson

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or more [0..*] guardian, where (CONF:5325) guardian SHALL contain exactly one [1..1] guardianPerson, where its type is Person

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).guardian->excluding(null)->reject(guardianPerson->one(guardianPerson : cda::Person | not guardianPerson.oclIsUndefined() and guardianPerson.oclIsKindOf(cda::Person)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<guardianPerson/>
</guardian>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.047
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimePreciseToYear

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) patient SHALL satisfy: BirthTime precise to year

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject(not birthTime.value.oclIsUndefined() and birthTime.value.size() >= 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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<birthTime value="10"/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<birthTime value="1980"/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.054
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimePreciseToDay

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) patient SHOULD satisfy: BirthTime precise to day

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject(not birthTime.value.oclIsUndefined() and birthTime.value.size() >= 6)

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<birthTime/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<birthTime value="19800101"/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.054
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientAdministrativeGenderCode

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) patient SHALL contain exactly one [1..1] administrativeGenderCode, where the @code SHALL be selected from ValueSet Administrative Gender (HL7 V3) 2.16.840.1.113883.1.11.1 DYNAMIC (CONF:6394)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject((administrativeGenderCode.oclIsUndefined() or administrativeGenderCode.isNullFlavorUndefined()) implies (not administrativeGenderCode.oclIsUndefined() and administrativeGenderCode.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = administrativeGenderCode.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.5.1' and (value.code = 'F' or value.code = 'M' or value.code = 'UN')))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<birthplace>
<place/>
</birthplace>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<administrativeGenderCode code="F" codeSystem="2.16.840.1.113883.5.1"/>
<birthplace>
<place/>
</birthplace>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.122
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplacePlaceAddr

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or one [0..1] birthplace, where (CONF:5395) each SHALL contain exactly one [1..1] place, where (CONF:5396) place SHALL contain exactly one [1..1] addr (CONF:5397)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).birthplace->excluding(null).place->excluding(null)->reject((addr.oclIsUndefined() or addr.isNullFlavorUndefined()) implies (not addr.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<birthplace>
<place/>
</birthplace>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<birthplace>
<place>
<addr/>
</place>
</birthplace>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.066
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplacePlace

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or one [0..1] birthplace, where (CONF:5395) birthplace SHALL contain exactly one [1..1] place, where its type is Place (CONF:5396)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).birthplace->excluding(null)->reject(place->one(place : cda::Place | not place.oclIsUndefined() and place.oclIsKindOf(cda::Place)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<birthplace/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<birthplace>
<place/>
</birthplace>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.047
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianPersonName

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each MAY contain zero or more [0..*] guardian, where (CONF:5325) each SHALL contain exactly one [1..1] guardianperson, where guardianPerson SHALL contain exactly one [1..1] name (CONF:9406)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).guardian->excluding(null).guardianPerson->excluding(null)->reject((name->isEmpty() or name->exists(element | element.isNullFlavorUndefined())) implies (not name->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<guardianPerson/>
</guardian>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian>
<guardianPerson>
<name/>
</guardianPerson>
</guardian>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.069
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationPreferenceInd

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each SHOULD contain zero or more [0..*] languageCommunication, where (CONF:5406) languageCommunication MAY contain zero or one [0..1] preferenceInd (CONF:5414)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).languageCommunication->excluding(null)->reject((preferenceInd.oclIsUndefined() or preferenceInd.isNullFlavorUndefined()) implies (not preferenceInd.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<languageCommunication/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<languageCommunication>
<preferenceInd value="true"/>
</languageCommunication>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.054
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationProficiencyLevelCode

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each SHOULD contain zero or more [0..*] languageCommunication, where (CONF:5406) languageCommunication SHOULD contain zero or one [0..1] proficiencyLevelCode, where the @code SHALL be selected from ValueSet LanguageAbilityProficiency 2.16.840.1.113883.1.11.12199 STATIC (CONF:9965)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).languageCommunication->excluding(null)->reject((proficiencyLevelCode.oclIsUndefined() or proficiencyLevelCode.isNullFlavorUndefined()) implies (not proficiencyLevelCode.oclIsUndefined() and proficiencyLevelCode.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = proficiencyLevelCode.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.5.61' and (value.code = 'E' or value.code = 'F' or value.code = 'G' or value.code = 'P')))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<languageCommunication/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<languageCommunication>
<proficiencyLevelCode code="E" codeSystem="2.16.840.1.113883.5.61" codeSystemName="" displayName=""/>
</languageCommunication>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.128
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationProficiencyLevelCodeP

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each SHOULD contain zero or more [0..*] languageCommunication, where (CONF:5406) languageCommunication SHOULD contain zero or one [0..1] proficiencyLevelCode, where the @code SHALL be selected from ValueSet LanguageAbilityProficiency 2.16.840.1.113883.1.11.12199 STATIC (CONF:9965)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).languageCommunication->excluding(null)->reject((proficiencyLevelCode.oclIsUndefined() or proficiencyLevelCode.isNullFlavorUndefined()) implies (not proficiencyLevelCode.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<languageCommunication/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<languageCommunication>
<proficiencyLevelCode code="E" codeSystem="2.16.840.1.113883.5.61" codeSystemName="" displayName=""/>
</languageCommunication>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.056
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationModeCode

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each SHOULD contain zero or more [0..*] languageCommunication, where (CONF:5406) languageCommunication MAY contain zero or one [0..1] modeCode, where the @code SHALL be selected from ValueSet HL7 LanguageAbilityMode 2.16.840.1.113883.1.11.12249 STATIC 1 (CONF:5409)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).languageCommunication->excluding(null)->reject((modeCode.oclIsUndefined() or modeCode.isNullFlavorUndefined()) implies (not modeCode.oclIsUndefined() and modeCode.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = modeCode.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.5.60' and (value.code = 'ESGN' or value.code = 'ESP' or value.code = 'EWR' or value.code = 'RSGN' or value.code = 'RSP' or value.code = 'RWR')))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<languageCommunication/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<languageCommunication>
<modeCode code="ESGN" codeSystem="2.16.840.1.113883.5.60" codeSystemName="" displayName=""/>
</languageCommunication>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.151
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationModeCodeP

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) each SHOULD contain zero or more [0..*] languageCommunication, where (CONF:5406) languageCommunication MAY contain zero or one [0..1] modeCode, where the @code SHALL be selected from ValueSet HL7 LanguageAbilityMode 2.16.840.1.113883.1.11.12249 STATIC 1 (CONF:5409)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).languageCommunication->excluding(null)->reject((modeCode.oclIsUndefined() or modeCode.isNullFlavorUndefined()) implies (not modeCode.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<languageCommunication/>
</patient>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<languageCommunication>
<modeCode code="ESGN" codeSystem="2.16.840.1.113883.5.60" codeSystemName="" displayName=""/>
</languageCommunication>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.056
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTime

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) patient SHALL contain exactly one [1..1] birthTime (CONF:5298)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject((birthTime.oclIsUndefined() or birthTime.isNullFlavorUndefined()) implies (not birthTime.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<birthTime/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.055
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCode

Constraint

Mu2consol General Header Constraints SHALL contain at least one [1..*] recordTarget each SHALL contain exactly one [1..1] patientRole, where patient Role SHALL contain exactly one [1..1] patient, where patient SHALL contain exactly one [1..1] ethnicGroupCode, where the @code SHALL be selected from OMB Standards for the Classification of Federal Data on Race and Ethnicity.

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject((ethnicGroupCode.oclIsUndefined() or ethnicGroupCode.isNullFlavorUndefined()) implies (not ethnicGroupCode.oclIsUndefined() and ethnicGroupCode.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = ethnicGroupCode.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.6.238' and (value.code = '2135-2' or value.code = '2186-5')))

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.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient/>
</patientRole>
</recordTarget>
</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.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<ethnicGroupCode code="2135-2" codeSystem="2.16.840.1.113883.6.238"/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.116
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientMaritalStatusCodeP

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) patient SHOULD contain zero or one [0..1] maritalStatusCode (CONF:5303), where the @code SHALL be selected from ValueSet HL7 Marital Status 2.16.840.1.113883.1.11.12212 STATIC 1

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject((maritalStatusCode.oclIsUndefined() or maritalStatusCode.isNullFlavorUndefined()) implies (not maritalStatusCode.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<maritalStatusCode code="A" codeSystem="2.16.840.1.113883.5.2"/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.058
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodeP

Constraint

Mu2consol General Header Constraints SHALL contain at least one [1..*] recordTarget each SHALL contain exactly one [1..1] patientRole, where patient Role SHALL contain exactly one [1..1] patient, where patient SHALL contain exactly one [1..1] ethnicGroupCode, where the @code SHALL be selected from OMB Standards for the Classification of Federal Data on Race and Ethnicity.

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject((ethnicGroupCode.oclIsUndefined() or ethnicGroupCode.isNullFlavorUndefined()) implies (not ethnicGroupCode.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.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient/>
</patientRole>
</recordTarget>
</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.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<ethnicGroupCode code="2135-2" codeSystem="2.16.840.1.113883.6.238"/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.069
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientMaritalStatusCode

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) patient SHOULD contain zero or one [0..1] maritalStatusCode (CONF:5303), where the @code SHALL be selected from ValueSet HL7 Marital Status 2.16.840.1.113883.1.11.12212 STATIC 1

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject((maritalStatusCode.oclIsUndefined() or maritalStatusCode.isNullFlavorUndefined()) implies (not maritalStatusCode.oclIsUndefined() and maritalStatusCode.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = maritalStatusCode.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.5.2' and (value.code = 'A' or value.code = 'D' or value.code = 'I' or value.code = 'L' or value.code = 'M' or value.code = 'P' or value.code = 'S' or value.code = 'T' or value.code = 'W')))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient/>
</patientRole>
</recordTarget>
</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">
<recordTarget>
<patientRole>
<patient>
<maritalStatusCode code="A" codeSystem="2.16.840.1.113883.5.2"/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.199
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientName

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) patient SHALL contain exactly one [1..1] name with data type USRealmPatientName (CONF:5284)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject((name->isEmpty() or name->exists(element | element.isNullFlavorUndefined())) implies (name->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<name/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.059
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodeP

Constraint

Mu2consol General Header Constraints SHALL contain at least one [1..*] recordTarget each SHALL contain exactly one [1..1] patientRole, where patient Role SHALL contain exactly one [1..1] patient, where patient SHALL contain exactly one [1..1] raceCode, where the @code SHALL be selected from OMB Standards for the Classification of Federal Data on Race and Ethnicity.

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject((raceCode.oclIsUndefined() or raceCode.isNullFlavorUndefined()) implies (not raceCode.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.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient/>
</patientRole>
</recordTarget>
</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.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<raceCode code="1111111111" codeSystem="2.16.840.1.113883.6.238"/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.055
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCode

Constraint

Mu2consol General Header Constraints SHALL contain at least one [1..*] recordTarget each SHALL contain exactly one [1..1] patientRole, where patient Role SHALL contain exactly one [1..1] patient, where patient SHALL contain exactly one [1..1] raceCode, where the @code SHALL be selected from OMB Standards for the Classification of Federal Data on Race and Ethnicity.

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject((raceCode.oclIsUndefined() or raceCode.isNullFlavorUndefined()) implies (not raceCode.oclIsUndefined() and raceCode.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = raceCode.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.6.238' and (value.code = '1002-5' or value.code = '2028-9' or value.code = '2076-8' or value.code = '2106-3' or value.code = '2054-5')))

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.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient/>
</patientRole>
</recordTarget>
</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.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<raceCode code="2054-5" codeSystem="2.16.840.1.113883.6.238"/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.103
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientReligiousAffiliationCodeP

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) patient MAY contain zero or one [0..1] religiousAffiliationCode (CONF:5317), where the @code SHALL be selected from ValueSet HL7 Religious Affiliation 2.16.840.1.113883.1.11.19185 STATIC 1

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject((religiousAffiliationCode.oclIsUndefined() or religiousAffiliationCode.isNullFlavorUndefined()) implies (not religiousAffiliationCode.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<religiousAffiliationCode code="1026" codeSystem="2.16.840.1.113883.5.1076"/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.055
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientReligiousAffiliationCode

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) patient MAY contain zero or one [0..1] religiousAffiliationCode (CONF:5317), where the @code SHALL be selected from ValueSet HL7 Religious Affiliation 2.16.840.1.113883.1.11.19185 STATIC 1

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject((religiousAffiliationCode.oclIsUndefined() or religiousAffiliationCode.isNullFlavorUndefined()) implies (not religiousAffiliationCode.oclIsUndefined() and religiousAffiliationCode.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = religiousAffiliationCode.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.5.1076' and not value.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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<religiousAffiliationCode code="1026" codeSystem="2.16.840.1.113883.5.1076"/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.102
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientSDTCRaceCodeP

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) patient MAY contain zero or more [0..*] sDTCRaceCode, where the @code SHALL be selected from ValueSet Race 2.16.840.1.113883.1.11.14914 STATIC 1 (CONF:7263)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject((sDTCRaceCode->isEmpty() or sDTCRaceCode->exists(element | element.isNullFlavorUndefined())) implies (not sDTCRaceCode->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient/>
</patientRole>
</recordTarget>
</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" xmlns:sdtc="urn:hl7-org:sdtc" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<sdtc:raceCode code="2058-6" codeSystem="2.16.840.1.113883.6.238"/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.057
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientSDTCRaceCode

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) patient MAY contain zero or more [0..*] sDTCRaceCode, where the @code SHALL be selected from ValueSet Race 2.16.840.1.113883.1.11.14914 STATIC 1 (CONF:7263)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject((sDTCRaceCode->isEmpty() or sDTCRaceCode->exists(element | element.isNullFlavorUndefined())) implies (sDTCRaceCode->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = element.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.6.238' and not value.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" xmlns:sdtc="urn:hl7-org:sdtc" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<sdtc:raceCode/>
</patient>
</patientRole>
</recordTarget>
</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" xmlns:sdtc="urn:hl7-org:sdtc" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<sdtc:raceCode code="2058-6" codeSystem="2.16.840.1.113883.6.238"/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.095
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardian

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) patient MAY contain zero or more [0..*] guardian, where its type is Guardian (CONF:5325)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject(guardian->exists(guardian : cda::Guardian | not guardian.oclIsUndefined() and guardian.oclIsKindOf(cda::Guardian)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<guardian/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.041
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplace

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patient Role SHALL contain exactly one [1..1] patient, where (CONF:5283) patient MAY contain zero or one [0..1] birthplace, where its type is Birthplace (CONF:5395)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject(birthplace->one(birthplace : cda::Birthplace | not birthplace.oclIsUndefined() and birthplace.oclIsKindOf(cda::Birthplace)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<birthplace/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.041
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunication

Constraint

Mu2consol General Header Constraints SHALL contain at least one [1..*] recordTarget each SHALL contain exactly one [1..1] patientRole, where patient Role SHALL contain exactly one [1..1] patient, where patient SHALL contain exactly one [1..1] languageCommunication, where its type is Language Communication

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null)->reject(languageCommunication->one(languageCommunication : cda::LanguageCommunication | not languageCommunication.oclIsUndefined() and languageCommunication.oclIsKindOf(cda::LanguageCommunication)))

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.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient/>
</patientRole>
</recordTarget>
</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.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient>
<languageCommunication/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.038
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStreet

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each MAY contain zero or one [0..1] providerOrganization, where (CONF:5416) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5422) addr SHALL contain at least one and not more than 4 streetAddressLine (CONF:7291)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).providerOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject(isNullFlavorUndefined() implies ( streetAddressLine->size() >=1 and streetAddressLine->size() <=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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine></addr>
</providerOrganization>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr/>
</providerOrganization>
</patientRole>
</recordTarget>
</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">
<recordTarget>
<patientRole>
<providerOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</providerOrganization>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.076
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressCity

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each MAY contain zero or one [0..1] providerOrganization, where (CONF:5416) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5422) addr SHALL contain exactly one [1..1] city (CONF:7292)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).providerOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((city->isEmpty() or city->exists(element | element.isNullFlavorUndefined())) implies (city->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr/>
</providerOrganization>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</providerOrganization>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.081
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressCountry

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each MAY contain zero or one [0..1] providerOrganization, where (CONF:5416) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5422) addr SHOULD contain zero or one [0..1] country (CONF:7295)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).providerOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((country->isEmpty() or country->exists(element | element.isNullFlavorUndefined())) implies (not country->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr/>
</providerOrganization>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</providerOrganization>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.078
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressPostalCode

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each MAY contain zero or one [0..1] providerOrganization, where (CONF:5416) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5422) addr SHOULD contain zero or one [0..1] postalCode (CONF:7294)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).providerOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((postalCode->isEmpty() or postalCode->exists(element | element.isNullFlavorUndefined())) implies (not postalCode->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr/>
</providerOrganization>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</providerOrganization>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.077
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressState

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each MAY contain zero or one [0..1] providerOrganization, where (CONF:5416) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5422) addr SHOULD contain zero or one [0..1] state (CONF:7293)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).providerOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((state->isEmpty() or state->exists(element | element.isNullFlavorUndefined())) implies (not state->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr/>
</providerOrganization>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</providerOrganization>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.078
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStreetAddressLine

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each MAY contain zero or one [0..1] providerOrganization, where (CONF:5416) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5422) addr SHALL contain at least one [1..*] streetAddressLine (CONF:7291)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).providerOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((streetAddressLine->isEmpty() or streetAddressLine->exists(element | element.isNullFlavorUndefined())) implies (not streetAddressLine->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr/>
</providerOrganization>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</providerOrganization>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.077
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressUseP

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each MAY contain zero or one [0..1] providerOrganization, where (CONF:5416) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5422) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).providerOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr/>
</providerOrganization>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</providerOrganization>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.049
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressUse

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each MAY contain zero or one [0..1] providerOrganization, where (CONF:5416) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5422) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).providerOrganization->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (use->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(vocab::PostalAddressUse) and let value : vocab::PostalAddressUse = element.oclAsType(vocab::PostalAddressUse) in value = vocab::PostalAddressUse::BAD or value = vocab::PostalAddressUse::DIR or value = vocab::PostalAddressUse::H or value = vocab::PostalAddressUse::HP or value = vocab::PostalAddressUse::HV or value = vocab::PostalAddressUse::PHYS or value = vocab::PostalAddressUse::PST or value = vocab::PostalAddressUse::PUB or value = vocab::PostalAddressUse::TMP or value = vocab::PostalAddressUse::WP) )))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr use=""/>
</providerOrganization>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</providerOrganization>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.131
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTELUse

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each MAY contain zero or one [0..1] providerOrganization, where (CONF:5416) each SHALL contain at least one [1..*] telecom with data type tel (CONF:5420) telecom SHOULD contain zero or one [0..1] @use (CONF:8000)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).providerOrganization->excluding(null).telecom->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<telecom/>
</providerOrganization>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<telecom use="HP"/>
</providerOrganization>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.054
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationAddr

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each MAY contain zero or one [0..1] providerOrganization, where (CONF:5416) providerOrganization SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5422)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).providerOrganization->excluding(null)->reject((addr->isEmpty() or addr->exists(element | element.isNullFlavorUndefined())) implies (not addr->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<addr/>
</providerOrganization>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.057
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationId

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each MAY contain zero or one [0..1] providerOrganization, where (CONF:5416) providerOrganization SHALL contain at least one [1..*] id (CONF:5417)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).providerOrganization->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<id/>
</providerOrganization>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.057
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationName

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each MAY contain zero or one [0..1] providerOrganization, where (CONF:5416) providerOrganization SHALL contain at least one [1..*] name (CONF:5419)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).providerOrganization->excluding(null)->reject((name->isEmpty() or name->exists(element | element.isNullFlavorUndefined())) implies (not name->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<name/>
</providerOrganization>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.058
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTelecom

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) each MAY contain zero or one [0..1] providerOrganization, where (CONF:5416) providerOrganization SHALL contain at least one [1..*] telecom with data type TEL (CONF:5420)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).providerOrganization->excluding(null)->reject((telecom->isEmpty() or telecom->exists(element | element.isNullFlavorUndefined())) implies (not telecom->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization/>
</patientRole>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization>
<telecom/>
</providerOrganization>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.058
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCode

Constraint

Mu2consol General Header Constraints SHALL contain at least one [1..*] recordTarget each SHALL contain exactly one [1..1] patientRole, where patient Role SHALL contain exactly one [1..1] patient, where each SHALL contain exactly one [1..1] languageCommunication, where languageCommunication SHALL contain exactly one [1..1] languageCode, where the @code SHALL be selected from the set of alpha-3 codes of ISO 639-2 that are in ISO 639-1.

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).languageCommunication->excluding(null)->reject((languageCode.oclIsUndefined() or languageCode.isNullFlavorUndefined()) implies (not languageCode.oclIsUndefined() and languageCode.oclIsKindOf(datatypes::CS) and let value : datatypes::CS = languageCode.oclAsType(datatypes::CS) in value.code = 'aar' or value.code = 'abk' or value.code = 'afr' or value.code = 'aka' or value.code = 'sqi' or value.code = 'amh' or value.code = 'ara' or value.code = 'arg' or value.code = 'hye' or value.code = 'asm' or value.code = 'ava' or value.code = 'ave' or value.code = 'aym' or value.code = 'aze' or value.code = 'bak' or value.code = 'bam' or value.code = 'eus' or value.code = 'bel' or value.code = 'ben' or value.code = 'bih' or value.code = 'bis' or value.code = 'bod' or value.code = 'bos' or value.code = 'bre' or value.code = 'bul' or value.code = 'mya' or value.code = 'cat' or value.code = 'ces' or value.code = 'cha' or value.code = 'che' or value.code = 'zho' or value.code = 'chu' or value.code = 'chv' or value.code = 'cor' or value.code = 'cos' or value.code = 'cre' or value.code = 'cym' or value.code = 'dan' or value.code = 'deu' or value.code = 'div' or value.code = 'nld' or value.code = 'dzo' or value.code = 'ell' or value.code = 'eng' or value.code = 'epo' or value.code = 'est' or value.code = 'ewe' or value.code = 'fao' or value.code = 'fas' or value.code = 'fij' or value.code = 'fin' or value.code = 'fra' or value.code = 'fry' or value.code = 'ful' or value.code = 'kat' or value.code = 'ger' or value.code = 'gla' or value.code = 'gle' or value.code = 'glg' or value.code = 'glv' or value.code = 'grn' or value.code = 'guj' or value.code = 'hat' or value.code = 'hau' or value.code = 'heb' or value.code = 'her' or value.code = 'hin' or value.code = 'hmo' or value.code = 'hrv' or value.code = 'hun' or value.code = 'ibo' or value.code = 'isl' or value.code = 'ido' or value.code = 'iii' or value.code = 'iku' or value.code = 'ile' or value.code = 'ina' or value.code = 'ind' or value.code = 'ipk' or value.code = 'ita' or value.code = 'jav' or value.code = 'jpn' or value.code = 'kal' or value.code = 'kan' or value.code = 'kas' or value.code = 'kau' or value.code = 'kaz' or value.code = 'khm' or value.code = 'kik' or value.code = 'kin' or value.code = 'kir' or value.code = 'kom' or value.code = 'kon' or value.code = 'kor' or value.code = 'kua' or value.code = 'kur' or value.code = 'lao' or value.code = 'lat' or value.code = 'lav' or value.code = 'lim' or value.code = 'lin' or value.code = 'lit' or value.code = 'ltz' or value.code = 'lub' or value.code = 'lug' or value.code = 'mkd' or value.code = 'mah' or value.code = 'mal' or value.code = 'mri' or value.code = 'mar' or value.code = 'msa' or value.code = 'mlg' or value.code = 'mlt' or value.code = 'mon' or value.code = 'nau' or value.code = 'nav' or value.code = 'nbl' or value.code = 'nde' or value.code = 'ndo' or value.code = 'nep' or value.code = 'nno' or value.code = 'nob' or value.code = 'nor' or value.code = 'nya' or value.code = 'oci' or value.code = 'oji' or value.code = 'ori' or value.code = 'orm' or value.code = 'oss' or value.code = 'pan' or value.code = 'pli' or value.code = 'pol' or value.code = 'por' or value.code = 'pus' or value.code = 'que' or value.code = 'roh' or value.code = 'ron' or value.code = 'run' or value.code = 'rus' or value.code = 'sag' or value.code = 'san' or value.code = 'sin' or value.code = 'slk' or value.code = 'slv' or value.code = 'sme' or value.code = 'smo' or value.code = 'sna' or value.code = 'snd' or value.code = 'som' or value.code = 'sot' or value.code = 'spa' or value.code = 'srd' or value.code = 'srp' or value.code = 'ssw' or value.code = 'sun' or value.code = 'swa' or value.code = 'swe' or value.code = 'tah' or value.code = 'tam' or value.code = 'tat' or value.code = 'tel' or value.code = 'tgk' or value.code = 'tgl' or value.code = 'tha' or value.code = 'tir' or value.code = 'ton' or value.code = 'tsn' or value.code = 'tso' or value.code = 'tuk' or value.code = 'tur' or value.code = 'twi' or value.code = 'uig' or value.code = 'ukr' or value.code = 'urd' or value.code = 'uzb' or value.code = 'ven' or value.code = 'vie' or value.code = 'vol' or value.code = 'wln' or value.code = 'wol' or value.code = 'xho' or value.code = 'yid' or value.code = 'yor' or value.code = 'zha' or value.code = 'zul'))

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">
<recordTarget>
<patientRole>
<patient>
<languageCommunication>
<languageCode code="abcd"/>
</languageCommunication>
</patient>
</patientRole>
</recordTarget>
</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">
<recordTarget>
<patientRole>
<patient>
<languageCommunication>
<languageCode code="zul"/>
</languageCommunication>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.096
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodeP

Constraint

Mu2consol General Header Constraints SHALL contain at least one [1..*] recordTarget each SHALL contain exactly one [1..1] patientRole, where patient Role SHALL contain exactly one [1..1] patient, where each SHALL contain exactly one [1..1] languageCommunication, where languageCommunication SHALL contain exactly one [1..1] languageCode, where the @code SHALL be selected from the set of alpha-3 codes of ISO 639-2 that are in ISO 639-1.

OCL

self.recordTarget->excluding(null).patientRole->excluding(null).patient->excluding(null).languageCommunication->excluding(null)->reject((languageCode.oclIsUndefined() or languageCode.isNullFlavorUndefined()) implies (not languageCode.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">
<recordTarget>
<patientRole>
<patient>
<languageCommunication/>
</patient>
</patientRole>
</recordTarget>
</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">
<recordTarget>
<patientRole>
<patient>
<languageCommunication>
<languageCode code="amh"/>
</languageCommunication>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.061
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleAddr

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patientRole SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5271)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null)->reject((addr->isEmpty() or addr->exists(element | element.isNullFlavorUndefined())) implies (not addr->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole/>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<addr/>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.051
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleId

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patientRole SHALL contain at least one [1..*] id (CONF:5268)

OCL

self.recordTarget->excluding(null).patientRole->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole/>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<id/>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.052
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleTelecom

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patientRole SHALL contain at least one [1..*] telecom with data type TEL (CONF:5280)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null)->reject((telecom->isEmpty() or telecom->exists(element | element.isNullFlavorUndefined())) implies (not telecom->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole/>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<telecom/>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.051
testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatient

Constraint

Mu2consol General Header Constraints SHALL contain at least one [1..*] recordTarget each SHALL contain exactly one [1..1] patientRole, where patientRole SHALL contain exactly one [1..1] patient, where its type is Patient

OCL

self.recordTarget->excluding(null).patientRole->excluding(null)->reject(patient->one(patient : cda::Patient | not patient.oclIsUndefined() and patient.oclIsKindOf(cda::Patient)))

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.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole/>
</recordTarget>
</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.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<patient/>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.036
testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganization

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] recordTarget (CONF:5266) each SHALL contain exactly one [1..1] patientRole, where (CONF:5268) patientRole MAY contain zero or one [0..1] providerOrganization, where its type is Provider Organization (CONF:5416)

OCL

self.recordTarget->excluding(null).patientRole->excluding(null)->reject(providerOrganization->one(providerOrganization : cda::Organization | not providerOrganization.oclIsUndefined() and providerOrganization.oclIsKindOf(cda::Organization)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole/>
</recordTarget>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole>
<providerOrganization/>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.035
testValidateGeneralHeaderConstraintsRecordTargetPatientRole

Constraint

Mu2consol General Header Constraints SHALL contain at least one [1..*] recordTarget recordTarget SHALL contain exactly one [1..1] patientRole, where its type is Patient Role

OCL

self.recordTarget->excluding(null)->reject(patientRole->one(patientRole : cda::PatientRole | not patientRole.oclIsUndefined() and patientRole.oclIsKindOf(cda::PatientRole)))

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.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget/>
</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.1"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<recordTarget>
<patientRole/>
</recordTarget>
</ClinicalDocument>

0.029
testValidateGeneralHeaderConstraintsComponentOfEncompassingEncounterEffectiveTime

Constraint

Consol General Header Constraints MAY contain exactly one [1..1] componentOf (CONF:9955) each SHALL contain exactly one [1..1] encompassingEncounter, where (CONF:9956) encompassingEncounter SHALL contain exactly one [1..1] effectiveTime (CONF:9958)

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.1"/>
<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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter>
<effectiveTime/>
</encompassingEncounter>
</componentOf>
</ClinicalDocument>

0.056
testValidateGeneralHeaderConstraintsComponentOfEncompassingEncounterId

Constraint

Consol General Header Constraints MAY contain exactly one [1..1] componentOf (CONF:9955) each SHALL contain exactly one [1..1] encompassingEncounter, where (CONF:9956) encompassingEncounter SHALL contain at least one [1..*] id (CONF:9959)

OCL

self.componentOf->excluding(null).encompassingEncounter->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.1"/>
<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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter>
<id/>
</encompassingEncounter>
</componentOf>
</ClinicalDocument>

0.052
testValidateGeneralHeaderConstraintsComponentOfEncompassingEncounter

Constraint

Consol General Header Constraints MAY contain exactly one [1..1] componentOf (CONF:9955) 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.1"/>
<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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<componentOf>
<encompassingEncounter/>
</componentOf>
</ClinicalDocument>

0.029
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStreet

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5452) addr SHALL contain at least one and not more than 4 streetAddressLine (CONF:7291)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject(isNullFlavorUndefined() implies ( streetAddressLine->size() >=1 and streetAddressLine->size() <=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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine></addr>
</assignedAuthor>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</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">
<author>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</ClinicalDocument>

0.072
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressCity

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5452) addr SHALL contain exactly one [1..1] city (CONF:7292)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((city->isEmpty() or city->exists(element | element.isNullFlavorUndefined())) implies (city->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</ClinicalDocument>

0.074
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressCountry

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5452) addr SHOULD contain zero or one [0..1] country (CONF:7295)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((country->isEmpty() or country->exists(element | element.isNullFlavorUndefined())) implies (not country->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</ClinicalDocument>

0.072
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressPostalCode

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5452) addr SHOULD contain zero or one [0..1] postalCode (CONF:7294)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((postalCode->isEmpty() or postalCode->exists(element | element.isNullFlavorUndefined())) implies (not postalCode->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</ClinicalDocument>

0.072
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressState

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5452) addr SHOULD contain zero or one [0..1] state (CONF:7293)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((state->isEmpty() or state->exists(element | element.isNullFlavorUndefined())) implies (not state->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</ClinicalDocument>

0.072
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStreetAddressLine

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5452) addr SHALL contain at least one [1..*] streetAddressLine (CONF:7291)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((streetAddressLine->isEmpty() or streetAddressLine->exists(element | element.isNullFlavorUndefined())) implies (not streetAddressLine->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</ClinicalDocument>

0.072
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressUseP

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5452) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr/>
</assignedAuthor>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</ClinicalDocument>

0.045
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressUse

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) each SHALL contain at least one [1..*] addr with data type USRealmAddress (CONF:5452) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.author->excluding(null).assignedAuthor->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (use->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(vocab::PostalAddressUse) and let value : vocab::PostalAddressUse = element.oclAsType(vocab::PostalAddressUse) in value = vocab::PostalAddressUse::BAD or value = vocab::PostalAddressUse::DIR or value = vocab::PostalAddressUse::H or value = vocab::PostalAddressUse::HP or value = vocab::PostalAddressUse::HV or value = vocab::PostalAddressUse::PHYS or value = vocab::PostalAddressUse::PST or value = vocab::PostalAddressUse::PUB or value = vocab::PostalAddressUse::TMP or value = vocab::PostalAddressUse::WP) )))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr use=""/>
</assignedAuthor>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</assignedAuthor>
</author>
</ClinicalDocument>

0.129
testValidateGeneralHeaderConstraintsAuthorAssignedAuthorTELUse

Constraint

Consol General Header Constraints SHALL contain at least one [1..*] author (CONF:5444) each SHALL contain exactly one [1..1] assignedAuthor, where (CONF:5448) each SHALL contain at least one [1..*] telecom with data type tel (CONF:5428) telecom SHOULD contain zero or one [0..1] @use (CONF:8000)

OCL

self.author->excluding(null).assignedAuthor->excluding(null).telecom->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<telecom/>
</assignedAuthor>
</author>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<author>
<assignedAuthor>
<telecom use="HP"/>
</assignedAuthor>
</author>
</ClinicalDocument>

0.047
testValidateGeneralHeaderConstraintsInformantRelatedEntityPersonName

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] relatedEntity, where each SHALL contain zero or one [0..1] relatedperson, where (CONF:8221) person SHALL contain exactly one [1..1] name (CONF:9406)

OCL

self.informant->excluding(null).relatedEntity->excluding(null).relatedPerson->excluding(null)->reject((name->isEmpty() or name->exists(element | element.isNullFlavorUndefined())) implies (not name->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<relatedPerson/>
</relatedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<relatedPerson>
<name/>
</relatedPerson>
</relatedEntity>
</informant>
</ClinicalDocument>

0.062
testValidateGeneralHeaderConstraintsInformantAssignedEntityAddr

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] assignedEntity, where assignedEntity SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220)

OCL

self.informant->excluding(null).assignedEntity->excluding(null)->reject((addr->isEmpty() or addr->exists(element | element.isNullFlavorUndefined())) implies (not addr->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity/>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<addr/>
</assignedEntity>
</informant>
</ClinicalDocument>

0.052
testValidateGeneralHeaderConstraintsInformantAssignedEntityCode

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] assignedEntity, where assignedEntity SHALL contain exactly one [1..1] code (CONF:8888)

OCL

self.informant->excluding(null).assignedEntity->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not code.oclIsUndefined() and code.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = code.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.6.101'))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity/>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<code code="207L00000X" codeSystem="2.16.840.1.113883.6.101"/>
</assignedEntity>
</informant>
</ClinicalDocument>

0.082
testValidateGeneralHeaderConstraintsInformantAssignedEntityCodeP

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] assignedEntity, where assignedEntity SHOULD contain zero or one [0..1] code (CONF:14912), where the @code SHALL be selected from ValueSet Healthcare Provider Taxonomy (NUCC - HIPAA) 2.16.840.1.114222.4.11.1066 DYNAMIC (CONF:14913)

OCL

self.informant->excluding(null).assignedEntity->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not 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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity/>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<code code="207L00000X" codeSystem="2.16.840.1.113883.6.101"/>
</assignedEntity>
</informant>
</ClinicalDocument>

0.051
testValidateGeneralHeaderConstraintsInformantAssignedEntityId

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] assignedEntity, where assignedEntity SHALL contain at least one [1..*] id (CONF:8887)

OCL

self.informant->excluding(null).assignedEntity->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity/>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<id/>
</assignedEntity>
</informant>
</ClinicalDocument>

0.052
testValidateGeneralHeaderConstraintsInformantAssignedEntityAssignedPerson

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] assignedEntity, where assignedEntity SHALL contain exactly one [1..1] assignedPerson, where its type is Person (CONF:5624)

OCL

self.informant->excluding(null).assignedEntity->excluding(null)->reject(assignedPerson->one(assignedPerson : cda::Person | not assignedPerson.oclIsUndefined() and assignedPerson.oclIsKindOf(cda::Person)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity/>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<assignedPerson/>
</assignedEntity>
</informant>
</ClinicalDocument>

0.036
testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStreet

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] relatedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHALL contain at least one and not more than 4 streetAddressLine (CONF:7291)

OCL

self.informant->excluding(null).relatedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject(isNullFlavorUndefined() implies ( streetAddressLine->size() >=1 and streetAddressLine->size() <=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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine><streetAddressLine>123</streetAddressLine></addr>
</relatedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr/>
</relatedEntity>
</informant>
</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">
<informant>
<relatedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</relatedEntity>
</informant>
</ClinicalDocument>

0.073
testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressCity

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] relatedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHALL contain exactly one [1..1] city (CONF:7292)

OCL

self.informant->excluding(null).relatedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((city->isEmpty() or city->exists(element | element.isNullFlavorUndefined())) implies (city->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr/>
</relatedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</relatedEntity>
</informant>
</ClinicalDocument>

0.075
testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressCountry

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] relatedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHOULD contain zero or one [0..1] country (CONF:7295)

OCL

self.informant->excluding(null).relatedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((country->isEmpty() or country->exists(element | element.isNullFlavorUndefined())) implies (not country->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr/>
</relatedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</relatedEntity>
</informant>
</ClinicalDocument>

0.074
testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressPostalCode

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] relatedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHOULD contain zero or one [0..1] postalCode (CONF:7294)

OCL

self.informant->excluding(null).relatedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((postalCode->isEmpty() or postalCode->exists(element | element.isNullFlavorUndefined())) implies (not postalCode->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr/>
</relatedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</relatedEntity>
</informant>
</ClinicalDocument>

0.074
testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressState

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] relatedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHOULD contain zero or one [0..1] state (CONF:7293)

OCL

self.informant->excluding(null).relatedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((state->isEmpty() or state->exists(element | element.isNullFlavorUndefined())) implies (not state->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr/>
</relatedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</relatedEntity>
</informant>
</ClinicalDocument>

0.073
testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStreetAddressLine

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] relatedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHALL contain at least one [1..*] streetAddressLine (CONF:7291)

OCL

self.informant->excluding(null).relatedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies ((streetAddressLine->isEmpty() or streetAddressLine->exists(element | element.isNullFlavorUndefined())) implies (not streetAddressLine->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr/>
</relatedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</relatedEntity>
</informant>
</ClinicalDocument>

0.073
testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressUseP

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] relatedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.informant->excluding(null).relatedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (not use->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr/>
</relatedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</relatedEntity>
</informant>
</ClinicalDocument>

0.046
testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressUse

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] relatedEntity, where each SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220) addr SHOULD contain zero or one [0..1] @use (CONF:7290), where the @code SHALL be selected from ValueSet PostalAddressUse 2.16.840.1.113883.1.11.10637 STATIC

OCL

self.informant->excluding(null).relatedEntity->excluding(null).addr->excluding(null)->select(isNullFlavorUndefined())->reject( ( isNullFlavorUndefined() implies (use->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(vocab::PostalAddressUse) and let value : vocab::PostalAddressUse = element.oclAsType(vocab::PostalAddressUse) in value = vocab::PostalAddressUse::BAD or value = vocab::PostalAddressUse::DIR or value = vocab::PostalAddressUse::H or value = vocab::PostalAddressUse::HP or value = vocab::PostalAddressUse::HV or value = vocab::PostalAddressUse::PHYS or value = vocab::PostalAddressUse::PST or value = vocab::PostalAddressUse::PUB or value = vocab::PostalAddressUse::TMP or value = vocab::PostalAddressUse::WP) )))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr use=""/>
</relatedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr use="HP"><streetAddressLine>123 Main Street</streetAddressLine><city>Boston</city><state>MA</state><country>US</country><postalCode>01001</postalCode></addr>
</relatedEntity>
</informant>
</ClinicalDocument>

0.128
testValidateGeneralHeaderConstraintsInformantHasAssignedEntityOrRelatedEntity

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) informant SHALL satisfy: contain exactly one [1..1] assignedEntity OR exactly one [1..1] relatedEntity (CONF:8002)

OCL

self.informant->excluding(null)->reject(assignedEntity.oclIsUndefined() xor relatedEntity.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity/>
<relatedEntity/>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity/>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity/>
</informant>
</ClinicalDocument>

0.032
testValidateGeneralHeaderConstraintsInformantAssignedEntity

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) informant MAY contain zero or one [0..1] assignedEntity, where its type is Assigned Entity

OCL

self.informant->excluding(null)->reject(assignedEntity->one(assignedEntity : cda::AssignedEntity | not assignedEntity.oclIsUndefined() and assignedEntity.oclIsKindOf(cda::AssignedEntity)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity/>
</informant>
</ClinicalDocument>

0.030
testValidateGeneralHeaderConstraintsInformantRelatedEntity

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) informant MAY contain zero or one [0..1] relatedEntity, where its type is Related Entity

OCL

self.informant->excluding(null)->reject(relatedEntity->one(relatedEntity : cda::RelatedEntity | not relatedEntity.oclIsUndefined() and relatedEntity.oclIsKindOf(cda::RelatedEntity)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity/>
</informant>
</ClinicalDocument>

0.029
testValidateGeneralHeaderConstraintsParticipantSupportAssociatedEntityHasAssociatedPersonOrScopingOrganization

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] participant (CONF:10003) supportParticipant Such participants, if present, SHALL have an associatedPerson or scopingOrganization element under participant/associatedEntity.

OCL

self.participant->excluding(null)->reject(associatedEntity.associatedPerson.oclIsUndefined() xor associatedEntity.scopingOrganization.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<participant>
<associatedEntity>
<associatedPerson/>
<scopingOrganization/>
</associatedEntity>
</participant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<participant>
<associatedEntity>
<scopingOrganization/>
</associatedEntity>
</participant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<participant>
<associatedEntity>
<associatedPerson/>
</associatedEntity>
</participant>
</ClinicalDocument>

0.034
testValidateGeneralHeaderConstraintsInformantRelatedEntityAddr

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] relatedEntity, where relatedEntity SHOULD contain zero or more [0..*] addr with data type USRealmAddress (CONF:8220)

OCL

self.informant->excluding(null).relatedEntity->excluding(null)->reject((addr->isEmpty() or addr->exists(element | element.isNullFlavorUndefined())) implies (not addr->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity/>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<addr/>
</relatedEntity>
</informant>
</ClinicalDocument>

0.053
testValidateGeneralHeaderConstraintsInformantRelatedEntityPerson

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] relatedEntity, where relatedEntity SHALL contain zero or one [0..1] relatedPerson, where its type is Person (CONF:8221)

OCL

self.informant->excluding(null).relatedEntity->excluding(null)->reject(relatedPerson->one(relatedPerson : cda::Person | not relatedPerson.oclIsUndefined() and relatedPerson.oclIsKindOf(cda::Person)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity/>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<relatedEntity>
<relatedPerson/>
</relatedEntity>
</informant>
</ClinicalDocument>

0.036
testValidateGeneralHeaderConstraintsInformantAssignedEntityPersonName

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] assignedEntity, where each SHALL contain exactly one [1..1] assignedperson, where (CONF:8221) assignedPerson SHALL contain exactly one [1..1] name (CONF:9406)

OCL

self.informant->excluding(null).assignedEntity->excluding(null).assignedPerson->excluding(null)->reject((name->isEmpty() or name->exists(element | element.isNullFlavorUndefined())) implies (not name->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<id/>
<assignedPerson/>
</assignedEntity>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<id/>
<assignedPerson>
<name/>
</assignedPerson>
</assignedEntity>
</informant>
</ClinicalDocument>

0.059
testValidateGeneralHeaderConstraintsInformantAssignedEntityHasNationalProviderIdentifier

Constraint

Consol General Header Constraints MAY contain zero or one [0..1] informant (CONF:8001) each MAY contain zero or one [0..1] assignedEntity, where assignedEntity SHOULD include zero or one [0..1] id where id/@root ="2.16.840.1.113883.4.6" National Provider Identifier (CONF:10027)

OCL

self.informant->excluding(null).assignedEntity->excluding(null)->reject(id->exists( root='2.16.840.1.113883.4.6' ))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity/>
</informant>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<informant>
<assignedEntity>
<id root="2.16.840.1.113883.4.6"/>
</assignedEntity>
</informant>
</ClinicalDocument>

0.028
testValidateGeneralHeaderConstraintsParticipantSupportTime

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] participant (CONF:10003) supportParticipant MAY contain zero or one [0..1] time (CONF:10004)

OCL

self.participant->excluding(null)->reject((time.oclIsUndefined() or time.isNullFlavorUndefined()) implies (not time.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<participant/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<participant>
<time/>
</participant>
</ClinicalDocument>

0.049
testValidateGeneralHeaderConstraintsInFulfillmentOfOrderId

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] inFulfillmentOf (CONF:9952) each SHALL contain exactly one [1..1] order, where (CONF:9953) 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.1"/>
<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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<inFulfillmentOf>
<order>
<id/>
</order>
</inFulfillmentOf>
</ClinicalDocument>

0.053
testValidateGeneralHeaderConstraintsInFulfillmentOfOrder

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] inFulfillmentOf (CONF:9952) 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.1"/>
<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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<inFulfillmentOf>
<order>
<id/>
</order>
</inFulfillmentOf>
</ClinicalDocument>

0.031
testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityHasNationalProviderIdentifier

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] documentationOf (CONF:14835) each SHALL contain exactly one [1..1] serviceEvent, where (CONF:14836) each SHOULD contain zero or more [0..*] performer, where (CONF:14839) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:14841) assignedEntity SHOULD include zero or one [0..1] id where id/@root ="2.16.840.1.113883.4.6" National Provider Identifier (CONF:10027)

OCL

self.documentationOf->excluding(null).serviceEvent->excluding(null).performer->excluding(null).assignedEntity->excluding(null)->reject(id->exists( root='2.16.840.1.113883.4.6' ))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<performer typeCode="PPRF">
<assignedEntity>
<id/>
</assignedEntity>
</performer>
</serviceEvent>
</documentationOf>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<performer typeCode="PPRF">
<assignedEntity>
<id root="2.16.840.1.113883.4.6"/>
</assignedEntity>
</performer>
</serviceEvent>
</documentationOf>
</ClinicalDocument>

0.041
testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityCodeP

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] documentationOf (CONF:14835) each SHALL contain exactly one [1..1] serviceEvent, where (CONF:14836) each SHOULD contain zero or more [0..*] performer, where (CONF:14839) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:14841) assignedEntity SHOULD contain zero or one [0..1] code (CONF:14912), where the @code SHALL be selected from ValueSet Healthcare Provider Taxonomy (NUCC - HIPAA) 2.16.840.1.114222.4.11.1066 DYNAMIC (CONF:14913)

OCL

self.documentationOf->excluding(null).serviceEvent->excluding(null).performer->excluding(null).assignedEntity->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not 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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<performer typeCode="PPRF">
<assignedEntity/>
</performer>
</serviceEvent>
</documentationOf>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<performer typeCode="PPRF">
<assignedEntity>
<code code="test" codeSystem="2.16.840.1.113883.6.101"/>
</assignedEntity>
</performer>
</serviceEvent>
</documentationOf>
</ClinicalDocument>

0.065
testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityCode

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] documentationOf (CONF:14835) each SHALL contain exactly one [1..1] serviceEvent, where (CONF:14836) each SHOULD contain zero or more [0..*] performer, where (CONF:14839) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:14841) assignedEntity SHALL contain exactly one [1..1] code (CONF:8888)

OCL

self.documentationOf->excluding(null).serviceEvent->excluding(null).performer->excluding(null).assignedEntity->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not code.oclIsUndefined() and code.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = code.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.6.101'))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<performer typeCode="PPRF">
<assignedEntity/>
</performer>
</serviceEvent>
</documentationOf>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<performer typeCode="PPRF">
<assignedEntity>
<code code="test" codeSystem="2.16.840.1.113883.6.101"/>
</assignedEntity>
</performer>
</serviceEvent>
</documentationOf>
</ClinicalDocument>

0.096
testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityId

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] documentationOf (CONF:14835) each SHALL contain exactly one [1..1] serviceEvent, where (CONF:14836) each SHOULD contain zero or more [0..*] performer, where (CONF:14839) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:14841) assignedEntity SHALL contain at least one [1..*] id (CONF:8887)

OCL

self.documentationOf->excluding(null).serviceEvent->excluding(null).performer->excluding(null).assignedEntity->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<performer typeCode="PPRF">
<assignedEntity/>
</performer>
</serviceEvent>
</documentationOf>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<performer typeCode="PPRF">
<assignedEntity>
<id/>
</assignedEntity>
</performer>
</serviceEvent>
</documentationOf>
</ClinicalDocument>

0.070
testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1FunctionCodeP

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] documentationOf (CONF:14835) each SHALL contain exactly one [1..1] serviceEvent, where (CONF:14836) each SHOULD contain zero or more [0..*] performer, where (CONF:14839) performer MAY contain zero or one [0..1] functionCode (CONF:16818), where the @code SHOULD be selected from (CodeSystem: 2.16.840.1.113883.5.88 ParticipationFunction) (CONF:16819)

OCL

self.documentationOf->excluding(null).serviceEvent->excluding(null).performer->excluding(null)->reject((functionCode.oclIsUndefined() or functionCode.isNullFlavorUndefined()) implies (not functionCode.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<performer typeCode="PPRF"/>
</serviceEvent>
</documentationOf>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<performer typeCode="PPRF">
<functionCode code="PRF" codeSystem="2.16.840.1.113883.5.88"/>
</performer>
</serviceEvent>
</documentationOf>
</ClinicalDocument>

0.058
testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1FunctionCode

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] documentationOf (CONF:14835) each SHALL contain exactly one [1..1] serviceEvent, where (CONF:14836) each SHOULD contain zero or more [0..*] performer, where (CONF:14839) performer MAY contain zero or one [0..1] functionCode (CONF:16818), where the @code SHOULD be selected from (CodeSystem: 2.16.840.1.113883.5.88 ParticipationFunction) (CONF:16819)

OCL

self.documentationOf->excluding(null).serviceEvent->excluding(null).performer->excluding(null)->reject((functionCode.oclIsUndefined() or functionCode.isNullFlavorUndefined()) implies (not functionCode.oclIsUndefined() and functionCode.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = functionCode.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.5.88'))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<performer typeCode="PPRF"/>
</serviceEvent>
</documentationOf>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<performer typeCode="PPRF">
<functionCode code="PRF" codeSystem="2.16.840.1.113883.5.88"/>
</performer>
</serviceEvent>
</documentationOf>
</ClinicalDocument>

0.091
testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1TypeCode

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] documentationOf (CONF:14835) each SHALL contain exactly one [1..1] serviceEvent, where (CONF:14836) each SHOULD contain zero or more [0..*] performer, where (CONF:14839) performer SHALL contain exactly one [1..1] @typeCode (CONF:14840)

OCL

self.documentationOf->excluding(null).serviceEvent->excluding(null).performer->excluding(null)->reject(isDefined('typeCode'))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<performer/>
</serviceEvent>
</documentationOf>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<performer typeCode="PRF"/>
</serviceEvent>
</documentationOf>
</ClinicalDocument>

0.027
testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntity

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] documentationOf (CONF:14835) each SHALL contain exactly one [1..1] serviceEvent, where (CONF:14836) each SHOULD contain zero or more [0..*] performer, where (CONF:14839) performer SHALL contain exactly one [1..1] assignedEntity, where its type is Assigned Entity (CONF:14841)

OCL

NO OCL FOUND FOR PROPERTY VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT_PERFORMER1_ASSIGNED_ENTITY__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">
<documentationOf>
<serviceEvent>
<performer/>
</serviceEvent>
</documentationOf>
</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">
<documentationOf>
<serviceEvent>
<performer>
<assignedEntity/>
</performer>
</serviceEvent>
</documentationOf>
</ClinicalDocument>

0.043
testValidateGeneralHeaderConstraintsDocumentationOfServiceEventEffectiveTimeLow

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] documentationOf (CONF:14835) each SHALL contain exactly one [1..1] serviceEvent, where (CONF:14836) serviceEvent effectiveTime SHALL contain exactly one [1..1] low (CONF:14838)

OCL

self.documentationOf->excluding(null).serviceEvent->excluding(null)->reject(effectiveTime->forAll(not low.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<effectiveTime/>
</serviceEvent>
</documentationOf>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<effectiveTime>
<low value="1"/>
<high value="2"/>
</effectiveTime>
</serviceEvent>
</documentationOf>
</ClinicalDocument>

0.036
testValidateGeneralHeaderConstraintsDocumentationOfServiceEventEffectiveTime

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] documentationOf (CONF:14835) each SHALL contain exactly one [1..1] serviceEvent, where (CONF:14836) serviceEvent SHALL contain exactly one [1..1] effectiveTime (CONF:8494)

OCL

self.documentationOf->excluding(null).serviceEvent->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent/>
</documentationOf>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<effectiveTime/>
</serviceEvent>
</documentationOf>
</ClinicalDocument>

0.056
testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] documentationOf (CONF:14835) each SHALL contain exactly one [1..1] serviceEvent, where (CONF:14836) serviceEvent SHOULD contain zero or more [0..*] performer, where its type is Performer1 (CONF:14839)

OCL

self.documentationOf->excluding(null).serviceEvent->excluding(null)->reject(performer->exists(performer : cda::Performer1 | not performer.oclIsUndefined() and performer.oclIsKindOf(cda::Performer1)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent/>
</documentationOf>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<documentationOf>
<serviceEvent>
<performer/>
</serviceEvent>
</documentationOf>
</ClinicalDocument>

0.037
testValidateGeneralHeaderConstraintsDocumentationOfServiceEvent

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] documentationOf (CONF:14835) documentationOf SHALL contain exactly one [1..1] serviceEvent, where its type is Service Event (CONF:14836)

OCL

NO OCL FOUND FOR PROPERTY VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT__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">
<documentationOf/>
</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">
<documentationOf>
<serviceEvent/>
</documentationOf>
</ClinicalDocument>

0.030
testValidateGeneralHeaderConstraintsAuthorizationConsentCode

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authorization (CONF:16792) each SHALL contain exactly one [1..1] consent, where (CONF:16793) consent MAY contain zero or one [0..1] code (CONF:16795)

OCL

self.authorization->excluding(null).consent->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not 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">
<realmCode code="US"/>
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authorization>
<consent/>
</authorization>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authorization>
<consent>
<code/>
</consent>
</authorization>
</ClinicalDocument>

0.052
testValidateGeneralHeaderConstraintsAuthorizationConsentId

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authorization (CONF:16792) each SHALL contain exactly one [1..1] consent, where (CONF:16793) consent MAY contain zero or more [0..*] id (CONF:16794)

OCL

self.authorization->excluding(null).consent->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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authorization>
<consent/>
</authorization>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authorization>
<consent>
<id/>
</consent>
</authorization>
</ClinicalDocument>

0.053
testValidateGeneralHeaderConstraintsAuthorizationConsentStatusCodeP

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authorization (CONF:16792) each SHALL contain exactly one [1..1] consent, where (CONF:16793) consent SHALL contain exactly one [1..1] statusCode (CONF:16797)/@code="completed" Completed (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) (CONF:16798)

OCL

self.authorization->excluding(null).consent->excluding(null)->reject((statusCode.oclIsUndefined() or statusCode.isNullFlavorUndefined()) implies (not statusCode.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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authorization>
<consent/>
</authorization>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authorization>
<consent>
<statusCode code="completed"/>
</consent>
</authorization>
</ClinicalDocument>

0.056
testValidateGeneralHeaderConstraintsAuthorizationConsentStatusCode

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authorization (CONF:16792) each SHALL contain exactly one [1..1] consent, where (CONF:16793) consent SHALL contain exactly one [1..1] statusCode (CONF:16797)/@code="completed" Completed (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) (CONF:16798)

OCL

self.authorization->excluding(null).consent->excluding(null)->reject((statusCode.oclIsUndefined() or statusCode.isNullFlavorUndefined()) implies (not statusCode.oclIsUndefined() and statusCode.oclIsKindOf(datatypes::CS) and let value : datatypes::CS = statusCode.oclAsType(datatypes::CS) in value.code = 'completed'))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authorization>
<consent/>
</authorization>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authorization>
<consent>
<statusCode code="completed"/>
</consent>
</authorization>
</ClinicalDocument>

0.093
testValidateGeneralHeaderConstraintsAuthorizationConsent

Constraint

Consol General Header Constraints MAY contain zero or more [0..*] authorization (CONF:16792) authorization SHALL contain exactly one [1..1] consent, where its type is Consent (CONF:16793)

OCL

self.authorization->excluding(null)->reject(consent->one(consent : cda::Consent | not consent.oclIsUndefined() and consent.oclIsKindOf(cda::Consent)))

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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authorization/>
</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.1"/>
<confidentialityCode codeSystem="2.16.840.1.113883.5.25" codeSystemName="ConfidentialityCode"/>
<authorization>
<consent/>
</authorization>
</ClinicalDocument>

0.032
Properties »