more fixes to snapshot generation tests after discussion

This commit is contained in:
Grahame Grieve 2019-07-26 07:41:51 +10:00
parent 019dc6c1b5
commit 6b9d455b9a
11 changed files with 3153 additions and 3181 deletions

View File

@ -18,6 +18,9 @@
<test gen="true" id="t4">
<rule text="The patient.identifier documentation must be right" fhirpath="fixture('t4-output').snapshot.element.where(path = 'Patient.identifier').definition.trace('definition') != '... some more doco'"/>
</test>
<test gen="true" id="t4a">
<rule text="The patient.contact.identifier documentation must be right" fhirpath="fixture('t4a-output').snapshot.element.where(path = 'Patient.contact.telecom').definition.trace('definition') != '... some more doco'"/>
</test>
<test gen="true" id="t5">
<rule text="The patient.deceased type must be right" fhirpath="fixture('t5-output').snapshot.element.where(base.path = 'Patient.deceased[x]').type.code = 'dateTime'"/>
<rule text="The patient.deceased path must be right" fhirpath="fixture('t5-output').snapshot.element.where(base.path = 'Patient.deceased[x]').path = 'Patient.deceased[x]'"/>
@ -160,6 +163,7 @@
<rule text="Element count must be increased by 15" fhirpath="fixture('t29-output').snapshot.element.count().trace('t29o') = fixture('parameters').snapshot.element.count().trace('t29') + 16"/>
<rule text="There is an element with id 'Parameters.parameter.part:foo.id'" fhirpath="fixture('t29-output').snapshot.element.where(id = 'Parameters.parameter.part:foo.id').count()=1"/>
</test>
<test gen="true" sort="true" id="t29a" fail="true"/>
<test gen="true" sort="true" id="t30b" include="t30a">
<rule text="Snapshot doesn't result in an error'" fhirpath="fixture('t30b-output').snapshot.element.count().trace('t30bo')&gt;1"/>
</test>
@ -207,6 +211,7 @@
<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="t43a" fail="true"/>
<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"/>

View File

@ -137,7 +137,7 @@
<img src="tbl_blank.png" alt="." style="background-color: inherit" class="hierarchy"/>
<img src="tbl_vjoin_end_slice.png" alt="." style="background-color: inherit" class="hierarchy"/>
<img src="icon_datatype.gif" alt="." style="background-color: white; background-color: inherit" title="Data Type" class="hierarchy"/>
<span title="Slice Coding: null">valueCoding</span>
<span title="Slice valueCoding: null">valueCoding</span>
<a name="Parameters.parameter.part.valueCoding"> </a>
</td>
<td style="vertical-align: top; text-align : left; background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/>
@ -1077,16 +1077,16 @@
<code value="Coding"/>
</type>
</element>
<element id="Parameters.parameter.part:foo.valueCoding:Coding">
<path value="Parameters.parameter.part.valueCoding"/>
<sliceName value="Coding"/>
<element id="Parameters.parameter.part:foo.value[x]:valueCoding">
<path value="Parameters.parameter.part.value[x]"/>
<sliceName value="valueCoding"/>
<min value="1"/>
<type>
<code value="Coding"/>
</type>
</element>
<element id="Parameters.parameter.part:foo.valueCoding:Coding.code">
<path value="Parameters.parameter.part.valueCoding.code"/>
<element id="Parameters.parameter.part:foo.value[x]:Coding.code">
<path value="Parameters.parameter.part.value[x].code"/>
<min value="1"/>
</element>
</differential>

View File

