Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
AdvanceDirectiveObservationTest14000.3782013-01-31T13:33:57JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateAdvanceDirectiveObservationAdvDirectiveCodeValueSet

Constraint

CCD Advance Directive Observation The value for Observation / code in an advance directive observation MAY be selected from ValueSet 2.16.840.1.113883.1.11.20.2 AdvanceDirectiveTypeCode STATIC 20061017. (CONF-90)

OCL

self.code.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="2.16.840.1.113883.10.20.1.17"/>
<code codeSystem="2.16.840.1.113883.6.96"/>
<statusCode code="completed"/>
</observation>

0.072
testValidateAdvanceDirectiveObservationAdvDirectiveCodeCodeSystem

Constraint

CCD Advance Directive Observation There SHOULD be an advance directive observation whose value for Observation / code is '304251008' 'Resuscitation status' 2.16.840.1.113883.6.96 SNOMED CT STATIC (CONF-91)

OCL

self.code.code = '304251008' and self.code.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="2.16.840.1.113883.10.20.1.17"/>
<code code="304251008" codeSystem="2.16.840.1.113883.6.96"/>
<statusCode code="completed"/>
</observation>

0.005
testValidateAdvanceDirectiveObservationTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:8655, CONF:10485 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.48"

OCL

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

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 codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

0.004
testValidateAdvanceDirectiveObservationClassCode

Constraint

Consol Advance Directive Observation SHALL contain exactly one [1..1] @classCode="OBS" Observation (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) (CONF:8648)

OCL

self.classCode=vocab::ActClassObservation::OBS

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 codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

0.003
testValidateAdvanceDirectiveObservationMoodCode

Constraint

Consol Advance Directive Observation SHALL contain exactly one [1..1] @moodCode="EVN" Event (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood) (CONF:8649)

OCL

self.moodCode=vocab::x_ActMoodDocumentObservation::EVN

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 codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

0.004
testValidateAdvanceDirectiveObservationId

Constraint

Consol Advance Directive Observation SHALL contain at least one [1..*] id (CONF:8654)

OCL

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

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"/>
<id/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

0.006
testValidateAdvanceDirectiveObservationStatusCode

Constraint

Consol Advance Directive Observation SHALL contain exactly one [1..1] statusCode/@code="completed" (CodeSystem: 2.16.840.1.113883.5.14 ActStatus) (CONF:8652)

OCL

(self.statusCode.oclIsUndefined() or self.statusCode.isNullFlavorUndefined()) implies (not self.statusCode.oclIsUndefined() and self.statusCode.oclIsKindOf(datatypes::CS) and let value : datatypes::CS = self.statusCode.oclAsType(datatypes::CS) in value.code = 'completed')

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 codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

0.010
testValidateAdvanceDirectiveObservationEffectiveTime

Constraint

Consol Advance Directive Observation SHALL contain exactly one [1..1] effectiveTime (CONF:8656)

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.10.20.22.4.48"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<effectiveTime/>
</observation>

0.007
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.006
testValidateAdvanceDirectiveObservationAdvanceDirectiveVerification

Constraint

CCD Advance Directive Observation MAY contain at least one [1..*] participant (CONF-93) Contains exactly one [1..1] Advance Directive Verification (templateId: 2.16.840.1.113883.10.20.1.58)

OCL

self.participant->exists(participant : cda::Participant2 | not participant.oclIsUndefined() and participant.oclIsKindOf(ccd::AdvanceDirectiveVerification))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<statusCode code="completed"/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<statusCode code="completed"/>
<participant typeCode="VRF">
<templateId root="2.16.840.1.113883.10.20.1.58"/>
</participant>
</observation>

0.132
testValidateAdvanceDirectiveObservationAdvanceDirectiveStatusObservation

Constraint

CCD Advance Directive Observation SHALL contain exactly one [1..1] entryRelationship (CONF-98) Contains exactly one [1..1] Advance Directive Status Observation (templateId: 2.16.840.1.113883.10.20.1.37)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(ccd::AdvanceDirectiveStatusObservation))

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.1.17"/>
<statusCode code="completed"/>
<entryRelationship>
<observation/>
</entryRelationship>
</observation>

0.039
testValidateAdvanceDirectiveObservationAdvanceDirectiveReference

Constraint

CCD Advance Directive Observation MAY contain zero or one [0..1] reference (CONF-102, CONF-103) Contains exactly one [1..1] Advance Directive Reference (templateId: 2.16.840.1.113883.10.20.1.36)

OCL

self.reference->one(reference : cda::Reference | not reference.oclIsUndefined() and reference.oclIsKindOf(ccd::AdvanceDirectiveReference))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<statusCode code="completed"/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.17"/>
<statusCode code="completed"/>
<reference typeCode="REFR">
<templateId root="2.16.840.1.113883.10.20.1.36"/>
</reference>
</observation>

0.080
testGetAdvanceDirectiveStatusObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.005
Properties »