StructureDefinition-sdc-questionnaire-launchContext.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <StructureDefinition xmlns="http://hl7.org/fhir">
3 <id value="sdc-questionnaire-launchContext" />
4 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
5 <valueCode value="fhir" />
6 </extension>
7 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
8 <valueInteger value="4">
9 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom">
10 <valueCanonical value="http://hl7.org/fhir/uv/sdc/ImplementationGuide/hl7.fhir.uv.sdc" />
11 </extension>
12 </valueInteger>
13 </extension>
14 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
15 <valueCode value="trial-use">
16 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom">
17 <valueCanonical value="http://hl7.org/fhir/uv/sdc/ImplementationGuide/hl7.fhir.uv.sdc" />
18 </extension>
19 </valueCode>
20 </extension>
21 <url value="http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext" />
22 <identifier>
23 <system value="urn:ietf:rfc:3986" />
24 <value value="urn:oid:2.16.840.1.113883.4.642.40.17.42.34" />
25 </identifier>
26 <version value="4.0.0-ballot" />
27 <name value="LaunchContextExtension" />
28 <title value="Launch Contexts" />
29 <status value="active" />
30 <date value="2024-12-22T04:48:38.0000000+01:00" />
31 <publisher value="HL7 International / FHIR Infrastructure" />
32 <contact>
33 <name value="HL7 International / FHIR Infrastructure" />
34 <telecom>
35 <system value="url" />
36 <value value="http://www.hl7.org/Special/committees/fiwg" />
37 </telecom>
38 </contact>
39 <contact>
40 <telecom>
41 <system value="url" />
42 <value value="http://www.hl7.org/Special/committees/fiwg" />
43 </telecom>
44 </contact>
45 <description value="Resources that provide context for form processing logic (pre-population, flow-control, drop-down selection, etc.) when creating/displaying/editing a QuestionnaireResponse." />
46 <jurisdiction>
47 <coding>
48 <system value="http://unstats.un.org/unsd/methods/m49/m49.htm" />
49 <code value="001" />
50 <display value="World" />
51 </coding>
52 </jurisdiction>
53 <purpose value="Indicates to systems creating or updating a QuestionnaireResponse what types of information to pass in for internal processing. May also influence things like SMART on FHIR permission requests." />
54 <fhirVersion value="4.0.1" />
55 <mapping>
56 <identity value="rim" />
57 <uri value="http://hl7.org/v3" />
58 <name value="RIM Mapping" />
59 </mapping>
60 <kind value="complex-type" />
61 <abstract value="false" />
62 <context>
63 <type value="element" />
64 <expression value="Questionnaire" />
65 </context>
66 <type value="Extension" />
67 <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension" />
68 <derivation value="constraint" />
69 <snapshot>
70 <element id="Extension">
71 <path value="Extension" />
72 <short value="Context resources needed for Questionnaire" />
73 <definition value="Resources that provide context for form processing logic (pre-population, flow-control, drop-down selection, etc.) when creating/displaying/editing a QuestionnaireResponse." />
74 <comment value="3 of these launch contexts are aligned with the existing SMART on FHIR "launch" contexts." />
75 <min value="0" />
76 <max value="*" />
77 <base>
78 <path value="Extension" />
79 <min value="0" />
80 <max value="*" />
81 </base>
82 <condition value="ele-1" />
83 <constraint>
84 <key value="ele-1" />
85 <severity value="error" />
86 <human value="All FHIR elements must have a @value or children" />
87 <expression value="hasValue() or (children().count() > id.count())" />
88 <xpath value="@value|f:*|h:div" />
89 <source value="http://hl7.org/fhir/StructureDefinition/Element" />
90 </constraint>
91 <constraint>
92 <key value="ext-1" />
93 <severity value="error" />
94 <human value="Must have either extensions or value[x], not both" />
95 <expression value="extension.exists() != value.exists()" />
96 <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
97 <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
98 </constraint>
99 <constraint>
100 <key value="sdc-lcext-1" />
101 <severity value="error" />
102 <human value="Types must be from the specified value set of resource types based on name: patient: Patient; user: Patient, Practitioner, PractitionerRole, Organization, RelatedPerson, Device; encounter: Encounter; location: Location; study: ResearchStudy; clinical: Any allowed clinical resource" />
103 <expression value="(extension('name').value.where(code='patient' and system='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext').exists() implies extension('type').all(value = 'Patient')) and (extension('name').value.where(code='user' and system='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext').exists() implies extension('type').all(value='Patient' or value='Practitioner' or value='PractitionerRole' or value='RelatedPerson' or value='Organization' or value='Device')) and (extension('name').value.where(code='encounter' and system='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext').exists() implies extension('type').all(value = 'Encounter')) and (extension('name').value.where(code='location' and system='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext').exists() implies extension('type').all(value = 'Location')) and (extension('name').value.where(code='study' and system='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext').exists() implies extension('type').all(value = 'ResearchStudy'))" />
104 <xpath value="(not(f:extension[@url='name' and f:valueCoding[f:code/@value='patient' and f:system/@value='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext']]) or not(f:extension[@url='type' and f:valueCode/@value!='Patient'])) and (not(f:extension[@url='name' and f:valueCoding[f:code/@value='user' and f:system/@value='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext']]) or not(f:extension[@url='type' and f:valueCode/@value!=('Patient','Practitioner','PractitionerRole','RelatedPerson', 'Organization', 'Device')])) and (not(f:extension[@url='name' and f:valueCoding[f:code/@value='encounter' and f:system/@value='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext']]) or not(f:extension[@url='type' and f:valueCode/@value!='Encounter']))) and (not(f:extension[@url='name' and f:valueCoding[f:code/@value='study' and f:system/@value='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext']]) or f:extension[@url='type' and not(f:valueCode/@value!='ResearchStudy'])) and (not(f:extension[@url='name' and f:valueCoding[f:code/@value='location' and f:system/@value='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext']]) or not(f:extension[@url='type' and f:valueCode/@value!='Location']))" />
105 <source value="http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext" />
106 </constraint>
107 <isModifier value="false" />
108 </element>
109 <element id="Extension.id">
110 <path value="Extension.id" />
111 <representation value="xmlAttr" />
112 <short value="Unique id for inter-element referencing" />
113 <definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
114 <min value="0" />
115 <max value="1" />
116 <base>
117 <path value="Element.id" />
118 <min value="0" />
119 <max value="1" />
120 </base>
121 <type>
122 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
123 <valueUrl value="string" />
124 </extension>
125 <code value="http://hl7.org/fhirpath/System.String" />
126 </type>
127 <isModifier value="false" />
128 <isSummary value="false" />
129 <mapping>
130 <identity value="rim" />
131 <map value="n/a" />
132 </mapping>
133 </element>
134 <element id="Extension.extension">
135 <path value="Extension.extension" />
136 <slicing>
137 <discriminator>
138 <type value="value" />
139 <path value="url" />
140 </discriminator>
141 <description value="Extensions are always sliced by (at least) url" />
142 <rules value="open" />
143 </slicing>
144 <short value="Extension" />
145 <definition value="An Extension" />
146 <min value="2" />
147 <max value="*" />
148 <base>
149 <path value="Element.extension" />
150 <min value="0" />
151 <max value="*" />
152 </base>
153 <type>
154 <code value="Extension" />
155 </type>
156 <constraint>
157 <key value="ele-1" />
158 <severity value="error" />
159 <human value="All FHIR elements must have a @value or children" />
160 <expression value="hasValue() or (children().count() > id.count())" />
161 <xpath value="@value|f:*|h:div" />
162 <source value="http://hl7.org/fhir/StructureDefinition/Element" />
163 </constraint>
164 <constraint>
165 <key value="ext-1" />
166 <severity value="error" />
167 <human value="Must have either extensions or value[x], not both" />
168 <expression value="extension.exists() != value.exists()" />
169 <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])" />
170 <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
171 </constraint>
172 <isModifier value="false" />
173 <isSummary value="false" />
174 </element>
175 <element id="Extension.extension:name">
176 <path value="Extension.extension" />
177 <sliceName value="name" />
178 <short value="Variable name" />
179 <definition value="The variable name the passed resource will be referenced by within the Questionnaire logic." />
180 <min value="1" />
181 <max value="1" />
182 <base>
183 <path value="Element.extension" />
184 <min value="0" />
185 <max value="*" />
186 </base>
187 <type>
188 <code value="Extension" />
189 </type>
190 <constraint>
191 <key value="ele-1" />
192 <severity value="error" />
193 <human value="All FHIR elements must have a @value or children" />
194 <expression value="hasValue() or (children().count() > id.count())" />
195 <xpath value="@value|f:*|h:div" />
196 <source value="http://hl7.org/fhir/StructureDefinition/Element" />
197 </constraint>
198 <constraint>
199 <key value="ext-1" />
200 <severity value="error" />
201 <human value="Must have either extensions or value[x], not both" />
202 <expression value="extension.exists() != value.exists()" />
203 <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])" />
204 <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
205 </constraint>
206 <isModifier value="false" />
207 <isSummary value="false" />
208 </element>
209 <element id="Extension.extension:name.id">
210 <path value="Extension.extension.id" />
211 <representation value="xmlAttr" />
212 <short value="Unique id for inter-element referencing" />
213 <definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
214 <min value="0" />
215 <max value="1" />
216 <base>
217 <path value="Element.id" />
218 <min value="0" />
219 <max value="1" />
220 </base>
221 <type>
222 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
223 <valueUrl value="string" />
224 </extension>
225 <code value="http://hl7.org/fhirpath/System.String" />
226 </type>
227 <isModifier value="false" />
228 <isSummary value="false" />
229 <mapping>
230 <identity value="rim" />
231 <map value="n/a" />
232 </mapping>
233 </element>
234 <element id="Extension.extension:name.extension">
235 <path value="Extension.extension.extension" />
236 <slicing>
237 <discriminator>
238 <type value="value" />
239 <path value="url" />
240 </discriminator>
241 <description value="Extensions are always sliced by (at least) url" />
242 <rules value="open" />
243 </slicing>
244 <short value="Extension" />
245 <definition value="An Extension" />
246 <min value="0" />
247 <max value="0" />
248 <base>
249 <path value="Element.extension" />
250 <min value="0" />
251 <max value="*" />
252 </base>
253 <type>
254 <code value="Extension" />
255 </type>
256 <constraint>
257 <key value="ele-1" />
258 <severity value="error" />
259 <human value="All FHIR elements must have a @value or children" />
260 <expression value="hasValue() or (children().count() > id.count())" />
261 <xpath value="@value|f:*|h:div" />
262 <source value="http://hl7.org/fhir/StructureDefinition/Element" />
263 </constraint>
264 <constraint>
265 <key value="ext-1" />
266 <severity value="error" />
267 <human value="Must have either extensions or value[x], not both" />
268 <expression value="extension.exists() != value.exists()" />
269 <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])" />
270 <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
271 </constraint>
272 <isModifier value="false" />
273 <isSummary value="false" />
274 </element>
275 <element id="Extension.extension:name.url">
276 <path value="Extension.extension.url" />
277 <representation value="xmlAttr" />
278 <short value="identifies the meaning of the extension" />
279 <definition value="Source of the definition for the extension code - a logical name or a URL." />
280 <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
281 <min value="1" />
282 <max value="1" />
283 <base>
284 <path value="Extension.url" />
285 <min value="1" />
286 <max value="1" />
287 </base>
288 <type>
289 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
290 <valueUrl value="uri" />
291 </extension>
292 <code value="http://hl7.org/fhirpath/System.String" />
293 </type>
294 <fixedUri value="name" />
295 <isModifier value="false" />
296 <isSummary value="false" />
297 <mapping>
298 <identity value="rim" />
299 <map value="N/A" />
300 </mapping>
301 </element>
302 <element id="Extension.extension:name.value[x]">
303 <path value="Extension.extension.value[x]" />
304 <short value="Value of extension" />
305 <definition value="Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list)." />
306 <min value="1" />
307 <max value="1" />
308 <base>
309 <path value="Extension.value[x]" />
310 <min value="0" />
311 <max value="1" />
312 </base>
313 <type>
314 <code value="Coding" />
315 </type>
316 <constraint>
317 <key value="ele-1" />
318 <severity value="error" />
319 <human value="All FHIR elements must have a @value or children" />
320 <expression value="hasValue() or (children().count() > id.count())" />
321 <xpath value="@value|f:*|h:div" />
322 <source value="http://hl7.org/fhir/StructureDefinition/Element" />
323 </constraint>
324 <isModifier value="false" />
325 <isSummary value="false" />
326 <binding>
327 <strength value="extensible" />
328 <description value="Launch context codes for use in defining questionnaires context at launch time (NOTE: the Coding.code will be used for the variable name and that (at present) there is no support for Questionnaires that use multiple launch contexts which share a common code but different code systems. Also, all launch context codes must meet the requirements to be a valid FHIRPath name.)." />
329 <valueSet value="http://hl7.org/fhir/uv/sdc/ValueSet/launchContext" />
330 </binding>
331 <mapping>
332 <identity value="rim" />
333 <map value="N/A" />
334 </mapping>
335 </element>
336 <element id="Extension.extension:type">
337 <path value="Extension.extension" />
338 <sliceName value="type" />
339 <short value="Resource type" />
340 <definition value="The kind of resource to be provided." />
341 <min value="1" />
342 <max value="*" />
343 <base>
344 <path value="Element.extension" />
345 <min value="0" />
346 <max value="*" />
347 </base>
348 <type>
349 <code value="Extension" />
350 </type>
351 <constraint>
352 <key value="ele-1" />
353 <severity value="error" />
354 <human value="All FHIR elements must have a @value or children" />
355 <expression value="hasValue() or (children().count() > id.count())" />
356 <xpath value="@value|f:*|h:div" />
357 <source value="http://hl7.org/fhir/StructureDefinition/Element" />
358 </constraint>
359 <constraint>
360 <key value="ext-1" />
361 <severity value="error" />
362 <human value="Must have either extensions or value[x], not both" />
363 <expression value="extension.exists() != value.exists()" />
364 <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])" />
365 <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
366 </constraint>
367 <isModifier value="false" />
368 <isSummary value="false" />
369 </element>
370 <element id="Extension.extension:type.id">
371 <path value="Extension.extension.id" />
372 <representation value="xmlAttr" />
373 <short value="Unique id for inter-element referencing" />
374 <definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
375 <min value="0" />
376 <max value="1" />
377 <base>
378 <path value="Element.id" />
379 <min value="0" />
380 <max value="1" />
381 </base>
382 <type>
383 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
384 <valueUrl value="string" />
385 </extension>
386 <code value="http://hl7.org/fhirpath/System.String" />
387 </type>
388 <isModifier value="false" />
389 <isSummary value="false" />
390 <mapping>
391 <identity value="rim" />
392 <map value="n/a" />
393 </mapping>
394 </element>
395 <element id="Extension.extension:type.extension">
396 <path value="Extension.extension.extension" />
397 <slicing>
398 <discriminator>
399 <type value="value" />
400 <path value="url" />
401 </discriminator>
402 <description value="Extensions are always sliced by (at least) url" />
403 <rules value="open" />
404 </slicing>
405 <short value="Extension" />
406 <definition value="An Extension" />
407 <min value="0" />
408 <max value="0" />
409 <base>
410 <path value="Element.extension" />
411 <min value="0" />
412 <max value="*" />
413 </base>
414 <type>
415 <code value="Extension" />
416 </type>
417 <constraint>
418 <key value="ele-1" />
419 <severity value="error" />
420 <human value="All FHIR elements must have a @value or children" />
421 <expression value="hasValue() or (children().count() > id.count())" />
422 <xpath value="@value|f:*|h:div" />
423 <source value="http://hl7.org/fhir/StructureDefinition/Element" />
424 </constraint>
425 <constraint>
426 <key value="ext-1" />
427 <severity value="error" />
428 <human value="Must have either extensions or value[x], not both" />
429 <expression value="extension.exists() != value.exists()" />
430 <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])" />
431 <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
432 </constraint>
433 <isModifier value="false" />
434 <isSummary value="false" />
435 </element>
436 <element id="Extension.extension:type.url">
437 <path value="Extension.extension.url" />
438 <representation value="xmlAttr" />
439 <short value="identifies the meaning of the extension" />
440 <definition value="Source of the definition for the extension code - a logical name or a URL." />
441 <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
442 <min value="1" />
443 <max value="1" />
444 <base>
445 <path value="Extension.url" />
446 <min value="1" />
447 <max value="1" />
448 </base>
449 <type>
450 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
451 <valueUrl value="uri" />
452 </extension>
453 <code value="http://hl7.org/fhirpath/System.String" />
454 </type>
455 <fixedUri value="type" />
456 <isModifier value="false" />
457 <isSummary value="false" />
458 <mapping>
459 <identity value="rim" />
460 <map value="N/A" />
461 </mapping>
462 </element>
463 <element id="Extension.extension:type.value[x]">
464 <path value="Extension.extension.value[x]" />
465 <short value="Value of extension" />
466 <definition value="Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list)." />
467 <min value="1" />
468 <max value="1" />
469 <base>
470 <path value="Extension.value[x]" />
471 <min value="0" />
472 <max value="1" />
473 </base>
474 <type>
475 <code value="code" />
476 </type>
477 <constraint>
478 <key value="ele-1" />
479 <severity value="error" />
480 <human value="All FHIR elements must have a @value or children" />
481 <expression value="hasValue() or (children().count() > id.count())" />
482 <xpath value="@value|f:*|h:div" />
483 <source value="http://hl7.org/fhir/StructureDefinition/Element" />
484 </constraint>
485 <isModifier value="false" />
486 <isSummary value="false" />
487 <binding>
488 <strength value="required" />
489 <valueSet value="http://hl7.org/fhir/ValueSet/resource-types" />
490 </binding>
491 <mapping>
492 <identity value="rim" />
493 <map value="N/A" />
494 </mapping>
495 </element>
496 <element id="Extension.extension:description">
497 <path value="Extension.extension" />
498 <sliceName value="description" />
499 <short value="Explanation of context element" />
500 <definition value="Guidance on the resource to be provided and what impact providing it will have on questionnaire behavior." />
501 <min value="0" />
502 <max value="1" />
503 <base>
504 <path value="Element.extension" />
505 <min value="0" />
506 <max value="*" />
507 </base>
508 <type>
509 <code value="Extension" />
510 </type>
511 <constraint>
512 <key value="ele-1" />
513 <severity value="error" />
514 <human value="All FHIR elements must have a @value or children" />
515 <expression value="hasValue() or (children().count() > id.count())" />
516 <xpath value="@value|f:*|h:div" />
517 <source value="http://hl7.org/fhir/StructureDefinition/Element" />
518 </constraint>
519 <constraint>
520 <key value="ext-1" />
521 <severity value="error" />
522 <human value="Must have either extensions or value[x], not both" />
523 <expression value="extension.exists() != value.exists()" />
524 <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])" />
525 <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
526 </constraint>
527 <isModifier value="false" />
528 <isSummary value="false" />
529 </element>
530 <element id="Extension.extension:description.id">
531 <path value="Extension.extension.id" />
532 <representation value="xmlAttr" />
533 <short value="Unique id for inter-element referencing" />
534 <definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
535 <min value="0" />
536 <max value="1" />
537 <base>
538 <path value="Element.id" />
539 <min value="0" />
540 <max value="1" />
541 </base>
542 <type>
543 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
544 <valueUrl value="string" />
545 </extension>
546 <code value="http://hl7.org/fhirpath/System.String" />
547 </type>
548 <isModifier value="false" />
549 <isSummary value="false" />
550 <mapping>
551 <identity value="rim" />
552 <map value="n/a" />
553 </mapping>
554 </element>
555 <element id="Extension.extension:description.extension">
556 <path value="Extension.extension.extension" />
557 <slicing>
558 <discriminator>
559 <type value="value" />
560 <path value="url" />
561 </discriminator>
562 <description value="Extensions are always sliced by (at least) url" />
563 <rules value="open" />
564 </slicing>
565 <short value="Extension" />
566 <definition value="An Extension" />
567 <min value="0" />
568 <max value="0" />
569 <base>
570 <path value="Element.extension" />
571 <min value="0" />
572 <max value="*" />
573 </base>
574 <type>
575 <code value="Extension" />
576 </type>
577 <constraint>
578 <key value="ele-1" />
579 <severity value="error" />
580 <human value="All FHIR elements must have a @value or children" />
581 <expression value="hasValue() or (children().count() > id.count())" />
582 <xpath value="@value|f:*|h:div" />
583 <source value="http://hl7.org/fhir/StructureDefinition/Element" />
584 </constraint>
585 <constraint>
586 <key value="ext-1" />
587 <severity value="error" />
588 <human value="Must have either extensions or value[x], not both" />
589 <expression value="extension.exists() != value.exists()" />
590 <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])" />
591 <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
592 </constraint>
593 <isModifier value="false" />
594 <isSummary value="false" />
595 </element>
596 <element id="Extension.extension:description.url">
597 <path value="Extension.extension.url" />
598 <representation value="xmlAttr" />
599 <short value="identifies the meaning of the extension" />
600 <definition value="Source of the definition for the extension code - a logical name or a URL." />
601 <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
602 <min value="1" />
603 <max value="1" />
604 <base>
605 <path value="Extension.url" />
606 <min value="1" />
607 <max value="1" />
608 </base>
609 <type>
610 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
611 <valueUrl value="uri" />
612 </extension>
613 <code value="http://hl7.org/fhirpath/System.String" />
614 </type>
615 <fixedUri value="description" />
616 <isModifier value="false" />
617 <isSummary value="false" />
618 <mapping>
619 <identity value="rim" />
620 <map value="N/A" />
621 </mapping>
622 </element>
623 <element id="Extension.extension:description.value[x]">
624 <path value="Extension.extension.value[x]" />
625 <short value="Value of extension" />
626 <definition value="Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list)." />
627 <min value="1" />
628 <max value="1" />
629 <base>
630 <path value="Extension.value[x]" />
631 <min value="0" />
632 <max value="1" />
633 </base>
634 <type>
635 <code value="string" />
636 </type>
637 <constraint>
638 <key value="ele-1" />
639 <severity value="error" />
640 <human value="All FHIR elements must have a @value or children" />
641 <expression value="hasValue() or (children().count() > id.count())" />
642 <xpath value="@value|f:*|h:div" />
643 <source value="http://hl7.org/fhir/StructureDefinition/Element" />
644 </constraint>
645 <isModifier value="false" />
646 <isSummary value="false" />
647 <mapping>
648 <identity value="rim" />
649 <map value="N/A" />
650 </mapping>
651 </element>
652 <element id="Extension.extension:multiplesAllowed">
653 <path value="Extension.extension" />
654 <sliceName value="multiplesAllowed" />
655 <short value="Allow multiple resources" />
656 <definition value="Indicates whether multiple resources are permitted for this context element." />
657 <min value="0" />
658 <max value="1" />
659 <base>
660 <path value="Element.extension" />
661 <min value="0" />
662 <max value="*" />
663 </base>
664 <type>
665 <code value="Extension" />
666 </type>
667 <constraint>
668 <key value="ele-1" />
669 <severity value="error" />
670 <human value="All FHIR elements must have a @value or children" />
671 <expression value="hasValue() or (children().count() > id.count())" />
672 <xpath value="@value|f:*|h:div" />
673 <source value="http://hl7.org/fhir/StructureDefinition/Element" />
674 </constraint>
675 <constraint>
676 <key value="ext-1" />
677 <severity value="error" />
678 <human value="Must have either extensions or value[x], not both" />
679 <expression value="extension.exists() != value.exists()" />
680 <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])" />
681 <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
682 </constraint>
683 <isModifier value="false" />
684 <isSummary value="false" />
685 </element>
686 <element id="Extension.extension:multiplesAllowed.id">
687 <path value="Extension.extension.id" />
688 <representation value="xmlAttr" />
689 <short value="Unique id for inter-element referencing" />
690 <definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
691 <min value="0" />
692 <max value="1" />
693 <base>
694 <path value="Element.id" />
695 <min value="0" />
696 <max value="1" />
697 </base>
698 <type>
699 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
700 <valueUrl value="string" />
701 </extension>
702 <code value="http://hl7.org/fhirpath/System.String" />
703 </type>
704 <isModifier value="false" />
705 <isSummary value="false" />
706 <mapping>
707 <identity value="rim" />
708 <map value="n/a" />
709 </mapping>
710 </element>
711 <element id="Extension.extension:multiplesAllowed.extension">
712 <path value="Extension.extension.extension" />
713 <slicing>
714 <discriminator>
715 <type value="value" />
716 <path value="url" />
717 </discriminator>
718 <description value="Extensions are always sliced by (at least) url" />
719 <rules value="open" />
720 </slicing>
721 <short value="Extension" />
722 <definition value="An Extension" />
723 <min value="0" />
724 <max value="0" />
725 <base>
726 <path value="Element.extension" />
727 <min value="0" />
728 <max value="*" />
729 </base>
730 <type>
731 <code value="Extension" />
732 </type>
733 <constraint>
734 <key value="ele-1" />
735 <severity value="error" />
736 <human value="All FHIR elements must have a @value or children" />
737 <expression value="hasValue() or (children().count() > id.count())" />
738 <xpath value="@value|f:*|h:div" />
739 <source value="http://hl7.org/fhir/StructureDefinition/Element" />
740 </constraint>
741 <constraint>
742 <key value="ext-1" />
743 <severity value="error" />
744 <human value="Must have either extensions or value[x], not both" />
745 <expression value="extension.exists() != value.exists()" />
746 <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])" />
747 <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
748 </constraint>
749 <isModifier value="false" />
750 <isSummary value="false" />
751 </element>
752 <element id="Extension.extension:multiplesAllowed.url">
753 <path value="Extension.extension.url" />
754 <representation value="xmlAttr" />
755 <short value="identifies the meaning of the extension" />
756 <definition value="Source of the definition for the extension code - a logical name or a URL." />
757 <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
758 <min value="1" />
759 <max value="1" />
760 <base>
761 <path value="Extension.url" />
762 <min value="1" />
763 <max value="1" />
764 </base>
765 <type>
766 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
767 <valueUrl value="uri" />
768 </extension>
769 <code value="http://hl7.org/fhirpath/System.String" />
770 </type>
771 <fixedUri value="multiplesAllowed" />
772 <isModifier value="false" />
773 <isSummary value="false" />
774 <mapping>
775 <identity value="rim" />
776 <map value="N/A" />
777 </mapping>
778 </element>
779 <element id="Extension.extension:multiplesAllowed.value[x]">
780 <path value="Extension.extension.value[x]" />
781 <short value="Value of extension" />
782 <definition value="Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list)." />
783 <min value="0" />
784 <max value="1" />
785 <base>
786 <path value="Extension.value[x]" />
787 <min value="0" />
788 <max value="1" />
789 </base>
790 <type>
791 <code value="boolean" />
792 </type>
793 <constraint>
794 <key value="ele-1" />
795 <severity value="error" />
796 <human value="All FHIR elements must have a @value or children" />
797 <expression value="hasValue() or (children().count() > id.count())" />
798 <xpath value="@value|f:*|h:div" />
799 <source value="http://hl7.org/fhir/StructureDefinition/Element" />
800 </constraint>
801 <isModifier value="false" />
802 <isSummary value="false" />
803 <mapping>
804 <identity value="rim" />
805 <map value="N/A" />
806 </mapping>
807 </element>
808 <element id="Extension.url">
809 <path value="Extension.url" />
810 <representation value="xmlAttr" />
811 <short value="identifies the meaning of the extension" />
812 <definition value="Source of the definition for the extension code - a logical name or a URL." />
813 <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
814 <min value="1" />
815 <max value="1" />
816 <base>
817 <path value="Extension.url" />
818 <min value="1" />
819 <max value="1" />
820 </base>
821 <type>
822 <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
823 <valueUrl value="uri" />
824 </extension>
825 <code value="http://hl7.org/fhirpath/System.String" />
826 </type>
827 <fixedUri value="http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext" />
828 <isModifier value="false" />
829 <isSummary value="false" />
830 <mapping>
831 <identity value="rim" />
832 <map value="N/A" />
833 </mapping>
834 </element>
835 <element id="Extension.value[x]">
836 <path value="Extension.value[x]" />
837 <short value="Value of extension" />
838 <definition value="Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list)." />
839 <min value="0" />
840 <max value="0" />
841 <base>
842 <path value="Extension.value[x]" />
843 <min value="0" />
844 <max value="1" />
845 </base>
846 <type>
847 <code value="base64Binary" />
848 </type>
849 <type>
850 <code value="boolean" />
851 </type>
852 <type>
853 <code value="canonical" />
854 </type>
855 <type>
856 <code value="code" />
857 </type>
858 <type>
859 <code value="date" />
860 </type>
861 <type>
862 <code value="dateTime" />
863 </type>
864 <type>
865 <code value="decimal" />
866 </type>
867 <type>
868 <code value="id" />
869 </type>
870 <type>
871 <code value="instant" />
872 </type>
873 <type>
874 <code value="integer" />
875 </type>
876 <type>
877 <code value="markdown" />
878 </type>
879 <type>
880 <code value="oid" />
881 </type>
882 <type>
883 <code value="positiveInt" />
884 </type>
885 <type>
886 <code value="string" />
887 </type>
888 <type>
889 <code value="time" />
890 </type>
891 <type>
892 <code value="unsignedInt" />
893 </type>
894 <type>
895 <code value="uri" />
896 </type>
897 <type>
898 <code value="url" />
899 </type>
900 <type>
901 <code value="uuid" />
902 </type>
903 <type>
904 <code value="Address" />
905 </type>
906 <type>
907 <code value="Age" />
908 </type>
909 <type>
910 <code value="Annotation" />
911 </type>
912 <type>
913 <code value="Attachment" />
914 </type>
915 <type>
916 <code value="CodeableConcept" />
917 </type>
918 <type>
919 <code value="Coding" />
920 </type>
921 <type>
922 <code value="ContactPoint" />
923 </type>
924 <type>
925 <code value="Count" />
926 </type>
927 <type>
928 <code value="Distance" />
929 </type>
930 <type>
931 <code value="Duration" />
932 </type>
933 <type>
934 <code value="HumanName" />
935 </type>
936 <type>
937 <code value="Identifier" />
938 </type>
939 <type>
940 <code value="Money" />
941 </type>
942 <type>
943 <code value="Period" />
944 </type>
945 <type>
946 <code value="Quantity" />
947 </type>
948 <type>
949 <code value="Range" />
950 </type>
951 <type>
952 <code value="Ratio" />
953 </type>
954 <type>
955 <code value="Reference" />
956 </type>
957 <type>
958 <code value="SampledData" />
959 </type>
960 <type>
961 <code value="Signature" />
962 </type>
963 <type>
964 <code value="Timing" />
965 </type>
966 <type>
967 <code value="ContactDetail" />
968 </type>
969 <type>
970 <code value="Contributor" />
971 </type>
972 <type>
973 <code value="DataRequirement" />
974 </type>
975 <type>
976 <code value="Expression" />
977 </type>
978 <type>
979 <code value="ParameterDefinition" />
980 </type>
981 <type>
982 <code value="RelatedArtifact" />
983 </type>
984 <type>
985 <code value="TriggerDefinition" />
986 </type>
987 <type>
988 <code value="UsageContext" />
989 </type>
990 <type>
991 <code value="Dosage" />
992 </type>
993 <type>
994 <code value="Meta" />
995 </type>
996 <constraint>
997 <key value="ele-1" />
998 <severity value="error" />
999 <human value="All FHIR elements must have a @value or children" />
1000 <expression value="hasValue() or (children().count() > id.count())" />
1001 <xpath value="@value|f:*|h:div" />
1002 <source value="http://hl7.org/fhir/StructureDefinition/Element" />
1003 </constraint>
1004 <isModifier value="false" />
1005 <isSummary value="false" />
1006 <mapping>
1007 <identity value="rim" />
1008 <map value="N/A" />
1009 </mapping>
1010 </element>
1011 </snapshot>
1012 <differential>
1013 <element id="Extension">
1014 <path value="Extension" />
1015 <short value="Context resources needed for Questionnaire" />
1016 <definition value="Resources that provide context for form processing logic (pre-population, flow-control, drop-down selection, etc.) when creating/displaying/editing a QuestionnaireResponse." />
1017 <comment value="3 of these launch contexts are aligned with the existing SMART on FHIR "launch" contexts." />
1018 <constraint>
1019 <key value="sdc-lcext-1" />
1020 <severity value="error" />
1021 <human value="Types must be from the specified value set of resource types based on name: patient: Patient; user: Patient, Practitioner, PractitionerRole, Organization, RelatedPerson, Device; encounter: Encounter; location: Location; study: ResearchStudy; clinical: Any allowed clinical resource" />
1022 <expression value="(extension('name').value.where(code='patient' and system='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext').exists() implies extension('type').all(value = 'Patient')) and (extension('name').value.where(code='user' and system='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext').exists() implies extension('type').all(value='Patient' or value='Practitioner' or value='PractitionerRole' or value='RelatedPerson' or value='Organization' or value='Device')) and (extension('name').value.where(code='encounter' and system='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext').exists() implies extension('type').all(value = 'Encounter')) and (extension('name').value.where(code='location' and system='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext').exists() implies extension('type').all(value = 'Location')) and (extension('name').value.where(code='study' and system='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext').exists() implies extension('type').all(value = 'ResearchStudy'))" />
1023 <xpath value="(not(f:extension[@url='name' and f:valueCoding[f:code/@value='patient' and f:system/@value='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext']]) or not(f:extension[@url='type' and f:valueCode/@value!='Patient'])) and (not(f:extension[@url='name' and f:valueCoding[f:code/@value='user' and f:system/@value='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext']]) or not(f:extension[@url='type' and f:valueCode/@value!=('Patient','Practitioner','PractitionerRole','RelatedPerson', 'Organization', 'Device')])) and (not(f:extension[@url='name' and f:valueCoding[f:code/@value='encounter' and f:system/@value='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext']]) or not(f:extension[@url='type' and f:valueCode/@value!='Encounter']))) and (not(f:extension[@url='name' and f:valueCoding[f:code/@value='study' and f:system/@value='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext']]) or f:extension[@url='type' and not(f:valueCode/@value!='ResearchStudy'])) and (not(f:extension[@url='name' and f:valueCoding[f:code/@value='location' and f:system/@value='http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext']]) or not(f:extension[@url='type' and f:valueCode/@value!='Location']))" />
1024 <source value="http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext" />
1025 </constraint>
1026 </element>
1027 <element id="Extension.extension">
1028 <path value="Extension.extension" />
1029 <min value="2" />
1030 </element>
1031 <element id="Extension.extension:name">
1032 <path value="Extension.extension" />
1033 <sliceName value="name" />
1034 <short value="Variable name" />
1035 <definition value="The variable name the passed resource will be referenced by within the Questionnaire logic." />
1036 <min value="1" />
1037 <max value="1" />
1038 </element>
1039 <element id="Extension.extension:name.extension">
1040 <path value="Extension.extension.extension" />
1041 <max value="0" />
1042 </element>
1043 <element id="Extension.extension:name.url">
1044 <path value="Extension.extension.url" />
1045 <fixedUri value="name" />
1046 </element>
1047 <element id="Extension.extension:name.value[x]">
1048 <path value="Extension.extension.value[x]" />
1049 <min value="1" />
1050 <type>
1051 <code value="Coding" />
1052 </type>
1053 <binding>
1054 <strength value="extensible" />
1055 <description value="Launch context codes for use in defining questionnaires context at launch time (NOTE: the Coding.code will be used for the variable name and that (at present) there is no support for Questionnaires that use multiple launch contexts which share a common code but different code systems. Also, all launch context codes must meet the requirements to be a valid FHIRPath name.)." />
1056 <valueSet value="http://hl7.org/fhir/uv/sdc/ValueSet/launchContext" />
1057 </binding>
1058 </element>
1059 <element id="Extension.extension:type">
1060 <path value="Extension.extension" />
1061 <sliceName value="type" />
1062 <short value="Resource type" />
1063 <definition value="The kind of resource to be provided." />
1064 <min value="1" />
1065 <max value="*" />
1066 </element>
1067 <element id="Extension.extension:type.extension">
1068 <path value="Extension.extension.extension" />
1069 <max value="0" />
1070 </element>
1071 <element id="Extension.extension:type.url">
1072 <path value="Extension.extension.url" />
1073 <fixedUri value="type" />
1074 </element>
1075 <element id="Extension.extension:type.value[x]">
1076 <path value="Extension.extension.value[x]" />
1077 <min value="1" />
1078 <type>
1079 <code value="code" />
1080 </type>
1081 <binding>
1082 <strength value="required" />
1083 <valueSet value="http://hl7.org/fhir/ValueSet/resource-types" />
1084 </binding>
1085 </element>
1086 <element id="Extension.extension:description">
1087 <path value="Extension.extension" />
1088 <sliceName value="description" />
1089 <short value="Explanation of context element" />
1090 <definition value="Guidance on the resource to be provided and what impact providing it will have on questionnaire behavior." />
1091 <min value="0" />
1092 <max value="1" />
1093 </element>
1094 <element id="Extension.extension:description.extension">
1095 <path value="Extension.extension.extension" />
1096 <max value="0" />
1097 </element>
1098 <element id="Extension.extension:description.url">
1099 <path value="Extension.extension.url" />
1100 <fixedUri value="description" />
1101 </element>
1102 <element id="Extension.extension:description.value[x]">
1103 <path value="Extension.extension.value[x]" />
1104 <min value="1" />
1105 <type>
1106 <code value="string" />
1107 </type>
1108 </element>
1109 <element id="Extension.extension:multiplesAllowed">
1110 <path value="Extension.extension" />
1111 <sliceName value="multiplesAllowed" />
1112 <short value="Allow multiple resources" />
1113 <definition value="Indicates whether multiple resources are permitted for this context element." />
1114 <min value="0" />
1115 <max value="1" />
1116 </element>
1117 <element id="Extension.extension:multiplesAllowed.extension">
1118 <path value="Extension.extension.extension" />
1119 <max value="0" />
1120 </element>
1121 <element id="Extension.extension:multiplesAllowed.url">
1122 <path value="Extension.extension.url" />
1123 <fixedUri value="multiplesAllowed" />
1124 </element>
1125 <element id="Extension.extension:multiplesAllowed.value[x]">
1126 <path value="Extension.extension.value[x]" />
1127 <type>
1128 <code value="boolean" />
1129 </type>
1130 </element>
1131 <element id="Extension.url">
1132 <path value="Extension.url" />
1133 <fixedUri value="http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext" />
1134 </element>
1135 <element id="Extension.value[x]">
1136 <path value="Extension.value[x]" />
1137 <max value="0" />
1138 </element>
1139 </differential>
1140 </StructureDefinition>