Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
ResultTest8000.1342013-01-31T13:34:35JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateResultTypeCodeSystem

Constraint

HITSP Result Result Type SHOULD be selected from LOINC (codeSystem 2.16.840.1.113883.6.1) or SNOMED CT (codeSystem 2.16.840.1.113883.6.96) (C154-[DE-15.03-1])

OCL

self.code.codeSystem = '2.16.840.1.113883.6.1' or 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.3.88.11.83.15.1"/>
<templateId root="2.16.840.1.113883.10.20.1.31"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<code codeSystem="2.16.840.1.113883.6.1"/>
<statusCode code="completed"/>
</observation>

<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.15.1"/>
<templateId root="2.16.840.1.113883.10.20.1.31"/>
<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.016
testValidateResultLaboratoryResultsValueSet

Constraint

HITSP Result Result Type for laboratory results SHOULD be coded as specified in HITSP/C80 Section 2.2.3.6.1 Laboratory Observations. (C154-[DE-15.03-2])

OCL

self.code.codeSystem = '2.16.840.1.113883.6.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.15.1"/>
<templateId root="2.16.840.1.113883.10.20.1.31"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<code codeSystem="2.16.840.1.113883.6.1"/>
<statusCode code="completed"/>
</observation>

0.007
testValidateResultValuePresence

Constraint

HITSP Result Result Value SHALL be present when the observation/@moodCode is EVN or GOL, and SHALL NOT be present when observation/@moodCode is INT or PRP. (C83-[DE-15.05-CDA-1])

OCL

(self.moodCode = vocab::x_ActMoodDocumentObservation::EVN or self.moodCode = vocab::x_ActMoodDocumentObservation::EVN) implies (not self.value->isEmpty()) and (self.moodCode = vocab::x_ActMoodDocumentObservation::INT or self.moodCode = vocab::x_ActMoodDocumentObservation::PRP) implies (self.value->isEmpty())

SuccessInvalid XML


<observation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="INT">
<templateId root="2.16.840.1.113883.3.88.11.83.15.1"/>
<templateId root="2.16.840.1.113883.10.20.1.31"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<statusCode code="completed"/>
<value xsi:type="CE"/>
</observation>

Valid XML


<observation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.15.1"/>
<templateId root="2.16.840.1.113883.10.20.1.31"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<statusCode code="completed"/>
<value xsi:type="CE"/>
<value xsi:type="CE"/>
</observation>

0.038
testValidateResultTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( C83-[DE-15-CDA-1] ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.3.88.11.83.15.1"

OCL

self.templateId->exists(id : datatypes::II | id.root = '2.16.840.1.113883.3.88.11.83.15.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.15.1"/>
<templateId root="2.16.840.1.113883.10.20.1.31"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<statusCode code="completed"/>
</observation>

0.007
testValidateResultCode

Constraint

HITSP Result SHALL contain exactly one [1..1] code

OCL

(self.code.oclIsUndefined() or self.code.isNullFlavorUndefined()) implies (not self.code.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.15.1"/>
<templateId root="2.16.840.1.113883.10.20.1.31"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<code/>
<statusCode code="completed"/>
</observation>

0.019
testValidateResultEffectiveTime

Constraint

HITSP Result 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.15.1"/>
<templateId root="2.16.840.1.113883.10.20.1.31"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<statusCode code="completed"/>
<effectiveTime/>
</observation>

0.023
testValidateResultValue

Constraint

HITSP Result SHALL contain exactly one [1..1] value

OCL

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

SuccessInvalid XML


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

Valid XML


<observation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.3.88.11.83.15.1"/>
<templateId root="2.16.840.1.113883.10.20.1.31"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13"/>
<statusCode code="completed"/>
<value xsi:type="CD"/>
</observation>

0.021
Properties »