Unit Test Results.

Designed for use with JUnit and Ant.

Class org.openhealthtools.mdht.uml.cda.hitsp.tests.AdvanceDirectiveTest

NameTestsErrorsFailuresTime(s)Time StampHost
AdvanceDirectiveTest13000.2042013-01-31T13:34:29JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.000
testValidateAdvanceDirectiveObservationCode

Constraint

Consol Advance Directive Observation SHALL contain exactly one [1..1] code, where the @code SHALL be selected from ValueSet Advance Directive Type Code 2.16.840.1.113883.1.11.20.2 STATIC 1 (CONF:8651)

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 (value.code = '281789004' or value.code = '89666000' or value.code = '225204009' or value.code = '52765003' or value.code = '78823007' or value.code = '304251008' or value.code = '61420007' or value.code = '71388002'))

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"/>
<code code="304251008" codeSystem="2.16.840.1.113883.6.96" codeSystemName="" displayName=""/>
<statusCode code="completed"/>
</observation>

0.004
testValidateAdvanceDirectiveHasStartingTime

Constraint

HITSP Advance Directive The starting time of the Advance Directive SHALL be recorded in the <low> element of the <effectiveTime> element in the Advance Directive <observation>

OCL

self.effectiveTime.low.hasContent() or self.effectiveTime.low.isNullFlavorDefined()

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.12"/>
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<effectiveTime/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.12"/>
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<effectiveTime>
<low value="high"/>
</effectiveTime>
</observation>

0.015
testValidateAdvanceDirectiveHasEndingTime

Constraint

HITSP Advance Directive The ending time of the Advance Directive SHALL be recorded in the <high> element of the <effectiveTime> element in the Advance Directive <observation>

OCL

self.effectiveTime.high.hasContent() or self.effectiveTime.high.isNullFlavorDefined()

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.12"/>
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<effectiveTime/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.12"/>
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<effectiveTime>
<high value="high"/>
</effectiveTime>
</observation>

0.016
testValidateAdvanceDirectiveHasCustodian

Constraint

HITSP Advance Directive Information required to obtain a copy of the Advance Directive SHALL be recorded in a <participantRole> element within a <participant> element of the Advance Directive <observation>

OCL

self.participant.participantRole->size() > 0

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.12"/>
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant>
<participantRole/>
</participant>
</observation>

0.011
testValidateAdvanceDirectiveParticipantTypeCode

Constraint

HITSP Advance Directive The typeCode attribute of the participant element SHALL be CST

OCL

self.participant->one(par : cda::Participant2 | par.typeCode = vocab::ParticipationType::CST)

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.12"/>
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant typeCode="CST"/>
</observation>

0.007
testValidateAdvanceDirectiveParticipantRoleClassCode

Constraint

HITSP Advance Directive The classCode of the participant/participantRole element SHALL be AGNT

OCL

self.participant.participantRole->one(pr : cda::ParticipantRole | pr.classCode = vocab::RoleClassRoot::AGNT)

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.12"/>
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant>
<participantRole classCode="AGNT"/>
</participant>
</observation>

0.008
testValidateAdvanceDirectiveHasAddress

Constraint

HITSP Advance Directive The address of the agent SHALL be recorded in an participant/participantRole/addr element when known

OCL

self.participant.participantRole.addr->size() = 1

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.12"/>
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<addr/>
</participantRole>
</participant>
</observation>

0.013
testValidateAdvanceDirectiveHasTelecom

Constraint

HITSP Advance Directive The telephone number or other electronic communications address for the agent SHALL be recorded in a participant/participantRole/telecom element when known

OCL

self.participant.participantRole.telecom->size() > 0

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.12"/>
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<telecom/>
</participantRole>
</participant>
</observation>

0.012
testValidateAdvanceDirectiveHasNameOfAgent

Constraint

HITSP Advance Directive The name of the agent who can provide a copy of the Advance Directive SHALL be recorded in the <name> element inside the participant/participantRole/playingEntity element

OCL

self.participant.participantRole.playingEntity.name->size() = 1

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.12"/>
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity>
<name/>
</playingEntity>
</participantRole>
</participant>
</observation>

0.014
testValidateAdvanceDirectiveTemplateId

Constraint

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

OCL

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

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.12"/>
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

0.008
testValidateAdvanceDirectiveCode

Constraint

HITSP Advance Directive SHALL contain exactly one [1..1] code, where the @code SHALL be selected from ValueSet Advance Directive Type 2.16.840.1.113883.1.11.20.2 STATIC 1

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 (value.code = '281789004' or value.code = '89666000' or value.code = '225204009' or value.code = '52765003' or value.code = '78823007' or value.code = '304251008'))

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.12"/>
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<code code="281789004" codeSystem="2.16.840.1.113883.6.96"/>
<statusCode code="completed"/>
</observation>

0.066
testValidateAdvanceDirectiveEffectiveTime

Constraint

HITSP Advance Directive SHALL contain exactly one [1..1] effectiveTime

OCL

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

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.12"/>
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<effectiveTime/>
</observation>

0.023
Properties »