Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
MedicationActivityTest46003.0442013-01-31T13:35:28JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateMedicationActivityMoodCode

Constraint

Consol Medication Activity SHALL contain exactly one [1..1] @moodCode, where the @code SHALL be selected from ValueSet MoodCodeEvnInt 2.16.840.1.113883.11.20.9.18 STATIC 2011-04-03 (CONF:7497)

OCL

not self.moodCode.oclIsUndefined() and self.moodCode.oclIsKindOf(vocab::x_DocumentSubstanceMood) and let value : vocab::x_DocumentSubstanceMood = self.moodCode.oclAsType(vocab::x_DocumentSubstanceMood) in value = vocab::x_DocumentSubstanceMood::EVN or value = vocab::x_DocumentSubstanceMood::INT

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" classCode="SBADM" moodCode="EVN">
<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>

<substanceadministration xmlns="urn:hl7-org:v3" classCode="SBADM" moodCode="INT">
<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>

0.047
testValidateMedicationActivityTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:7499, CONF:10504 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.16"

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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>

0.011
testValidateMedicationActivityId

Constraint

Consol Medication Activity SHALL contain at least one [1..*] id (CONF:7500)

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<id/>
<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>

0.036
testValidateMedicationActivityStatusCode

Constraint

Consol Medication Activity SHALL contain exactly one [1..1] statusCode (CONF:7507)

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" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<statusCode code="completed"/>
<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>

0.040
testValidateMedicationActivityMaxDoseQuantity

Constraint

Consol Medication Activity MAY contain zero or one [0..1] maxDoseQuantity (CONF:7518)

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" 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"/>
<maxDoseQuantity/>
</substanceadministration>

0.035
testValidateMedicationActivityRouteCode

Constraint

Consol Medication Activity MAY contain zero or one [0..1] routeCode, where the @code SHALL be selected from ValueSet Medication Route FDA Value Set 2.16.840.1.113883.3.88.12.3221.8.7 STATIC 1 (CONF:7514)

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 (value.code = 'C38192' or value.code = 'C38193' or value.code = 'C38194' or value.code = 'C38675' or value.code = 'C38197' or value.code = 'C38633' or value.code = 'C38205' or value.code = 'C38206' or value.code = 'C38208' or value.code = 'C38209' or value.code = 'C38210' or value.code = 'C38211' or value.code = 'C38212' or value.code = 'C38200' or value.code = 'C38215' or value.code = 'C38219' or value.code = 'C38220' or value.code = 'C38221' or value.code = 'C38222' or value.code = 'C38223' or value.code = 'C38224' or value.code = 'C38225' or value.code = 'C38226' or value.code = 'C38227' or value.code = 'C38228' or value.code = 'C38229' or value.code = 'C38230' or value.code = 'C38231' or value.code = 'C38232' or value.code = 'C38233' or value.code = 'C38234' or value.code = 'C38217' or value.code = 'C38218' or value.code = 'C38235' or value.code = 'C38238' or value.code = 'C38239' or value.code = 'C38240' or value.code = 'C38241' or value.code = 'C38242' or value.code = 'C38243' or value.code = 'C38245' or value.code = 'C38246' or value.code = 'C38247' or value.code = 'C38249' or value.code = 'C38250' or value.code = 'C38251' or value.code = 'C38252' or value.code = 'C38253' or value.code = 'C38254' or value.code = 'C28161' or value.code = 'C38255' or value.code = 'C38256' or value.code = 'C38257' or value.code = 'C38258' or value.code = 'C38259' or value.code = 'C38260' or value.code = 'C38261' or value.code = 'C38262' or value.code = 'C38263' or value.code = 'C38264' or value.code = 'C38265' or value.code = 'C38266' or value.code = 'C38267' or value.code = 'C38207' or value.code = 'C38268' or value.code = 'C38269' or value.code = 'C38270' or value.code = 'C38272' or value.code = 'C38273' or value.code = 'C38276' or value.code = 'C38277' or value.code = 'C38278' or value.code = 'C38280' or value.code = 'C38203' or value.code = 'C38281' or value.code = 'C38282' or value.code = 'C38284' or value.code = 'C38285' or value.code = 'C48623' or value.code = 'C38286' or value.code = 'C38287' or value.code = 'C38288' or value.code = 'C38289' or value.code = 'C38291' or value.code = 'C38676' or value.code = 'C38292' or value.code = 'C38677' or value.code = 'C38293' or value.code = 'C38294' or value.code = 'C38295' or value.code = 'C38216' or value.code = 'C38296' or value.code = 'C38198' or value.code = 'C38297' or value.code = 'C38298' or value.code = 'C38299' or value.code = 'C38300' or value.code = 'C38301' or value.code = 'C38304' or value.code = 'C38305' or value.code = 'C38283' or value.code = 'C38307' or value.code = 'C38308' or value.code = 'C38309' or value.code = 'C38312' or value.code = 'C38271'))

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<routeCode code="C38194" codeSystem="2.16.840.1.113883.3.26.1.1"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</substanceadministration>

