Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
ReactionObservationTest24001.0882013-01-31T13:36:16JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testGetMedicationActivities

Constraint

OCL

SuccessInvalid XML

Valid XML

0.041
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.014
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.010
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.008
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.099
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.047
testGetSeverityObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.046
testGetProcedureActivityProcedures

Constraint

OCL

SuccessInvalid XML

Valid XML

0.040
testValidateReactionObservationTextReference

Constraint

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

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

0.049
testValidateReactionObservationTextReferenceValue

Constraint

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

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

0.067
testValidateReactionObservationReferenceValue

Constraint

Consol Reaction 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:15919)

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 adverse reaction.
</content></text>
<entry>
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.9"/>
<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 adverse reaction.
</content></text>
<entry>
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.9"/>
<text>Some sample text<reference value="#1.2.3.4"/></text>
<statusCode code="completed"/>
</observation>
</entry>
</section>

0.086
testValidateReactionObservationEffectiveTimeLow

Constraint

Consol Reaction Observation effectiveTime, if present, SHOULD contain zero or one [0..1] low (CONF:7333)

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

0.045
testValidateReactionObservationEffectiveTimeHigh

Constraint

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

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

0.045
testValidateReactionObservationSeverityObservationInversionInd

Constraint

Consol Reaction Observation entryRelationship with target entry Severity Observation SHALL contain exactly one [1..1] @inversionInd="true" TRUE (CONF:10375)

OCL

self.entryRelationship->select(er : cda::EntryRelationship | er.observation.oclIsTypeOf(consol::SeverityObservation))->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.9"/>
<statusCode code="completed"/>
<entryRelationship inversionInd="false">
<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>

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/>
</observation>

0.026
testValidateReactionObservationProcedureActivityProcedureInversionInd

Constraint

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

OCL

self.entryRelationship->select(er : cda::EntryRelationship | er.procedure.oclIsTypeOf(consol::ProcedureActivityProcedure))->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.9"/>
<statusCode code="completed"/>
<entryRelationship inversionInd="false">
<procedure classCode="PROC">
<templateId root="2.16.840.1.113883.10.20.22.4.14"/>
<priorityCode codeSystem="2.16.840.1.113883.5.7" codeSystemName="ActPriority"/>
<targetSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</procedure>
</entryRelationship>
</observation>

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/>
</observation>

0.025
testValidateReactionObservationMedicationActivityInversionInd

Constraint

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

OCL

self.entryRelationship->select(er : cda::EntryRelationship | er.substanceAdministration.oclIsTypeOf(consol::MedicationActivity))->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.9"/>
<statusCode code="completed"/>
<entryRelationship inversionInd="false">
<substanceAdministration classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<routeCode codeSystem="2.16.840.1.113883.3.26.1.1" codeSystemName="NCI Thesaurus"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</substanceAdministration>
</entryRelationship>
</observation>

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/>
</observation>

0.025
testValidateReactionObservationId

Constraint

Consol Reaction Observation SHALL contain exactly one [1..1] id (CONF:7329)

OCL

(self.id->isEmpty() or self.id->exists(element | element.isNullFlavorUndefined())) implies (self.id->size() = 1)

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

0.050
testValidateReactionObservationCode

Constraint

Consol Reaction Observation SHALL contain exactly one [1..1] code (CONF:16851)

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

0.042
testValidateReactionObservationText

Constraint

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

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

0.045
testValidateReactionObservationEffectiveTime

Constraint

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

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

0.051
testValidateReactionObservationValue

Constraint

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

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: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.9"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="234422006" codeSystem="2.16.840.1.113883.3.88.12.3221.7.4"/>
</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.9"/>
<templateId root="2.16.840.1.113883.10.20.22.4.9"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="234422006" codeSystem="2.16.840.1.113883.6.96"/>
</observation>

0.119
testValidateReactionObservationProcedureActivityProcedure

Constraint

Consol Reaction Observation MAY contain zero or more [0..*] entryRelationship (CONF:7337, CONF:7338, CONF:15920) Contains @typeCode="RSON" RSON, and Contains exactly one [1..1] Procedure Activity Procedure (templateId: 2.16.840.1.113883.10.20.22.4.14)

OCL

self.entryRelationship->exists(entryRelationship : cda::EntryRelationship | not entryRelationship.procedure.oclIsUndefined() and entryRelationship.procedure.oclIsKindOf(consol::ProcedureActivityProcedure) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::RSON)

SuccessInvalid 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" inversionInd="true">
<procedure classCode="PROC">
<templateId root="2.16.840.1.113883.10.20.22.4.14"/>
<priorityCode codeSystem="2.16.840.1.113883.5.7" codeSystemName="ActPriority"/>
<targetSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</procedure>
</entryRelationship>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.9"/>
<templateId root="2.16.840.1.113883.10.20.22.4.9"/>
<statusCode code="completed"/>
<entryRelationship typeCode="RSON" inversionInd="true">
<procedure classCode="PROC">
<templateId root="2.16.840.1.113883.10.20.22.4.14"/>
<priorityCode codeSystem="2.16.840.1.113883.5.7" codeSystemName="ActPriority"/>
<targetSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</procedure>
</entryRelationship>
</observation>

0.048
testValidateReactionObservationMedicationActivity

Constraint

Consol Reaction Observation MAY contain zero or more [0..*] entryRelationship (CONF:7340, CONF:7341, CONF:15921) Contains @typeCode="RSON" RSON, and Contains exactly one [1..1] Medication Activity (templateId: 2.16.840.1.113883.10.20.22.4.16)

OCL

self.entryRelationship->exists(entryRelationship : cda::EntryRelationship | not entryRelationship.substanceAdministration.oclIsUndefined() and entryRelationship.substanceAdministration.oclIsKindOf(consol::MedicationActivity) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::RSON)

SuccessInvalid 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" inversionInd="true">
<substanceAdministration classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<routeCode codeSystem="2.16.840.1.113883.3.26.1.1" codeSystemName="NCI Thesaurus"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</substanceAdministration>
</entryRelationship>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.9"/>
<templateId root="2.16.840.1.113883.10.20.22.4.9"/>
<statusCode code="completed"/>
<entryRelationship typeCode="RSON" inversionInd="true">
<substanceAdministration classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<routeCode codeSystem="2.16.840.1.113883.3.26.1.1" codeSystemName="NCI Thesaurus"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</substanceAdministration>
</entryRelationship>
</observation>

0.049
Properties »