Skip to content

Commit

Permalink
Merge pull request #113 from onc-healthit/develop
Browse files Browse the repository at this point in the history
mrege develop into master for SITE 3.1.49 release
  • Loading branch information
drbgfc authored Jul 27, 2021
2 parents b077626 + 8bf66e1 commit dd54a01
Show file tree
Hide file tree
Showing 3 changed files with 319 additions and 7 deletions.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.sitenv</groupId>
<artifactId>referenceccdavalidator</artifactId>
<version>1.0.57</version>
<version>1.0.58</version>
<packaging>war</packaging>
<name>Reference CCDA Validator</name>

Expand All @@ -15,9 +15,9 @@
<code.validator.version>latestVersion</code.validator.version>
<content.validator.version>latestVersion</content.validator.version>
<!-- MDHT properties -->
<mdht.models.version>3.0.0.20210210</mdht.models.version>
<mdht.models.version>3.0.0.20210720</mdht.models.version>
<ds4pcontent.version>${mdht.models.version}</ds4pcontent.version>
<mdht.plugins.version>3.0.0.202102100600 </mdht.plugins.version>
<mdht.plugins.version>3.0.0.202107200500</mdht.plugins.version>
</properties>

<repositories>
Expand Down Expand Up @@ -222,7 +222,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.9.2</version>
<version>2.9.10.7</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down Expand Up @@ -255,7 +255,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
36 changes: 34 additions & 2 deletions src/test/java/org/sitenv/referenceccda/test/tests/RefCCDATest.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public class RefCCDATest extends ReferenceValidationTester implements Validation
DS4P_WITH_NO_DS4P_DATA_INP = 12, TWO_MEGS = 13, CCD_R21_EF = 14,
SUB_SOCIAL_HISTORY_WITH_BIRTH_SEX_OBS_TEMPLATE_SITE_3094 = 15,
SUB_PROCEDURES_WITH_DEVICE_IDENTIFIER_OBSERVATION_SITE_3218 = 16,
SUB_PROCEDURES_WITH_DEVICE_IDENTIFIER_OBSERVATION_BAD_VALUE_ROOT_SITE_3218 = 17;
SUB_PROCEDURES_WITH_DEVICE_IDENTIFIER_OBSERVATION_BAD_VALUE_ROOT_SITE_3218 = 17,
DS4P_REFRAIN_OBSERVATION = 18;


// Feel free to add docs to the end but don't alter existing data
Expand All @@ -89,7 +90,8 @@ public class RefCCDATest extends ReferenceValidationTester implements Validation
RefCCDATest.class.getResource("/C-CDA_R2-1_CCD_EF.xml").toURI(),
RefCCDATest.class.getResource("/SocialHistoryWithBirthSexObsTemplateSite3094.xml").toURI(),
RefCCDATest.class.getResource("/subProceduresWithDeviceIdentifierObservationSite3218.xml").toURI(),
RefCCDATest.class.getResource("/subProceduresWithDeviceIdentifierObservationBadValueRootSite3218.xml").toURI(),
RefCCDATest.class.getResource("/subProceduresWithDeviceIdentifierObservationBadValueRootSite3218.xml").toURI(),
RefCCDATest.class.getResource("/DS4PRefrainTest.xml").toURI()
};
} catch (URISyntaxException e) {
if (LOG_RESULTS_TO_CONSOLE)
Expand Down Expand Up @@ -729,7 +731,37 @@ public void deviceIdentifierObservationInProceduresInvariantErrorSite3218_Expect
"The 'DeviceIdentifierObservationDeviceIdentifierObservationIIUDIissuingagency' invariant is violated on";
passIfIssueIsInResults(results, ValidationResultType.CCDA_MDHT_CONFORMANCE_ERROR, udiValueRootError);
}

/*
* Refrain terminology update
*/
@Test
public void ds4pRefrainTerminologyUpdate_ExpectPassTest() {
List<RefCCDAValidationResult> results = validateDocumentAndReturnResults(
convertCCDAFileToString(CCDA_FILES[DS4P_REFRAIN_OBSERVATION]), CCDATypes.NON_SPECIFIC_DS4P);

results = getMDHTErrorsFromResults(results);
printResultsBasedOnFlags(results);

final String ds4PRefrainError = "CONF:9135";
failIfIssueIsInResults(results, ValidationResultType.CCDA_MDHT_CONFORMANCE_ERROR, ds4PRefrainError);
}

