Ratio.xml
  1 <?xml version="1.0" encoding="utf-8"?>
  2 <StructureDefinition xmlns="http://hl7.org/fhir">
  3   <id value="Ratio" />
  4   <meta>
  5     <lastUpdated value="2019-10-31T23:29:23.356+01:00" />
  6   </meta>
  7   <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
  8     <valueCode value="normative" />
  9   </extension>
 10   <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
 11     <valueCode value="4.0.0" />
 12   </extension>
 13   <url value="http://hl7.org/fhir/StructureDefinition/Ratio" />
 14   <version value="4.0.1" />
 15   <name value="Ratio" />
 16   <status value="active" />
 17   <date value="2019-10-31T23:29:23.0000000+01:00" />
 18   <publisher value="HL7 FHIR Standard" />
 19   <contact>
 20     <telecom>
 21       <system value="url" />
 22       <value value="http://hl7.org/fhir" />
 23     </telecom>
 24   </contact>
 25   <description value="Base StructureDefinition for Ratio Type: A relationship of two Quantity values - expressed as a numerator and a denominator." />
 26   <purpose value="Need to able to capture ratios for some measurements (titers) and some rates (costs)." />
 27   <fhirVersion value="4.0.1" />
 28   <mapping>
 29     <identity value="v2" />
 30     <uri value="http://hl7.org/v2" />
 31     <name value="HL7 v2 Mapping" />
 32   </mapping>
 33   <mapping>
 34     <identity value="rim" />
 35     <uri value="http://hl7.org/v3" />
 36     <name value="RIM Mapping" />
 37   </mapping>
 38   <kind value="complex-type" />
 39   <abstract value="false" />
 40   <type value="Ratio" />
 41   <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Element" />
 42   <derivation value="specialization" />
 43   <snapshot>
 44     <element id="Ratio">
 45       <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
 46         <valueCode value="normative" />
 47       </extension>
 48       <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
 49         <valueCode value="4.0.0" />
 50       </extension>
 51       <path value="Ratio" />
 52       <short value="A ratio of two Quantity values - a numerator and a denominator" />
 53       <definition value="A relationship of two Quantity values - expressed as a numerator and a denominator." />
 54       <comment value="The Ratio datatype should only be used to express a relationship of two numbers if the relationship cannot be suitably expressed using a Quantity and a common unit.  Where the denominator value is known to be fixed to "1", Quantity should be used instead of Ratio." />
 55       <min value="0" />
 56       <max value="*" />
 57       <base>
 58         <path value="Ratio" />
 59         <min value="0" />
 60         <max value="*" />
 61       </base>
 62       <condition value="ele-1" />
 63       <constraint>
 64         <key value="ele-1" />
 65         <severity value="error" />
 66         <human value="All FHIR elements must have a @value or children" />
 67         <expression value="hasValue() or (children().count() > id.count())" />
 68         <xpath value="@value|f:*|h:div" />
 69         <source value="http://hl7.org/fhir/StructureDefinition/Element" />
 70       </constraint>
 71       <constraint>
 72         <key value="rat-1" />
 73         <severity value="error" />
 74         <human value="Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present" />
 75         <expression value="(numerator.empty() xor denominator.exists()) and (numerator.exists() or extension.exists())" />
 76         <xpath value="(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) > 0) or (count(f:extension) > 0))" />
 77       </constraint>
 78       <isModifier value="false" />
 79       <mapping>
 80         <identity value="rim" />
 81         <map value="n/a" />
 82       </mapping>
 83       <mapping>
 84         <identity value="v2" />
 85         <map value="N/A" />
 86       </mapping>
 87       <mapping>
 88         <identity value="rim" />
 89         <map value="RTO" />
 90       </mapping>
 91     </element>
 92     <element id="Ratio.id">
 93       <path value="Ratio.id" />
 94       <representation value="xmlAttr" />
 95       <short value="Unique id for inter-element referencing" />
 96       <definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
 97       <min value="0" />
 98       <max value="1" />
 99       <base>
