fix CDA parsing

This commit is contained in:
Grahame Grieve 2019-06-15 08:05:24 +10:00
parent 9a344b251c
commit 8798c5cf58
3 changed files with 6 additions and 5 deletions

View File

@ -99,11 +99,11 @@ public abstract class ParserBase {
return null;
}
for (StructureDefinition sd : context.allStructures()) {
if (name.equals(sd.getType()) && sd.getDerivation() == TypeDerivationRule.SPECIALIZATION && !sd.getUrl().startsWith("http://hl7.org/fhir/StructureDefinition/de-")) {
if((ns == null || ns.equals(FormatUtilities.FHIR_NS)) && !ToolingExtensions.hasExtension(sd, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"))
if (sd.getDerivation() == TypeDerivationRule.SPECIALIZATION && !sd.getUrl().startsWith("http://hl7.org/fhir/StructureDefinition/de-")) {
if(name.equals(sd.getType()) && (ns == null || ns.equals(FormatUtilities.FHIR_NS)) && !ToolingExtensions.hasExtension(sd, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"))
return sd;
String sns = ToolingExtensions.readStringExtension(sd, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace");
if (ns != null && ns.equals(sns))
if (name.equals(sd.getType()) && ns != null && ns.equals(sns))
return sd;
}
}

View File

@ -404,6 +404,7 @@ public class Validator {
}
} catch (Exception e) {
System.out.println(" ...Failure: "+e.getMessage());
e.printStackTrace();
}
} else if (mode == EngineMode.NARRATIVE) {
DomainResource r = validator.generate(sources.get(0));

View File

@ -724,8 +724,8 @@
"errorCount": 19,
"errors-for-debugging" : ["ERROR: Bundle.entry[4].resource.entry[1].resource.section[1].code.coding: unable to find code 886921000000105 in http://snomed.info/sct\r\n",
"ERROR: Bundle.entry[4].resource.entry[1].resource.section[2].code.coding: unable to find code 1077881000000105 in http://snomed.info/sct",
"ERROR: Bundle.entry[4].resource.entry[1].resource.section[3].code.coding: Concept not found (next char = "c", in "cons") at character 1",
"ERROR: Bundle.entry[4].resource.entry[1].resource.section[4].code.coding: Concept not found (next char = "e", in "eligcrit") at character 1",
"ERROR: Bundle.entry[4].resource.entry[1].resource.section[3].code.coding: Concept not found (next char = \"c\", in \"cons\") at character 1",
"ERROR: Bundle.entry[4].resource.entry[1].resource.section[4].code.coding: Concept not found (next char = \"e\", in \"eligcrit\") at character 1",
"ERROR: Bundle.entry[4].resource.entry[1].resource.section[5].code.coding: unable to find code 886711000000101 in http://snomed.info/sct",
"ERROR: Bundle.entry[4].resource.entry[1].resource.section[6].code.coding: unable to find code 717121000000105 in http://snomed.info/sct",
"ERROR: Bundle.entry[4].resource.entry[1].resource.section[7].code.coding: unable to find code 1102181000000102 in http://snomed.info/sct",