Unit Test Results.

Designed for use with JUnit and Ant.

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

NameTestsErrorsFailuresTime(s)Time StampHost
SocialHistorySectionTest14000.5502013-01-31T13:36:25JKMSoftware-desktop

Tests

NameStatusResultTime(s)
testConstructor

Constraint

OCL

SuccessInvalid XML

Valid XML

0.001
testValidateSocialHistorySectionTemplateId

Constraint

The 'SocialHistorySectionTemplateId' invariant is violated on 'org.openhealthtools.mdht.uml.cda.mu2consol.impl.SocialHistorySectionImpl@143d9e05{#//}'

OCL

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

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.17"/>
<templateId root="2.16.840.1.113883.10.20.22.2.17"/>
<code code="29762-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Social history"/>
</section>

0.014
testValidateSocialHistorySectionCode

Constraint

Consol Social History Section SHALL contain exactly one [1..1] code (CONF:14819)/@code="29762-2" Social history (CodeSystem: 2.16.840.1.113883.6.1 LOINC) (CONF:14820)

OCL

(self.code.oclIsUndefined() or self.code.isNullFlavorUndefined()) implies (not self.code.oclIsUndefined() and self.code.oclIsKindOf(datatypes::CE) and let value : datatypes::CE = self.code.oclAsType(datatypes::CE) in value.code = '29762-2' and value.codeSystem = '2.16.840.1.113883.6.1')

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.17"/>
<code code="29762-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Social history"/>
</section>

0.104
testValidateSocialHistorySectionTitle

Constraint

Consol Social History Section SHALL contain exactly one [1..1] title (CONF:7938)

OCL

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

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.17"/>
<code code="29762-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Social history"/>
<title>title</title>
</section>

0.048
testValidateSocialHistorySectionText

Constraint

Consol Social History Section SHALL contain exactly one [1..1] text (CONF:7939)

OCL

not self.text.oclIsUndefined()

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.17"/>
<code code="29762-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Social history"/>
<text/>
</section>

0.015
testValidateSocialHistorySectionSocialHistoryObservation

Constraint

Consol Social History Section MAY contain zero or more [0..*] entry (CONF:7953, CONF:7954) Contains exactly one [1..1] Social History Observation (templateId: 2.16.840.1.113883.10.20.22.4.38)

OCL

self.entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(consol::SocialHistoryObservation))

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.17"/>
<code code="29762-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Social history"/>
<entry>
<observation/>
</entry>
</section>

0.037
testGetSocialHistoryObservations

Constraint

OCL

SuccessInvalid XML

Valid XML

0.042
testGetPregnancyObservations

Constraint

OCL

SuccessInvalid XML

Valid XML

0.042
testValidateSocialHistorySectionCodeP

Constraint

Consol Social History Section SHALL contain exactly one [1..1] code (CONF:14819)/@code="29762-2" Social history (CodeSystem: 2.16.840.1.113883.6.1 LOINC) (CONF:14820)

OCL

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

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.17"/>
<code code="29762-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Social history"/>
</section>

0.045
testValidateSocialHistorySectionPregnancyObservation

Constraint

Consol Social History Section MAY contain zero or more [0..*] entry (CONF:9132, CONF:9133) Contains exactly one [1..1] Pregnancy Observation (templateId: 2.16.840.1.113883.10.20.15.3.8)

OCL

self.entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(consol::PregnancyObservation))

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.17"/>
<code code="29762-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Social history"/>
<entry>
<observation/>
</entry>
</section>

0.037
testValidateSocialHistorySectionSmokingStatusObservation

Constraint

Consol Social History Section SHOULD contain zero or more [0..*] entry (CONF:14823, CONF:14824) Contains exactly one [1..1] Smoking Status Observation (templateId: 2.16.840.1.113883.10.20.22.4.78)

OCL

self.entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(consol::SmokingStatusObservation))

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.17"/>
<code code="29762-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Social history"/>
<entry>
<observation/>
</entry>
</section>

0.037
testValidateSocialHistorySectionTobaccoUse

Constraint

Consol Social History Section MAY contain zero or more [0..*] entry (CONF:16816, CONF:16817) Contains exactly one [1..1] Tobacco Use (templateId: 2.16.840.1.113883.10.20.22.4.85)

OCL

self.entry->exists(entry : cda::Entry | not entry.observation.oclIsUndefined() and entry.observation.oclIsKindOf(consol::TobaccoUse))

SuccessInvalid XML


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

Valid XML


<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.17"/>
<code code="29762-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Social history"/>
<entry>
<observation/>
</entry>
</section>

0.042
testGetSmokingStatusObservations

Constraint

OCL

SuccessInvalid XML

Valid XML

0.042
testGetTobaccoUses

Constraint

OCL

SuccessInvalid XML

Valid XML

0.041
Properties »