Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
CognitiveStatusProblemObservationTest24000.5802013-01-31T13:34:42JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateProblemObservationTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:14926, CONF:14927 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.4"

OCL

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

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.4"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>

0.012
testValidateCognitiveStatusProblemObservationHasTextReference

Constraint

Consol Cognitive Status Problem Observation The text, if present, SHOULD contain zero or one [0..1] reference/@value (CONF:14342)

OCL

not self.text.oclIsUndefined() implies (self.text->forAll(reference->size() = 1) and 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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<text><reference value="test"/></text>
<statusCode code="completed"/>
</observation>

0.043
testValidateCognitiveStatusProblemObservationHasTextReferenceValue

Constraint

Consol Cognitive Status Problem 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:14343)

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 health status observed.
</content></text>
<entry>
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<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 health status observed.
</content></text>
<entry>
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<text>Some sample text<reference value="#1.2.3.4"/></text>
<statusCode code="completed"/>
</observation>
</entry>
</section>

0.046
testValidateCognitiveStatusProblemObservationHasOnsetDate

Constraint

Consol Cognitive Status Problem Observation The effectiveTime element , if present, SHALL contain exactly one [1..1] low (CONF:14325)

OCL

not self.effectiveTime.low.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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<statusCode code="completed"/>
<effectiveTime>
<low value="1"/>
<high value="2"/>
</effectiveTime>
</observation>

0.012
testValidateCognitiveStatusProblemObservationHasResolutionDate

Constraint

Consol Cognitive Status Problem Observation effectiveTime, if present, SHOULD contain zero or one [0..1] high (CONF:14326)

OCL

not self.effectiveTime.high.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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<statusCode code="completed"/>
<effectiveTime>
<low value="1"/>
<high value="2"/>
</effectiveTime>
</observation>

0.011
testValidateCognitiveStatusProblemObservationClassCode

Constraint

Consol Cognitive Status Problem Observation SHALL contain exactly one [1..1] @classCode="OBS" Observation (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) (CONF:14319)

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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<statusCode code="completed"/>
</observation>

0.006
testValidateCognitiveStatusProblemObservationMoodCode

Constraint

Consol Cognitive Status Problem Observation SHALL contain exactly one [1..1] @moodCode="EVN" Event (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood) (CONF:14320)

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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<statusCode code="completed"/>
</observation>

0.006
testValidateCognitiveStatusProblemObservationNegationInd

Constraint

Consol Cognitive Status Problem Observation MAY contain zero or one [0..1] @negationInd (CONF:14344)

OCL

not self.negationInd.oclIsUndefined()

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN" negationInd="true">
<templateId root="2.16.840.1.113883.10.20.22.4.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<statusCode code="completed"/>
</observation>

0.009
testValidateCognitiveStatusProblemObservationId

Constraint

Consol Cognitive Status Problem Observation SHALL contain exactly one [1..1] id (CONF:14321)

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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<id/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<statusCode code="completed"/>
</observation>

0.026
testValidateCognitiveStatusProblemObservationCodeP

Constraint

Consol Cognitive Status Problem Observation SHALL contain exactly one [1..1] code (CONF:14804)/@code="373930000" Cognitive function finding (CodeSystem: 2.16.840.1.113883.6.1 LOINC) (CONF:14805)

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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<statusCode code="completed"/>
</observation>

0.022
testValidateCognitiveStatusProblemObservationCode

Constraint

Consol Cognitive Status Problem Observation SHALL contain exactly one [1..1] code (CONF:14804)/@code="373930000" Cognitive function finding (CodeSystem: 2.16.840.1.113883.6.1 LOINC) (CONF:14805)

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 = '373930000' and value.codeSystem = '2.16.840.1.113883.6.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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.1" codeSystemName="" displayName=""/>
<statusCode code="completed"/>
</observation>

0.047
testValidateCognitiveStatusProblemObservationText

Constraint

Consol Cognitive Status Problem Observation SHOULD contain zero or one [0..1] text (CONF:14341)

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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<text/>
<statusCode code="completed"/>
</observation>

