Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
AllergyObservationTest36001.1332013-01-31T13:34:38JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.000
testGetProblemEntryReactionObservationContainers

Constraint

OCL

SuccessInvalid XML

Valid XML

0.019
testGetSeverity

Constraint

OCL

SuccessInvalid XML

Valid XML

0.020
testValidateAllergyObservationValueOriginalText

Constraint

Consol Allergy Observation value SHOULD contain zero or one [0..1] originalText (CONF:7422)

OCL

self.value.oclAsType(datatypes::CD).originalText->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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<value xsi:type="CD">
<originalText/>
</value>
</observation>

0.013
testValidateAllergyObservationOriginalTextReference

Constraint

Consol Allergy Observation originalText, if present, MAY contain zero or one [0..1] reference (CONF:15949)

OCL

self.value.oclAsType(datatypes::CD).originalText->size() = 1 implies self.value.oclAsType(datatypes::CD).originalText->one(reference->size() = 1)

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

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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<value xsi:type="CD">
<originalText><reference value="test"/></originalText>
</value>
</observation>

0.030
testValidateAllergyObservationOriginalTextReferenceValue

Constraint

Consol Allergy Observation reference, if present, SHOULD contain zero or one [0..1] reference/@value (CONF:15950)

OCL

self.value.oclAsType(datatypes::CD).originalText.reference->size() = 1 implies self.value.oclAsType(datatypes::CD).originalText.reference.value->size() = 1

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

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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<value xsi:type="CD">
<originalText><reference value="test"/></originalText>
</value>
</observation>

0.030
testValidateAllergyObservationReferenceValue

Constraint

Consol Allergy Observation reference/@value SHALL begin with a '#' and SHALL point to its corresponding narrative (CONF:15951)

OCL

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

0.071
testValidateAllergyObservationAllergyStatusInversionIndicator

Constraint

Consol Allergy Observation entryRelationship with target entry AllergyStatusObservation SHALL contain exactly one [1..1] @inversionInd="true" True (CONF:7446)

OCL

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

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<entryRelationship>
<observation/>
</entryRelationship>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<entryRelationship/>
</observation>

0.014
testValidateAllergyObservationReactionInversionIndicator

Constraint

Consol Allergy Observation entryRelationship with target entry Reaction Observation SHALL contain exactly one [1..1] @inversionInd="true" True (CONF:7449)

OCL

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

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<entryRelationship>
<observation/>
</entryRelationship>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<entryRelationship/>
</observation>

0.014
testValidateAllergyObservationSeverityInversionIndicator

Constraint

Consol Allergy Observation entryRelationship with target entry Severity Observation SHALL contain exactly one [1..1] @inversionInd="true" True (CONF:9964)

OCL

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

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<entryRelationship>
<observation/>
</entryRelationship>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<entryRelationship/>
</observation>

0.014
testValidateAllergyObservationAllergyPlayingEntityCodeSystems

Constraint

Consol Allergy Observation In an allergy to a specific medication the code SHALL be selected from the ValueSet 2.16.840.1.113883.3.88.12.80.16 Medication Brand Name DYNAMIC or the ValueSet 2.16.840.1.113883.3.88.12.80.17 Medication Clinical Drug DYNAMIC. In an allergy to a class of medications the code SHALL be selected from the ValueSet 2.16.840.1.113883.3.88.12.80.18 Medication Drug Class DYNAMIC. In an allergy to a food or other substance the code SHALL be selected from the ValueSet 2.16.840.1.113883.3.88.12.80.20 Ingredient Name DYNAMIC (CONF:7421, CONF:10083, CONF:10084)

OCL

(self.value->forAll(value | value.isNullFlavorUndefined())) implies (((self.value->forAll(value | value.oclAsType(datatypes::CD).code = '419511003' or value.oclAsType(datatypes::CD).code = '416098002' or value.oclAsType(datatypes::CD).code = '59037007')) and (self.participant.participantRole.playingEntity->forAll(code.isNullFlavorDefined() or code.codeSystem = '2.16.840.1.113883.6.88' or code.codeSystem='2.16.840.1.113883.3.26.1.5'))) or ((self.value->forAll(value | value.oclAsType(datatypes::CD).code = '418471000' or value.oclAsType(datatypes::CD).code = '414285001' or value.oclAsType(datatypes::CD).code = '235719002')) and (self.participant.participantRole.playingEntity->forAll(code.isNullFlavorDefined() or code.codeSystem = '2.16.840.1.113883.4.9'))) or ((self.value->forAll(value | value.oclAsType(datatypes::CD).code = '420134006' or value.oclAsType(datatypes::CD).code = '418038007' or value.oclAsType(datatypes::CD).code = '419199007')) and (self.participant.participantRole.playingEntity->forAll(code.isNullFlavorDefined() or code.codeSystem = '2.16.840.1.113883.6.88' or code.codeSystem='2.16.840.1.113883.3.26.1.5' or code.codeSystem = '2.16.840.1.113883.4.9'))))

SuccessInvalid 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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="419511003" codeSystem="1.2.3.4" codeSystemName="" displayName=""/>
<participant>
<participantRole>
<playingEntity>
<code/>
</playingEntity>
</participantRole>
</participant>
</observation>

<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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="123456" codeSystem="1.2.3.4" codeSystemName="" displayName=""/>
<participant>
<participantRole>
<playingEntity>
<code/>
</playingEntity>
</participantRole>
</participant>
</observation>

<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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="12345" codeSystem="1.2.3.4" codeSystemName="" displayName=""/>
<participant>
<participantRole>
<playingEntity>
<code code="test" codeSystem="2.16.840.1.113883.6.88"/>
</playingEntity>
</participantRole>
</participant>
</observation>

<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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="419511003" codeSystem="1.2.3.4" codeSystemName="" displayName=""/>
<participant>
<participantRole>
<playingEntity>
<code code="test" codeSystem="2.16.840.1.113883.4.9"/>
</playingEntity>
</participantRole>
</participant>
</observation>

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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="419511003" codeSystem="1.2.3.4" codeSystemName="" displayName=""/>
<participant>
<participantRole>
<playingEntity>
<code code="test" codeSystem="2.16.840.1.113883.6.88"/>
</playingEntity>
</participantRole>
</participant>
</observation>

<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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<value xsi:type="CD" code="419511003" codeSystem="1.2.3.4" codeSystemName="" displayName=""/>
<participant>
<participantRole>
<playingEntity>
<code code="test" codeSystem="2.16.840.1.113883.3.26.1.5"/>
</playingEntity>
</participantRole>
</participant>
</observation>

<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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<value xsi:type="CD" nullFlavor="NA"/>
<participant>
<participantRole>
<playingEntity>
<code code="test" codeSystem="2.16.840.1.113883.4.9"/>
</playingEntity>
</participantRole>
</participant>
</observation>

0.171
testValidateAllergyObservationTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:7381, CONF:10488 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.7"

OCL

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

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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
</observation>

0.008
testValidateAllergyObservationClassCode

Constraint

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

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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
</observation>

0.005
testValidateAllergyObservationMoodCode

Constraint

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

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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
</observation>

0.005
testValidateAllergyObservationId

Constraint

Consol Allergy Observation SHALL contain at least one [1..*] id (CONF:7382)

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.7"/>
<id/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
</observation>

0.021
testValidateAllergyObservationCodeP

Constraint

Consol Allergy Observation SHALL contain exactly one [1..1] code (CONF:15947)/@code="ASSERTION" (CodeSystem: 2.16.840.1.113883.5.4 HL7ActCode) (CONF:15948)

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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
</observation>

0.020
testValidateAllergyObservationCode

Constraint

Consol Allergy Observation SHALL contain exactly one [1..1] code (CONF:15947)/@code="ASSERTION" (CodeSystem: 2.16.840.1.113883.5.4 HL7ActCode) (CONF:15948)

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

0.042
testValidateAllergyObservationStatusCode

Constraint

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

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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
</observation>

0.048
testValidateAllergyObservationEffectiveTime

Constraint

Consol Allergy Observation SHALL contain exactly one [1..1] effectiveTime (CONF:7387)

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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<effectiveTime/>
</observation>

0.024
testValidateAllergyObservationValue

Constraint

Consol Allergy Observation SHALL contain exactly one [1..1] value with data type CD, where the @code SHALL be selected from ValueSet Allergy/Adverse Event Type 2.16.840.1.113883.3.88.12.3221.6.2 DYNAMIC (CONF:7390, CONF:9139)

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 = '420134006' or value.code = '418038007' or value.code = '419511003' or value.code = '418471000' or value.code = '419199007' or value.code = '416098002' or value.code = '414285001' or value.code = '59037007' or value.code = '235719002')))

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

0.103
testValidateAllergyObservationProblemEntryReactionObservationContainer

Constraint

Consol Allergy Observation SHOULD contain zero or more [0..*] entryRelationship (CONF:7447, CONF:7907, CONF:15955) Contains @typeCode="MFST" MFST, and Contains exactly one [1..1] Reaction Observation (templateId: 2.16.840.1.113883.10.20.22.4.9)

OCL

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

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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<entryRelationship typeCode="MFST">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.9"/>
<statusCode code="completed"/>
</observation>
</entryRelationship>
</observation>

0.022
testValidateAllergyObservationSeverity

Constraint

Consol Allergy Observation SHOULD contain zero or one [0..1] entryRelationship (CONF:9961, CONF:9962, CONF:15956) Contains @typeCode="SUBJ" SUBJ, and Contains exactly one [1..1] Severity Observation (templateId: 2.16.840.1.113883.10.20.22.4.8)

