Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
PregnancyObservationTest11000.4682013-01-31T13:35:50JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidatePregnancyObservationCode

Constraint

Consol Pregnancy Observation SHALL contain exactly one [1..1] code (CONF:454)/@code="ASSERTION" Assertion (CodeSystem: 2.16.840.1.113883.5.4 HL7ActCode)

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.code = 'ASSERTION' and value.codeSystem = '2.16.840.1.113883.5.4')

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.15.3.8"/>
<code xsi:type="CE" code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
</observation>

0.085
testValidatePregnancyObservationValue

Constraint

Consol Pregnancy Observation SHALL contain exactly one [1..1] value with data type CD/@code="77386006" Pregnant (CodeSystem: 2.16.840.1.113883.6.96 SNOMEDCT) (CONF:457)

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.code = '77386006' and value.codeSystem = '2.16.840.1.113883.6.96'))

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.15.3.8"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="77386006" codeSystem="2.16.840.1.113883.6.96"/>
</observation>

0.098
testValidatePregnancyObservationTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:16768, CONF:16868 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.15.3.8"

OCL

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

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.15.3.8"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
</observation>

0.012
testValidatePregnancyObservationClassCode

Constraint

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

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.15.3.8"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
</observation>

0.008
testValidatePregnancyObservationMoodCode

Constraint

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

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.15.3.8"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
</observation>

0.008
testValidatePregnancyObservationCodeP

Constraint

Consol Pregnancy Observation SHALL contain exactly one [1..1] code (CONF:454)/@code="ASSERTION" Assertion (CodeSystem: 2.16.840.1.113883.5.4 HL7ActCode)

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

0.037
testValidatePregnancyObservationStatusCode

Constraint

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

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.15.3.8"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
</observation>

0.087
testValidatePregnancyObservationEffectiveTime

Constraint

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

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.15.3.8"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
<effectiveTime/>
</observation>

0.045
testValidatePregnancyObservationEstimatedDateOfDelivery

Constraint

Consol Pregnancy Observation MAY contain zero or one [0..1] entryRelationship (CONF:458, CONF:459, CONF:15584) Contains @typeCode="REFR" REFR, and Contains exactly one [1..1] Estimated Date Of Delivery (templateId: 2.16.840.1.113883.10.20.15.3.1)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(consol::EstimatedDateOfDelivery) 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.15.3.8"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
<entryRelationship typeCode="REFR">
<observation/>
</entryRelationship>
</observation>

0.043
testGetEstimatedDateOfDelivery

Constraint

OCL

SuccessInvalid XML

Valid XML

0.041
Properties »