Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
MedicationsSectionTest10000.0802013-01-31T13:34:16JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.000
testGetMedicationActivities

Constraint

OCL

SuccessInvalid XML

Valid XML

0.007
testGetSupplyActivities

Constraint

OCL

SuccessInvalid XML

Valid XML

0.008
testValidateMedicationsSectionHasMedicationOrSupplyActivity

Constraint

CCD Medications Section SHOULD satisfy: Clinical statements include one or more Medication Activity and/or one or more Supply Activity. (CONF-298)

OCL

self.getSubstanceAdministrations()->exists(activity : cda::SubstanceAdministration | activity.oclIsKindOf(ccd::MedicationActivity)) or self.getSupplies()->exists(activity : cda::Supply | activity.oclIsKindOf(ccd::SupplyActivity))

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.1.8"/>
<code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medication use"/>
<entry>
<substanceAdministration/>
</entry>
<entry>
<supply/>
</entry>
</section>

0.009
testValidateMedicationsSectionTemplateId

Constraint

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

OCL

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

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.1.8"/>
<code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medication use"/>
</section>

0.004
testValidateMedicationsSectionCode

Constraint

Consol Medications Section SHALL contain exactly one [1..1] code/@code="10160-0" History of medication use (CodeSystem: 2.16.840.1.113883.6.1 LOINC) (CONF:7569)

OCL

(self.code.oclIsUndefined() or self.code.isNullFlavorUndefined()) implies (not self.code.oclIsUndefined() and self.code.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = self.code.oclAsType(datatypes::CE) in value.code = '10160-0' and value.codeSystem = '2.16.840.1.113883.6.1')

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.1.1"/>
<templateId root="2.16.840.1.113883.10.20.22.2.1"/>
<code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medication use"/>
</section>

0.016
testValidateMedicationsSectionTitle

Constraint

Consol Medications Section SHALL contain exactly one [1..1] title (CONF:7570)

OCL

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

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.1.1"/>
<templateId root="2.16.840.1.113883.10.20.22.2.1"/>
<code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medication use"/>
<title>Medications</title>
</section>

0.009
testValidateMedicationsSectionText

Constraint

Consol Medications Section SHALL contain exactly one [1..1] text (CONF:7571)

OCL

not self.text.oclIsUndefined()

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.1.1"/>
<templateId root="2.16.840.1.113883.10.20.22.2.1"/>
<code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medication use"/>
<text/>
</section>

0.004
testValidateMedicationsSectionMedicationActivity

Constraint

CCD Medications Section SHOULD contain zero or more [0..*] entry (CONF-298) Contains exactly one [1..1] Medication Activity (templateId: 2.16.840.1.113883.10.20.1.24)

OCL

self.entry->exists(entry : cda::Entry | not entry.substanceAdministration.oclIsUndefined() and entry.substanceAdministration.oclIsKindOf(ccd::MedicationActivity))

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.1.8"/>
<code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medication use"/>
<entry>
<substanceAdministration/>
</entry>
</section>

0.008
testValidateMedicationsSectionSupplyActivity

Constraint

CCD Medications Section SHOULD contain zero or more [0..*] entry (CONF-298) Contains exactly one [1..1] Supply Activity (templateId: 2.16.840.1.113883.10.20.1.34)

OCL

self.entry->exists(entry : cda::Entry | not entry.supply.oclIsUndefined() and entry.supply.oclIsKindOf(ccd::SupplyActivity))

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.1.8"/>
<code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medication use"/>
<entry>
<supply/>
</entry>
</section>

0.008
Properties »