100         <path value="Element.id" />
101         <min value="0" />
102         <max value="1" />
103       </base>
104       <type>
105         <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
106           <valueUrl value="string" />
107         </extension>
108         <code value="http://hl7.org/fhirpath/System.String" />
109       </type>
110       <isModifier value="false" />
111       <isSummary value="false" />
112       <mapping>
113         <identity value="rim" />
114         <map value="n/a" />
115       </mapping>
116     </element>
117     <element id="Ratio.extension">
118       <path value="Ratio.extension" />
119       <slicing>
120         <discriminator>
121           <type value="value" />
122           <path value="url" />
123         </discriminator>
124         <description value="Extensions are always sliced by (at least) url" />
125         <rules value="open" />
126       </slicing>
127       <short value="Additional content defined by implementations" />
128       <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 manageable, 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." />
129       <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." />
130       <alias value="extensions" />
131       <alias value="user content" />
132       <min value="0" />
133       <max value="*" />
134       <base>
135         <path value="Element.extension" />
136         <min value="0" />
137         <max value="*" />
138       </base>
139       <type>
140         <code value="Extension" />
141       </type>
142       <constraint>
143         <key value="ele-1" />
144         <severity value="error" />
145         <human value="All FHIR elements must have a @value or children" />
146         <expression value="hasValue() or (children().count() > id.count())" />
147         <xpath value="@value|f:*|h:div" />
148         <source value="http://hl7.org/fhir/StructureDefinition/Element" />
149       </constraint>
150       <constraint>
151         <key value="ext-1" />
152         <severity value="error" />
153         <human value="Must have either extensions or value[x], not both" />
154         <expression value="extension.exists() != value.exists()" />
155         <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])" />
156         <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
157       </constraint>
158       <isModifier value="false" />
159       <isSummary value="false" />
160       <mapping>
161         <identity value="rim" />
162         <map value="n/a" />
163       </mapping>
164     </element>
165     <element id="Ratio.numerator">
166       <path value="Ratio.numerator" />
167       <short value="Numerator value" />
168       <definition value="The value of the numerator." />
169       <min value="0" />
170       <max value="1" />
171       <base>
172         <path value="Ratio.numerator" />
173         <min value="0" />
174         <max value="1" />
175       </base>
176       <type>
177         <code value="Quantity" />
178       </type>
179       <constraint>
180         <key value="ele-1" />
181         <severity value="error" />
182         <human value="All FHIR elements must have a @value or children" />
183         <expression value="hasValue() or (children().count() > id.count())" />
184         <xpath value="@value|f:*|h:div" />
185         <source value="http://hl7.org/fhir/StructureDefinition/Element" />
186       </constraint>
187       <isModifier value="false" />
188       <isSummary value="true" />
189       <mapping>
190         <identity value="rim" />
191         <map value=".numerator" />
192       </mapping>
193     </element>
194     <element id="Ratio.denominator">
195       <path value="Ratio.denominator" />
196       <short value="Denominator value" />
197       <definition value="The value of the denominator." />
198       <min value="0" />
199       <max value="1" />
200       <base>
201         <path value="Ratio.denominator" />
202         <min value="0" />
203         <max value="1" />
204       </base>
205       <type>
206         <code value="Quantity" />
207       </type>
208       <constraint>
209         <key value="ele-1" />
210         <severity value="error" />
211         <human value="All FHIR elements must have a @value or children" />
212         <expression value="hasValue() or (children().count() > id.count())" />
213         <xpath value="@value|f:*|h:div" />
214         <source value="http://hl7.org/fhir/StructureDefinition/Element" />
215       </constraint>
216       <isModifier value="false" />
217       <isSummary value="true" />
218       <mapping>
219         <identity value="rim" />
220         <map value=".denominator" />
221       </mapping>
222     </element>
223   </snapshot>
224   <differential>
225     <element id="Ratio">
226       <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
227         <valueCode value="normative" />
228       </extension>
229       <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
230         <valueCode value="4.0.0" />
231       </extension>
232       <path value="Ratio" />
233       <short value="A ratio of two Quantity values - a numerator and a denominator" />
234       <definition value="A relationship of two Quantity values - expressed as a numerator and a denominator." />
235       <comment value="The Ratio datatype should only be used to express a relationship of two numbers if the relationship cannot be suitably expressed using a Quantity and a common unit.  Where the denominator value is known to be fixed to "1", Quantity should be used instead of Ratio." />
236       <min value="0" />
237       <max value="*" />
238       <constraint>
239         <key value="rat-1" />
240         <severity value="error" />
241         <human value="Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present" />
242         <expression value="(numerator.empty() xor denominator.exists()) and (numerator.exists() or extension.exists())" />
243         <xpath value="(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) > 0) or (count(f:extension) > 0))" />
244       </constraint>
245       <mapping>
246         <identity value="v2" />
247         <map value="N/A" />
248       </mapping>
249       <mapping>
250         <identity value="rim" />
251         <map value="RTO" />
252       </mapping>
253     </element>
254     <element id="Ratio.numerator">
255       <path value="Ratio.numerator" />
256       <short value="Numerator value" />
257       <definition value="The value of the numerator." />
258       <min value="0" />
259       <max value="1" />
260       <type>
261         <code value="Quantity" />
262       </type>
263       <isSummary value="true" />
264       <mapping>
265         <identity value="rim" />
266         <map value=".numerator" />
267       </mapping>
268     </element>
269     <element id="Ratio.denominator">
270       <path value="Ratio.denominator" />
271       <short value="Denominator value" />
272       <definition value="The value of the denominator." />
273       <min value="0" />
274       <max value="1" />
275       <type>
276         <code value="Quantity" />
277       </type>
278       <isSummary value="true" />
279       <mapping>
280         <identity value="rim" />
281         <map value=".denominator" />
282       </mapping>
283     </element>
284   </differential>
285 </StructureDefinition>