Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
GeneralHeaderConstraintsTest400269.5062013-01-31T13:33:46JKMSoftware-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.180
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.003
testValidateGeneralHeaderConstraintsPersonHasName

Constraint

CDT General Header Constraints SHALL satisfy: All patient, guardianPerson, assignedPerson, maintainingPerson, relatedPerson, intendedRecipient/informationRecipient, associatedPerson, and relatedSubject/subject elements have a name. (CONF-HP-6)

OCL

-- implemented in Java using XPath selector

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId root="2.16.840.1.113883.10.20.3"/>
<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="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId root="2.16.840.1.113883.10.20.3"/>
<recordTarget>
<patientRole>
<patient>
<name/>
</patient>
</patientRole>
</recordTarget>
</ClinicalDocument>

2.271
testValidateGeneralHeaderConstraintsRolesShallHaveAddrAndTelecom

Constraint

CDT General Header Constraints SHALL satisfy: All patientRole, assignedAuthor, assignedEntity[not(parent::dataEnterer)] and associatedEntity elements have an addr and telecom element. (CONF-HP-7)

OCL

-- implemented in Java using XPath selector

SuccessInvalid XML


<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<realmCode code="US"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId root="2.16.840.1.113883.10.20.3"/>
<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="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId root="2.16.840.1.113883.10.20.3"/>
<recordTarget>
<patientRole>
<addr/>
<telecom/>
<patient/>
</patientRole>
</recordTarget>
</ClinicalDocument>

0.013
testValidateGeneralHeaderConstraintsRolesShouldHaveAddrAndTelecom

Constraint

OCL

-- implemented in Java using XPath selector

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsRolesShouldHaveAddrAndTelecom" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsRolesShouldHaveAddrAndTelecom" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsRolesShouldHaveAddrAndTelecom(GeneralHeaderConstraintsTest.java:204)
0.005
testValidateGeneralHeaderConstraintsOrganizationsHaveContactInfo

Constraint

OCL

-- implemented in Java using XPath selector

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsOrganizationsHaveContactInfo" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsOrganizationsHaveContactInfo" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsOrganizationsHaveContactInfo(GeneralHeaderConstraintsTest.java:238)
0.006
testValidateGeneralHeaderConstraintsTimePreciseToDay

Constraint

OCL

-- implemented in Java using XPath selector

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsTimePreciseToDay" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsTimePreciseToDay" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsTimePreciseToDay(GeneralHeaderConstraintsTest.java:272)
0.005
testValidateGeneralHeaderConstraintsTimePreciseToYear

Constraint

OCL

cda::OrganizationPartOf.allInstances()->select( effectiveTime.oclIsUndefined()).oclAsType( ecore::EObject)-> union( cda::MaintainedEntity.allInstances()->select( effectiveTime.oclIsUndefined()).oclAsType( ecore::EObject) )->union( cda::RelatedEntity.allInstances()->select( effectiveTime.oclIsUndefined()).oclAsType( ecore::EObject) )->union(cda::RelatedEntity.allInstances()->select( effectiveTime.oclIsUndefined()).oclAsType( ecore::EObject) )->union(cda::RelatedEntity.allInstances()->select( effectiveTime.oclIsUndefined()).oclAsType( ecore::EObject) )->union(cda::ServiceEvent.allInstances()->select( effectiveTime.oclIsUndefined()).oclAsType( ecore::EObject) )->union(cda::EncounterParticipant.allInstances()->select( time.oclIsUndefined()).oclAsType( ecore::EObject))->union(self.participant->select( time.oclIsUndefined()).oclAsType( ecore::EObject))->union(cda::OrganizationPartOf.allInstances().effectiveTime->union(cda::MaintainedEntity.allInstances().effectiveTime)->union( cda::RelatedEntity.allInstances().effectiveTime)->union(cda::RelatedEntity.allInstances().effectiveTime)->union(cda::RelatedEntity.allInstances().effectiveTime)->union(cda::ServiceEvent.allInstances().effectiveTime)->union(cda::EncounterParticipant.allInstances().time)->union(self.participant.time)->select(current : datatypes::IVL_TS | ((not current.low.oclIsUndefined()) and (current.low.value.oclIsUndefined() or current.low.value.size() < 4)) or ((not current.center.oclIsUndefined()) and (current.center.value.oclIsUndefined() or current.center.value.size() < 4)) or ((not current.high.oclIsUndefined()) and (current.high.value.oclIsUndefined() or current.high.value.size() < 4)) or (current.low.oclIsUndefined() and current.center.oclIsUndefined() and current.high.oclIsUndefined()) ).oclAsType( ecore::EObject))

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId root="2.16.840.1.113883.10.20.3"/>
</ClinicalDocument>

