Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
ProblemObservationTest13000.1302013-01-31T13:34:17JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testGetAgeObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.008
testValidateProblemObservationInformationSource

Constraint

CCD Problem Observation SHALL contain one or more sources of information. (CONF-161)

OCL

not self.informant->isEmpty() or not self.getSection().informant->isEmpty()or not self.getClinicalDocument().informant->isEmpty()or self.reference->exists(ref : cda::Reference | ref.typeCode = vocab::x_ActRelationshipExternalReference::XCRPT)or (self.entryRelationship->exists(rel : cda::EntryRelationship | rel.typeCode = vocab::x_ActRelationshipEntryRelationship::REFR and rel.observation.code.code = '48766-0'))

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

0.022
testValidateProblemObservationContainsPatientAwareness

Constraint

CCD Problem Observation MAY contain exactly one Patient Awareness (CONF-180)

OCL

self.participant->one(partic : cda::Participant2 | partic.oclIsKindOf(ccd::PatientAwareness))

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

0.004
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.005
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.018
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.010
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.010
testValidateProblemObservationProblemHealthStatus

Constraint

CCD Problem Observation MAY contain zero or one [0..1] entryRelationship (CONF-165) Contains @typeCode="REFR" REFR, and Contains exactly one [1..1] Problem Health Status Observation (templateId: 2.16.840.1.113883.10.20.1.51)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(ccd::ProblemHealthStatusObservation) 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.1.28"/>
<statusCode code="completed"/>
<entryRelationship typeCode="REFR">
<observation/>
</entryRelationship>
</observation>

0.011
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.011
testGetProblemStatus

Constraint

OCL

SuccessInvalid XML

Valid XML

0.008
testGetProblemHealthStatus

Constraint

OCL

SuccessInvalid XML

Valid XML

0.009
Properties »