Unit Test Results.

Designed for use with JUnit and Ant.

Class org.openhealthtools.mdht.uml.cda.ccd.tests.FamilyHistoryObservationTest

NameTestsErrorsFailuresTime(s)Time StampHost
FamilyHistoryObservationTest17000.1852013-01-31T13:34:13JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testGetAgeObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.007
testValidateFamilyHistoryObservationTemplateId

Constraint

SHALL contain exactly one [1..1] templateId ( CONF:10496 ) such that it SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.46"

OCL

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

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

0.005
testValidateFamilyHistoryObservationHasSubjectPatientRelationship

Constraint

CCD Family History Observation A subject participant SHALL contain exactly one RelatedSubject, representing the relationship of the subject to the patient

OCL

not self.subject.oclIsUndefined() implies self.subject.relatedSubject->size() = 1

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<statusCode code="completed"/>
<subject/>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<statusCode code="completed"/>
<subject>
<relatedSubject/>
</subject>
</observation>

0.056
testValidateFamilyHistoryObservationRelationshipValueCode

Constraint

CCD Family History Observation The value for RelatedSubject / @classCode SHALL be "PRS" "Personal relationship" 2.16.840.1.113883.5.110 RoleClass STATIC

OCL

not self.subject.oclIsUndefined() implies self.subject.relatedSubject.classCode = vocab::x_DocumentSubject::PRS

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<statusCode code="completed"/>
<subject>
<relatedSubject classCode="PAT"/>
</subject>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<statusCode code="completed"/>
<subject>
<relatedSubject classCode="PRS"/>
</subject>
</observation>

0.007
testValidateFamilyHistoryObservationHasRelatedSubjectCode

Constraint

CCD Family History Observation RelatedSubject SHALL contain exactly one RelatedSubject / code (CONF-214)

OCL

not self.subject.oclIsUndefined() implies self.subject.relatedSubject.code->size() = 1

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<statusCode code="completed"/>
<subject>
<relatedSubject/>
</subject>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<statusCode code="completed"/>
<subject>
<relatedSubject>
<code/>
</relatedSubject>
</subject>
</observation>

0.009
testValidateFamilyHistoryObservationRelatedSubjectCodeValueSet

Constraint

CCD Family History Observation The value for "RelatedSubject / code" SHOULD be selected from ValueSet 2.16.840.1.113883.1.11.19579 FamilyHistoryRelatedSubjectCode DYNAMIC or 2.16.840.1.113883.1.11.20.21 FamilyHistoryPersonCode DYNAMIC

OCL

not self.subject.oclIsUndefined() implies self.subject.relatedSubject.code.codeSystem = '2.16.840.1.113883.5.111'

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<statusCode code="completed"/>
<subject>
<relatedSubject/>
</subject>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<statusCode code="completed"/>
<subject>
<relatedSubject>
<code codeSystem="2.16.840.1.113883.5.111"/>
</relatedSubject>
</subject>
</observation>

0.008
testValidateFamilyHistoryObservationHasRelatedSubjectSubject

Constraint

CCD Family History Observation RelatedSubject SHOULD contain exactly one RelatedSubject / subject

OCL

not self.subject.oclIsUndefined() implies self.subject.relatedSubject.subject->size() = 1

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<statusCode code="completed"/>
<subject>
<relatedSubject/>
</subject>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<statusCode code="completed"/>
<subject>
<relatedSubject>
<subject/>
</relatedSubject>
</subject>
</observation>

0.010
testValidateFamilyHistoryObservationHasGenderCode

Constraint

CCD Family History Observation RelatedSubject / subject SHOULD contain exactly one RelatedSubject / subject / administrativeGenderCode.

OCL

not self.subject.oclIsUndefined() implies self.subject.relatedSubject.subject.administrativeGenderCode->size() = 1

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<statusCode code="completed"/>
<subject>
<relatedSubject>
<subject/>
</relatedSubject>
</subject>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<statusCode code="completed"/>
<subject>
<relatedSubject>
<subject>
<administrativeGenderCode/>
</subject>
</relatedSubject>
</subject>
</observation>

0.009
testValidateFamilyHistoryObservationRelatedSubjectBirthTime

Constraint

CCD Family History Observation SHOULD satisfy: subject/relatedSubject/subject contains exactly one birthTime (CONF-219)

OCL

self.subject.relatedSubject.subject.birthTime->size() = 1

SuccessInvalid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<statusCode code="completed"/>
<subject>
<relatedSubject>
<subject/>
</relatedSubject>
</subject>
</observation>

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<statusCode code="completed"/>
<subject>
<relatedSubject>
<subject>
<birthTime/>
</subject>
</relatedSubject>
</subject>
</observation>

0.006
testValidateFamilyHistoryObservationId

Constraint

Consol Family History Observation SHALL contain at least one [1..*] id (CONF:8592)

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

0.009
testValidateFamilyHistoryObservationStatusCode

Constraint

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

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

0.014
testValidateFamilyHistoryObservationEffectiveTime

Constraint

Consol Family History Observation SHOULD contain zero or one [0..1] effectiveTime (CONF:8593)

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

0.009
testValidateFamilyHistoryObservationMoodCode

Constraint

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

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

0.007
testValidateFamilyHistoryObservationAgeObservation

Constraint

Consol Family History Observation MAY contain zero or one [0..1] entryRelationship (CONF:8675, CONF:8676, CONF:15526) Contains @typeCode="SUBJ" SUBJ, and Contains exactly one [1..1] Age Observation (templateId: 2.16.840.1.113883.10.20.22.4.31)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(consol::AgeObservation) 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.46"/>
<code codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMEDCT"/>
<statusCode code="completed"/>
<entryRelationship typeCode="SUBJ">
<observation/>
</entryRelationship>
</observation>

0.008
testValidateFamilyHistoryObservationProblemStatusObservation

Constraint

CCD Family History Observation MAY contain zero or one [0..1] entryRelationship (CONF-207) Contains exactly one [1..1] Problem Status Observation (templateId: 2.16.840.1.113883.10.20.1.50)

OCL

self.entryRelationship->one(entryRelationship : cda::EntryRelationship | not entryRelationship.observation.oclIsUndefined() and entryRelationship.observation.oclIsKindOf(ccd::ProblemStatusObservation))

SuccessInvalid XML


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

Valid XML


<observation xmlns="urn:hl7-org:v3" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.1.22"/>
<statusCode code="completed"/>
<entryRelationship>
<observation/>
</entryRelationship>
</observation>

0.009
testGetProblemStatusObservation

Constraint

OCL

SuccessInvalid XML

Valid XML

0.006
Properties »