update snapshot generation + tests after discussion

This commit is contained in:
Grahame Grieve 2019-07-23 06:31:17 +10:00
parent ecb3a8e1fe
commit 4274392020
6 changed files with 48 additions and 42 deletions

View File

@ -778,7 +778,7 @@ public class ProfileUtilities extends TranslatingUtilities {
// fix the slice names too while we're at it...
for (TypeSlice ts : typeList)
if (ts.type != null)
ts.defn.setSliceName(ts.type);
ts.defn.setSliceName(rootName(cpath)+Utilities.capitalize(ts.type));
// ok passed the checks.
// copy the root diff, and then process any children it has
@ -1072,6 +1072,12 @@ public class ProfileUtilities extends TranslatingUtilities {
}
private String rootName(String cpath) {
String t = tail(cpath);
return t.replace("[x]", "");
}
private String determineTypeSlicePath(String path, String cpath) {
String headP = path.substring(0, path.lastIndexOf("."));
// String tailP = path.substring(path.lastIndexOf(".")+1);

View File

@ -204,14 +204,14 @@
<rule text="There should be 9 element definitions for value[x] (base + quantity + walking into quantity" fhirpath="fixture('t43-output').snapshot.element.where(path.startsWith('Observation.value')).count() = 9"/>
<rule text="The element definition for value[x] should have 1 type" fhirpath="fixture('t43-output').snapshot.element.where(id = 'Observation.value[x]').type.count().trace('count') = 1"/>
<rule text="The element definition for value[x] should have short = 'some text'" fhirpath="fixture('t43-output').snapshot.element.where(id = 'Observation.value[x]').short = 'some text'"/>
<rule text="The element definition for value[x] quantity slice should have sliceName = 'Quantity'" fhirpath="fixture('t43-output').snapshot.element.where(id = 'Observation.value[x]:Quantity').check(exists(), 'no slice').sliceName = 'Quantity'"/>
<rule text="The element definition for value[x].value quantity slice should have sliceName = 'Quantity'" fhirpath="fixture('t43-output').snapshot.element.where(id = 'Observation.value[x]:Quantity.value').check(exists(), 'no slice').min = 1"/>
<rule text="The element definition for value[x] quantity slice should have sliceName = 'Quantity'" fhirpath="fixture('t43-output').snapshot.element.where(id = 'Observation.value[x]:valueQuantity').check(exists(), 'no slice').sliceName = 'valueQuantity'"/>
<rule text="The element definition for value[x].value quantity slice should have sliceName = 'Quantity'" fhirpath="fixture('t43-output').snapshot.element.where(id = 'Observation.value[x]:valueQuantity.value').check(exists(), 'no slice').min = 1"/>
</test>
<test gen="true" sort="true" id="t44">
<rule text="There should be 9 element definitions for value[x] (base + quantity + walking into quantity" fhirpath="fixture('t44-output').snapshot.element.where(path.startsWith('Observation.value')).count() = 9"/>
<rule text="The element definition for value[x] should have 1 type" fhirpath="fixture('t44-output').snapshot.element.where(id = 'Observation.value[x]').type.count().trace('count') = 1"/>
<rule text="The element definition for value[x] should have short = 'some text'" fhirpath="fixture('t44-output').snapshot.element.where(id = 'Observation.value[x]').short = 'some text'"/>
<rule text="The element definition for value[x] quantity slice should have sliceName = 'Quantity'" fhirpath="fixture('t44-output').snapshot.element.where(id = 'Observation.value[x]:Quantity').check(exists(), 'no slice').sliceName = 'Quantity'"/>
<rule text="The element definition for value[x].value quantity slice should have sliceName = 'Quantity'" fhirpath="fixture('t44-output').snapshot.element.where(id = 'Observation.value[x]:Quantity.value').check(exists(), 'no slice').min = 1"/>
<rule text="The element definition for value[x] quantity slice should have sliceName = 'Quantity'" fhirpath="fixture('t44-output').snapshot.element.where(id = 'Observation.value[x]:valueQuantity').check(exists(), 'no slice').sliceName = 'valueQuantity'"/>
<rule text="The element definition for value[x].value quantity slice should have sliceName = 'Quantity'" fhirpath="fixture('t44-output').snapshot.element.where(id = 'Observation.value[x]:valueQuantity.value').check(exists(), 'no slice').min = 1"/>
</test>
</snapshot-generation-tests>

View File

@ -773,9 +773,9 @@
<isModifier value="false"/>
<isSummary value="true"/>
</element>
<element id="Parameters.parameter.part:foo.value[x]:Coding">
<element id="Parameters.parameter.part:foo.value[x]:valueCoding">
<path value="Parameters.parameter.part.value[x]"/>
<sliceName value="Coding"/>
<sliceName value="valueCoding"/>
<short value="If parameter is a data type"/>
<definition value="If the parameter is a data type."/>
<min value="1"/>
@ -792,7 +792,7 @@
<isModifier value="false"/>
<isSummary value="true"/>
</element>
<element id="Parameters.parameter.part:foo.value[x]:Coding.id">
<element id="Parameters.parameter.part:foo.value[x]:valueCoding.id">
<path value="Parameters.parameter.part.value[x].id"/>
<representation value="xmlAttr"/>
<short value="Unique id for inter-element referencing"/>
@ -814,7 +814,7 @@
<map value="n/a"/>
</mapping>
</element>
<element id="Parameters.parameter.part:foo.value[x]:Coding.extension">
<element id="Parameters.parameter.part:foo.value[x]:valueCoding.extension">
<path value="Parameters.parameter.part.value[x].extension"/>
<slicing>
<discriminator>
@ -846,7 +846,7 @@
<map value="n/a"/>
</mapping>
</element>
<element id="Parameters.parameter.part:foo.value[x]:Coding.system">
<element id="Parameters.parameter.part:foo.value[x]:valueCoding.system">
<path value="Parameters.parameter.part.value[x].system"/>
<short value="Identity of the terminology system"/>
<definition value="The identification of the code system that defines the meaning of the symbol in the code."/>
@ -877,7 +877,7 @@
<map value="fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem"/>
</mapping>
</element>
<element id="Parameters.parameter.part:foo.value[x]:Coding.version">
<element id="Parameters.parameter.part:foo.value[x]:valueCoding.version">
<path value="Parameters.parameter.part.value[x].version"/>
<short value="Version of the system - if relevant"/>
<definition value="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged."/>
@ -907,7 +907,7 @@
<map value="fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion"/>
</mapping>
</element>
<element id="Parameters.parameter.part:foo.value[x]:Coding.code">
<element id="Parameters.parameter.part:foo.value[x]:valueCoding.code">
<path value="Parameters.parameter.part.value[x].code"/>
<short value="Symbol in syntax defined by the system"/>
<definition value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)."/>
@ -937,7 +937,7 @@
<map value="fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code"/>
</mapping>
</element>
<element id="Parameters.parameter.part:foo.value[x]:Coding.display">
<element id="Parameters.parameter.part:foo.value[x]:valueCoding.display">
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
<valueBoolean value="true"/>
</extension>
@ -970,7 +970,7 @@
<map value="fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName"/>
</mapping>
</element>
<element id="Parameters.parameter.part:foo.value[x]:Coding.userSelected">
<element id="Parameters.parameter.part:foo.value[x]:valueCoding.userSelected">
<path value="Parameters.parameter.part.value[x].userSelected"/>
<short value="If this coding was chosen directly by the user"/>
<definition value="Indicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays)."/>

View File

@ -39,7 +39,7 @@
<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"/>
<td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/>
</tr>
</tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: #F7F7F7;">
<td style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck12.png)" class="hierarchy">
@ -60,7 +60,7 @@
<span style="font-weight:bold; font-style: italic">Slice: </span>
<span style="font-style: italic">Unordered, Unspecified by type:$this</span>
</td>
</tr>
</tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;">
<td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck05.png)" class="hierarchy">
@ -76,7 +76,7 @@
<a href="nulldatatypes.html#Quantity">Quantity</a>
</td>
<td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">some text for quantity</td>
</tr>
</tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: #F7F7F7;">
<td style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck040.png)" class="hierarchy">
@ -91,7 +91,7 @@
<td style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">1..</td>
<td style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/>
<td style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/>
</tr>
</tr>
<tr>
<td colspan="5" class="hierarchy">
@ -955,9 +955,9 @@
<map value="363714003 |Interprets|"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity">
<element id="Observation.value[x]:valueQuantity">
<path value="Observation.value[x]"/>
<sliceName value="Quantity"/>
<sliceName value="valueQuantity"/>
<short value="some text for quantity"/>
<definition value="The information determined as a result of making the observation, if the information has a simple value."/>
<comment value="An observation may have; 1) a single value here, 2) both a value and a set of related or component values, or 3) only a set of related or component values. If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://test.org/profile/observation.html#notes) below."/>
@ -992,7 +992,7 @@
<map value="363714003 |Interprets|"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity.id">
<element id="Observation.value[x]:valueQuantity.id">
<path value="Observation.value[x].id"/>
<representation value="xmlAttr"/>
<short value="Unique id for inter-element referencing"/>
@ -1014,7 +1014,7 @@
<map value="n/a"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity.extension">
<element id="Observation.value[x]:valueQuantity.extension">
<path value="Observation.value[x].extension"/>
<slicing>
<discriminator>
@ -1046,7 +1046,7 @@
<map value="n/a"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity.value">
<element id="Observation.value[x]:valueQuantity.value">
<path value="Observation.value[x].value"/>
<short value="Numerical value (with implicit precision)"/>
<definition value="The value of the measured amount. The value includes an implicit precision in the presentation of the value."/>
@ -1073,7 +1073,7 @@
<map value="PQ.value, CO.value, MO.value, IVL.high or IVL.low depending on the value"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity.comparator">
<element id="Observation.value[x]:valueQuantity.comparator">
<path value="Observation.value[x].comparator"/>
<short value="&lt; | &lt;= | &gt;= | &gt; - how to understand the value"/>
<definition value="How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is &quot;&lt;&quot; , then the real value is &lt; stated value."/>
@ -1109,7 +1109,7 @@
<map value="IVL properties"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity.unit">
<element id="Observation.value[x]:valueQuantity.unit">
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
<valueBoolean value="true"/>
</extension>
@ -1138,7 +1138,7 @@
<map value="PQ.unit"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity.system">
<element id="Observation.value[x]:valueQuantity.system">
<path value="Observation.value[x].system"/>
<short value="System that defines coded unit form"/>
<definition value="The identification of the system that provides the coded form of the unit."/>
@ -1165,7 +1165,7 @@
<map value="CO.codeSystem, PQ.translation.codeSystem"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity.code">
<element id="Observation.value[x]:valueQuantity.code">
<path value="Observation.value[x].code"/>
<short value="Coded form of the unit"/>
<definition value="A computer processable form of the unit in some unit representation system."/>