@ -53,7 +53,7 @@
</element>
<element>
<path value="Parameters.parameter.part.valueCoding"/>
<sliceName value="Coding"/>
<sliceName value="valueCoding"/>
<min value="1"/>
<type>
<code value="Coding"/>

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<StructureDefinition xmlns="http://hl7.org/fhir">
<id value="t29a"/>
<url value="urn:uuid:8371f159-76b3-41f7-a66f-bde129e7e603"/>
<name value="t29a"/>
<status value="draft"/>
<description value="fixture for #29: Test recursion on elements that are deeper than children of the root and have a different name (Parameters.parameter.part)"/>
<kind value="resource"/>
<abstract value="false"/>
<type value="OperationOutcome"/>
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Parameters"/>
<derivation value="constraint"/>
<differential>
<element>
<path value="Parameters"/>
</element>
<element>
<path value="Parameters.parameter"/>
</element>
<element>
<path value="Parameters.parameter.part"/>
<slicing>
<discriminator>
<type value="value"/>
<path value="name"/>
</discriminator>
<rules value="closed"/>
</slicing>
</element>
<element>
<path value="Parameters.parameter.part"/>
<sliceName value="foo"/>
<min value="1"/>
<max value="1"/>
</element>
<element>
<path value="Parameters.parameter.part.name"/>
<fixedString value="foo"/>
<mustSupport value="true"/>
</element>
<element>
<path value="Parameters.parameter.part.value[x]"/>
<slicing>
<discriminator>
<type value="type"/>
<path value="$this"/>
</discriminator>
</slicing>
<type>
<code value="Coding"/>
</type>
</element>
<element>
<path value="Parameters.parameter.part.valueCoding"/>
<sliceName value="Coding"/>
<min value="1"/>
<type>
<code value="Coding"/>
</type>
</element>
<element>
<path value="Parameters.parameter.part.valueCoding.code"/>
<min value="1"/>
</element>
</differential>
</StructureDefinition>

View File

@ -2141,15 +2141,15 @@
<code value="Quantity"/>
</type>
</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"/>
<type>
<code value="Quantity"/>
</type>
</element>
<element id="Observation.value[x]:Quantity.value">
<element id="Observation.value[x]:valueQuantity.value">
<path value="Observation.value[x].value"/>
<min value="1"/>
</element>

View File

@ -30,7 +30,7 @@
</element>
<element>
<path value="Observation.value[x]"/>
<sliceName value="Quantity"/>
<sliceName value="valueQuantity"/>
<short value="some text for quantity"/>
<type>
<code value="Quantity"/>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<StructureDefinition xmlns="http://hl7.org/fhir">
<id value="t43"/>
<url value="urn:uuid:4caab1de-9278-4783-810c-472c3071f7fd"/>
<name value="t43"/>
<status value="draft"/>
<description value="fixture for #43: Choice Types: constrain list of choices to 1 and constrain the type (slicing)"/>
<kind value="resource"/>
<abstract value="false"/>
<type value="Observation"/>
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Observation"/>
<derivation value="constraint"/>
<differential>
<element>
<path value="Observation"/>
</element>
<element>
<path value="Observation.value[x]"/>
<slicing>
<discriminator>
<type value="type"/>
<path value="$this"/>
</discriminator>
</slicing>
<short value="some text"/>
<type>
<code value="Quantity"/>
</type>
</element>
<element>
<path value="Observation.value[x]"/>
<sliceName value="Quantity"/>
<short value="some text for quantity"/>
<type>
<code value="Quantity"/>
</type>
</element>
<element>
<path value="Observation.value[x].value"/>
<min value="1"/>
</element>
</differential>
</StructureDefinition>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<StructureDefinition xmlns="http://hl7.org/fhir">
<id value="t4"/>
<url value="urn:uuid:71e0a5a6-95bf-4e04-aa6a-4af0ebef3f29"/>
<name value="t4"/>
<status value="draft"/>
<description value="fixture for #4: test appending documentation"/>
<kind value="resource"/>
<abstract value="false"/>
<type value="Patient"/>
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Patient"/>
<derivation value="constraint"/>
<differential>
<element>
<path value="Patient.contact.telecom"/>
<definition value="... some more doco"/>
</element>
</differential>
</StructureDefinition>

File diff suppressed because it is too large Load Diff