Skip to content

Commit

Permalink
Merge pull request #128 from swmuir/develop
Browse files Browse the repository at this point in the history
Fix Medications Section entries optional inheritance SITE-3346
  • Loading branch information
drbgfc authored Oct 22, 2021
2 parents c1cdbb9 + 4fba2f2 commit 979d442
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<code.validator.version>latestVersion</code.validator.version>
<content.validator.version>latestVersion</content.validator.version>
<!-- MDHT properties -->
<mdht.models.version>3.0.0.20211018</mdht.models.version>
<mdht.models.version>3.0.0.20211021</mdht.models.version>
<ds4pcontent.version>${mdht.models.version}</ds4pcontent.version>
<mdht.plugins.version>3.0.0.202110121523</mdht.plugins.version>

Expand Down
25 changes: 23 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 @@ -73,7 +73,7 @@ public class RefCCDATest extends ReferenceValidationTester implements Validation
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,
DS4P_REFRAIN_OBSERVATION = 18,IVL_REAL_EXAMPLE=19,IVL_REAL_EXAMPLE2=20,REFERRAL_NOTE=21,REFERRAL_NOTE2=22,SDTCTEST=23,CONSOLNOTEACTIVITY=24;
DS4P_REFRAIN_OBSERVATION = 18,IVL_REAL_EXAMPLE=19,IVL_REAL_EXAMPLE2=20,REFERRAL_NOTE=21,REFERRAL_NOTE2=22,SDTCTEST=23,CONSOLNOTEACTIVITY=24,MEDICATION_SECTION_CODE_INVALID=25;


// Feel free to add docs to the end but don't alter existing data
Expand Down Expand Up @@ -105,7 +105,10 @@ public class RefCCDATest extends ReferenceValidationTester implements Validation
RefCCDATest.class.getResource("/ReferralNote.xml").toURI(),
RefCCDATest.class.getResource("/ReferralNote2.xml").toURI(),
RefCCDATest.class.getResource("/SDTCExtensionsTest.xml").toURI(),
RefCCDATest.class.getResource("/ConsolNoteActivity.xml").toURI()
RefCCDATest.class.getResource("/ConsolNoteActivity.xml").toURI(),
RefCCDATest.class.getResource("/MedicationSectionCodeInvalid.xml").toURI()




};
Expand Down Expand Up @@ -827,6 +830,24 @@ public void noteActivity_expectfailtest() {
passIfIssueIsInResults(results, ValidationResultType.CCDA_MDHT_CONFORMANCE_WARN, "3250-16940, 3250-16941");
}

/*
* SITE-3346 Validators triggers false error for MedicationSectionCode
*/
@Test
public void test_MedicationSectionCodeInvalid() {
List<RefCCDAValidationResult> results = validateDocumentAndReturnResults(
convertCCDAFileToString(CCDA_FILES[MEDICATION_SECTION_CODE_INVALID]), CCDATypes.NON_SPECIFIC_CCDAR2);
results = getMDHTErrorsFromResults(results);
passIfIssueIsInResults(results, ValidationResultType.CCDA_MDHT_CONFORMANCE_ERROR, "15387");
// check that it is returned only once
int codeSectionCounter=0;
for (RefCCDAValidationResult result : results) {
if (result.getDescription() !=null && result.getDescription().contains("15387")) {
codeSectionCounter++;
}
}
assertTrue(codeSectionCounter==1);
}


/**
Expand Down
26 changes: 26 additions & 0 deletions src/test/resources/MedicationSectionCodeInvalid.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="CDA.xsl"?>
<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hl7-org:v3 C:\XML\CDA_SDTC_Schema\infrastructure\cda\CDA_SDTC.xsd"
xmlns="urn:hl7-org:v3"
xmlns:cda="urn:hl7-org:v3">
<component>
<structuredBody>
<component>
<section>
<templateId
root="2.16.840.1.113883.10.20.22.2.1.1"/>
<!-- negative testing: bad code (not a code that exists anywhere) -db -->
<code
code="ashfdkjdsahfkdsahfdflksskjfdsa"
codeSystem="2.16.840.1.113883.6.1"
codeSystemName="LOINC"
displayName="HISTORY OF MEDICATION USE"/>
</section>
</component>



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

0 comments on commit 979d442

Please sign in to comment.