Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
StudyActTest15000.6382013-01-31T13:36:25JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateStudyActIdsHaveRoot

Constraint

Consol Study Act ids SHALL contain exactly one [1..1] @root (CONF:9213)

OCL

self.id->forAll( not root.oclIsUndefined() )

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<id/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<id root="test"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
</act>

0.025
testValidateStudyActNoIdExtension

Constraint

Consol Study Act Such ids SHALL NOT contain [0..0] @extension (CONF:9211)

OCL

self.id->forAll( extension.oclIsUndefined() )

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<id extension="test"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<id root="test"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
</act>

0.018
testValidateStudyActTextReference

Constraint

Consol Study Act text, if present, SHOULD contain zero or one [0..1] reference (CONF:15995)

OCL

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

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
<text/>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
<text><reference/></text>
</act>

0.051
testValidateStudyActTextReferenceValue

Constraint

Consol Study Act reference, if present, SHOULD contain zero or one [0..1] @value (CONF:15996)

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="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
<text><reference/></text>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
<text><reference value="test"/></text>
</act>

0.069
testValidateStudyActReferenceValue

Constraint

Consol Study Act 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:15997)

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 health status observed.
</content></text>
<entry>
<act classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
<text>Some sample text<reference value="#1.2.3.4"/></text>
</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 health status observed.
</content></text>
<entry>
<act classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
<text>Some sample text<reference value="#1.2.3.4"/></text>
</act>
</entry>
</section>

0.087
testValidateStudyActTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:10533 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.6.2.6"

OCL

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

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
</act>

0.015
testValidateStudyActClassCode

Constraint

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

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="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
</act>

0.009
testValidateStudyActMoodCode

Constraint

Consol Study Act SHALL contain exactly one [1..1] @moodCode="EVN" Event (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood) (CONF:9208)

OCL

self.moodCode=vocab::x_DocumentActMood::EVN

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
</act>

0.009
testValidateStudyActId

Constraint

Consol Study Act SHALL contain at least one [1..*] id (CONF:9210)

OCL

(self.id->isEmpty() or self.id->exists(element | element.isNullFlavorUndefined())) implies (not self.id->isEmpty())

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<id/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
</act>

0.049
testValidateStudyActCode

Constraint

Consol Study Act SHALL contain exactly one [1..1] code/@code="113014" (CodeSystem: 1.2.840.10008.2.16.4 DCM) (CONF:9214)

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.code = '113014' and value.codeSystem = '1.2.840.10008.2.16.4')

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="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<code xsi:type="CE" code="113014" codeSystem="1.2.840.10008.2.16.4"/>
</act>

0.100
testValidateStudyActEffectiveTime

Constraint

Consol Study Act SHOULD contain zero or one [0..1] effectiveTime (CONF:9216)

OCL

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

SuccessInvalid XML


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

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
<effectiveTime/>
</act>

0.056
testValidateStudyActText

Constraint

Consol Study Act MAY contain zero or one [0..1] text (CONF:9215)

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="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
<text/>
</act>

0.047
testValidateStudyActSeriesAct

Constraint

Consol Study Act SHALL contain zero or one [0..1] entryRelationship (CONF:9219, CONF:9220, CONF:15937) Contains @typeCode="COMP" COMP, and Contains exactly one [1..1] Series Act (templateId: 2.16.840.1.113883.10.20.22.4.63)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.act.oclIsUndefined() and entryRelationship.act.oclIsKindOf(consol::SeriesAct) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::COMP)

SuccessInvalid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
</act>

Valid XML


<act xmlns="urn:hl7-org:v3" classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.6"/>
<code code="113014" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
<entryRelationship typeCode="COMP">
<act classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.63"/>
<code code="113015" codeSystem="1.2.840.10008.2.16.4" codeSystemName="DCM"/>
</act>
</entryRelationship>
</act>

0.050
testGetSeriesAct

Constraint

OCL

SuccessInvalid XML

Valid XML

0.049
Properties »