Unit Test Results.

Designed for use with JUnit and Ant.

Class org.openhealthtools.mdht.uml.cda.ihe.tests.ImmunizationTest

NameTestsErrorsFailuresTime(s)Time StampHost
ImmunizationTest7000.0902013-01-31T13:34:24JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateImmunizationComments

Constraint

The 'ImmunizationComments' invariant is violated on 'org.openhealthtools.mdht.uml.cda.ihe.impl.ImmunizationImpl@6933711b{#//}'

OCL

self.negationInd=true implies not self.entryRelationship.act->select( act | act.oclIsKindOf(ccd::Comment) )->isEmpty()

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3" moodCode="EVN" negationInd="true">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.12"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<code code="IMMUNIZ" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" moodCode="EVN" negationInd="true">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.12"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.12"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<code code="IMMUNIZ" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<entryRelationship>
<act classCode="ACT" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.40"/>
<code code="48767-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Annotation comment"/>
</act>
</entryRelationship>
</substanceadministration>

0.017
testValidateImmunizationTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( ) such that it SHALL contain exactly one [1..1] @root="1.3.6.1.4.1.19376.1.5.3.1.4.12"

OCL

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

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3"/>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.12"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<code code="IMMUNIZ" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
</substanceadministration>

0.006
testValidateImmunizationCode

Constraint

IHE Immunization SHALL contain zero or one [0..1] code/@code="IMMUNIZ" (CodeSystem: 2.16.840.1.113883.5.4 HL7ActCode) (6.3.4.17.5)

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

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3"/>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.12"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<code code="IMMUNIZ" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
</substanceadministration>

0.027
testValidateImmunizationStatusCode

Constraint

The statusCode shall be set to "completed" for all immunizations

OCL

(self.statusCode.oclIsUndefined() or self.statusCode.isNullFlavorUndefined()) implies (not self.statusCode.oclIsUndefined())

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3"/>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.12"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<code code="IMMUNIZ" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
</substanceadministration>

0.015
testValidateImmunizationMoodCode

Constraint

IHE Immunization SHALL contain exactly one [1..1] @moodCode="EVN" Event (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood) (6.3.4.17.2)

OCL

isDefined('moodCode')

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3"/>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.12"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<code code="IMMUNIZ" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
</substanceadministration>

0.005
testValidateImmunizationEffectiveTime

Constraint

IHE Immunization SHALL satisfy: The effectiveTime element shall be present and should contain a time value that indicates the date of the substance administration. If the date is unkown, this shall be recorded using the nullFlavor attribute, with the reason that the information is unknown being specified. Otherwise, the date shall be recorded, and should have precision of at least the day. (6.3.4.17.8)

OCL

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

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3"/>

Valid XML


<substanceadministration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.12"/>
<templateId root="2.16.840.1.113883.10.20.1.24"/>
<code code="IMMUNIZ" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<effectiveTime xsi:type="IVL_TS"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
</substanceadministration>

0.016
Properties »