0.023
testValidateCognitiveStatusProblemObservationStatusCode

Constraint

Consol Cognitive Status Problem Observation SHALL contain exactly one [1..1] statusCode/@code="completed" Completed (CodeSystem: 2.16.840.1.113883.5.14 ActStatus) (CONF:14323)

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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<statusCode code="completed"/>
</observation>

0.047
testValidateCognitiveStatusProblemObservationEffectiveTime

Constraint

Consol Cognitive Status Problem Observation SHOULD contain zero or one [0..1] effectiveTime (CONF:14324)

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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<statusCode code="completed"/>
<effectiveTime/>
</observation>

0.025
testValidateCognitiveStatusProblemObservationMethodCode

Constraint

Consol Cognitive Status Problem Observation MAY contain zero or more [0..*] methodCode (CONF:14693)

OCL

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

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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<statusCode code="completed"/>
<methodCode/>
</observation>

0.025
testValidateCognitiveStatusProblemObservationValueP

Constraint

Consol Cognitive Status Problem Observation SHALL contain exactly one [1..1] value, where the @code SHOULD be selected from ValueSet Problem 2.16.840.1.113883.3.88.12.3221.7.4 DYNAMIC (CONF:14349)

OCL

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

SuccessInvalid XML


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

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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="" codeSystem="2.16.840.1.113883.6.96" codeSystemName="" displayName=""/>
</observation>

0.023
testValidateCognitiveStatusProblemObservationValue

Constraint

Consol Cognitive Status Problem Observation SHALL contain exactly one [1..1] value, where the @code SHOULD be selected from ValueSet Problem 2.16.840.1.113883.3.88.12.3221.7.4 DYNAMIC (CONF:14349)

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

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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="" codeSystem="2.16.840.1.113883.6.96" codeSystemName="" displayName=""/>
</observation>

0.057
testValidateCognitiveStatusProblemObservationNonMedicinalSupplyActivity

Constraint

Consol Cognitive Status Problem Observation MAY contain zero or more [0..*] entryRelationship (CONF:14331, CONF:14588, CONF:14351) Contains @typeCode="REFR" REFR, and Contains exactly one [1..1] Non Medicinal Supply Activity (templateId: 2.16.840.1.113883.10.20.22.4.50)

OCL

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

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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<statusCode code="completed"/>
<entryRelationship typeCode="REFR">
<supply/>
</entryRelationship>
</observation>

0.024
testValidateCognitiveStatusProblemObservationCaregiverCharacteristics

Constraint

Consol Cognitive Status Problem Observation MAY contain zero or more [0..*] entryRelationship (CONF:14335, CONF:14589, CONF:14352) Contains @typeCode="REFR" REFR, and Contains exactly one [1..1] Caregiver Characteristics (templateId: 2.16.840.1.113883.10.20.22.4.72)

OCL

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

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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<statusCode code="completed"/>
<entryRelationship typeCode="REFR">
<observation/>
</entryRelationship>
</observation>

0.023
testValidateCognitiveStatusProblemObservationAssessmentScaleObservation

Constraint

Consol Cognitive Status Problem Observation MAY contain zero or more [0..*] entryRelationship (CONF:14467, CONF:14590, CONF:14468) Contains @typeCode="COMP" COMP, and Contains exactly one [1..1] Assessment Scale Observation (templateId: 2.16.840.1.113883.10.20.22.4.69)

OCL

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

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.73"/>
<templateId root="2.16.840.1.113883.10.20.22.4.4"/>
<code code="373930000" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT" displayName="Cognitive function finding"/>
<statusCode code="completed"/>
<entryRelationship typeCode="COMP">
<observation/>
</entryRelationship>
</observation>

0.024
testGetNonMedicinalSupplyActivities

Constraint

OCL

SuccessInvalid XML

Valid XML

0.020
testGetCaregiverCharacteristicss

Constraint

OCL

SuccessInvalid XML

Valid XML

0.020
testGetAssessmentScaleObservations

Constraint

OCL

SuccessInvalid XML

Valid XML

0.020
Properties »