1.455
testValidateMedicationActivityDoseQuantity

Constraint

Consol Medication Activity SHOULD contain zero or one [0..1] doseQuantity (CONF:7516)

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" 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"/>
<doseQuantity/>
</substanceadministration>

0.040
testValidateMedicationActivityRateQuantity

Constraint

Consol Medication Activity MAY contain zero or one [0..1] rateQuantity (CONF:7517)

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<rateQuantity/>
</substanceadministration>

0.040
testValidateMedicationActivityPerformer

Constraint

Consol Medication Activity MAY contain zero or one [0..1] performer (CONF:7522) Contains exactly one [1..1] CDA Performer2

OCL

self.performer->one(performer : cda::Performer2 | not performer.oclIsUndefined() and performer.oclIsKindOf(rim::Participation))

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<performer/>
</substanceadministration>

0.023
testValidateMedicationActivityReactionObservation

Constraint

Consol Medication Activity MAY contain zero or one [0..1] entryRelationship (CONF:7552, CONF:7544, CONF:16091) Contains @typeCode="CAUS" CAUS, and Contains exactly one [1..1] Reaction Observation (templateId: 2.16.840.1.113883.10.20.22.4.9)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(consol::ReactionObservation) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::CAUS)

SuccessInvalid XML


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

Valid XML


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

0.037
testGetIndications

Constraint

OCL

SuccessInvalid XML

Valid XML

0.032
testGetInstructions

Constraint

OCL

SuccessInvalid XML

Valid XML

0.036
testGetReactionObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.036
testGetMedicationSupplyOrder

Constraint

OCL

SuccessInvalid XML

Valid XML

0.036
testValidateMedicationActivityDoseQuantityorrateQuantity

Constraint

Consol Medication Activity Medication Activity SHOULD include doseQuantity OR rateQuantity

OCL

self.doseQuantity->size() = 1 xor self.rateQuantity->size() = 1

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<rateQuantity/>
</substanceadministration>

0.037
testValidateMedicationActivityTextReference

Constraint

Consol Medication Activity text, if present, SHOULD contain zero or one [0..1] reference (CONF:15977)

OCL

not self.text.oclIsUndefined() implies self.text->forAll(reference->size() = 1)

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<text/>
<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>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<text><reference value="test"/></text>
<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>

0.038
testValidateMedicationActivityReferenceValue

Constraint

Consol Medication Activity reference, if present, SHOULD contain zero or one [0..1] @value (CONF:15978)

OCL

self.text->forAll(reference->size() = 1) implies self.text->forAll(reference->one(value->size() = 1))

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<text><reference/></text>
<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>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<text><reference value="test"/></text>
<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>

0.051
testValidateMedicationActivityTextReferenceValue

Constraint

Consol Medication Activity 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:15979)

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="">
Not a particularly severe reaction.
</content></text>
<entry>
<substanceAdministration classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<text>Some sample text<reference value="#1.2.3.4"/></text>
<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>
</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">
Not a particularly severe reaction.
</content></text>
<entry>
<substanceAdministration classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<text>Some sample text<reference value="#1.2.3.4"/></text>
<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>
</entry>
</section>

0.067
testValidateMedicationActivityEffectiveTimeIVLTS

Constraint

Consol Medication Activity SHALL contain exactly one [1..1] effectiveTime such that it SHALL contain exactly one [1..1] @xsi:type = "IVL_TS" (CONF:7508, CONF:9104)

OCL

self.effectiveTime->select(ef | ef.oclIsTypeOf(datatypes::IVL_TS))->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" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<effectiveTime xsi:type="IVL_TS"/>
<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>

0.023
testValidateMedicationActivityEffectiveTimeLow

Constraint

