fixes to snapshot generation

This commit is contained in:
Grahame Grieve 2019-09-27 08:49:44 +10:00
parent 47429311cf
commit 0ba9061e0b
6 changed files with 41 additions and 24 deletions

View File

@ -1295,7 +1295,8 @@ public class ProfileUtilities extends TranslatingUtilities {
if (usage.hasBinding())
res.setBinding(usage.getBinding().copy());
for (ElementDefinitionConstraintComponent c : usage.getConstraint())
res.addConstraint(c);
if (!res.hasConstraint(c.getKey()))
res.addConstraint(c);
for (Extension e : usage.getExtension()) {
if (!res.hasExtension(e.getUrl()))
res.addExtension(e.copy());
@ -1971,13 +1972,16 @@ public class ProfileUtilities extends TranslatingUtilities {
s.setSource(base.getId());
}
if (derived.hasConstraint()) {
for (ElementDefinitionConstraintComponent s : derived.getConstraint()) {
ElementDefinitionConstraintComponent inv = s.copy();
base.getConstraint().add(inv);
for (ElementDefinitionConstraintComponent s : derived.getConstraint()) {
if (!base.hasConstraint(s.getKey())) {
ElementDefinitionConstraintComponent inv = s.copy();
base.getConstraint().add(inv);
}
}
}
for (IdType id : derived.getCondition()) {
base.getCondition().add(id);
if (!base.hasCondition(id))
base.getCondition().add(id);
}
// now, check that we still have a bindable type; if not, delete the binding - see task 8477

View File

@ -7576,6 +7576,22 @@ When pattern[x] is used to constrain a complex object, it means that each proper
public String present() {
return hasId() ? getId() : getPath();
}
public boolean hasCondition(IdType id) {
for (IdType c : getCondition()) {
if (c.primitiveValue().equals(id.primitiveValue()))
return true;
}
return false;
}
public boolean hasConstraint(String key) {
for (ElementDefinitionConstraintComponent c : getConstraint()) {
if (c.getKey().equals(key))
return true;
}
return false;
}

View File

@ -36,8 +36,13 @@
<a name="Patient.extension"> </a>
</td>
<td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/>
<td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">..3</td>
<td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/>
<td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">
<span style="opacity: 0.4">0</span>..
<span style="opacity: 0.4">3</span>
</td>
<td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">
<a style="opacity: 0.4" href="nulldatatypes.html#Extension">Extension</a>
</td>
<td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">
<span style="font-weight:bold">Slice: </span>Unordered, Open by value:url
</td>
@ -362,8 +367,8 @@
<element id="Patient.extension:name2">
<path value="Patient.extension"/>
<sliceName value="name2"/>
<short value="Mother&#39;s Maiden name"/>
<definition value="Mother&#39;s maiden (unmarried) name, commonly collected to help verify patient identity."/>
<short value="Condition(s) limiting movement, senses, or activities"/>
<definition value="Value(s) identifying physical or mental condition(s) that limits a person&#39;s movements, senses, or activities."/>
<min value="0"/>
<max value="*"/>
<base>
@ -373,7 +378,7 @@
</base>
<type>
<code value="Extension"/>
<profile value="http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName"/>
<profile value="http://hl7.org/fhir/StructureDefinition/patient-disability"/>
</type>
<condition value="ele-1"/>
<constraint>
@ -393,14 +398,6 @@
<source value="Extension"/>
</constraint>
<isModifier value="false"/>
<mapping>
<identity value="v2"/>
<map value="PID-6"/>
</mapping>
<mapping>
<identity value="rim"/>
<map value="Role relationship to entity with maiden name (?)"/>
</mapping>
</element>
<element id="Patient.modifierExtension">
<path value="Patient.modifierExtension"/>
@ -1602,7 +1599,7 @@
<sliceName value="name2"/>
<type>
<code value="Extension"/>
<profile value="http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName"/>
<profile value="http://hl7.org/fhir/StructureDefinition/patient-disability"/>
</type>
</element>
</differential>

View File

@ -38,7 +38,7 @@
<sliceName value="name2"/>
<type>
<code value="Extension"/>
<profile value="http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName"/>
<profile value="http://hl7.org/fhir/StructureDefinition/patient-disability"/>
</type>
</element>
</differential>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<StructureDefinition xmlns="http://hl7.org/fhir">
<id value="t4"/>
<id value="t4a"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
@ -53,7 +53,7 @@
</div>
</text>
<url value="urn:uuid:71e0a5a6-95bf-4e04-aa6a-4af0ebef3f29"/>
<name value="t4"/>
<name value="t4a"/>
<status value="draft"/>
<description value="fixture for #4: test appending documentation"/>
<mapping>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<StructureDefinition xmlns="http://hl7.org/fhir">
<id value="t4"/>
<id value="t4a"/>
<url value="urn:uuid:71e0a5a6-95bf-4e04-aa6a-4af0ebef3f29"/>
<name value="t4"/>
<name value="t4a"/>
<status value="draft"/>
<description value="fixture for #4: test appending documentation"/>
<kind value="resource"/>