OCL

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

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<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.7"/>
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<entryRelationship typeCode="SUBJ">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.8"/>
<code code="SEV" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode" displayName="Severity observation"/>
<statusCode code="completed"/>
<interpretationCode codeSystem="2.16.840.1.113883.5.83" codeSystemName="ObservationInterpretation"/>
</observation>
</entryRelationship>
</observation>

0.022
testValidateAllergyObservationAllergyStatusObservation

Constraint

Consol Allergy Observation MAY contain zero or one [0..1] entryRelationship (CONF:7440, CONF:7906, CONF:15954) Contains @typeCode="SUBJ" SUBJ, and Contains exactly one [1..1] Allergy Status Observation (templateId: 2.16.840.1.113883.10.20.22.4.28)

OCL

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

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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<entryRelationship typeCode="SUBJ">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.28"/>
<code code="33999-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Status"/>
<statusCode code="completed"/>
</observation>
</entryRelationship>
</observation>

0.023
testValidateAllergyObservationParticipant

Constraint

Consol Allergy Observation SHOULD contain exactly one [1..1] participant (CONF:7402)

OCL

self.participant->one(participant : cda::Participant2 | not participant.oclIsUndefined() and participant.oclIsKindOf(cda::Participant2))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant/>
</observation>

0.015
testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeOriginalText

Constraint

Consol Allergy Observation SHOULD contain exactly one [1..1] participant (CONF:7402) each SHALL contain exactly one [1..1] participantRole, where (CONF:7404) each SHALL contain exactly one [1..1] playingEntity, where (CONF:7406) playingEntity code SHOULD contain zero or one [0..1] originalText (CONF:7424)

OCL

self.participant->excluding(null).participantRole->excluding(null).playingEntity->excluding(null)->reject(not code.originalText.oclIsUndefined())

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity>
<code/>
</playingEntity>
</participantRole>
</participant>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity>
<code>
<originalText/>
</code>
</playingEntity>
</participantRole>
</participant>
</observation>

0.024
testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityOriginalTextReference

Constraint

Consol Allergy Observation SHOULD contain exactly one [1..1] participant (CONF:7402) each SHALL contain exactly one [1..1] participantRole, where (CONF:7404) each SHALL contain exactly one [1..1] playingEntity, where (CONF:7406) playingEntity originalText, if present, SHOULD contain zero or one [0..1] reference (CONF:7425)

OCL

self.participant->excluding(null).participantRole->excluding(null).playingEntity->excluding(null)->reject(not code.originalText.oclIsUndefined() implies not code.originalText.reference.oclIsUndefined())

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity>
<code>
<originalText/>
</code>
</playingEntity>
</participantRole>
</participant>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity>
<code>
<originalText><reference/></originalText>
</code>
</playingEntity>
</participantRole>
</participant>
</observation>

0.035
testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityReferenceValue

Constraint

Consol Allergy Observation SHOULD contain exactly one [1..1] participant (CONF:7402) each SHALL contain exactly one [1..1] participantRole, where (CONF:7404) each SHALL contain exactly one [1..1] playingEntity, where (CONF:7406) playingEntity reference, if present, SHOULD contain zero or one [0..1] @value (CONF:15952)

OCL

self.participant->excluding(null).participantRole->excluding(null).playingEntity->excluding(null)->reject(not code.originalText.reference.oclIsUndefined() implies code.originalText.reference.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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity>
<code>
<originalText><reference/></originalText>
</code>
</playingEntity>
</participantRole>
</participant>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity>
<code>
<originalText><reference value="test"/></originalText>
</code>
</playingEntity>
</participantRole>
</participant>
</observation>

0.040
testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityOriginalTextReferenceValue

Constraint

Consol Allergy Observation SHOULD contain exactly one [1..1] participant (CONF:7402) each SHALL contain exactly one [1..1] participantRole, where (CONF:7404) each SHALL contain exactly one [1..1] playingEntity, where (CONF:7406) playingEntity 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:15953)

OCL

