Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
EncounterActivitiesTest21000.5212013-01-31T13:34:52JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateEncounterActivitiesCodeOriginalText

Constraint

Consol Encounter Activities code, if present, SHOULD contain zero or one [0..1] originalText (CONF:8719)

OCL

not code.oclIsUndefined() implies not code.originalText.oclIsUndefined()

SuccessInvalid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code/>
</encounter>

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code>
<originalText/>
</code>
</encounter>

0.031
testValidateEncounterActivitiesCodeOriginalTextReference

Constraint

Consol Encounter Activities originalText, if present, SHOULD contain zero or one [0..1] reference (CONF:15970)

OCL

not self.code.originalText.oclIsUndefined() implies not self.code.originalText.reference.value.oclIsUndefined()

SuccessInvalid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code>
<originalText/>
</code>
</encounter>

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code>
<originalText><reference value="test"/></originalText>
</code>
</encounter>

0.026
testValidateEncounterActivitiesReferenceValue

Constraint

Consol Encounter Activities reference, if present, SHOULD contain zero or one [0..1] @value (CONF:15971)

OCL

not self.code.originalText.reference.oclIsUndefined() implies not self.code.originalText.reference.value.oclIsUndefined()

SuccessInvalid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code>
<originalText><reference/></originalText>
</code>
</encounter>

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code>
<originalText><reference value="test"/></originalText>
</code>
</encounter>

0.028
testValidateEncounterActivitiesCodeOriginalTextReferenceValue

Constraint

Consol Encounter Activities 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:15972)

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 encounter.
</content></text>
<entry>
<encounter classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code>
<originalText>Some sample text<reference value="#1.2.3.4"/></originalText>
</code>
</encounter>
</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 encounter.
</content></text>
<entry>
<encounter classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code>
<originalText>Some sample text<reference value="#1.2.3.4"/></originalText>
</code>
</encounter>
</entry>
</section>

0.052
testValidateEncounterActivitiesServiceDeliveryTypeCode

Constraint

Consol Encounter Activities EncounterActivities with target entry Service Delivery Location SHALL contain exactly one [1..1] @typeCode="LOC" Location (CodeSystem: 2.16.840.1.113883.5.1002 HL7ActRelationshipType) STATIC (CONF:8740)

OCL

self.participant->select(par : cda::Participant2 | par.participantRole.oclIsKindOf(consol::ServiceDeliveryLocation))->forAll(p : cda::Participant2 | p.typeCode=vocab::ParticipationType::LOC)

SuccessInvalid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
<participant>
<participantRole/>
</participant>
</encounter>

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
<participant typeCode="LOC">
<participantRole/>
</participant>
</encounter>

0.014
testValidateEncounterActivitiesTemplateId

Constraint

The 'EncounterActivitiesTemplateId' invariant is violated on 'org.openhealthtools.mdht.uml.cda.mu2consol.impl.EncounterActivitiesImpl@40ae6b79{#//}'

OCL

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

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
</encounter>

0.008
testValidateEncounterActivitiesClassCode

Constraint

Consol Encounter Activities SHALL contain exactly one [1..1] @classCode="ENC" (CodeSystem: 2.16.840.1.113883.5.6 HL7ActClass) (CONF:8710)

OCL

self.classCode=vocab::ActClass::ENC

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
</encounter>

0.005
testValidateEncounterActivitiesMoodCode

Constraint

Consol Encounter Activities SHALL contain exactly one [1..1] @moodCode="EVN" Event (CodeSystem: 2.16.840.1.113883.5.1001 HL7ActMood) (CONF:8711)

OCL

self.moodCode=vocab::x_DocumentEncounterMood::EVN

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
</encounter>

0.006
testValidateEncounterActivitiesId

Constraint

Consol Encounter Activities SHALL contain at least one [1..*] id (CONF:8713)

OCL

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

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<id/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
</encounter>

0.027
testValidateEncounterActivitiesCode

Constraint

Consol Encounter Activities SHOULD contain zero or one [0..1] code, where the @code SHOULD be selected from ValueSet EncounterTypeCode 2.16.840.1.113883.3.88.12.80.32 DYNAMIC (CONF:8714)

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.codeSystem = '2.16.840.1.113883.6.12' and not value.code.oclIsUndefined())

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code code="test" codeSystem="2.16.840.1.113883.6.12"/>
</encounter>

