Skip to content

Commit

Permalink
Properly Process all-slice element definitions when generating snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
Grahame Grieve committed Feb 14, 2025
1 parent 81ef211 commit 1d34bba
Show file tree
Hide file tree
Showing 9 changed files with 5,258 additions and 336 deletions.
2,104 changes: 2,104 additions & 0 deletions r5/snapshot-generation/ILCorePractitioner-expected.json

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions r5/snapshot-generation/ca-patient-expected.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,15 @@
<code value="JHN"/>
</coding>
</patternCodeableConcept>
<example>
<label value="Pattern"/>
<valueCodeableConcept>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/v2-0203"/>
<code value="MR"/>
</coding>
</valueCodeableConcept>
</example>
<constraint>
<key value="ele-1"/>
<severity value="error"/>
Expand Down
4 changes: 2 additions & 2 deletions r5/snapshot-generation/eob-nested-expected.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9655,7 +9655,7 @@
<expression value="hasValue() or (children().count() &gt; id.count())"/>
<source value="http://hl7.org/fhir/StructureDefinition/Element"/>
</constraint>
<mustSupport value="false"/>
<mustSupport value="true"/>
<isModifier value="false"/>
<isSummary value="false"/>
<binding>
Expand Down Expand Up @@ -9913,7 +9913,7 @@
<expression value="hasValue() or (children().count() &gt; id.count())"/>
<source value="http://hl7.org/fhir/StructureDefinition/Element"/>
</constraint>
<mustSupport value="false"/>
<mustSupport value="true"/>
<isModifier value="false"/>
<isSummary value="false"/>
<binding>
Expand Down
7 changes: 4 additions & 3 deletions r5/snapshot-generation/manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@
<test gen="true" id="logical-base-child" register="logical-base-parent" description="constraining when specialising"/>
<test gen="true" id="obs-perf" description="Observation.performer generating short description, definition and comments wrong (https://chat.fhir.org/#narrow/stream/179252-IG-creation/topic/Broken.20snapshot.20generation)"/>
<test gen="true" id="pat-cm" debug="false" description="Claimed issue with sparse differential interpretation (https://chat.fhir.org/#narrow/stream/215610-shorthand/topic/.E2.9C.94.20Mapping.20value.5Bx.5D.20in.20extension.20elements)"/>
<test gen="true" id="profile-patient-op-base" debug="true" description="Test Obligation Profile generation"/>
<test gen="true" id="profile-patient-op3" debug="true" register="profile-patient-op-base-input,profile-patient-op1,profile-patient-op2,profile-patient-op2a"
<test gen="true" id="profile-patient-op-base" debug="false" description="Test Obligation Profile generation"/>
<test gen="true" id="profile-patient-op3" debug="false" register="profile-patient-op-base-input,profile-patient-op1,profile-patient-op2,profile-patient-op2a"
description="Test Obligation Profile generation"/>
<test gen="true" id="reslicing-profile" debug="true" description="Bug: pattern value was getting lost"/>
<test gen="true" id="reslicing-profile" debug="false" description="Bug: pattern value was getting lost"/>
<test gen="true" id="mi-use-derived" description="A simple case of refining a profile further" register="mi-defn-base,mi-defn-derived,mi-use-base"/>
<test gen="true" id="mi-use-distinct" fail="true" reason="invalid constrained type Reference from Reference in http://hl7.org/fhir/test/StructureDefinition/mi-use-distinct" description="An illegal constraint, won't build" register="mi-defn-base,mi-defn-distinct,mi-use-base"/>
<test gen="true" id="mi-use-imposed" description="The profile is refined further *using the imposeProfile* extension" register="mi-defn-base,mi-defn-imposed,mi-use-base"/>
Expand All @@ -281,4 +281,5 @@
<test gen="true" id="type-slicing-exclusion" register="type-slicing-exclusion-base" description="found bug around excluding type choices in type slicing"/>
<test gen="true" id="l1-resource" register="l1-datatype" description="Inherit description from data type profile on the derived differential #1"/>
<test gen="true" id="l2-resource" register="l1-resource-input,l1-datatype,l2-datatype" description="Inherit description from data type profile on the derived differential #2"/>
<test gen="true" id="ILCorePractitioner" debug="false" description="slicing but with details for all slices "/>
</snapshot-generation-tests>
317 changes: 317 additions & 0 deletions r5/snapshot-generation/org2a-expected.xml
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,323 @@
<map value="Participant.identifier"/>
</mapping>
</element>
<element id="Organization.identifier:CLIA.id">
<path value="Organization.identifier.id"/>
<representation value="xmlAttr"/>
<short value="Unique id for inter-element referencing"/>
<definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
<min value="0"/>
<max value="1"/>
<base>
<path value="Element.id"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
<valueUrl value="id"/>
</extension>
<code value="http://hl7.org/fhirpath/System.String"/>
</type>
<condition value="ele-1"/>
<isModifier value="false"/>
<isSummary value="false"/>
<mapping>
<identity value="rim"/>
<map value="n/a"/>
</mapping>
</element>
<element id="Organization.identifier:CLIA.extension">
<path value="Organization.identifier.extension"/>
<slicing>
<discriminator>
<type value="value"/>
<path value="url"/>
</discriminator>
<description value="Extensions are always sliced by (at least) url"/>
<rules value="open"/>
</slicing>
<short value="Additional content defined by implementations"/>
<definition value="May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
<comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone."/>
<alias value="extensions"/>
<alias value="user content"/>
<min value="0"/>
<max value="*"/>
<base>
<path value="Element.extension"/>
<min value="0"/>
<max value="*"/>
</base>
<type>
<code value="Extension"/>
</type>
<constraint>
<key value="ele-1"/>
<severity value="error"/>
<human value="All FHIR elements must have a @value or children"/>
<expression value="hasValue() or (children().count() &gt; id.count())"/>
<source value="http://hl7.org/fhir/StructureDefinition/Element"/>
</constraint>
<constraint>
<key value="ext-1"/>
<severity value="error"/>
<human value="Must have either extensions or value[x], not both"/>
<expression value="extension.exists() != value.exists()"/>
<source value="http://hl7.org/fhir/StructureDefinition/Extension"/>
</constraint>
<isModifier value="false"/>
<isSummary value="false"/>
<mapping>
<identity value="rim"/>
<map value="n/a"/>
</mapping>
</element>
<element id="Organization.identifier:CLIA.use">
<path value="Organization.identifier.use"/>
<short value="usual | official | temp | secondary | old (If known)"/>
<definition value="The purpose of this identifier."/>
<comment value="Applications can assume that an identifier is permanent unless it explicitly says that it is temporary."/>
<requirements value="Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers."/>
<min value="0"/>
<max value="1"/>
<base>
<path value="Identifier.use"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="code"/>
</type>
<constraint>
<key value="ele-1"/>
<severity value="error"/>
<human value="All FHIR elements must have a @value or children"/>
<expression value="hasValue() or (children().count() &gt; id.count())"/>
<source value="http://hl7.org/fhir/StructureDefinition/Element"/>
</constraint>
<isModifier value="true"/>
<isModifierReason value="This is labeled as &quot;Is Modifier&quot; because applications should not mistake a temporary id for a permanent one."/>
<isSummary value="true"/>
<binding>
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
<valueString value="IdentifierUse"/>
</extension>
<strength value="required"/>
<description value="Identifies the purpose for this identifier, if known ."/>
<valueSet value="http://hl7.org/fhir/ValueSet/identifier-use|5.0.0"/>
</binding>
<mapping>
<identity value="v2"/>
<map value="N/A"/>
</mapping>
<mapping>
<identity value="rim"/>
<map value="Role.code or implied by context"/>
</mapping>
</element>
<element id="Organization.identifier:CLIA.type">
<path value="Organization.identifier.type"/>
<short value="Description of identifier"/>
<definition value="A coded type for the identifier that can be used to determine which identifier to use for a specific purpose."/>
<comment value="This element deals only with general categories of identifiers. It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage. Where the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type."/>
<requirements value="Allows users to make use of identifiers when the identifier system is not known."/>
<min value="0"/>
<max value="1"/>
<base>
<path value="Identifier.type"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="CodeableConcept"/>
</type>
<constraint>
<key value="ele-1"/>
<severity value="error"/>
<human value="All FHIR elements must have a @value or children"/>
<expression value="hasValue() or (children().count() &gt; id.count())"/>
<source value="http://hl7.org/fhir/StructureDefinition/Element"/>
</constraint>
<isModifier value="false"/>
<isSummary value="true"/>
<binding>
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
<valueString value="IdentifierType"/>
</extension>
<strength value="extensible"/>
<description value="A coded type for an identifier that can be used to determine which identifier to use for a specific purpose."/>
<valueSet value="http://hl7.org/fhir/ValueSet/identifier-type"/>
</binding>
<mapping>
<identity value="v2"/>
<map value="CX.5"/>
</mapping>
<mapping>
<identity value="rim"/>
<map value="Role.code or implied by context"/>
</mapping>
</element>
<element id="Organization.identifier:CLIA.system">
<path value="Organization.identifier.system"/>
<short value="The namespace for the identifier value"/>
<definition value="Establishes the namespace for the value - that is, an absolute URL that describes a set values that are unique."/>
<comment value="Identifier.system is always case sensitive."/>
<requirements value="There are many sets of identifiers. To perform matching of two identifiers, we need to know what set we're dealing with. The system identifies a particular set of unique identifiers."/>
<min value="0"/>
<max value="1"/>
<base>
<path value="Identifier.system"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="uri"/>
</type>
<example>
<label value="General"/>
<valueUri value="http://www.acme.com/identifiers/patient"/>
</example>
<constraint>
<key value="ele-1"/>
<severity value="error"/>
<human value="All FHIR elements must have a @value or children"/>
<expression value="hasValue() or (children().count() &gt; id.count())"/>
<source value="http://hl7.org/fhir/StructureDefinition/Element"/>
</constraint>
<mustSupport value="true"/>
<isModifier value="false"/>
<isSummary value="true"/>
<mapping>
<identity value="v2"/>
<map value="CX.4 / EI-2-4"/>
</mapping>
<mapping>
<identity value="rim"/>
<map value="II.root or Role.id.root"/>
</mapping>
<mapping>
<identity value="servd"/>
<map value="./IdentifierType"/>
</mapping>
</element>
<element id="Organization.identifier:CLIA.value">
<path value="Organization.identifier.value"/>
<short value="The value that is unique"/>
<definition value="The portion of the identifier typically relevant to the user and which is unique within the context of the system."/>
<comment value="If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986. The value's primary purpose is computational mapping. As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.) A value formatted for human display can be conveyed using the [http://hl7.org/fhir/StructureDefinition/rendered-value](http://hl7.org/fhir/extensions/StructureDefinition-rendered-value.html)). Identifier.value is to be treated as case sensitive unless knowledge of the Identifier.system allows the processer to be confident that non-case-sensitive processing is safe."/>
<min value="0"/>
<max value="1"/>
<base>
<path value="Identifier.value"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="string"/>
</type>
<example>
<label value="General"/>
<valueString value="123456"/>
</example>
<condition value="ident-1"/>
<constraint>
<key value="ele-1"/>
<severity value="error"/>
<human value="All FHIR elements must have a @value or children"/>
<expression value="hasValue() or (children().count() &gt; id.count())"/>
<source value="http://hl7.org/fhir/StructureDefinition/Element"/>
</constraint>
<mustSupport value="true"/>
<isModifier value="false"/>
<isSummary value="true"/>
<mapping>
<identity value="v2"/>
<map value="CX.1 / EI.1"/>
</mapping>
<mapping>
<identity value="rim"/>
<map value="II.extension or II.root if system indicates OID or GUID (Or Role.id.extension or root)"/>
</mapping>
<mapping>
<identity value="servd"/>
<map value="./Value"/>
</mapping>
</element>
<element id="Organization.identifier:CLIA.period">
<path value="Organization.identifier.period"/>
<short value="Time period when id is/was valid for use"/>
<definition value="Time period during which identifier is/was valid for use."/>
<min value="0"/>
<max value="1"/>
<base>
<path value="Identifier.period"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="Period"/>
</type>
<constraint>
<key value="ele-1"/>
<severity value="error"/>
<human value="All FHIR elements must have a @value or children"/>
<expression value="hasValue() or (children().count() &gt; id.count())"/>
<source value="http://hl7.org/fhir/StructureDefinition/Element"/>
</constraint>
<isModifier value="false"/>
<isSummary value="true"/>
<mapping>
<identity value="v2"/>
<map value="CX.7 + CX.8"/>
</mapping>
<mapping>
<identity value="rim"/>
<map value="Role.effectiveTime or implied by context"/>
</mapping>
<mapping>
<identity value="servd"/>
<map value="./StartDate and ./EndDate"/>
</mapping>
</element>
<element id="Organization.identifier:CLIA.assigner">
<path value="Organization.identifier.assigner"/>
<short value="Organization that issued id (may be just text)"/>
<definition value="Organization that issued/manages the identifier."/>
<comment value="The Identifier.assigner may omit the .reference element and only contain a .display element reflecting the name or other textual information about the assigning organization."/>
<min value="0"/>
<max value="1"/>
<base>
<path value="Identifier.assigner"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="Reference"/>
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization"/>
</type>
<constraint>
<key value="ele-1"/>
<severity value="error"/>
<human value="All FHIR elements must have a @value or children"/>
<expression value="hasValue() or (children().count() &gt; id.count())"/>
<source value="http://hl7.org/fhir/StructureDefinition/Element"/>
</constraint>
<isModifier value="false"/>
<isSummary value="true"/>
<mapping>
<identity value="v2"/>
<map value="CX.4 / (CX.4,CX.9,CX.10)"/>
</mapping>
<mapping>
<identity value="rim"/>
<map value="II.assigningAuthorityName but note that this is an improper use by the definition of the field. Also Role.scoper"/>
</mapping>
<mapping>
<identity value="servd"/>
<map value="./IdentifierIssuingAuthority"/>
</mapping>
</element>
<element id="Organization.active">
<path value="Organization.active"/>
<short value="Whether the organization's record is still in active use"/>
Expand Down
Loading

0 comments on commit 1d34bba

Please sign in to comment.