self.participant->excluding(null).participantRole->excluding(null).playingEntity->excluding(null)->reject(not code.originalText.reference.value.oclIsUndefined() implies not getSection().text.getText(code.originalText.reference.value.substring(2, code.originalText.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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity>
<code>
<originalText>Some sample text<reference value="#1.2.3.4"/></originalText>
</code>
</playingEntity>
</participantRole>
</participant>
</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.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<text>Some sample text<reference value="#1.2.3.4"/></text>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity>
<code>
<originalText>Some sample text<reference value="#1.2.3.4"/></originalText>
</code>
</playingEntity>
</participantRole>
</participant>
</observation>
</entry>
</section>

0.062
testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeTranslation

Constraint

Consol Allergy Observation SHOULD contain exactly one [1..1] participant (CONF:7402) each SHALL contain exactly one [1..1] participantRole, where (CONF:7404) each SHALL contain exactly one [1..1] playingEntity, where (CONF:7406) playingEntity code MAY contain zero or more [0..*] translation (CONF:7431)

OCL

self.participant->excluding(null).participantRole->excluding(null).playingEntity->excluding(null)->reject(not code.translation->isEmpty())

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity>
<code/>
</playingEntity>
</participantRole>
</participant>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity>
<code>
<translation/>
</code>
</playingEntity>
</participantRole>
</participant>
</observation>

0.024
testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityClassCode

Constraint

Consol Allergy Observation SHOULD contain exactly one [1..1] participant (CONF:7402) each SHALL contain exactly one [1..1] participantRole, where (CONF:7404) each SHALL contain exactly one [1..1] playingEntity, where (CONF:7406) playingEntity SHALL contain exactly one [1..1] @classCode="MMAT" (CONF:7407)

OCL

self.participant->excluding(null).participantRole->excluding(null).playingEntity->excluding(null)->reject(isDefined('classCode'))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity>
<code/>
</playingEntity>
</participantRole>
</participant>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity classCode="MMAT"/>
</participantRole>
</participant>
</observation>

0.018
testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCode

Constraint

Consol Allergy Observation SHOULD contain exactly one [1..1] participant (CONF:7402) each SHALL contain exactly one [1..1] participantRole, where (CONF:7404) each SHALL contain exactly one [1..1] playingEntity, where (CONF:7406) playingEntity SHALL contain exactly one [1..1] code (CONF:7419)

OCL

self.participant->excluding(null).participantRole->excluding(null).playingEntity->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not code.oclIsUndefined()))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity/>
</participantRole>
</participant>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity>
<code/>
</playingEntity>
</participantRole>
</participant>
</observation>

0.038
testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleClassCode

Constraint

Consol Allergy Observation SHOULD contain exactly one [1..1] participant (CONF:7402) each SHALL contain exactly one [1..1] participantRole, where (CONF:7404) participantRole SHALL contain exactly one [1..1] @classCode/@code="MANU" Manufactured Product (CodeSystem: 2.16.840.1.113883.5.110 HL7RoleClass) (CONF:7405)

OCL

self.participant->excluding(null).participantRole->excluding(null)->reject(not classCode.oclIsUndefined() and classCode.oclIsKindOf(vocab::RoleClassRoot) and let value : vocab::RoleClassRoot = classCode.oclAsType(vocab::RoleClassRoot) in value = vocab::RoleClassRoot::MANU)

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole/>
</participant>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole classCode="MANU"/>
</participant>
</observation>

0.034
testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRolePlayingEntity

Constraint

Consol Allergy Observation SHOULD contain exactly one [1..1] participant (CONF:7402) each SHALL contain exactly one [1..1] participantRole, where (CONF:7404) participantRole SHALL contain exactly one [1..1] playingEntity, where its type is Allergy Observation Playing Entity (CONF:7406)

OCL

self.participant->excluding(null).participantRole->excluding(null)->reject(playingEntity->one(playingEntity : cda::PlayingEntity | not playingEntity.oclIsUndefined() and playingEntity.oclIsKindOf(cda::PlayingEntity)))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole/>
</participant>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole>
<playingEntity/>
</participantRole>
</participant>
</observation>

0.025
testValidateAllergyObservationAllergyObservationParticipantTypeCode

Constraint

Consol Allergy Observation SHOULD contain exactly one [1..1] participant (CONF:7402) participant SHALL contain exactly one [1..1] @typeCode/@code="CSM" Consumable (CodeSystem: 2.16.840.1.113883.5.90 HL7ParticipationType) (CONF:7403)

OCL

self.participant->excluding(null)->reject(not typeCode.oclIsUndefined() and typeCode.oclIsKindOf(vocab::ParticipationType) and let value : vocab::ParticipationType = typeCode.oclAsType(vocab::ParticipationType) in value = vocab::ParticipationType::CSM)

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant typeCode="CSM"/>
</observation>

0.031
testValidateAllergyObservationAllergyObservationParticipantParticipantRole

Constraint

Consol Allergy Observation SHOULD contain exactly one [1..1] participant (CONF:7402) participant SHALL contain exactly one [1..1] participantRole, where its type is Allergy Observation Participant Role (CONF:7404)

OCL

self.participant->excluding(null)->reject(participantRole->one(participantRole : cda::ParticipantRole | not participantRole.oclIsUndefined() and participantRole.oclIsKindOf(cda::ParticipantRole)))

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4" codeSystemName="HL7ActCode"/>
<statusCode code="completed"/>
<participant>
<participantRole/>
</participant>
</observation>

0.020
testGetAllergyStatusObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.021
Properties »