0.057
testValidateEncounterActivitiesEffectiveTime

Constraint

Consol Encounter Activities SHALL contain exactly one [1..1] effectiveTime (CONF:8715)

OCL

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

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
<effectiveTime/>
</encounter>

0.029
testValidateEncounterActivitiesServiceDeliveryLocation

Constraint

Consol Encounter Activities MAY contain zero or more [0..*] participant (CONF:8738, CONF:14903) Contains exactly one [1..1] Service Delivery Location (templateId: 2.16.840.1.113883.10.20.22.4.32)

OCL

self.participant->exists(participant : cda::Participant2 | not participant.participantRole.oclIsUndefined() and participant.participantRole.oclIsKindOf(consol::ServiceDeliveryLocation))

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
<participant typeCode="LOC">
<participantRole/>
</participant>
</encounter>

0.020
testValidateEncounterActivitiesIndication

Constraint

Consol Encounter Activities MAY contain zero or more [0..*] entryRelationship (CONF:8722, CONF:8723, CONF:14899) Contains @typeCode="RSON" RSON, and Contains exactly one [1..1] Indication (templateId: 2.16.840.1.113883.10.20.22.4.19)

OCL

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

SuccessInvalid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
</encounter>

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
<entryRelationship typeCode="RSON">
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.19"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
</observation>
</entryRelationship>
</encounter>

0.029
testValidateEncounterActivitiesEncounterPerformer

Constraint

Consol Encounter Activities MAY contain zero or more [0..*] performer (CONF:8725)

OCL

self.performer->exists(performer : cda::Performer2 | not performer.oclIsUndefined() and performer.oclIsKindOf(cda::Performer2))

SuccessInvalid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
</encounter>

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
<performer/>
</encounter>

0.018
testValidateEncounterActivitiesEncounterDiagnosis

Constraint

Consol Encounter Activities MAY contain zero or more [0..*] entryRelationship (CONF:15492, CONF:15973) Contains exactly one [1..1] Encounter Diagnosis (templateId: 2.16.840.1.113883.10.20.22.4.80)

OCL

self.entryRelationship->exists(entryRelationship : cda::EntryRelationship | not entryRelationship.act.oclIsUndefined() and entryRelationship.act.oclIsKindOf(consol::EncounterDiagnosis))

SuccessInvalid XML


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

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
<entryRelationship>
<act/>
</entryRelationship>
</encounter>

0.022
testValidateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntityCode

Constraint

Consol Encounter Activities MAY contain zero or more [0..*] performer (CONF:8725) each SHALL contain exactly one [1..1] assignedEntity, where (CONF:8726) encounterPerformerAssignedEntity MAY contain zero or one [0..1] code (CONF:8727)

OCL

self.performer->excluding(null).assignedEntity->excluding(null)->reject((code.oclIsUndefined() or code.isNullFlavorUndefined()) implies (not code.oclIsUndefined()))

SuccessInvalid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
<performer>
<assignedEntity/>
</performer>
</encounter>

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
<performer>
<assignedEntity>
<code/>
</assignedEntity>
</performer>
</encounter>

0.042
testValidateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntity

Constraint

Consol Encounter Activities MAY contain zero or more [0..*] performer (CONF:8725) encounterPerformer SHALL contain exactly one [1..1] assignedEntity, where its type is Encounter Performer Assigned Entity (CONF:8726)

OCL

self.performer->excluding(null)->reject(assignedEntity->one(assignedEntity : cda::AssignedEntity | not assignedEntity.oclIsUndefined() and assignedEntity.oclIsKindOf(cda::AssignedEntity)))

SuccessInvalid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
<performer/>
</encounter>

Valid XML


<encounter xmlns="urn:hl7-org:v3" classCode="ENC" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.49"/>
<code codeSystem="2.16.840.1.113883.6.12" codeSystemName="CPT-4"/>
<performer>
<assignedEntity/>
</performer>
</encounter>

0.024
testGetServiceDeliveryLocations

Constraint

OCL

SuccessInvalid XML

Valid XML

0.025
testGetIndications

Constraint

OCL

SuccessInvalid XML

Valid XML

0.023
testGetEncounterDiagnosiss

Constraint

OCL

SuccessInvalid XML

Valid XML

0.024
Properties »