Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
AdvanceDirectivesSectionTest8000.1402013-01-31T13:34:37JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
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.045
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.022
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.008
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.017
testValidateAdvanceDirectivesSectionEntriesOptionalTemplateId

Constraint

The 'AdvanceDirectivesSectionEntriesOptionalTemplateId' invariant is violated on 'org.openhealthtools.mdht.uml.cda.consol.impl.AdvanceDirectivesSectionImpl@fc8fdf4{#//}'

OCL

self.templateId->exists(id : datatypes::II | id.root = '2.16.840.1.113883.10.20.22.2.21.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.007
testValidateAdvanceDirectivesSectionCodeP

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())

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.020
testGetConsolAdvanceDirectiveObservations

Constraint

OCL

SuccessInvalid XML

Valid XML

0.018
Properties »