ERROR EXPECT PASS validateGeneralHeaderConstraintsTimePreciseToYear:

junit.framework.AssertionFailedError: ERROR EXPECT PASS validateGeneralHeaderConstraintsTimePreciseToYear:
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectPass(CDAValidationTest.java:265)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:798)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsTimePreciseToYear(GeneralHeaderConstraintsTest.java:306)
0.108
testValidateGeneralHeaderConstraintsTelephoneMatchesRegex

Constraint

OCL

-- implemented in Java using XPath selector

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsTelephoneMatchesRegex" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsTelephoneMatchesRegex" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsTelephoneMatchesRegex(GeneralHeaderConstraintsTest.java:340)
0.779
testValidateGeneralHeaderConstraintsHasTelephoneDialingDigits

Constraint

OCL

-- implemented in Java using XPath selector

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasTelephoneDialingDigits" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasTelephoneDialingDigits" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsHasTelephoneDialingDigits(GeneralHeaderConstraintsTest.java:374)
0.159
testValidateGeneralHeaderConstraintsUnknownTelephoneUsesNullFlavor

Constraint

OCL

-- implemented in Java using XPath selector

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsUnknownTelephoneUsesNullFlavor" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsUnknownTelephoneUsesNullFlavor" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsUnknownTelephoneUsesNullFlavor(GeneralHeaderConstraintsTest.java:408)
0.004
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.005
testValidateGeneralHeaderConstraintsIdRootFormat

Constraint

CDT General Header Constraints SHALL satisfy: The id/@root attribute is a syntactically correct UUID or OID. (CONF-HP-17)

OCL

self.id.matches('root','([0-2])(.([1-9][0-9]*|0))+') or self.id.matches('root','([A-Fa-f0-9]{8})(-[A-Fa-f0-9]{4}){3}(-[A-Fa-f0-9]{12})')

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId root="2.16.840.1.113883.10.20.3"/>
</ClinicalDocument>

ERROR EXPECT PASS validateGeneralHeaderConstraintsIdRootFormat: CDT General Header Constraints SHALL satisfy: The id/@root attribute is a syntactically correct UUID or OID. (CONF-HP-17) CDT General Header Constraints SHALL satisfy: The id/@root attribute is a syntactically correct UUID or OID. (CONF-HP-17)

junit.framework.AssertionFailedError: ERROR EXPECT PASS validateGeneralHeaderConstraintsIdRootFormat: CDT General Header Constraints SHALL satisfy: The id/@root attribute is a syntactically correct UUID or OID. (CONF-HP-17) CDT General Header Constraints SHALL satisfy: The id/@root attribute is a syntactically correct UUID or OID. (CONF-HP-17)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectPass(CDAValidationTest.java:265)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:798)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsIdRootFormat(GeneralHeaderConstraintsTest.java:478)
0.433
testValidateGeneralHeaderConstraintsOidLength

Constraint

OCL

self.id->select((not id.root.oclIsUndefined()) and id.root.size() > 64 )

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId root="2.16.840.1.113883.10.20.3"/>
</ClinicalDocument>

ERROR EXPECT PASS validateGeneralHeaderConstraintsOidLength:

junit.framework.AssertionFailedError: ERROR EXPECT PASS validateGeneralHeaderConstraintsOidLength:
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectPass(CDAValidationTest.java:265)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:798)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsOidLength(GeneralHeaderConstraintsTest.java:512)
0.008
testValidateGeneralHeaderConstraintsLanguageCodeForm

Constraint

CDT General Header Constraints SHALL satisfy: languageCode has the form nn, or nn-CC. (CONF-HP-25)

OCL

self.languageCode.matches('code','(([a-z]{2})(-[A-Z]{2})?)')

SuccessInvalid XML


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

<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
<languageCode code="aaaa"/>
</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">
<languageCode code="AAAA"/>
</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">
<languageCode code="aa-aa"/>
</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">
<languageCode code="AA-AA"/>
</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">
<languageCode code="aaa"/>
</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">
<languageCode code="a"/>
</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">
<languageCode code="AA-aa"/>
</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">
<languageCode code="AA-"/>
</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">
<languageCode code="en"/>
</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">
<languageCode code="en-US"/>
</ClinicalDocument>

