Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
AssessmentScaleObservationTest23000.5352013-01-31T13:34:40JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.000
testValidateAssessmentScaleObservationCodeCodeSystem

Constraint

Consol Assessment Scale Observation SHOULD be from LOINC (CodeSystem: 2.16.840.1.113883.6.1) or SNOMED CT (CodeSystem: 2.16.840.1.113883.6.96) identifying the assessment scale (CONF:14440)

OCL

self.code.isNullFlavorDefined() or self.code.codeSystem = '2.16.840.1.113883.6.1' or self.code.codeSystem = '2.16.840.1.113883.6.96'

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.69"/>
<code code="" codeSystem="2.16.840.1.113883.6.1" codeSystemName="" displayName=""/>
<statusCode code="completed"/>
</observation>

0.022
testValidateAssessmentScaleObservationInterpretationCodeTranslation

Constraint

Consol Assessment Scale Observation interpretationCode, if present, MAY contain zero or more [0..*] translation (CONF:14888)

OCL

self.interpretationCode->size() > 0 implies self.interpretationCode.translation->size() > 0

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.69"/>
<statusCode code="completed"/>
<interpretationCode/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.69"/>
<statusCode code="completed"/>
<interpretationCode>
<translation/>
</interpretationCode>
</observation>

0.024
testValidateAssessmentScaleObservationTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:14436, CONF:14437 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.69"

OCL

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

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.69"/>
<statusCode code="completed"/>
</observation>

0.007
testValidateAssessmentScaleObservationClassCode

Constraint

Consol Assessment Scale Observation SHALL contain exactly one [1..1] @classCode="OBS" Observation (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) (CONF:14434)

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.69"/>
<statusCode code="completed"/>
</observation>

0.005
testValidateAssessmentScaleObservationMoodCode

Constraint

Consol Assessment Scale Observation SHALL contain exactly one [1..1] @moodCode="EVN" Event (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood) (CONF:14435)

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.69"/>
<statusCode code="completed"/>
</observation>

0.005
testValidateAssessmentScaleObservationCode

Constraint

Consol Assessment Scale Observation SHALL contain exactly one [1..1] code (CONF:14439)

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.69"/>
<code/>
<statusCode code="completed"/>
</observation>

0.020
testValidateAssessmentScaleObservationDerivationExpr

Constraint

Consol Assessment Scale Observation MAY contain zero or one [0..1] derivationExpr (CONF:14637)

OCL