Consol Medication Activity effectiveTime with @xsi:type="IVL_TS" SHALL contain exactly one [1..1] low

OCL

self.effectiveTime->select(ef | ef.oclIsTypeOf(datatypes::IVL_TS))->forAll( eff | eff.oclAsType(datatypes::IVL_TS).low->size() = 1)

SuccessInvalid XML


<substanceadministration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<effectiveTime xsi:type="IVL_TS"/>
<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>

Valid XML


<substanceadministration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<effectiveTime xsi:type="IVL_TS">
<low/>
</effectiveTime>
<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>

0.032
testValidateMedicationActivityEffectiveTimeHigh

Constraint

Consol Medication Activity effectiveTime with @xsi:type="IVL_TS" SHALL contain exactly one [1..1] high

OCL

self.effectiveTime->select(ef | ef.oclIsTypeOf(datatypes::IVL_TS))->forAll( eff | eff.oclAsType(datatypes::IVL_TS).high->size() = 1)

SuccessInvalid XML


<substanceadministration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<effectiveTime xsi:type="IVL_TS"/>
<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>

Valid XML


<substanceadministration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<effectiveTime xsi:type="IVL_TS">
<high/>
</effectiveTime>
<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>

0.033
testValidateMedicationActivityEffectiveTimePIVLTS

Constraint

Consol Medication Activity SHOULD contain zero or one [0..1] effectiveTime such that it SHALL contain exactly one [1..1] @xsi:type = "PIVL_TS" or "EIVL_TS" (CONF:7513, CONF:9105)

OCL

self.effectiveTime->select(ef | ef.oclIsTypeOf(datatypes::PIVL_TS) or ef.oclIsTypeOf(datatypes::EIVL_TS))->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" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<effectiveTime xsi:type="EIVL_TS"/>
<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>

0.036
testValidateMedicationActivityEffectiveTimeOperator

Constraint

Consol Medication Activity effectiveTime with @xsi:type = "PIVL_TS" or "EIVL_TS" SHALL contain exactly one [1..1] @operator="A" (CONF:9106)

OCL

self.effectiveTime->select(ef | ef.oclIsTypeOf(datatypes::PIVL_TS) or ef.oclIsTypeOf(datatypes::EIVL_TS))->forAll(eff | eff.operator = vocab::SetOperator::A and eff.operator->size() = 1)

SuccessInvalid XML


<substanceadministration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<effectiveTime xsi:type="EIVL_TS"/>
<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>

Valid XML


<substanceadministration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<effectiveTime xsi:type="EIVL_TS" operator="A"/>
<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>

0.045
testValidateMedicationActivityDoseQuantityUnit

Constraint

Consol Medication Activity doseQuantity, if present, SHOULD contain zero or one [0..1] @unit, which SHALL be selected from ValueSet UCUM Units of Measure (case sensitive) 2.16.840.1.113883.1.11.12839 DYNAMIC (CONF:7526)

OCL

not self.doseQuantity.oclIsUndefined() implies not self.doseQuantity.unit.oclIsUndefined()

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<doseQuantity/>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<doseQuantity unit="test"/>
</substanceadministration>

0.035
testValidateMedicationActivityDrugVehicleTypeCode

Constraint

Consol Medication Activity participant with target entry Drug Vehicle SHALL contain exactly one [1..1] @typeCode="CSM" (CodeSystem: HL7ParticipationType 2.16.840.1.113883.5.90) (CONF:7524)

OCL

self.participant->select(par : cda::Participant2 | par.participantRole.oclIsKindOf(consol::DrugVehicle))->forAll(p : cda::Participant2 | p.typeCode=vocab::ParticipationType::CSM)

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<participant>
<participantRole/>
</participant>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<participant typeCode="CSM">
<participantRole/>
</participant>
</substanceadministration>

0.016
testValidateMedicationActivityInstructionsInversionInd

Constraint

Consol Medication Activity entryRelationship with target entry Instructions SHALL contain exactly one [1..1] @inversionInd="true" True (CONF:7542)

OCL

self.entryRelationship->select(er : cda::EntryRelationship | er.act.oclIsTypeOf(consol::Instructions))->forAll(ent : cda::EntryRelationship | ent.inversionInd=true)

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<entryRelationship>
<act/>
</entryRelationship>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<entryRelationship/>
</substanceadministration>

0.020
testValidateMedicationActivityPreconditionSubstanceAdmTypeCode

