Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
ProblemObservationTest28001.3162013-01-31T13:35:55JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.000
testGetAgeObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.044
testValidateProblemObservationTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:14926, CONF:14927 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.4"

OCL

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

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

0.015
testValidateProblemObservationMoodCode

Constraint

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

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

0.008
testValidateProblemObservationStatusCode

Constraint

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

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

0.088
testValidateProblemObservationEffectiveTime

Constraint

Consol Problem Observation SHOULD contain zero or one [0..1] effectiveTime (CONF:9050)

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

0.046
testValidateProblemObservationProblemStatus

Constraint

Consol Problem Observation MAY contain zero or one [0..1] entryRelationship (CONF:9063, CONF:9068, CONF:15591) Contains @typeCode="REFR" REFR, and Contains exactly one [1..1] Problem Status (templateId: 2.16.840.1.113883.10.20.22.4.6)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(consol::ProblemStatus) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::REFR)

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.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<entryRelationship typeCode="REFR">
<observation/>
</entryRelationship>
</observation>

0.044
testValidateProblemObservationAgeObservation

Constraint

Consol Problem Observation MAY contain zero or one [0..1] entryRelationship (CONF:9059, CONF:9060, CONF:15590) Contains @typeCode="SUBJ" SUBJ, and Contains exactly one [1..1] Age Observation (templateId: 2.16.840.1.113883.10.20.22.4.31)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(consol::AgeObservation) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::SUBJ)

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.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<entryRelationship typeCode="SUBJ">
<observation/>
</entryRelationship>
</observation>

0.043
testGetProblemStatus

Constraint

OCL

SuccessInvalid XML

Valid XML

0.042
testGetHealthStatusObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.043
testValidateProblemObservationHasTextReference

Constraint

Consol Problem Observation The text, if present, SHOULD contain zero or one [0..1] reference (CONF:15587)

OCL

not self.text.oclIsUndefined() implies self.text->forAll(reference->size() = 1)

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<text/>
<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.22.4.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<text><reference value="test"/></text>
<statusCode code="completed"/>
</observation>

0.044
testValidateProblemObservationTextReferenceValue

Constraint

Consol Problem Observation reference, if present, SHALL contain exactly one [1..1] @value (CONF:15588)

OCL

self.text->forAll(reference->size() = 1) implies self.text->forAll(reference->one(value->size() = 1))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<text><reference/></text>
<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.22.4.4"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<text><reference value="test"/></text>
<statusCode code="completed"/>
</observation>

0.060
testValidateProblemObservationHasTextReferenceValue

Constraint

Consol Problem Observation reference/@value SHALL begin with a '#' and SHALL point to its corresponding narrative (using the approach defined in CDA Release 2, section 4.3.5.1) (CONF:15589)

OCL

not self.text.reference.value.oclIsUndefined() implies not self.getSection().text.getText(self.text.reference.value.substring(2, self.text.reference.value.size())).oclIsUndefined()

SuccessInvalid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.2.5"/>
<code code="10210-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="GENERAL STATUS"/>
<text><content ID="">
No particular problem observed.
</content></text>
<entry>
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<text>Some sample text<reference value="#1.2.3.4"/></text>
<statusCode code="completed"/>
</observation>
</entry>
</section>

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.2.5"/>
<code code="10210-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="GENERAL STATUS"/>
<text><content ID="1.2.3.4">
No particular problem observed.
</content></text>
<entry>
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<text>Some sample text<reference value="#1.2.3.4"/></text>
<statusCode code="completed"/>
</observation>
</entry>
</section>

0.076
testValidateProblemObservationHasOnsetDate

Constraint

Consol Problem Observation The effectiveTime element , if present, SHALL contain exactly one [1..1] low (CONF:15603)

OCL

not self.effectiveTime.oclIsUndefined() implies not self.effectiveTime.low.oclIsUndefined()

SuccessInvalid XML


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

0.040
testValidateProblemObservationHasResolutionDate

Constraint

Consol Problem Observation effectiveTime, if present, SHOULD contain zero or one [0..1] high (CONF:15604)

OCL

not self.effectiveTime.oclIsUndefined() implies not self.effectiveTime.high.oclIsUndefined()

SuccessInvalid XML


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

0.040
testValidateProblemObservationValueNullFlavor

Constraint

Consol Problem Observation value MAY contain zero or one [0..1] @nullFlavor (CONF:10141)

OCL

self.value->forAll(val | not val.isNullFlavorUndefined())

SuccessInvalid 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.10.20.22.4.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<value xsi:type="CD"/>
</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.10.20.22.4.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<value xsi:type="CD" nullFlavor="UNK"/>
</observation>

0.014
testValidateProblemObservationAgeObservationInversion

Constraint

Consol Problem Observation entryRelationship with target entry Age Observation SHALL contain exactly one [1..1] @inversionInd="true" True (CONF:9069)

OCL