(self.derivationExpr.oclIsUndefined() or self.derivationExpr.isNullFlavorUndefined()) implies (not self.derivationExpr.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.69"/>
<derivationExpr/>
<statusCode code="completed"/>
</observation>

0.023
testValidateAssessmentScaleObservationEffectiveTime

Constraint

Consol Assessment Scale Observation SHALL contain exactly one [1..1] effectiveTime (CONF:14445)

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.69"/>
<statusCode code="completed"/>
<effectiveTime/>
</observation>

0.023
testValidateAssessmentScaleObservationId

Constraint

Consol Assessment Scale Observation SHALL contain at least one [1..*] id (CONF:14438)

OCL

(self.id->isEmpty() or self.id->exists(element | element.isNullFlavorUndefined())) implies (not self.id->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.69"/>
<id/>
<statusCode code="completed"/>
</observation>

0.022
testValidateAssessmentScaleObservationInterpretationCode

Constraint

Consol Assessment Scale Observation MAY contain zero or more [0..*] interpretationCode (CONF:14459)

OCL

(self.interpretationCode->isEmpty() or self.interpretationCode->exists(element | element.isNullFlavorUndefined())) implies (not self.interpretationCode->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.69"/>
<statusCode code="completed"/>
<interpretationCode/>
</observation>

0.022
testValidateAssessmentScaleObservationStatusCode

Constraint

Consol Assessment Scale Observation SHALL contain exactly one [1..1] statusCode (CONF:14444)/@code="completed" Completed (CodeSystem: 2.16.840.1.113883.5.14 ActStatus)

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.69"/>
<statusCode code="completed"/>
</observation>

0.044
testValidateAssessmentScaleObservationStatusCodeP

Constraint

Consol Assessment Scale Observation SHALL contain exactly one [1..1] statusCode (CONF:14444)/@code="completed" Completed (CodeSystem: 2.16.840.1.113883.5.14 ActStatus)

OCL

(self.statusCode.oclIsUndefined() or self.statusCode.isNullFlavorUndefined()) implies (not self.statusCode.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.69"/>
<statusCode code="completed"/>
</observation>

0.024
testValidateAssessmentScaleObservationValue

Constraint

Consol Assessment Scale Observation SHALL contain exactly one [1..1] value (CONF:14450)

OCL

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

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.69"/>
<statusCode code="completed"/>
<value xsi:type="CD"/>
</observation>

0.023
testValidateAssessmentScaleObservationAuthor

Constraint

Consol Assessment Scale Observation MAY contain zero or more [0..*] author (CONF:14460) Contains exactly one [1..1] CDA Author

OCL

self.author->exists(author : cda::Author | not author.oclIsUndefined() and author.oclIsKindOf(rim::Participation))

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.69"/>
<statusCode code="completed"/>
<author/>
</observation>

0.017
testValidateAssessmentScaleObservationReferenceRange

Constraint

Consol Assessment Scale Observation MAY contain zero or more [0..*] referenceRange (CONF:16799)

OCL

self.referenceRange->exists(referenceRange : cda::ReferenceRange | not referenceRange.oclIsUndefined() and referenceRange.oclIsKindOf(cda::ReferenceRange))

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.69"/>
<statusCode code="completed"/>
<referenceRange/>
</observation>

0.015
testValidateAssessmentScaleObservationAssessmentScaleSupportingObservation

Constraint

Consol Assessment Scale Observation SHOULD contain zero or more [0..*] entryRelationship (CONF:14451, CONF:16741, CONF:16742) Contains @typeCode="COMP" COMP, and Contains exactly one [1..1] Assessment Scale Supporting Observation (templateId: 2.16.840.1.113883.10.20.22.4.86)

OCL

self.entryRelationship->exists(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(consol::AssessmentScaleSupportingObservation) 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.69"/>
<statusCode code="completed"/>
<entryRelationship typeCode="COMP">
<observation/>
</entryRelationship>
</observation>

0.023
testValidateAssessmentScaleObservationReferenceRangeObservationRangeTextReference

Constraint

Consol Assessment Scale Observation MAY contain zero or more [0..*] referenceRange (CONF:16799) each SHALL contain exactly one [1..1] observationRange, where (CONF:16800) observationRange text, if present, SHOULD contain zero or one [0..1] reference (CONF:16802)

OCL

self.referenceRange->excluding(null).observationRange->excluding(null)->reject(not text.oclIsUndefined() implies text->forAll(reference->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.69"/>
<statusCode code="completed"/>
<referenceRange>
<observationRange>
<text/>
</observationRange>
</referenceRange>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.69"/>
<statusCode code="completed"/>
<referenceRange>
<observationRange>
<text><reference/></text>
</observationRange>
</referenceRange>
</observation>

0.035
testValidateAssessmentScaleObservationReferenceRangeObservationRangeTextReferenceValue

Constraint

Consol Assessment Scale Observation MAY contain zero or more [0..*] referenceRange (CONF:16799) each SHALL contain exactly one [1..1] observationRange, where (CONF:16800) observationRange reference, if present, MAY contain zero or one [0..1] @value (CONF:16803)

OCL

self.referenceRange->excluding(null).observationRange->excluding(null)->reject(text->forAll(reference->size() = 1) implies 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.69"/>
<statusCode code="completed"/>
<referenceRange>
<observationRange>
<text><reference/></text>
</observationRange>
</referenceRange>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.69"/>
<statusCode code="completed"/>
<referenceRange>
<observationRange>
<text><reference value="test"/></text>
</observationRange>
</referenceRange>
</observation>

0.043
testValidateAssessmentScaleObservationReferenceRangeObservationRangeReferenceValue

Constraint

Consol Assessment Scale Observation MAY contain zero or more [0..*] referenceRange (CONF:16799) each SHALL contain exactly one [1..1] observationRange, where (CONF:16800) observationRange 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:16804)

OCL

self.referenceRange->excluding(null).observationRange->excluding(null)->reject(not text.reference.value.oclIsUndefined() implies not getSection().text.getText(text.reference.value.substring(2, 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.69"/>
<statusCode code="completed"/>
<referenceRange>
<observationRange>
<text>Some sample text<reference value="#1.2.3.4"/></text>
</observationRange>
</referenceRange>
</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.69"/>
<statusCode code="completed"/>
<referenceRange>
<observationRange>
<text>Some sample text<reference value="#1.2.3.4"/></text>
</observationRange>
</referenceRange>
<referenceRange>
<observationRange>
<text>Some sample text<reference/></text>
</observationRange>
</referenceRange>
</observation>
</entry>
</section>

0.057
testValidateAssessmentScaleObservationReferenceRangeObservationRangeText

Constraint

Consol Assessment Scale Observation MAY contain zero or more [0..*] referenceRange (CONF:16799) each SHALL contain exactly one [1..1] observationRange, where (CONF:16800) observationRange SHOULD contain zero or one [0..1] text (CONF:16801)

OCL

self.referenceRange->excluding(null).observationRange->excluding(null)->reject((text.oclIsUndefined() or text.isNullFlavorUndefined()) implies (not text.oclIsUndefined()))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.69"/>
<statusCode code="completed"/>
<referenceRange>
<observationRange/>
</referenceRange>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.69"/>
<statusCode code="completed"/>
<referenceRange>
<observationRange>
<text/>
</observationRange>
</referenceRange>
</observation>

0.035
testValidateAssessmentScaleObservationReferenceRangeObservationRange

Constraint

Consol Assessment Scale Observation MAY contain zero or more [0..*] referenceRange (CONF:16799) referenceRange SHALL contain exactly one [1..1] observationRange, where its type is Observation Range (CONF:13938)

OCL

self.referenceRange->excluding(null)->reject(observationRange->one(observationRange : cda::ObservationRange | not observationRange.oclIsUndefined() and observationRange.oclIsKindOf(cda::ObservationRange)))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.69"/>
<statusCode code="completed"/>
<referenceRange/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.69"/>
<statusCode code="completed"/>
<referenceRange>
<observationRange/>
</referenceRange>
</observation>

0.021
testGetAssessmentScaleSupportingObservations

Constraint

OCL

SuccessInvalid XML

Valid XML

0.019
Properties »