Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
InstructionsTest11000.4162013-01-31T13:35:27JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateInstructionsTextReference

Constraint

Consol Instructions This text, if present, SHOULD contain zero or one [0..1] reference (CONF:15577)

OCL

not self.text.oclIsUndefined() implies self.text->forAll(reference->size() = 1)

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.20"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<text/>
<statusCode code="completed"/>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.20"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<text><reference value="aa"/></text>
<statusCode code="completed"/>
</act>

0.039
testValidateInstructionsReferenceValue

Constraint

Consol Instructions reference SHOULD contain exactly one [1..1] @value (CONF:15578)

OCL

self.text->forAll(reference->size() = 1) implies self.text->forAll(reference->one(value->size() = 1))

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.20"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<text><reference/></text>
<statusCode code="completed"/>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.20"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<text><reference value="test"/></text>
<statusCode code="completed"/>
</act>

0.053
testValidateInstructionsTextReferenceValue

Constraint

Consol Instructions reference/@value SHALL begin with a '#' and SHALL point to its corresponding narrative (using the approach defined in CDA Release 2, section 4.3.5.1) (CONF:15579)

OCL

not self.text.reference.value.oclIsUndefined() implies not self.getSection().text.getText(self.text.reference.value.substring(2, self.text.reference.value.size())).oclIsUndefined()

SuccessInvalid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.2.5"/>
<code code="10210-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="GENERAL STATUS"/>
<text><content ID="">
No particular instructions provided.
</content></text>
<entry>
<act classCode="ACT" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.20"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<text>Some sample text<reference value="#1.2.3.4"/></text>
<statusCode code="completed"/>
</act>
</entry>
</section>

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.2.5"/>
<code code="10210-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="GENERAL STATUS"/>
<text><content ID="1.2.3.4">
No particular instructions provided.
</content></text>
<entry>
<act classCode="ACT" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.20"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<text>Some sample text<reference value="#1.2.3.4"/></text>
<statusCode code="completed"/>
</act>
</entry>
</section>

0.065
testValidateInstructionsTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:7393, CONF:10503 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.20"

OCL

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

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3"/>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.20"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</act>

0.012
testValidateInstructionsClassCode

Constraint

Consol Instructions SHALL contain exactly one [1..1] @classCode="ACT" Act (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) (CONF:7391)

OCL

self.classCode=vocab::x_ActClassDocumentEntryAct::ACT

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3"/>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.20"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</act>

0.009
testValidateInstructionsMoodCode

Constraint

Consol Instructions SHALL contain exactly one [1..1] @moodCode="INT" (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood) (CONF:7392)

OCL

self.moodCode=vocab::x_DocumentActMood::INT

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3"/>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.20"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</act>

0.009
testValidateInstructionsCodeP

Constraint

Consol Instructions SHALL contain exactly one [1..1] code, where the @code SHOULD be selected from ValueSet PatientEducation 2.16.840.1.113883.11.20.9.34 DYNAMIC (CONF:7394)

OCL

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

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3"/>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.20"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</act>

0.036
testValidateInstructionsCode

Constraint

Consol Instructions SHALL contain exactly one [1..1] code, where the @code SHOULD be selected from ValueSet PatientEducation 2.16.840.1.113883.11.20.9.34 DYNAMIC (CONF:7394)

OCL

(self.code.oclIsUndefined() or self.code.isNullFlavorUndefined()) implies (not self.code.oclIsUndefined() and self.code.oclIsKindOf(datatypes::CD) and let value : datatypes::CD = self.code.oclAsType(datatypes::CD) in value.codeSystem = '2.16.840.1.113883.6.96' and not value.code.oclIsUndefined())

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3"/>

Valid XML


<act xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.20"/>
<code xsi:type="CE" code="" codeSystem="2.16.840.1.113883.6.96" codeSystemName="codeSystemName" displayName="displayName"/>
<statusCode code="completed"/>
</act>

0.078
testValidateInstructionsText

Constraint

Consol Instructions SHOULD contain zero or one [0..1] text (CONF:7395)

OCL

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

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3"/>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.20"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<text/>
<statusCode code="completed"/>
</act>

0.035
testValidateInstructionsStatusCode

Constraint

Consol Instructions SHALL contain exactly one [1..1] statusCode/@code="completed" Completed (CodeSystem: 2.16.840.1.113883.5.14 ActStatus) (CONF:7396)

OCL

(self.statusCode.oclIsUndefined() or self.statusCode.isNullFlavorUndefined()) implies (not self.statusCode.oclIsUndefined() and self.statusCode.oclIsKindOf(datatypes::CS) and let value : datatypes::CS = self.statusCode.oclAsType(datatypes::CS) in value.code = 'completed')

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3"/>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.20"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</act>

0.076
Properties »