self.entryRelationship->select(er : cda::EntryRelationship | not er.observation.oclIsUndefined() and er.observation.oclIsKindOf(consol::AgeObservation))->forAll(ent : cda::EntryRelationship | ent.inversionInd=true)

SuccessInvalid XML


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

Valid XML


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

0.041
testValidateProblemObservationValueTranslation

Constraint

Consol Problem Observation value MAY contain zero or more [0..*] translation (CONF:16749)

OCL

self.value.oclAsType(datatypes::CD).translation->size()>0

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.10.20.22.4.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<value xsi:type="CD">
<translation code="" codeSystem="2.16.840.1.113883.6.3" codeSystemName="" displayName=""/>
</value>
</observation>

0.027
testValidateProblemObservationValueTranslationCode

Constraint

Consol Problem Observation translation, if present, MAY contain zero or one [0..1] @code (CodeSystem: ICD10 2.16.840.1.113883.6.3) (CONF:16750)

OCL

self.value.oclAsType(datatypes::CD).translation->size()>0 implies self.value.oclAsType(datatypes::CD).translation->forAll(code->size() = 1)

SuccessInvalid 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.10.20.22.4.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<value xsi:type="CD">
<translation/>
</value>
</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.10.20.22.4.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<value xsi:type="CD">
<translation code="" codeSystem="2.16.840.1.113883.6.3" codeSystemName="" displayName=""/>
</value>
</observation>

0.057
testValidateProblemObservationClassCode

Constraint

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

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

0.008
testValidateProblemObservationNegationInd

Constraint

Consol Problem Observation MAY contain zero or one [0..1] @negationInd (CONF:10139)

OCL

not self.negationInd.oclIsUndefined()

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN" negationInd="true">
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

0.017
testValidateProblemObservationId

Constraint

Consol Problem Observation SHALL contain at least one [1..*] id (CONF:9043)

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

0.042
testValidateProblemObservationCodeP

Constraint

Consol Problem Observation SHALL contain exactly one [1..1] code, where the @code SHOULD be selected from ValueSet Problem Type 2.16.840.1.113883.3.88.12.3221.7.2 STATIC 2008-12-18 (CONF:9045)

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

0.038
testValidateProblemObservationCode

Constraint

Consol Problem Observation SHALL contain exactly one [1..1] code, where the @code SHOULD be selected from ValueSet Problem Type 2.16.840.1.113883.3.88.12.3221.7.2 STATIC 2008-12-18 (CONF:9045)

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 = '404684003' or value.code = '409586006' or value.code = '282291009' or value.code = '64572001' or value.code = '248536006' or value.code = '418799008' or value.code = '55607006' or value.code = '373930000'))

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

0.188
testValidateProblemObservationText

Constraint

Consol Problem Observation SHOULD contain zero or one [0..1] text (CONF:9185)

OCL

(self.text.oclIsUndefined() or self.text.isNullFlavorUndefined()) implies (not self.text.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.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<text/>
<statusCode code="completed"/>
</observation>

0.041
testValidateProblemObservationValue

Constraint

Consol Problem Observation SHALL contain exactly one [1..1] value with data type CD, where the @code SHOULD be selected from ValueSet Problem 2.16.840.1.113883.3.88.12.3221.7.4 DYNAMIC (CONF:9058)

OCL

(self.value->isEmpty() or self.value->exists(element | element.isNullFlavorUndefined())) implies (self.value->size() = 1 and self.value->forAll(element | not element.oclIsUndefined() and element.oclIsKindOf(datatypes::CD) and let value : datatypes::CD = element.oclAsType(datatypes::CD) in value.codeSystem = '2.16.840.1.113883.6.96' and not value.code.oclIsUndefined()))

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.10.20.22.4.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="234422006" codeSystem="2.16.840.1.113883.6.96"/>
</observation>

0.107
testValidateProblemObservationValueP

Constraint

Consol Problem Observation SHALL contain exactly one [1..1] value with data type CD, where the @code SHOULD be selected from ValueSet Problem 2.16.840.1.113883.3.88.12.3221.7.4 DYNAMIC (CONF:9058)

OCL

(self.value->isEmpty() or self.value->exists(element | element.isNullFlavorUndefined())) implies (self.value->size() = 1 and self.value->forAll(element | element.oclIsTypeOf(datatypes::CD)))

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.10.20.22.4.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="234422006" codeSystem="2.16.840.1.113883.6.96"/>
</observation>

0.056
testValidateProblemObservationHealthStatusObservation

Constraint

Consol Problem Observation MAY contain zero or one [0..1] entryRelationship (CONF:9067, CONF:9064, CONF:15592) Contains @typeCode="REFR" REFR, and Contains exactly one [1..1] Health Status Observation (templateId: 2.16.840.1.113883.10.20.22.4.5)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(consol::HealthStatusObservation) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::REFR)

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.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<entryRelationship typeCode="REFR">
<observation/>
</entryRelationship>
</observation>

0.043
Properties »