0.018
testValidateGeneralHeaderConstraintsSetIdAndVersionNumber

Constraint

OCL

(self.setId.oclIsUndefined() and self.versionNumber.oclIsUndefined()) xor (not self.setId.oclIsUndefined() and not self.versionNumber.oclIsUndefined())

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsSetIdAndVersionNumber" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsSetIdAndVersionNumber" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsSetIdAndVersionNumber(GeneralHeaderConstraintsTest.java:669)
0.006
testValidateGeneralHeaderConstraintsSetIdAndIdAreUnique

Constraint

OCL

(not self.setId.oclIsUndefined() and not self.id.oclIsUndefined()) implies (self.setId.root <> self.id.root or self.setId.extension <> self.id.extension)

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsSetIdAndIdAreUnique" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsSetIdAndIdAreUnique" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsSetIdAndIdAreUnique(GeneralHeaderConstraintsTest.java:703)
0.007
testValidateGeneralHeaderConstraintsCopyTimeNotPresent

Constraint

OCL

self.copyTime.oclIsUndefined()

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsCopyTimeNotPresent" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsCopyTimeNotPresent" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsCopyTimeNotPresent(GeneralHeaderConstraintsTest.java:737)
0.017
testValidateGeneralHeaderConstraintsHasRecordTargetPatientRole

Constraint

CDT General Header Constraints SHALL satisfy: At least one recordTarget/patientRole element is present. (CONF-HP-31)

OCL

self.recordTarget->size() > 0 and self.recordTarget->exists(target : cda::RecordTarget | not target.patientRole.oclIsUndefined())

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId root="2.16.840.1.113883.10.20.3"/>
</ClinicalDocument>

ERROR EXPECT PASS validateGeneralHeaderConstraintsHasRecordTargetPatientRole: CDT General Header Constraints SHALL satisfy: At least one recordTarget/patientRole element is present. (CONF-HP-31) CDT General Header Constraints SHALL satisfy: At least one recordTarget/patientRole element is present. (CONF-HP-31)

junit.framework.AssertionFailedError: ERROR EXPECT PASS validateGeneralHeaderConstraintsHasRecordTargetPatientRole: CDT General Header Constraints SHALL satisfy: At least one recordTarget/patientRole element is present. (CONF-HP-31) CDT General Header Constraints SHALL satisfy: At least one recordTarget/patientRole element is present. (CONF-HP-31)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectPass(CDAValidationTest.java:265)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:798)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsHasRecordTargetPatientRole(GeneralHeaderConstraintsTest.java:771)
0.007
testValidateGeneralHeaderConstraintsHasPatientBirthTime

Constraint

OCL

self.recordTarget->forAll(target : cda::RecordTarget | not target.patientRole.oclIsUndefined() implies (not target.patientRole.patient.birthTime.value.oclIsUndefined() or not target.patientRole.patient.birthTime.nullFlavor.oclIsUndefined()))

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasPatientBirthTime" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasPatientBirthTime" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsHasPatientBirthTime(GeneralHeaderConstraintsTest.java:805)
0.007
testValidateGeneralHeaderConstraintsHasAdministrativeGenderCode

Constraint

OCL

self.recordTarget->forAll(target : cda::RecordTarget | not target.patientRole.oclIsUndefined() implies (not target.patientRole.patient.administrativeGenderCode.code.oclIsUndefined() or not target.patientRole.patient.administrativeGenderCode.nullFlavor.oclIsUndefined()))

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasAdministrativeGenderCode" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasAdministrativeGenderCode" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsHasAdministrativeGenderCode(GeneralHeaderConstraintsTest.java:839)
0.007
testValidateGeneralHeaderConstraintsHasProviderOrganization

Constraint

CDT General Header Constraints MAY satisfy: The providerOrganization element is present. (CONF-HP-36)

OCL

self.recordTarget->exists(target : cda::RecordTarget | not target.patientRole.providerOrganization.oclIsUndefined())

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId root="2.16.840.1.113883.10.20.3"/>
</ClinicalDocument>

ERROR EXPECT PASS validateGeneralHeaderConstraintsHasProviderOrganization: CDT General Header Constraints MAY satisfy: The providerOrganization element is present. (CONF-HP-36) CDT General Header Constraints MAY satisfy: The providerOrganization element is present. (CONF-HP-36)