Constraint

Consol Medication Activity Precondition for Substance Administration SHALL contain exactly one [1..1] @typeCode="PRCN" (CodeSystem: HL7ActRelationshipType 2.16.840.1.113883.5.1002) (CONF:7550)

OCL

self.precondition->select(par : cda::Precondition | par.oclIsKindOf(consol::PreconditionForSubstanceAdministration))->forAll(p : cda::Precondition | p.typeCode=vocab::ActRelationshipType::PRCN)

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<precondition typeCode="CAUS"/>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<precondition typeCode="PRCN"/>
</substanceadministration>

0.015
testValidateMedicationActivityClassCode

Constraint

Consol Medication Activity SHALL contain exactly one [1..1] @classCode="SBADM" (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) (CONF:7496)

OCL

self.classCode=vocab::ActClass::SBADM

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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>

0.008
testValidateMedicationActivityCode

Constraint

Consol Medication Activity MAY contain zero or one [0..1] code (CONF:7506)

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" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<code/>
<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>

0.033
testValidateMedicationActivityRouteCodeP

Constraint

Consol Medication Activity MAY contain zero or one [0..1] routeCode, where the @code SHALL be selected from ValueSet Medication Route FDA Value Set 2.16.840.1.113883.3.88.12.3221.8.7 STATIC 1 (CONF:7514)

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" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<routeCode code="code" codeSystem="codeSystem"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</substanceadministration>

0.035
testValidateMedicationActivityApproachSiteCode

Constraint

Consol Medication Activity MAY contain zero or one [0..1] approachSiteCode, where the @code SHALL be selected from ValueSet Body Site Value Set 2.16.840.1.113883.3.88.12.3221.8.9 STATIC 2 (CONF:7515)

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" 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"/>
<approachSiteCode/>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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 code="code" codeSystem="2.16.840.1.113883.6.96" codeSystemName="codeSystemName" displayName="displayName"/>
</substanceadministration>

0.077
testValidateMedicationActivityApproachSiteCodeP

Constraint

Consol Medication Activity MAY contain zero or one [0..1] approachSiteCode, where the @code SHALL be selected from ValueSet Body Site Value Set 2.16.840.1.113883.3.88.12.3221.8.9 STATIC 2 (CONF:7515)

OCL

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

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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 code="code" codeSystem="2.16.840.1.113883.6.96" codeSystemName="codeSystemName" displayName="displayName"/>
</substanceadministration>

0.037
testValidateMedicationActivityAdministrationUnitCode

Constraint

Consol Medication Activity MAY contain zero or one [0..1] administrationUnitCode, where the @code MAY be selected from ValueSet Medication Product Form Value Set 2.16.840.1.113883.3.88.12.3221.8.11 STATIC 1 (CONF:7519)

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" 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"/>
<administrationUnitCode code="code" codeSystem="2.16.840.1.113883.3.26.1.1"/>
</substanceadministration>

0.089
testValidateMedicationActivityText

Constraint

Consol Medication Activity SHOULD contain zero or one [0..1] text (CONF:7501)

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<text/>
<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>

0.036
testValidateMedicationActivityRepeatNumber

Constraint

Consol Medication Activity MAY contain zero or one [0..1] repeatNumber (CONF:7555)

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<repeatNumber/>
<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>

0.040
testValidateMedicationActivityMedicationSupplyOrder

Constraint

Consol Medication Activity MAY contain zero or one [0..1] entryRelationship (CONF:7543, CONF:7547, CONF:16089) Contains @typeCode="REFR" REFR, and Contains exactly one [1..1] Medication Supply Order (templateId: 2.16.840.1.113883.10.20.22.4.17)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.supply.oclIsUndefined() and entryRelationship.supply.oclIsKindOf(consol::MedicationSupplyOrder) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::REFR)

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<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"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship typeCode="REFR">
<supply classCode="SPLY" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.17"/>
</supply>
</entryRelationship>
</substanceadministration>

0.038
testValidateMedicationActivityConsumable

Constraint

Consol Medication Activity SHALL contain exactly one [1..1] consumable (CONF:7520)

OCL

self.consumable->one(consumable : cda::Consumable | not consumable.oclIsUndefined() and consumable.oclIsKindOf(cda::Consumable))

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<consumable/>
</substanceadministration>

0.024
testValidateMedicationActivityConsumableMedicationInformation

