Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
ReactionObservationTest10000.0952013-01-31T13:34:19JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateReactionObservationHasReactionIntervention

Constraint

CCD Reaction Observation A reaction observation MAY contain one or more reation interventions. (CONF-280)

OCL

not self.getEntryRelationshipTargets(vocab::x_ActRelationshipEntryRelationship::RSON, cda::ClinicalStatement)->isEmpty()

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.54"/>
<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.1.54"/>
<statusCode code="completed"/>
<entryRelationship typeCode="RSON">
<observation/>
</entryRelationship>
</observation>

0.008
testValidateReactionObservationReactionInterventionTypeCode

Constraint

CCD Reaction Observation The value for entryRelationship / @typeCode in a relationship between a reaction observation and reaction intervention SHALL be "RSON" "Has reason" 2.16.840.1.113883.5.1002 ActRelationshipType STATIC. (CONF-296)

OCL

self.entryRelationship->forAll(entry | entry.typeCode <> vocab::x_ActRelationshipEntryRelationship::RSON or ( entry.typeCode = vocab::x_ActRelationshipEntryRelationship::RSON and (entry.act->isEmpty() and entry.procedure->isEmpty() ) ) )

SuccessInvalid XML


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

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

Valid XML


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

0.015
testValidateReactionObservationReactionInterventionType

Constraint

CCD Reaction Observation A reaction intervention SHALL be represented as a procedure activity (templateId 2.16.840.1.113883.10.20.1.29), a medication activity (templateId 2.16.840.1.113883.10.20.1.24), or some other clinical statement. (CONF-297)

OCL

self.getEntryRelationshipTargets(vocab::x_ActRelationshipEntryRelationship::RSON, cda::ClinicalStatement)->exists(entry : cda::ClinicalStatement | entry.oclIsKindOf(ccd::ProcedureActivity) or entry.oclIsKindOf(ccd::MedicationActivity))

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.54"/>
<statusCode code="completed"/>
<entryRelationship typeCode="RSON">
<substanceAdministration/>
</entryRelationship>
</observation>

0.008
testValidateReactionObservationTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:7323, CONF:10523 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.9"

OCL

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

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

0.005
testValidateReactionObservationClassCode

Constraint

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

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

0.004
testValidateReactionObservationMoodCode

Constraint

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

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

0.005
testValidateReactionObservationStatusCode

Constraint

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

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

0.021
testValidateReactionObservationSeverityObservation

Constraint

Consol Reaction Observation SHOULD contain zero or one [0..1] entryRelationship (CONF:7580, CONF:7581, CONF:15922) Contains @typeCode="SUBJ" SUBJ, and Contains exactly one [1..1] Severity Observation (templateId: 2.16.840.1.113883.10.20.22.4.8)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(consol::SeverityObservation) 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.9"/>
<statusCode code="completed"/>
<entryRelationship typeCode="SUBJ">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.8"/>
<code code="SEV" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Severity observation"/>
<statusCode code="completed"/>
<interpretationCode codeSystem="2.16.840.1.113883.5.83" codeSystemName="ObservationInterpretation"/>
</observation>
</entryRelationship>
</observation>

0.013
testGetSeverityObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.010
Properties »