junit.framework.AssertionFailedError: ERROR EXPECT PASS validateGeneralHeaderConstraintsHasProviderOrganization: CDT General Header Constraints MAY satisfy: The providerOrganization element is present. (CONF-HP-36) CDT General Header Constraints MAY satisfy: The providerOrganization element is present. (CONF-HP-36)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectPass(CDAValidationTest.java:265)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:798)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsHasProviderOrganization(GeneralHeaderConstraintsTest.java:873)
0.006
testValidateGeneralHeaderConstraintsHasAuthorTime

Constraint

OCL

self.author->forAll(author : cda::Author | not author.time.oclIsUndefined())

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasAuthorTime" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasAuthorTime" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsHasAuthorTime(GeneralHeaderConstraintsTest.java:907)
0.004
testValidateGeneralHeaderConstraintsHasAssignedAuthorId

Constraint

OCL

self.author->forAll(author : cda::Author | author.assignedAuthor.id->size() > 0)

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasAssignedAuthorId" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasAssignedAuthorId" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsHasAssignedAuthorId(GeneralHeaderConstraintsTest.java:941)
0.005
testValidateGeneralHeaderConstraintsHasAssignedAuthorPersonOrDevice

Constraint

OCL

self.author->forAll(author : cda::Author | not author.assignedAuthor.assignedPerson.oclIsUndefined() or not author.assignedAuthor.assignedAuthoringDevice.oclIsUndefined())

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasAssignedAuthorPersonOrDevice" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasAssignedAuthorPersonOrDevice" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsHasAssignedAuthorPersonOrDevice(GeneralHeaderConstraintsTest.java:975)
0.005
testValidateGeneralHeaderConstraintsHasDataEntererAssignedPerson

Constraint

OCL

not self.dataEnterer.oclIsUndefined() implies not self.dataEnterer.assignedEntity.assignedPerson.oclIsUndefined()

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasDataEntererAssignedPerson" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasDataEntererAssignedPerson" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsHasDataEntererAssignedPerson(GeneralHeaderConstraintsTest.java:1009)
0.004
testValidateGeneralHeaderConstraintsHasDataEntererTime

Constraint

OCL

not self.dataEnterer.oclIsUndefined() implies not self.dataEnterer.time.oclIsUndefined()

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasDataEntererTime" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasDataEntererTime" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsHasDataEntererTime(GeneralHeaderConstraintsTest.java:1043)
0.005
testValidateGeneralHeaderConstraintsHasInformant

Constraint

CDT General Header Constraints MAY satisfy: The informant element is present. (CONF-HP-42)

OCL

self.informant->size() > 0

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId root="2.16.840.1.113883.10.20.3"/>
</ClinicalDocument>

ERROR EXPECT PASS validateGeneralHeaderConstraintsHasInformant: CDT General Header Constraints MAY satisfy: The informant element is present. (CONF-HP-42) CDT General Header Constraints MAY satisfy: The informant element is present. (CONF-HP-42)

junit.framework.AssertionFailedError: ERROR EXPECT PASS validateGeneralHeaderConstraintsHasInformant: CDT General Header Constraints MAY satisfy: The informant element is present. (CONF-HP-42) CDT General Header Constraints MAY satisfy: The informant element is present. (CONF-HP-42)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectPass(CDAValidationTest.java:265)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:798)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsHasInformant(GeneralHeaderConstraintsTest.java:1077)
0.005
testValidateGeneralHeaderConstraintsHasInformantAssignedPersonOrRelatedPerson

Constraint

OCL

self.informant->forAll(i : cda::Informant12 | not i.assignedEntity.assignedPerson.oclIsUndefined() or not i.relatedEntity.relatedPerson.oclIsUndefined())

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasInformantAssignedPersonOrRelatedPerson" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsHasInformantAssignedPersonOrRelatedPerson" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsHasInformantAssignedPersonOrRelatedPerson(GeneralHeaderConstraintsTest.java:1111)
0.006
testValidateGeneralHeaderConstraintsLegalAuthenticatorHasAssignedPerson

Constraint

OCL

not self.legalAuthenticator.oclIsUndefined() implies not self.legalAuthenticator.assignedEntity.assignedPerson.oclIsUndefined()

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsLegalAuthenticatorHasAssignedPerson" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsLegalAuthenticatorHasAssignedPerson" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsLegalAuthenticatorHasAssignedPerson(GeneralHeaderConstraintsTest.java:1145)
0.005
testValidateGeneralHeaderConstraintsAuthenticatorHasAssignedPerson