Constraint

Consol Medication Activity SHALL contain exactly one [1..1] consumable (CONF:7520) consumable SHALL contain exactly one [1..1] manufacturedProduct, where its type is Medication Information (CONF:16085)

OCL

self.consumable->excluding(null)->reject(manufacturedProduct->one(manufacturedProduct : cda::ManufacturedProduct | not manufacturedProduct.oclIsUndefined() and manufacturedProduct.oclIsKindOf(consol::MedicationInformation)))

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<consumable/>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<consumable>
<manufacturedProduct/>
</consumable>
</substanceadministration>

0.037
testValidateMedicationActivityInstructions

Constraint

Consol Medication Activity MAY contain zero or one [0..1] entryRelationship (CONF:7539, CONF:7540, CONF:16088) Contains @typeCode="SUBJ" SUBJ, and Contains exactly one [1..1] Instructions (templateId: 2.16.840.1.113883.10.20.22.4.20)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.act.oclIsUndefined() and entryRelationship.act.oclIsKindOf(consol::Instructions) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::SUBJ)

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" classCode="SBADM">
<templateId root="2.16.840.1.113883.10.20.22.4.16"/>
<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"/>
<approachSiteCode codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<entryRelationship typeCode="SUBJ">
<act classCode="ACT" moodCode="INT">
<templateId root="2.16.840.1.113883.10.20.22.4.20"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</act>
</entryRelationship>
</substanceadministration>

0.037
testValidateMedicationActivityIndication

Constraint

Consol Medication Activity MAY contain zero or more [0..*] entryRelationship (CONF:7536, CONF:7537, CONF:16087) Contains @typeCode="RSON" RSON, and Contains exactly one [1..1] Indication (templateId: 2.16.840.1.113883.10.20.22.4.19)

OCL

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

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<entryRelationship typeCode="RSON">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.19"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>
</entryRelationship>
</substanceadministration>

0.037
testValidateMedicationActivityMedicationDispense

Constraint

Consol Medication Activity MAY contain zero or more [0..*] entryRelationship (CONF:7549, CONF:7553, CONF:16090) Contains @typeCode="REFR" REFR, and Contains exactly one [1..1] Medication Dispense (templateId: 2.16.840.1.113883.10.20.22.4.18)

OCL

self.entryRelationship->exists(entryRelationship : cda::EntryRelationship | not entryRelationship.supply.oclIsUndefined() and entryRelationship.supply.oclIsKindOf(consol::MedicationDispense) and entryRelationship.typeCode = vocab::x_ActRelationshipEntryRelationship::REFR)

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<entryRelationship typeCode="REFR">
<supply classCode="SPLY" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.18"/>
</supply>
</entryRelationship>
</substanceadministration>

0.038
testValidateMedicationActivityPrecondition

Constraint

Consol Medication Activity MAY contain zero or more [0..*] precondition (CONF:7546, CONF:16092) Contains exactly one [1..1] Precondition For Substance Administration (templateId: 2.16.840.1.113883.10.20.22.4.25)

OCL

self.precondition->exists(precondition : cda::Precondition | not precondition.oclIsUndefined() and precondition.oclIsKindOf(consol::PreconditionForSubstanceAdministration))

SuccessInvalid XML


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

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<precondition typeCode="PRCN"/>
</substanceadministration>

0.024
testValidateMedicationActivityDrugVehicle

Constraint

Consol Medication Activity MAY contain zero or more [0..*] participant (CONF:7523, CONF:7524, CONF:16086) Contains exactly one [1..1] Drug Vehicle (templateId: 2.16.840.1.113883.10.20.22.4.24)

OCL

self.participant->exists(participant : cda::Participant2 | not participant.participantRole.oclIsUndefined() and participant.participantRole.oclIsKindOf(consol::DrugVehicle))

SuccessInvalid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<participant/>
</substanceadministration>

Valid XML


<substanceadministration xmlns="urn:hl7-org:v3" 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"/>
<participant>
<participantRole classCode="MANU">
<templateId root="2.16.840.1.113883.10.20.22.4.24"/>
<code code="412307009" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
</participantRole>
</participant>
</substanceadministration>

0.027
testGetMedicationDispenses

Constraint

OCL

SuccessInvalid XML

Valid XML

0.032
testGetDrugVehicles

Constraint

OCL

SuccessInvalid XML

Valid XML

0.032
Properties »