Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
TextObservationTest15000.6432013-01-31T13:36:26JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testGetSOPInstanceObservations

Constraint

OCL

SuccessInvalid XML

Valid XML

0.043
testGetQuantityMeasurementObservations

Constraint

OCL

SuccessInvalid XML

Valid XML

0.042
testValidateTextObservationTextReference

Constraint

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

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.6.2.12"/>
<text/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.12"/>
<text><reference/></text>
</observation>

0.052
testValidateTextObservationTextReferenceValue

Constraint

Consol Text Observation reference, if present, SHOULD contain zero or one [0..1] @value (CONF:15939)

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.6.2.12"/>
<text><reference/></text>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.12"/>
<text><reference value="test"/></text>
</observation>

0.069
testValidateTextObservationReferenceValue

Constraint

Consol Text 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:15940)

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 health status observed.
</content></text>
<entry>
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.12"/>
<text>Some sample text<reference value="#1.2.3.4"/></text>
</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 health status observed.
</content></text>
<entry>
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.6.2.12"/>
<text>Some sample text<reference value="#1.2.3.4"/></text>
</observation>
</entry>
</section>

0.088
testValidateTextObservationTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:9290, CONF:10534 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.6.2.12"

OCL

self.templateId->exists(id : datatypes::II | id.root = '2.16.840.1.113883.10.20.6.2.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.10.20.6.2.12"/>
</observation>

0.014
testValidateTextObservationClassCode

Constraint

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

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.6.2.12"/>
</observation>

0.009
testValidateTextObservationMoodCode

Constraint

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

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.6.2.12"/>
</observation>

0.009
testValidateTextObservationCode

Constraint

Consol Text Observation SHALL contain exactly one [1..1] code (CONF:9291)

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: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.6.2.12"/>
<code xsi:type="CE"/>
</observation>

0.044
testValidateTextObservationEffectiveTime

Constraint

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

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.6.2.12"/>
<effectiveTime/>
</observation>

0.056
testValidateTextObservationText

Constraint

Consol Text Observation MAY contain zero or one [0..1] text (CONF:9295)

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.6.2.12"/>
<text/>
</observation>

0.047
testValidateTextObservationValue

Constraint

Consol Text Observation SHALL contain exactly one [1..1] value with data type ED (CONF:9292)

OCL

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

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.6.2.12"/>
<value xsi:type="ED"/>
</observation>

0.066
testValidateTextObservationSOPInstanceObservation

Constraint

Consol Text Observation MAY contain zero or more [0..*] entryRelationship (CONF:9298, CONF:9299, CONF:15941) Contains @typeCode="SPRT" SPRT, and Contains exactly one [1..1] SOP Instance Observation (templateId: 2.16.840.1.113883.10.20.6.2.8)

OCL

self.entryRelationship->exists(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(consol::SOPInstanceObservation) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::SPRT)

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.6.2.12"/>
<entryRelationship typeCode="SPRT">
<observation/>
</entryRelationship>
</observation>

0.049
testValidateTextObservationQuantityMeasurementObservation

Constraint

Consol Text Observation MAY contain zero or more [0..*] entryRelationship (CONF:9301, CONF:9302, CONF:15942) Contains @typeCode="SPRT" SPRT, and Contains exactly one [1..1] Quantity Measurement Observation (templateId: 2.16.840.1.113883.10.20.6.2.14)

OCL

self.entryRelationship->exists(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(consol::QuantityMeasurementObservation) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::SPRT)

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.6.2.12"/>
<entryRelationship typeCode="SPRT">
<observation/>
</entryRelationship>
</observation>

0.050
Properties »