Constraint

CDT General Header Constraints The assignedEntity/assignedPerson element SHALL be present in an authenticator element. (CONF-HP-52)

OCL

self.authenticator->forAll(auth : cda::Authenticator | auth.assignedEntity->forAll(entity : cda::AssignedEntity | not entity.assignedPerson.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="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId root="2.16.840.1.113883.10.20.3"/>
<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="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId root="2.16.840.1.113883.10.20.3"/>
<authenticator>
<assignedEntity>
<assignedPerson/>
</assignedEntity>
</authenticator>
</ClinicalDocument>

0.010
testValidateGeneralHeaderConstraintsTimePreciseToSecond

Constraint

OCL

-- implemented in Java using XPath selector

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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

ERROR EXPECT FAIL validateGeneralHeaderConstraintsTimePreciseToSecond" passed when it was expected to fail.<?xml version="1.0" encoding="UTF-8"?> <ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd"/>

junit.framework.AssertionFailedError: ERROR EXPECT FAIL validateGeneralHeaderConstraintsTimePreciseToSecond" passed when it was expected to fail.

at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectFail(CDAValidationTest.java:286)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:751)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsTimePreciseToSecond(GeneralHeaderConstraintsTest.java:1227)
0.006
testValidateGeneralHeaderConstraintsTimePreciseToYearAndDay

Constraint

OCL

cda::OrganizationPartOf.allInstances()->select( effectiveTime.oclIsUndefined()).oclAsType( ecore::EObject)-> union( cda::MaintainedEntity.allInstances()->select( effectiveTime.oclIsUndefined()).oclAsType( ecore::EObject) )->union( cda::RelatedEntity.allInstances()->select( effectiveTime.oclIsUndefined()).oclAsType( ecore::EObject) )->union(cda::RelatedEntity.allInstances()->select( effectiveTime.oclIsUndefined()).oclAsType( ecore::EObject) )->union(cda::RelatedEntity.allInstances()->select( effectiveTime.oclIsUndefined()).oclAsType( ecore::EObject) )->union(cda::ServiceEvent.allInstances()->select( effectiveTime.oclIsUndefined()).oclAsType( ecore::EObject) )->union(cda::EncounterParticipant.allInstances()->select( time.oclIsUndefined()).oclAsType( ecore::EObject))->union(self.participant->select( time.oclIsUndefined()).oclAsType( ecore::EObject))->union(cda::OrganizationPartOf.allInstances().effectiveTime->union(cda::MaintainedEntity.allInstances().effectiveTime)->union( cda::RelatedEntity.allInstances().effectiveTime)->union(cda::RelatedEntity.allInstances().effectiveTime)->union(cda::RelatedEntity.allInstances().effectiveTime)->union(cda::ServiceEvent.allInstances().effectiveTime)->union(cda::EncounterParticipant.allInstances().time)->union(self.participant.time)->select(current : datatypes::IVL_TS | ((not current.low.oclIsUndefined()) and (current.low.value.oclIsUndefined() or current.low.value.size() < 8)) or ((not current.center.oclIsUndefined()) and (current.center.value.oclIsUndefined() or current.center.value.size() < 8)) or ((not current.high.oclIsUndefined()) and (current.high.value.oclIsUndefined() or current.high.value.size() < 8)) or (current.low.oclIsUndefined() and current.center.oclIsUndefined() and current.high.oclIsUndefined()) ).oclAsType( ecore::EObject))

FailureInvalid XML


<?xml version="1.0" encoding="UTF-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="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId root="2.16.840.1.113883.10.20.3"/>
</ClinicalDocument>

ERROR EXPECT PASS validateGeneralHeaderConstraintsTimePreciseToYearAndDay:

junit.framework.AssertionFailedError: ERROR EXPECT PASS validateGeneralHeaderConstraintsTimePreciseToYearAndDay:
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectPass(CDAValidationTest.java:265)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:798)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.cdt.tests.GeneralHeaderConstraintsTest.testValidateGeneralHeaderConstraintsTimePreciseToYearAndDay(GeneralHeaderConstraintsTest.java:1261)
5.151
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.008
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.005
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.005
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.009
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.006
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.005
Properties »