View File

@ -39,7 +39,7 @@
<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"/>
<td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/>
</tr>
</tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: #F7F7F7;">
<td style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck10.png)" class="hierarchy">
@ -55,7 +55,7 @@
<a href="nulldatatypes.html#Quantity">Quantity</a>
</td>
<td style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">some text</td>
</tr>
</tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white;">
<td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck01.png)" class="hierarchy">
@ -69,7 +69,7 @@
<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"/>
<td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">some text for quantity</td>
</tr>
</tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: #F7F7F7;">
<td style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck000.png)" class="hierarchy">
@ -84,7 +84,7 @@
<td style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">1..</td>
<td style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/>
<td style="vertical-align: top; text-align : left; background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/>
</tr>
</tr>
<tr>
<td colspan="5" class="hierarchy">
@ -948,9 +948,9 @@
<map value="363714003 |Interprets|"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity">
<element id="Observation.value[x]:valueQuantity">
<path value="Observation.value[x]"/>
<sliceName value="Quantity"/>
<sliceName value="valueQuantity"/>
<short value="some text for quantity"/>
<definition value="The information determined as a result of making the observation, if the information has a simple value."/>
<comment value="An observation may have; 1) a single value here, 2) both a value and a set of related or component values, or 3) only a set of related or component values. If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://test.org/profile/observation.html#notes) below."/>
@ -985,7 +985,7 @@
<map value="363714003 |Interprets|"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity.id">
<element id="Observation.value[x]:valueQuantity.id">
<path value="Observation.value[x].id"/>
<representation value="xmlAttr"/>
<short value="Unique id for inter-element referencing"/>
@ -1007,7 +1007,7 @@
<map value="n/a"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity.extension">
<element id="Observation.value[x]:valueQuantity.extension">
<path value="Observation.value[x].extension"/>
<slicing>
<discriminator>
@ -1039,7 +1039,7 @@
<map value="n/a"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity.value">
<element id="Observation.value[x]:valueQuantity.value">
<path value="Observation.value[x].value"/>
<short value="Numerical value (with implicit precision)"/>
<definition value="The value of the measured amount. The value includes an implicit precision in the presentation of the value."/>
@ -1066,7 +1066,7 @@
<map value="PQ.value, CO.value, MO.value, IVL.high or IVL.low depending on the value"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity.comparator">
<element id="Observation.value[x]:valueQuantity.comparator">
<path value="Observation.value[x].comparator"/>
<short value="&lt; | &lt;= | &gt;= | &gt; - how to understand the value"/>
<definition value="How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is &quot;&lt;&quot; , then the real value is &lt; stated value."/>
@ -1102,7 +1102,7 @@
<map value="IVL properties"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity.unit">
<element id="Observation.value[x]:valueQuantity.unit">
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
<valueBoolean value="true"/>
</extension>
@ -1131,7 +1131,7 @@
<map value="PQ.unit"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity.system">
<element id="Observation.value[x]:valueQuantity.system">
<path value="Observation.value[x].system"/>
<short value="System that defines coded unit form"/>
<definition value="The identification of the system that provides the coded form of the unit."/>
@ -1158,7 +1158,7 @@
<map value="CO.codeSystem, PQ.translation.codeSystem"/>
</mapping>
</element>
<element id="Observation.value[x]:Quantity.code">
<element id="Observation.value[x]:valueQuantity.code">
<path value="Observation.value[x].code"/>
<short value="Coded form of the unit"/>
<definition value="A computer processable form of the unit in some unit representation system."/>

View File

@ -598,9 +598,9 @@
<map value="n/a"/>
</mapping>
</element>
<element id="Patient.deceased[x]:dateTime">
<element id="Patient.deceased[x]:deceasedDateTime">
<path value="Patient.deceased[x]"/>
<sliceName value="dateTime"/>
<sliceName value="deceasedDateTime"/>
<short value="Indicates if the individual is deceased or not"/>
<definition value="Indicates if the individual is deceased or not."/>
<comment value="New Comment"/>