Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
SmokingStatusObservationTest13000.8262013-01-31T13:36:23JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.000
testValidateSmokingStatusObservationEffectiveTimeLow

Constraint

Consol Smoking Status Observation effectiveTime SHALL contain exactly one [1..1] low (CONF:14818)

OCL

not self.effectiveTime.oclIsUndefined() implies not self.effectiveTime.low.oclIsUndefined()

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.78"/>
<templateId root="2.16.840.1.113883.10.20.22.4.85"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
<effectiveTime/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.78"/>
<templateId root="2.16.840.1.113883.10.20.22.4.85"/>
<templateId root="2.16.840.1.113883.10.20.22.4.78"/>
<templateId root="2.16.840.1.113883.10.20.22.4.85"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
<effectiveTime>
<low/>
</effectiveTime>
</observation>

0.050
testValidateSmokingStatusObservationClassCode

Constraint

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

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.78"/>
<templateId root="2.16.840.1.113883.10.20.22.4.85"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
</observation>

0.010
testValidateSmokingStatusObservationMoodCode

Constraint

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

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.78"/>
<templateId root="2.16.840.1.113883.10.20.22.4.85"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
</observation>

0.010
testValidateSmokingStatusObservationCodeP

Constraint

Consol Smoking Status Observation SHALL contain exactly one [1..1] code (CONF:14808)/@code="ASSERTION" Assertion (CodeSystem: 2.16.840.1.113883.5.4 HL7ActCode)

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.78"/>
<templateId root="2.16.840.1.113883.10.20.22.4.85"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
</observation>

0.045
testValidateSmokingStatusObservationCode

Constraint

Consol Smoking Status Observation SHALL contain exactly one [1..1] code (CONF:14808)/@code="ASSERTION" Assertion (CodeSystem: 2.16.840.1.113883.5.4 HL7ActCode)

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 = 'ASSERTION' and value.codeSystem = '2.16.840.1.113883.5.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.78"/>
<templateId root="2.16.840.1.113883.10.20.22.4.85"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="" displayName=""/>
<statusCode code="completed"/>
</observation>

0.102
testValidateSmokingStatusObservationEffectiveTime

Constraint

Consol Smoking Status Observation SHALL contain exactly one [1..1] effectiveTime (CONF:14814)

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.78"/>
<templateId root="2.16.840.1.113883.10.20.22.4.85"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
<effectiveTime/>
</observation>

0.057
testValidateSmokingStatusObservationStatusCodeP

Constraint

Consol Smoking Status Observation SHALL contain exactly one [1..1] statusCode (CONF:14809)/@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.78"/>
<templateId root="2.16.840.1.113883.10.20.22.4.85"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
</observation>

0.055
testValidateSmokingStatusObservationStatusCode

Constraint

Consol Smoking Status Observation SHALL contain exactly one [1..1] statusCode (CONF:14809)/@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.78"/>
<templateId root="2.16.840.1.113883.10.20.22.4.85"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
</observation>

0.105
testValidateSmokingStatusObservationValueP

Constraint

Mu2consol Smoking Status Observation SHALL contain exactly one [1..1] value, where the @code SHALL be selected from ValueSet Smoking Status STATIC

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.78"/>
<templateId root="2.16.840.1.113883.10.20.22.4.85"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
<value xsi:type="CD"/>
</observation>

0.051
testValidateSmokingStatusObservationValue

Constraint

Mu2consol Smoking Status Observation SHALL contain exactly one [1..1] value, where the @code SHALL be selected from ValueSet Smoking Status STATIC

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 (value.code = '449868002' or value.code = '428041000124106' or value.code = '8517006' or value.code = '266919005' or value.code = '77176002' or value.code = '266927001' or value.code = '428071000124103' or value.code = '428061000124105')))

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.78"/>
<templateId root="2.16.840.1.113883.10.20.22.4.85"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="428061000124105" codeSystem="2.16.840.1.113883.6.96"/>
</observation>

0.200
testValidateTobaccoUseTemplateId

Constraint

The 'TobaccoUseTemplateId' invariant is violated on 'org.openhealthtools.mdht.uml.cda.mu2consol.impl.SmokingStatusObservationImpl@30785c4{#//}'

OCL

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

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.78"/>
<templateId root="2.16.840.1.113883.10.20.22.4.85"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
</observation>

0.015
testValidateTobaccoUseValue

Constraint

Consol Tobacco Use SHALL contain exactly one [1..1] value with data type CD (CONF:16562), where the @code SHALL be selected from ValueSet Tobacco Use 2.16.840.1.113883.11.20.9.41 DYNAMIC (CONF:16563)

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.85"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Assertion"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="" codeSystem="2.16.840.1.113883.6.96" codeSystemName="" displayName=""/>
</observation>

0.123
Properties »