Unit Test Results.

Designed for use with JUnit and Ant.

Class org.openhealthtools.mdht.uml.cda.ccd.tests.AdvanceDirectivesSectionTest

NameTestsErrorsFailuresTime(s)Time StampHost
AdvanceDirectivesSectionTest7000.0702013-01-31T13:34:11JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateAdvanceDirectivesSectionTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.1.1"

OCL

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

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.1.1"/>
<code code="42348-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Advance directives"/>
</section>

0.005
testValidateAdvanceDirectivesSectionCode

Constraint

Consol Advance Directives Section SHALL contain exactly one [1..1] code (CONF:15343)/@code="42348-3" Advance directives (CodeSystem: 2.16.840.1.113883.6.1 LOINC) (CONF:15344)

OCL

(self.code.oclIsUndefined() or self.code.isNullFlavorUndefined()) implies (not self.code.oclIsUndefined() and self.code.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = self.code.oclAsType(datatypes::CE) in value.code = '42348-3' and value.codeSystem = '2.16.840.1.113883.6.1')

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.21.1"/>
<templateId root="2.16.840.1.113883.10.20.22.2.21"/>
<code code="42348-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Advance Directives"/>
</section>

0.011
testValidateAdvanceDirectivesSectionTitle

Constraint

Consol Advance Directives Section SHALL contain exactly one [1..1] title (CONF:8645)

OCL

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

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.21.1"/>
<templateId root="2.16.840.1.113883.10.20.22.2.21"/>
<code code="42348-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Advance Directives"/>
<title>title</title>
</section>

0.035
testValidateAdvanceDirectivesSectionText

Constraint

Consol Advance Directives Section SHALL contain exactly one [1..1] text (CONF:8646)

OCL

not self.text.oclIsUndefined()

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.21.1"/>
<templateId root="2.16.840.1.113883.10.20.22.2.21"/>
<code code="42348-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Advance Directives"/>
<text/>
</section>

0.003
testValidateAdvanceDirectivesSectionAdvanceDirectiveObservation

Constraint

Consol Advance Directives Section SHALL contain at least one [1..*] entry (CONF:8647, CONF:8801) Contains exactly one [1..1] Advance Directive Observation (templateId: 2.16.840.1.113883.10.20.22.4.48)

OCL

self.entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(consol::AdvanceDirectiveObservation))

SuccessInvalid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.21.1"/>
<templateId root="2.16.840.1.113883.10.20.22.2.21"/>
<code code="42348-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Advance Directives"/>
</section>

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.21.1"/>
<templateId root="2.16.840.1.113883.10.20.22.2.21"/>
<code code="42348-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Advance Directives"/>
<entry>
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>
</entry>
</section>

0.006
testGetAdvanceDirectiveObservations

Constraint

OCL

SuccessInvalid XML

Valid XML

0.006
Properties »