/*
* Advanced Directive choice test
*/
@Test
public void advanceDirectivesChoice_ExpectFailTest() {
List<RefCCDAValidationResult> results = validateDocumentAndReturnResults(
convertCCDAFileToString(CCDA_FILES[DS4P_REFRAIN_OBSERVATION]), CCDATypes.NON_SPECIFIC_DS4P);

results = getMDHTErrorsFromResults(results);
printResultsBasedOnFlags(results);

final String ds4PRefrainError = "CONF:1198-32881";
passIfIssueIsInResults(results, ValidationResultType.CCDA_MDHT_CONFORMANCE_ERROR, ds4PRefrainError);
}

private static List<ConfiguredExpression> getGenericConfiguredExpressionsForTesting() {
final String validationMessage = "Will always fail";
final String configuredXpathExpression = "//v3:informant/v3:relatedEntity/v3:relatedPerson/v3:name";
Expand Down
280 changes: 280 additions & 0 deletions src/test/resources/DS4PRefrainTest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
<!-- -->
<!-- CCDA Header Transition of Care -->
<!-- -->
<!-- <?xml-stylesheet type='text/xsl' href='http://www.powersoftmd.com/CCDAXSL/PowerSoftMDCED.xsl'?> -->
<?xml-stylesheet type='text/xsl' href='http://www.powersoftmd.com/CCDAXSL/GenericCDA.xsl'?>
<ClinicalDocument xmlns="urn:hl7-org:v3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sdtc="urn:hl7-org:sdtc" xmlns:cda="urn:hl7-org:v3"
xmlns:voc="urn:hl7-org:v3/voc">
<templateId extension="IMPL_CDAR2_LEVEL1"
root="2.16.840.1.113883.10" />
<templateId root="2.16.840.1.113883.10.20.22.1.1"
extension="2015-08-01" />
<templateId root="2.16.840.1.113883.10.20.22.1.1" />
<templateId root="2.16.840.1.113883.10.20.22.1.2"
extension="2015-08-01" />
<templateId root="2.16.840.1.113883.10.20.22.1.2" />
<templateId root="2.16.840.1.113883.10.20.22.1.15"
extension="2015-08-01" />
<templateId root="2.16.840.1.113883.10.20.22.1.15" />
<component>
<structuredBody>
<templateId extension="IMPL_CDAR2_LEVEL1"
root="2.16.840.1.113883.10" />
<!-- ******************************************************** -->
<!-- Privacy and Security Markings Section -->
<!-- ******************************************************** -->
<component>
<!-- Privacy and Security Markings Section -->
<section>
<!-- Privacy Markings section template -->
<templateId root="2.16.840.1.113883.3.3251.1.5"
assigningAuthorityName="HL7 Security" />
<code code="57017-6" codeSystem="2.16.840.1.113883.6.1"
codeSystemName="LOINC" displayName="Privacy policy Organization" />
<title>Security and Privacy Prohibitions</title>
<text>
Section Author: Dr. Davis Albert, Neighborhood Physicians Practice
<br />
PROHIBITION ON REDISCLOSURE OF CONFIDENTIAL INFORMATION:
<br />
This notice accompanies a disclosure of information concerning a
client in alcohol/drug treatment, made
to you with the consent of such client. This information has been
disclosed to you from records protected
by federal confidentiality rules (42 C.F.R. Part 2). The federal
rules prohibit you from making any
further disclosure of this information unless further disclosure is
expressly permitted by the written
consent of the person to whom it pertains or as otherwise permitted by 42
C.F.R. Part 2. A general
authorization for the release of medical or other information is NOT sufficient
for this purpose. The
federal rules restrict any use of the information to criminally
investigate or prosecute any alcohol or
drug abuse patient.
</text>
<confidentialityCode code="R"
codeSystem="2.16.840.1.113883.5.25"
codeSystemName="HL7 Confidentiality" />
<author>
<!-- Mandatory Document Author for DS4P -->
<templateId root="2.16.840.1.113883.3.3251.1.2"
assigningAuthorityName="HL7 Security" />
<time value="20150622" />
<assignedAuthor>
<!-- Mandatory Document Provenance - assigned author for DS4P -->
<templateId root="2.16.840.1.113883.3.3251.1.3"
assigningAuthorityName="HL7 Security" />
<!-- auhorId -->
<id extension="111111" root="2.16.840.1.113883.4.6" />
<code code="200000000X" codeSystem="2.16.840.1.113883.6.101"
displayName="Allopathic &amp; Osteopathic Physicians" />
<addr>
<streetAddressLine>2472 Rocky place</streetAddressLine>
<city>Beaverton</city>
<state>OR</state>
<postalCode>97006</postalCode>
<country>US</country>
</addr>
<telecom use="WP" value="tel:+1(555)-555-1002" />
<assignedPerson>
<!-- AuthorProviderName -->
<name>
<prefix>Dr.</prefix>
<family>Albert</family>
<given>Davis</given>
</name>
</assignedPerson>
<!-- added representedOrganization for CCD requirements when we do
NOT have an assignedPerson -db -->
<!-- Consol Continuity of Care Document (CCD) (V3) SHALL contain at
least one [1..*] author, where its type is Author (CONF:1198-9442) each SHALL
contain exactly one [1..1] assignedAuthor, where (CONF:1198-9443) assignedAuthor
SHALL contain exactly one [1..1] assignedPerson and/or exactly one [1..1]
representedOrganization (CONF:1198-8456) -->
<representedOrganization>
<id root="2.16.840.1.113883.19.5" />
<name>Neighborhood Physicians Practice</name>
</representedOrganization>
</assignedAuthor>
</author>
<entry typeCode="COMP">
<!-- Privacy Marking Entry to indicate the precise/computable security
obligations and refrains -->
<templateId root="2.16.840.1.113883.3.3251.1.9"
assigningAuthorityName="HL7 Security" />
<organizer classCode="CLUSTER" moodCode="EVN">
<!-- Privacy Annotations are organized using template "2.16.840.1.113883.3.3251.1.4" -->
<templateId root="2.16.840.1.113883.3.3251.1.4"
assigningAuthorityName="HL7 Security" />
<statusCode code="active" />

<component typeCode="COMP">
<observation classCode="OBS" moodCode="EVN">
<!-- Security Observation -->
<templateId root="2.16.840.1.113883.3.445.21"
assigningAuthorityName="HL7 CBCC" />
<!-- Refrain Policy Code template -->
<templateId root="2.16.840.1.113883.3.445.23"
assigningAuthorityName="HL7 CBCC" />
<code code="SECCONOBS"
codeSystem="2.16.840.1.113883.1.11.20457"
displayName="Security Classification"
codeSystemName="HL7 SecurityObservationTypeCodeSystem" />
<!-- Value set constraint "2.16.840.1.113883.1.11.20446" -->
<!-- old invalid value -dbDS4P -->
<!-- <value xsi:type="CE" code="NORDSLCD" codeSystem="2.16.840.1.113883.5.1063"
codeSystemName="SecurityObservationValueCodeSystem" displayName="Prohibition
on redisclosure without patient consent directive"> <originalText>Prohibition
on redisclosure without patient consent directive</originalText> </value> -->
<!-- new correct value -db -->
<value xsi:type="CE" code="NOAUTH"
codeSystem="2.16.840.1.113883.5.1063"
codeSystemName="SecurityObservationValue"
displayName="Prohibition on redisclosure without patient consent directive">
<originalText>Prohibition on redisclosure without patient
consent directive</originalText>
</value>
</observation>
</component>

<component typeCode="COMP">
<observation classCode="OBS" moodCode="EVN">
<!-- Security Observation -->
<templateId root="2.16.840.1.113883.3.445.21"
assigningAuthorityName="HL7 CBCC" />
<!-- Refrain Policy Code template -->
<templateId root="2.16.840.1.113883.3.445.23"
assigningAuthorityName="HL7 CBCC" />
<code code="SECCONOBS"
codeSystem="2.16.840.1.113883.1.11.20457"
displayName="Security Classification"
codeSystemName="HL7 SecurityObservationTypeCodeSystem" />
<!-- Value set constraint "2.16.840.1.113883.1.11.20446" -->
<!-- old invalid value -dbDS4P -->
<!-- <value xsi:type="CE" code="NORDSLCD" codeSystem="2.16.840.1.113883.5.1063"
codeSystemName="SecurityObservationValueCodeSystem" displayName="Prohibition
on redisclosure without patient consent directive"> <originalText>Prohibition
on redisclosure without patient consent directive</originalText> </value> -->
<!-- new correct value -db -->
<value xsi:type="CE" code="NOAUTH"
codeSystem="2.16.840.1.113883.5.1063"
codeSystemName="SecurityObservationValue"
displayName="Prohibition on redisclosure without patient consent directive">
<originalText>Prohibition on redisclosure without patient
consent directive</originalText>
</value>
</observation>
</component>


<component typeCode="COMP">
<observation classCode="OBS" moodCode="EVN">
<!-- Security Observation -->
<templateId root="2.16.840.1.113883.3.445.21"
assigningAuthorityName="HL7 CBCC" />
<!-- Refrain Policy Code template -->
<templateId root="2.16.840.1.113883.3.445.23"
assigningAuthorityName="HL7 CBCC" />
<code code="SECCONOBS"
codeSystem="2.16.840.1.113883.1.11.20457"
displayName="Security Classification"
codeSystemName="HL7 SecurityObservationTypeCodeSystem" />
<!-- Value set constraint "2.16.840.1.113883.1.11.20446" -->
<!-- old invalid value -dbDS4P -->
<!-- <value xsi:type="CE" code="NORDSLCD" codeSystem="2.16.840.1.113883.5.1063"
codeSystemName="SecurityObservationValueCodeSystem" displayName="Prohibition
on redisclosure without patient consent directive"> <originalText>Prohibition
on redisclosure without patient consent directive</originalText> </value> -->
<!-- new correct value -db -->
<value xsi:type="CE" code="NOINTEGRATE"
codeSystem="2.16.840.1.113883.5.1063"
codeSystemName="SecurityObservationValue"
displayName="Prohibition on redisclosure without patient consent directive">
<originalText>Prohibition on redisclosure without patient
consent directive</originalText>
</value>
</observation>
</component>


<component typeCode="COMP">
<observation classCode="OBS" moodCode="EVN">
<!-- Security Observation -->
<templateId root="2.16.840.1.113883.3.445.21"
assigningAuthorityName="HL7 CBCC" />
<!-- Refrain Policy Code template -->
<templateId root="2.16.840.1.113883.3.445.23"
assigningAuthorityName="HL7 CBCC" />
<code code="SECCONOBS"
codeSystem="2.16.840.1.113883.1.11.20457"
displayName="Security Classification"
codeSystemName="HL7 SecurityObservationTypeCodeSystem" />
<!-- Value set constraint "2.16.840.1.113883.1.11.20446" -->
<!-- old invalid value -dbDS4P -->
<!-- <value xsi:type="CE" code="NORDSLCD" codeSystem="2.16.840.1.113883.5.1063"
codeSystemName="SecurityObservationValueCodeSystem" displayName="Prohibition
on redisclosure without patient consent directive"> <originalText>Prohibition
on redisclosure without patient consent directive</originalText> </value> -->
<!-- new correct value -db -->
<value xsi:type="CE" code="NOCOLLECT"
codeSystem="2.16.840.1.113883.5.1063"
codeSystemName="SecurityObservationValue"
displayName="Prohibition on redisclosure without patient consent directive">
<originalText>Prohibition on redisclosure without patient
consent directive</originalText>
</value>
</observation>
</component>

</organizer>
</entry>
</section>
</component>







<component>
<section xmlns="urn:hl7-org:v3">
<templateId root="2.16.840.1.113883.10.20.22.2.21.1"
extension="2015-08-01" />
<templateId root="2.16.840.1.113883.10.20.22.2.21" />
<templateId root="2.16.840.1.113883.10.20.22.2.21"
extension="2015-08-01" />
<code code="42348-3" codeSystem="2.16.840.1.113883.6.1"
codeSystemName="LOINC" displayName="Advance Directives" />
<entry>
<observation classCode="OBS" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.48"
extension="2015-08-01" />
<templateId root="2.16.840.1.113883.10.20.22.4.48" />
<code codeSystem="2.16.840.1.113883.6.96"
codeSystemName="SNOMEDCT" />
<statusCode code="completed" />
</observation>
<organizer classCode="CLUSTER" moodCode="EVN">
<templateId root="2.16.840.1.113883.10.20.22.4.108"
extension="2015-08-01" />
<code code="45473-6" codeSystem="2.16.840.1.113883.6.1"
codeSystemName="LOINC"
displayName="Advance directive - living will" />
<statusCode code="completed" />
</organizer>
</entry>
</section>
</component>






</structuredBody>
</component>
</ClinicalDocument>

0 comments on commit dd54a01

Please sign in to comment.