Skip to content

Commit

Permalink
Cardinality Issues with Extension-DiagnosticReport.media.link
Browse files Browse the repository at this point in the history
Create the extension at root level and added FHIR path
  • Loading branch information
KazeemHamzat committed Dec 10, 2024
1 parent 227de2e commit 9b2f011
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 35 deletions.
62 changes: 47 additions & 15 deletions structuredefinitions/Extension-UKCore-DiagnosticReportMediaLink.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<StructureDefinition xmlns="http://hl7.org/fhir">
<id value="Extension-UKCore-DiagnosticReportMediaLink" />
<url value="http://hl7.org/fhir/5.0/StructureDefinition/extension-DiagnosticReport.media.link" />
<version value="0.0.2" />
<version value="0.0.1" />
<name value="ExtensionUKCoreDiagnosticReportMediaLink" />
<title value="Extension UK Core Diagnostic Report Media Link" />
<status value="draft" />
<date value="2024-12-05" />
<date value="2024-06-07" />
<publisher value="HL7 UK" />
<contact>
<name value="HL7 UK" />
Expand All @@ -17,12 +17,9 @@
<rank value="1" />
</telecom>
</contact>
<description
value="An extension to replicate the changes within R5 to support adding a reference to image or data source(DocumentReference)." />
<purpose
value="This is a Genomics use case to support the backporting of R5 functionality to support adding a reference to image or data source(DocumentReference)." />
<copyright
value="Copyright © 2021+ HL7 UK Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. HL7® FHIR® standard Copyright © 2011+ HL7 The HL7® FHIR® standard is used under the FHIR license. You may obtain a copy of the FHIR license at https://www.hl7.org/fhir/license.html." />
<description value="An extension to replicate the changes within R5 to support adding a reference to image or data source(DocumentReference)." />
<purpose value="This is a Genomics use case to support the backporting of R5 functionality to support adding a reference to image or data source(DocumentReference)." />
<copyright value="Copyright © 2021+ HL7 UK Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. HL7® FHIR® standard Copyright © 2011+ HL7 The HL7® FHIR® standard is used under the FHIR license. You may obtain a copy of the FHIR license at https://www.hl7.org/fhir/license.html." />
<fhirVersion value="4.0.1" />
<mapping>
<identity value="rim" />
Expand All @@ -33,24 +30,59 @@
<abstract value="false" />
<context>
<type value="element" />
<expression value="DiagnosticReport.media" />
<expression value="DiagnosticReport" />
</context>
<type value="Extension" />
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension" />
<derivation value="constraint" />
<differential>
<element id="Extension.url">
<path value="Extension.url" />
<fixedUri
value="http://hl7.org/fhir/5.0/StructureDefinition/extension-DiagnosticReport.media.link" />
<element id="Extension">
<path value="Extension" />
<short value="Reference to a DocumentReference resource." />
</element>
<element id="Extension.value[x]">
<path value="Extension.value[x]" />
<element id="Extension.extension">
<path value="Extension.extension" />
<min value="1" />
</element>
<element id="Extension.extension:comment">
<path value="Extension.extension" />
<sliceName value="comment" />
</element>
<element id="Extension.extension:comment.url">
<path value="Extension.extension.url" />
<fixedUri value="comment" />
</element>
<element id="Extension.extension:comment.value[x]">
<path value="Extension.extension.value[x]" />
<min value="1" />
<type>
<code value="string" />
</type>
</element>
<element id="Extension.extension:link">
<path value="Extension.extension" />
<sliceName value="link" />
<min value="1" />
</element>
<element id="Extension.extension:link.url">
<path value="Extension.extension.url" />
<fixedUri value="link" />
</element>
<element id="Extension.extension:link.value[x]">
<path value="Extension.extension.value[x]" />
<min value="1" />
<type>
<code value="Reference" />
<targetProfile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-DocumentReference" />
</type>
</element>
<element id="Extension.url">
<path value="Extension.url" />
<fixedUri value="http://hl7.org/fhir/5.0/StructureDefinition/extension-DiagnosticReport.media.link" />
</element>
<element id="Extension.value[x]">
<path value="Extension.value[x]" />
<max value="0" />
</element>
</differential>
</StructureDefinition>
39 changes: 19 additions & 20 deletions structuredefinitions/UKCore-DiagnosticReport.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/DiagnosticReport" />
<derivation value="constraint" />
<differential>
<element id="DiagnosticReport">
<path value="DiagnosticReport" />
<constraint>
<key value="ukcore-diag-lab-002" />
<severity value="error" />
<human value="Only one of DiagnosticReport.media.link or DiagnosticReport.media.extension:mediaLinkR5 can be populated at a time." />
<expression value="media.link.exists() xor extension('http://hl7.org/fhir/5.0/StructureDefinition/extension-DiagnosticReport.media.link').exist()" />
</constraint>
</element>
<element id="DiagnosticReport.extension:compositionReferenceR5">
<path value="DiagnosticReport.extension" />
<sliceName value="compositionReferenceR5" />
Expand All @@ -43,6 +52,16 @@
<short value="Reference to a Composition resource." />
<definition value="Reference to a Composition resource instance that provides structure for organizing the contents of the DiagnosticReport." />
</element>
<element id="DiagnosticReport.extension:mediaLinkR5">
<path value="DiagnosticReport.extension" />
<sliceName value="mediaLinkR5" />
<type>
<code value="Extension" />
<profile value="http://hl7.org/fhir/5.0/StructureDefinition/extension-DiagnosticReport.media.link" />
</type>
<isModifier value="false" />
<isSummary value='true' />
</element>
<element id="DiagnosticReport.extension:noteR5">
<path value="DiagnosticReport.extension" />
<sliceName value="noteR5" />
Expand Down Expand Up @@ -131,26 +150,6 @@
<short value="Observations that are part of this diagnostic report." />
<mustSupport value="true" />
</element>
<element id="DiagnosticReport.media">
<path value="DiagnosticReport.media" />
<constraint>
<key value="ukcore-diag-lab-002" />
<severity value="error" />
<human
value="Only one of DiagnosticReport.media.link or DiagnosticReport.media.extension:mediaLinkR5 can be used at a time." />
<expression
value="link.exists() xor extension('http://hl7.org/fhir/5.0/StructureDefinition/extension-DiagnosticReport.media.link').exist()" />
</constraint>
</element>
<element id="DiagnosticReport.media.extension:mediaLinkR5">
<path value="DiagnosticReport.media.extension" />
<sliceName value="mediaLinkR5" />
<type>
<code value="Extension" />
<profile value="http://hl7.org/fhir/5.0/StructureDefinition/extension-DiagnosticReport.media.link" />
</type>
<isModifier value="false" />
</element>
<element id="DiagnosticReport.conclusionCode">
<path value="DiagnosticReport.conclusionCode" />
<binding>
Expand Down

0 comments on commit 9b2f011

Please sign in to comment.