Unit Test Results.

Designed for use with JUnit and Ant.

Class org.openhealthtools.mdht.uml.cda.hitsp.tests.MedicationTest

NameTestsErrorsFailuresTime(s)Time StampHost
MedicationTest30010.6892013-01-31T13:34:34JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateHITSPMedicationTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( C83-[DE-8-CDA-1] ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.3.88.11.83.8"

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</substanceadministration>

0.008
testValidateHITSPMedicationFirstEffectiveTimeDatatype

Constraint

HITSP Medication The first &lt;effectiveTime> SHALL use the IVL_TS data type unless for a single administration, in which case, it SHALL use the TS data type. (C83-[DE-8-CDA-3])

OCL

self.effectiveTime->exists (ef : datatypes::SXCM_TS | not ef.oclIsUndefined())

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<effectiveTime/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</substanceadministration>

0.009
testValidateHITSPMedicationDoseUnits

Constraint

HITSP Medication doseQuantity/@unit, Dose Units MAY be present when needed. If present it SHALL be coded as 2.16.840.1.113883.3.88.12.80.29 Unit of Measure (C154-[DE-8.08-1])

OCL

self.doseQuantity->exists(dq : datatypes::IVL_PQ | dq.unit='2.16.840.1.113883.3.88.12.80.29')

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<doseQuantity unit="2.16.840.1.113883.3.88.12.80.29"/>
</substanceadministration>

0.008
testValidateHITSPMedicationDeliveryMethodDescription

Constraint

HITSP Medication The free text description of the delivery method MAY be included within a <originalText> element beneath the <code> element (C83-[DE-8.12-CDA-2])

OCL

not self.code.originalText.oclIsUndefined()

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code>
<originalText/>
</code>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</substanceadministration>

0.009
testValidateHITSPMedicationHasMedicationInformation

Constraint

HITSP Medication SHALL satisfy: Contains one consumable element which contains the Medication Information template. The name and code for the medication are recorded in the <consumable> element.

OCL

self.consumable.manufacturedProduct->exists(mp : cda::ManufacturedProduct | mp.oclIsKindOf(hitsp::MedicationInformation))

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<consumable/>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<consumable>
<manufacturedProduct/>
</consumable>
</substanceadministration>

0.008
testValidateHITSPMedicationHasStatusOfMedication

Constraint

HITSP Medication The medication status MAY be recorded using the CCD Medication Status observation using the value set defined in the CCD (C154-[DE-8.20-1])

OCL

self.getObservations()->exists(po : cda::Observation | po.oclIsKindOf(ccd::MedicationStatusObservation))

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<observation/>
</entryRelationship>
</substanceadministration>

0.009
testValidateHITSPMedicationHasIndication

Constraint

HITSP Medication MAY contain [0..*] indications which SHALL be recorded using the Indication problem observation (templateID 2.16.840.1.113883.10.20.1.28) described in the CCD Implementation Guide. (C83-[DE-8.20-CDA-1])

OCL

self.getObservations()->exists(po : cda::Observation | po.oclIsKindOf(ccd::ProblemObservation))

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<observation/>
</entryRelationship>
</substanceadministration>

0.008
testValidateHITSPMedicationHasIndicationNarrativeText

Constraint

HITSP Medication The indication problem observation SHALL contain a <text> element that includes a <reference> element whose value attribute points to the narrative text that is the indication for the medication (C83-[DE-8.20-CDA-2])

OCL

self.getObservations()->exists(po : cda::Observation | po.oclIsKindOf(ccd::ProblemObservation) and not po.text.reference.oclIsUndefined())

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<observation>
<text><reference/></text>
</observation>
</entryRelationship>
</substanceadministration>

0.017
testValidateHITSPMedicationHasIndicationVocab

Constraint

HITSP Medication The indication SHALL be coded as 2.16.840.1.113883.3.88.12.3221.7.4, Problem Value Set, version: 20100125, Dynamic (C154-[DE-8.20-1])

OCL

self.getObservations()->exists(po : cda::Observation | po.oclIsKindOf(ccd::ProblemObservation) and po.code.codeSystem = '2.16.840.1.113883.6.96')

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<observation>
<code codeSystem="2.16.840.1.113883.6.96"/>
</observation>
</entryRelationship>
</substanceadministration>

0.014
testValidateHITSPMedicationHasPatientInstructions

Constraint

HITSP Medication MAY contain Patient Instructions which SHALL be recorded using the Patient Medication Instructions template (templateID 1.3.6.1.4.1.19376.1.5.3.1.4.3) (C83-[DE-8.22-CDA-1])

OCL

self.getActs()->exists(po : cda::Act | po.oclIsKindOf(ihe::PatientMedicalInstructions))

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<act/>
</entryRelationship>
</substanceadministration>

0.008
testValidateHITSPMedicationHasMedicationVehicle

Constraint

HITSP Medication The vehicle for administering a medication MAY be recorded in a <participantRole> element inside a <participant> element in the <substanceAdministration> element (C83-[DE-8.24-CDA-1])

OCL

self.getSubstanceAdministrations()->exists(sa : cda::SubstanceAdministration | sa.participant.participantRole->size() > 0)

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<substanceAdministration>
<participant>
<participantRole/>
</participant>
</substanceAdministration>
</entryRelationship>
</substanceadministration>

0.014
testValidateHITSPMedicationMedicationVehicleType

Constraint

HITSP Medication The typeCode attribute of the <participant> element SHALL be CSM (C83-[DE-8.24-CDA-2])

OCL

self.getSubstanceAdministrations()->exists(sa : cda::SubstanceAdministration | sa.participant->size() > 0) implies self.getSubstanceAdministrations()->exists(sa : cda::SubstanceAdministration | sa.participant->exists(par : cda::Participant2 | par.typeCode = vocab::ParticipationType::CSM))

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<substanceAdministration>
<participant/>
</substanceAdministration>
</entryRelationship>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<substanceAdministration>
<participant typeCode="CSM"/>
</substanceAdministration>
</entryRelationship>
</substanceadministration>

0.023
testValidateHITSPMedicationMedicationVehicleClass

Constraint

HITSP Medication The classCode of the <participantRole> SHALL be MANU (C83-[DE-8.24-CDA-3])

OCL

self.getSubstanceAdministrations()->exists(sa : cda::SubstanceAdministration | sa.participant.participantRole->size() > 0) implies self.getSubstanceAdministrations()->exists(sa : cda::SubstanceAdministration | sa.participant->exists(par : cda::Participant2 | par.typeCode = vocab::ParticipationType::CSM and par.participantRole->exists(pr : cda::ParticipantRole | pr.classCode = vocab::RoleClassRoot::MANU)))

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<substanceAdministration>
<participant>
<participantRole/>
</participant>
</substanceAdministration>
</entryRelationship>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<substanceAdministration>
<participant typeCode="CSM">
<participantRole classCode="MANU"/>
</participant>
</substanceAdministration>
</entryRelationship>
</substanceadministration>

0.029
testValidateHITSPMedicationMedicationVehicleCode

Constraint

HITSP Medication A <code> element for the <participantRole> SHALL be present and SHALL contain the code 412307009 from the SNOMED CT code system (C83-[DE-8.24-CDA-4])

OCL

self.getSubstanceAdministrations()->exists(sa : cda::SubstanceAdministration | sa.participant.participantRole->size() > 0) implies self.getSubstanceAdministrations()->exists(sa : cda::SubstanceAdministration | sa.participant->exists(par : cda::Participant2 | par.typeCode = vocab::ParticipationType::CSM and par.participantRole->exists(pr : cda::ParticipantRole | pr.classCode = vocab::RoleClassRoot::MANU and pr.code.code = '412307009' and pr.code.codeSystem = '2.16.840.1.113883.6.96')))

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<substanceAdministration>
<participant>
<participantRole/>
</participant>
</substanceAdministration>
</entryRelationship>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<substanceAdministration>
<participant typeCode="CSM">
<participantRole classCode="MANU">
<code code="412307009" codeSystem="2.16.840.1.113883.6.96"/>
</participantRole>
</participant>
</substanceAdministration>
</entryRelationship>
</substanceadministration>

0.041
testValidateHITSPMedicationMedicationVehicleName

Constraint

HITSP Medication The <name> element in the <playingEntity> element SHALL record the name of the drug vehicle (C83-[DE-8.24-CDA-5])

OCL

self.getSubstanceAdministrations()->exists(sa : cda::SubstanceAdministration | sa.participant.participantRole->size() > 0) implies self.getSubstanceAdministrations()->exists(sa : cda::SubstanceAdministration | sa.participant->exists(par : cda::Participant2 | par.typeCode = vocab::ParticipationType::CSM and par.participantRole->exists(pr : cda::ParticipantRole | pr.classCode = vocab::RoleClassRoot::MANU and pr.code.code = '412307009' and pr.code.codeSystem = '2.16.840.1.113883.6.96' and pr.playingEntity.name->size() > 0)))

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<substanceAdministration>
<participant typeCode="CSM">
<participantRole classCode="MANU">
<code code="412307009" codeSystem="2.16.840.1.113883.6.96"/>
<playingEntity/>
</participantRole>
</participant>
</substanceAdministration>
</entryRelationship>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<substanceAdministration>
<participant typeCode="CSM">
<participantRole classCode="MANU">
<code code="412307009" codeSystem="2.16.840.1.113883.6.96"/>
<playingEntity>
<name/>
</playingEntity>
</participantRole>
</participant>
</substanceAdministration>
</entryRelationship>
</substanceadministration>

0.051
testValidateHITSPMedicationMedicationVehicleCodedName

Constraint

HITSP Medication The <code> element in the <playingEntity> element MAY be used to supply a coded term for the drug vehicle (C83-[DE-8.24-CDA-6])

OCL

self.getSubstanceAdministrations()->exists(sa : cda::SubstanceAdministration | sa.participant.participantRole->size() > 0) implies self.getSubstanceAdministrations()->exists(sa : cda::SubstanceAdministration | sa.participant->exists(par : cda::Participant2 | par.typeCode =vocab::ParticipationType::CSM and par.participantRole->exists(pr : cda::ParticipantRole | pr.classCode = vocab::RoleClassRoot::MANU and pr.code.code = '412307009' and pr.code.codeSystem = '2.16.840.1.113883.6.96' and pr.playingEntity.code->size() > 0)))

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<substanceAdministration>
<participant typeCode="CSM">
<participantRole classCode="MANU">
<playingEntity/>
</participantRole>
</participant>
</substanceAdministration>
</entryRelationship>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<substanceAdministration>
<participant typeCode="CSM">
<participantRole classCode="MANU">
<code code="412307009" codeSystem="2.16.840.1.113883.6.96"/>
<playingEntity>
<code code="12345" codeSystem="2.16.840.1.113883.3.88.12.80.21"/>
<name/>
</playingEntity>
</participantRole>
</participant>
</substanceAdministration>
</entryRelationship>
</substanceadministration>

0.051
testValidateHITSPMedicationMedicationVehicleCodedNameVocab

Constraint

HITSP Medication SHALL satisfy: The Medication Vehicle shall be coded as 2.16.840.1.113883.3.88.12.80.21, Medication Vehicle Value Set, version: 20081218, Dynamic (C154-[DE-8.24-1])

OCL

self.getSubstanceAdministrations()->exists(sa : cda::SubstanceAdministration | sa.participant.participantRole->size() > 0) implies self.getSubstanceAdministrations()->exists(sa : cda::SubstanceAdministration | sa.participant->exists(par : cda::Participant2 | par.typeCode = vocab::ParticipationType::CSM and par.participantRole->exists(pr : cda::ParticipantRole | pr.classCode = vocab::RoleClassRoot::MANU and pr.code.code = '412307009' and pr.code.codeSystem = '2.16.840.1.113883.6.96' and pr.playingEntity.code->size() > 0 and pr.playingEntity.code.codeSystem = '2.16.840.1.113883.6.96')))

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<substanceAdministration>
<participant typeCode="CSM">
<participantRole classCode="MANU">
<playingEntity/>
</participantRole>
</participant>
</substanceAdministration>
</entryRelationship>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship>
<substanceAdministration>
<participant typeCode="CSM">
<participantRole classCode="MANU">
<code code="412307009" codeSystem="2.16.840.1.113883.6.96"/>
<playingEntity>
<code code="12345" codeSystem="2.16.840.1.113883.6.96"/>
</playingEntity>
</participantRole>
</participant>
</substanceAdministration>
</entryRelationship>
</substanceadministration>

0.058
testValidateHITSPMedicationEffectiveTime

Constraint

HITSP Medication MAY contain at least one [1..*] effectiveTime with data type IVL_TS (CONF-308)

OCL

(self.effectiveTime->isEmpty() or self.effectiveTime->exists(element | element.isNullFlavorUndefined())) implies (not self.effectiveTime->isEmpty() and self.effectiveTime->forAll(element | element.oclIsTypeOf(datatypes::IVL_TS)))

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">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<effectiveTime xsi:type="IVL_TS"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</substanceadministration>

0.028
testValidateHITSPMedicationRouteCode

Constraint

HITSP Medication MAY contain at least one [1..*] routeCode (CONF-309, CONF-310), where the @code SHALL be selected from ValueSet Medication Route FDA 2.16.840.1.113883.3.88.12.3221.8.7 STATIC 1

OCL

(self.routeCode.oclIsUndefined() or self.routeCode.isNullFlavorUndefined()) implies (not self.routeCode.oclIsUndefined() and self.routeCode.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = self.routeCode.oclAsType(datatypes::CE) in value.codeSystem = '2.16.840.1.113883.3.26.1.1' and not value.code.oclIsUndefined())

FailureInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</substanceadministration>

ERROR EXPECT PASS validateHITSPMedicationRouteCode: HITSP Medication MAY contain at least one [1..*] routeCode (CONF-309, CONF-310), where the @code SHALL be selected from ValueSet Medication Route FDA 2.16.840.1.113883.3.88.12.3221.8.7 STATIC 1 HITSP Medication MAY contain at least one [1..*] routeCode (CONF-309, CONF-310), where the @code SHALL be selected from ValueSet Medication Route FDA 2.16.840.1.113883.3.88.12.3221.8.7 STATIC 1

junit.framework.AssertionFailedError: ERROR EXPECT PASS validateHITSPMedicationRouteCode: HITSP Medication MAY contain at least one [1..*] routeCode (CONF-309, CONF-310), where the @code SHALL be selected from ValueSet Medication Route FDA 2.16.840.1.113883.3.88.12.3221.8.7 STATIC 1 HITSP Medication MAY contain at least one [1..*] routeCode (CONF-309, CONF-310), where the @code SHALL be selected from ValueSet Medication Route FDA 2.16.840.1.113883.3.88.12.3221.8.7 STATIC 1
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$CDAValidationTestCase.validateExpectPass(CDAValidationTest.java:265)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doTest(CDAValidationTest.java:798)
at org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest$OperationsTestCase.doValidationTest(CDAValidationTest.java:845)
at org.openhealthtools.mdht.uml.cda.hitsp.tests.MedicationTest.testValidateHITSPMedicationRouteCode(MedicationTest.java:891)
0.045
testValidateHITSPMedicationRouteCodeP

Constraint

HITSP Medication MAY contain at least one [1..*] routeCode (CONF-309, CONF-310), where the @code SHALL be selected from ValueSet Medication Route FDA 2.16.840.1.113883.3.88.12.3221.8.7 STATIC 1

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</substanceadministration>

0.019
testValidateHITSPMedicationDoseQuantity

Constraint

HITSP Medication MAY contain at least one [1..*] doseQuantity

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<doseQuantity/>
</substanceadministration>

0.021
testValidateHITSPMedicationAdministrationUnitCode

Constraint

HITSP Medication MAY contain exactly one [1..1] administrationUnitCode, where the @code MAY be selected from ValueSet Medication Product Form 2.16.840.1.113883.3.88.12.3221.8.11 STATIC 1 (C154-[DE-8.11-1])

OCL

(self.administrationUnitCode.oclIsUndefined() or self.administrationUnitCode.isNullFlavorUndefined()) implies (not self.administrationUnitCode.oclIsUndefined() and self.administrationUnitCode.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = self.administrationUnitCode.oclAsType(datatypes::CE) in not value.codeSystem.oclIsUndefined() or not value.codeSystemName.oclIsUndefined())

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<administrationUnitCode code="code" codeSystem="codeSystem"/>
</substanceadministration>

0.047
testValidateHITSPMedicationMaxDoseQuantity

Constraint

HITSP Medication MAY contain at least one [1..*] maxDoseQuantity (CONF-312)

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<maxDoseQuantity/>
</substanceadministration>

0.020
testValidateHITSPMedicationApproachSiteCodeP

Constraint

HITSP Medication MAY contain zero or more [0..*] approachSiteCode (C154-[DE-8.09-1]), where the @code SHALL be selected from ValueSet Body Site 2.16.840.1.113883.3.88.12.3221.8.9 STATIC 2

OCL

(self.approachSiteCode->isEmpty() or self.approachSiteCode->exists(element | element.isNullFlavorUndefined())) implies (not self.approachSiteCode->isEmpty())

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</substanceadministration>

0.020
testValidateHITSPMedicationApproachSiteCode

Constraint

HITSP Medication MAY contain zero or more [0..*] approachSiteCode (C154-[DE-8.09-1]), where the @code SHALL be selected from ValueSet Body Site 2.16.840.1.113883.3.88.12.3221.8.9 STATIC 2

OCL

(self.approachSiteCode->isEmpty() or self.approachSiteCode->exists(element | element.isNullFlavorUndefined())) implies (self.approachSiteCode->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


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<approachSiteCode code="aaa" codeSystem="2.16.840.1.113883.6.96"/>
</substanceadministration>

0.040
testValidateHITSPMedicationCode

Constraint

HITSP Medication MAY contain zero or more [0..*] code (C83-[DE-8.12-CDA-1])

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.3.88.11.83.8"/>
<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.7"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<routeCode codeSystem="2.16.840.1.113883.5.112" codeSystemName="HL7 RouteOfAdministration"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</substanceadministration>

0.019
testGetMedicationType

Constraint

OCL

SuccessInvalid XML

Valid XML

0.019
testGetMedicationOrderInformations

Constraint

OCL

SuccessInvalid XML

Valid XML

0.017
testGetHITSPReactionObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.019
Properties »