Unit Test Results.

Designed for use with JUnit and Ant.

Class org.openhealthtools.mdht.uml.cda.ihe.tests.AdvanceDirectiveObservationTest

NameTestsErrorsFailuresTime(s)Time StampHost
AdvanceDirectiveObservationTest8000.0842013-01-31T13:34:21JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
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
testValidateIHEAdvanceDirectiveObservationHasExternalReference

Constraint

IHE Advance Directive Observation MAY satisfy: The advanced directive observation may contain a single reference to an external document. The reference may be recorded using CCD :: Advance Directive Reference (2.16.840.1.113883.10.20.1.36)

OCL

self.reference->select(r | r.oclIsKindOf(ccd::AdvanceDirectiveReference))->size() =1

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<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"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<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"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<reference typeCode="REFR">
<templateId root="2.16.840.1.113883.10.20.1.36"/>
</reference>
</observation>

0.009
testValidateIHEAdvanceDirectiveObservationTemplateId

Constraint

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

OCL

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

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<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"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

0.006
testValidateIHEAdvanceDirectiveObservationCode

Constraint

IHE Advance Directive Observation SHALL contain exactly one [1..1] code, where the @code SHALL be selected from (CodeSystem: 2.16.840.1.113883.6.96 SNOMEDCT)

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

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<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"/>
<code codeSystem="2.16.840.1.113883.6.96"/>
<statusCode code="completed"/>
</observation>

0.021
testValidateIHEAdvanceDirectiveObservationRepeatNumber

Constraint

IHE Advance Directive Observation SHALL contain [0..0] repeatNumber

OCL

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

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<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"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<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"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<repeatNumber/>
</observation>

0.014
testValidateIHEAdvanceDirectiveObservationInterpretationCode

Constraint

IHE Advance Directive Observation SHALL contain [0..0] interpretationCode

OCL

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

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<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"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<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"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<interpretationCode/>
</observation>

0.014
testValidateIHEAdvanceDirectiveObservationTargetSiteCode

Constraint

IHE Advance Directive Observation SHALL contain [0..0] targetSiteCode

OCL

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

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<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"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7"/>
<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"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<targetSiteCode/>
</observation>

0.013
Properties »