Fixed problem where discriminators containing the extension function didn't properly look for fixed value in the profile but instead always went to the extension definition.
This commit is contained in:
parent
0d8b6d18a9
commit
e8e8c1af4e
|
@ -4145,10 +4145,12 @@ public class FHIRPathEngine {
|
|||
List<ElementDefinition> childDefinitions = ProfileUtilities.getChildMap(sd, element);
|
||||
for (ElementDefinition t : childDefinitions) {
|
||||
if (t.getPath().endsWith(".extension") && t.hasSliceName()) {
|
||||
sd = worker.fetchResource(StructureDefinition.class, t.getType().get(0).getProfile().get(0).getValue());
|
||||
while (sd!=null && !sd.getBaseDefinition().equals("http://hl7.org/fhir/StructureDefinition/Extension"))
|
||||
sd = worker.fetchResource(StructureDefinition.class, sd.getBaseDefinition());
|
||||
if (sd.getUrl().equals(targetUrl)) {
|
||||
StructureDefinition exsd = worker.fetchResource(StructureDefinition.class, t.getType().get(0).getProfile().get(0).getValue());
|
||||
while (exsd!=null && !exsd.getBaseDefinition().equals("http://hl7.org/fhir/StructureDefinition/Extension"))
|
||||
exsd = worker.fetchResource(StructureDefinition.class, exsd.getBaseDefinition());
|
||||
if (exsd.getUrl().equals(targetUrl)) {
|
||||
if (ProfileUtilities.getChildMap(sd, t).isEmpty())
|
||||
sd = exsd;
|
||||
focus = t;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--<StructureDefinition xmlns="http://hl7.org/fhir" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hl7.org/fhir ../../../../../../FHIR/schema/fhir-single.xsd">-->
|
||||
<StructureDefinition xmlns="http://hl7.org/fhir">
|
||||
<id value="extension-slice-profile"/>
|
||||
<url value="http://hl7.org/fhir/StructureDefinition/extension-slice-profile"/>
|
||||
<name value="ExtensionSliceProfile"/>
|
||||
<status value="draft"/>
|
||||
<description value="Test slicing by extension with fixed value"/>
|
||||
<kind value="resource"/>
|
||||
<abstract value="false"/>
|
||||
<type value="Patient"/>
|
||||
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Patient"/>
|
||||
<derivation value="constraint"/>
|
||||
<differential>
|
||||
<element id="Patient">
|
||||
<path value="Patient"/>
|
||||
</element>
|
||||
<element id="Patient.name">
|
||||
<path value="Patient.name"/>
|
||||
<slicing>
|
||||
<discriminator>
|
||||
<type value="value"/>
|
||||
<path value="extension('http://hl7.org/fhir/StructureDefinition/data-absent-reason').valueCode"/>
|
||||
</discriminator>
|
||||
<rules value="open"/>
|
||||
</slicing>
|
||||
</element>
|
||||
<element id="Patient.name:foo">
|
||||
<path value="Patient.name"/>
|
||||
<sliceName value="foo"/>
|
||||
<min value="1"/>
|
||||
</element>
|
||||
<element id="Patient.name:foo.extension:dar">
|
||||
<path value="Patient.name.extension"/>
|
||||
<sliceName value="dar"/>
|
||||
<min value="1"/>
|
||||
<type>
|
||||
<code value="Extension"/>
|
||||
<profile value="http://hl7.org/fhir/StructureDefinition/data-absent-reason"/>
|
||||
</type>
|
||||
</element>
|
||||
<element id="Patient.name:foo.extension:dar.valueCode">
|
||||
<path value="Patient.name.extension.valueCode"/>
|
||||
<fixedCode value="unknown"/>
|
||||
</element>
|
||||
</differential>
|
||||
</StructureDefinition>
|
|
@ -0,0 +1,13 @@
|
|||
<Patient xmlns="http://hl7.org/fhir">
|
||||
<id value="extension-slice"/>
|
||||
<text>
|
||||
<status value="generated"/>
|
||||
<div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div>
|
||||
</text>
|
||||
<name>
|
||||
<extension url="http://hl7.org/fhir/StructureDefinition/data-absent-reason">
|
||||
<valueCode value="unknown"/>
|
||||
</extension>
|
||||
</name>
|
||||
</Patient>
|
|
@ -460,6 +460,13 @@
|
|||
"version" : "3.0",
|
||||
"questionnaire" : "questionnaire-enableWhen-test3.xml",
|
||||
"errorCount": 0
|
||||
},
|
||||
"extension-slice.xml" : {
|
||||
"errorCount": 0,
|
||||
"profile" : {
|
||||
"source" : "extension-slice-profile.xml",
|
||||
"errorCount": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue