This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Profile-medicationstatement-de-basis-0.2.xml
3162 lines (3162 loc) · 142 KB
/
Profile-medicationstatement-de-basis-0.2.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<StructureDefinition xmlns="http://hl7.org/fhir">
<url value="http://fhir.de/StructureDefinition/medicationstatement-de-basis/0.2" />
<version value="0.2.4" />
<name value="medicationstatement-de-basis-0.2" />
<title value="MedicationStatement, deutsches Basisprofil (Version 0.2)" />
<status value="draft" />
<experimental value="true" />
<date value="2018-06-05" />
<publisher value="HL7 Deutschland e.V. (Technisches Komitee FHIR)" />
<contact>
<telecom>
<system value="url" />
<value value="http://hl7.de/technische-komitees/fhir/" />
</telecom>
</contact>
<description value="Basisprofil für die Verwendung der MedicationStatement Ressource in Deutschland" />
<copyright value="HL7 Deutschland e.V." />
<fhirVersion value="3.0.1" />
<kind value="resource" />
<abstract value="false" />
<type value="MedicationStatement" />
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/MedicationStatement" />
<derivation value="constraint" />
<snapshot>
<element id="MedicationStatement">
<path value="MedicationStatement" />
<short value="Record of medication being taken by a patient" />
<definition value="A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains 

The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information." />
<comment value="When interpreting a medicationStatement, the value of the status and NotTaken needed to be considered:
MedicationStatement.status + MedicationStatement.wasNotTaken
Status=Active + NotTaken=T = Not currently taking
Status=Completed + NotTaken=T = Not taken in the past
Status=Intended + NotTaken=T = No intention of taking
Status=Active + NotTaken=F = Taking, but not as prescribed
Status=Active + NotTaken=F = Taking
Status=Intended +NotTaken= F = Will be taking (not started)
Status=Completed + NotTaken=F = Taken in past
Status=In Error + NotTaken=N/A = In Error." />
<min value="0" />
<max value="*" />
<base>
<path value="Resource" />
<min value="0" />
<max value="*" />
</base>
<constraint>
<key value="dom-2" />
<severity value="error" />
<human value="If the resource is contained in another resource, it SHALL NOT contain nested Resources" />
<expression value="contained.contained.empty()" />
<xpath value="not(parent::f:contained and f:contained)" />
</constraint>
<constraint>
<key value="dom-1" />
<severity value="error" />
<human value="If the resource is contained in another resource, it SHALL NOT contain any narrative" />
<expression value="contained.text.empty()" />
<xpath value="not(parent::f:contained and f:text)" />
</constraint>
<constraint>
<key value="dom-4" />
<severity value="error" />
<human value="If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated" />
<expression value="contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()" />
<xpath value="not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))" />
</constraint>
<constraint>
<key value="dom-3" />
<severity value="error" />
<human value="If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource" />
<expression value="contained.where(('#'+id in %resource.descendants().reference).not()).empty()" />
<xpath value="not(exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))]))" />
</constraint>
<constraint>
<key value="mst-1" />
<severity value="error" />
<human value="Reason not taken is only permitted if Taken is No" />
<expression value="reasonNotTaken.exists().not() or (taken = 'n')" />
<xpath value="not(exists(f:reasonNotTaken)) or f:taken/@value='n'" />
</constraint>
<mapping>
<identity value="rim" />
<map value="Entity. Role, or Act" />
</mapping>
<mapping>
<identity value="workflow" />
<map value="..Event" />
</mapping>
<mapping>
<identity value="rim" />
<map value="SubstanceAdministration" />
</mapping>
<mapping>
<identity value="w5" />
<map value="clinical.medication" />
</mapping>
</element>
<element id="MedicationStatement.id">
<path value="MedicationStatement.id" />
<short value="Logical id of this artifact" />
<definition value="The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes." />
<comment value="The only time that a resource does not have an id is when it is being submitted to the server using a create operation." />
<min value="0" />
<max value="1" />
<base>
<path value="Resource.id" />
<min value="0" />
<max value="1" />
</base>
<type>
<code value="id" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isSummary value="true" />
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
</element>
<element id="MedicationStatement.meta">
<path value="MedicationStatement.meta" />
<short value="Metadata about the resource" />
<definition value="The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource." />
<min value="0" />
<max value="1" />
<base>
<path value="Resource.meta" />
<min value="0" />
<max value="1" />
</base>
<type>
<code value="Meta" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isSummary value="true" />
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
<mapping>
<identity value="rim" />
<map value="N/A" />
</mapping>
</element>
<element id="MedicationStatement.implicitRules">
<path value="MedicationStatement.implicitRules" />
<short value="A set of rules under which this content was created" />
<definition value="A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content." />
<comment value="Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. 

This element is labelled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation." />
<min value="0" />
<max value="1" />
<base>
<path value="Resource.implicitRules" />
<min value="0" />
<max value="1" />
</base>
<type>
<code value="uri" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isModifier value="true" />
<isSummary value="true" />
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
</element>
<element id="MedicationStatement.language">
<path value="MedicationStatement.language" />
<short value="Language of the resource content" />
<definition value="The base language in which the resource is written." />
<comment value="Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute)." />
<min value="0" />
<max value="1" />
<base>
<path value="Resource.language" />
<min value="0" />
<max value="1" />
</base>
<type>
<code value="code" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<binding>
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet">
<valueReference>
<reference value="http://hl7.org/fhir/ValueSet/all-languages" />
</valueReference>
</extension>
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
<valueString value="Language" />
</extension>
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
<valueBoolean value="true" />
</extension>
<strength value="extensible" />
<description value="A human language." />
<valueSetReference>
<reference value="http://hl7.org/fhir/ValueSet/languages" />
</valueSetReference>
</binding>
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
</element>
<element id="MedicationStatement.text">
<path value="MedicationStatement.text" />
<short value="Text summary of the resource, for human interpretation" />
<definition value="A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety." />
<comment value="Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a "text blob" or where text is additionally entered raw or narrated and encoded in formation is added later." />
<alias value="narrative" />
<alias value="html" />
<alias value="xhtml" />
<alias value="display" />
<min value="0" />
<max value="1" />
<base>
<path value="DomainResource.text" />
<min value="0" />
<max value="1" />
</base>
<type>
<code value="Narrative" />
</type>
<condition value="ele-1" />
<condition value="dom-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
<mapping>
<identity value="rim" />
<map value="N/A" />
</mapping>
<mapping>
<identity value="rim" />
<map value="Act.text?" />
</mapping>
</element>
<element id="MedicationStatement.contained">
<path value="MedicationStatement.contained" />
<short value="Contained, inline Resources" />
<definition value="These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope." />
<comment value="This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again." />
<alias value="inline resources" />
<alias value="anonymous resources" />
<alias value="contained resources" />
<min value="0" />
<max value="*" />
<base>
<path value="DomainResource.contained" />
<min value="0" />
<max value="*" />
</base>
<type>
<code value="Resource" />
</type>
<mapping>
<identity value="rim" />
<map value="Entity. Role, or Act" />
</mapping>
<mapping>
<identity value="rim" />
<map value="N/A" />
</mapping>
</element>
<element id="MedicationStatement.extension">
<path value="MedicationStatement.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 resource. In order 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 is allowed to 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="DomainResource.extension" />
<min value="0" />
<max value="*" />
</base>
<type>
<code value="Extension" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</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()" />
<xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
</constraint>
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
<mapping>
<identity value="rim" />
<map value="N/A" />
</mapping>
</element>
<element id="MedicationStatement.modifierExtension">
<path value="MedicationStatement.modifierExtension" />
<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="Extensions that cannot be ignored" />
<definition value="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order 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 is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." />
<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="DomainResource.modifierExtension" />
<min value="0" />
<max value="*" />
</base>
<type>
<code value="Extension" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</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()" />
<xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
</constraint>
<isModifier value="true" />
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
<mapping>
<identity value="rim" />
<map value="N/A" />
</mapping>
</element>
<element id="MedicationStatement.identifier">
<path value="MedicationStatement.identifier" />
<short value="External identifier" />
<definition value="External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated." />
<min value="0" />
<max value="*" />
<base>
<path value="MedicationStatement.identifier" />
<min value="0" />
<max value="*" />
</base>
<type>
<code value="Identifier" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isSummary value="true" />
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
<mapping>
<identity value="v2" />
<map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
</mapping>
<mapping>
<identity value="rim" />
<map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. The Identifier class is a little looser than the v3 type II because it allows URIs as well as registered OIDs or GUIDs. Also maps to Role[classCode=IDENT]" />
</mapping>
<mapping>
<identity value="servd" />
<map value="Identifier" />
</mapping>
<mapping>
<identity value="workflow" />
<map value="…identifer" />
</mapping>
<mapping>
<identity value="rim" />
<map value=".id" />
</mapping>
<mapping>
<identity value="w5" />
<map value="id" />
</mapping>
</element>
<element id="MedicationStatement.basedOn">
<path value="MedicationStatement.basedOn" />
<short value="Fulfils plan, proposal or order" />
<definition value="A plan, proposal or order that is fulfilled in whole or in part by this event." />
<comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
<requirements value="Allows tracing of authorization for the event and tracking whether proposals/recommendations were acted upon." />
<min value="0" />
<max value="*" />
<base>
<path value="MedicationStatement.basedOn" />
<min value="0" />
<max value="*" />
</base>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/MedicationRequest" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/CarePlan" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/ProcedureRequest" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/ReferralRequest" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<constraint>
<key value="ref-1" />
<severity value="error" />
<human value="SHALL have a contained resource if a local reference is provided" />
<expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
<xpath value="not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])" />
</constraint>
<isSummary value="true" />
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
<mapping>
<identity value="rim" />
<map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
</mapping>
<mapping>
<identity value="workflow" />
<map value="…basedOn" />
</mapping>
<mapping>
<identity value="rim" />
<map value=".outboundRelationship[typeCode=FLFS].target[classCode=SBADM or PROC or PCPR or OBS, moodCode=RQO orPLAN or PRP]" />
</mapping>
</element>
<element id="MedicationStatement.partOf">
<path value="MedicationStatement.partOf" />
<short value="Part of referenced event" />
<definition value="A larger event of which this particular event is a component or step." />
<comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
<requirements value="This should not be used when indicating which resource a MedicationStatement has been derived from. If that is the use case, then MedicationStatement.derivedFrom should be used." />
<min value="0" />
<max value="*" />
<base>
<path value="MedicationStatement.partOf" />
<min value="0" />
<max value="*" />
</base>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/MedicationDispense" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/MedicationStatement" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Procedure" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Observation" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://fhir.de/StructureDefinition/medicationstatement-de-basis/0.2" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<constraint>
<key value="ref-1" />
<severity value="error" />
<human value="SHALL have a contained resource if a local reference is provided" />
<expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
<xpath value="not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])" />
</constraint>
<isSummary value="true" />
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
<mapping>
<identity value="rim" />
<map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
</mapping>
<mapping>
<identity value="workflow" />
<map value="…part of" />
</mapping>
<mapping>
<identity value="rim" />
<map value=".outboundRelationship[typeCode=COMP]/target[classCode=SPLY or SBADM or PROC or OBS,moodCode=EVN]" />
</mapping>
</element>
<element id="MedicationStatement.context">
<path value="MedicationStatement.context" />
<short value="Encounter / Episode associated with MedicationStatement" />
<definition value="The encounter or episode of care that establishes the context for this MedicationStatement." />
<comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
<min value="0" />
<max value="1" />
<base>
<path value="MedicationStatement.context" />
<min value="0" />
<max value="1" />
</base>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Encounter" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/EpisodeOfCare" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<constraint>
<key value="ref-1" />
<severity value="error" />
<human value="SHALL have a contained resource if a local reference is provided" />
<expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
<xpath value="not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])" />
</constraint>
<isSummary value="true" />
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
<mapping>
<identity value="rim" />
<map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
</mapping>
<mapping>
<identity value="workflow" />
<map value="…context" />
</mapping>
<mapping>
<identity value="rim" />
<map value=".inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN, code="type of encounter or episode"]" />
</mapping>
</element>
<element id="MedicationStatement.status">
<path value="MedicationStatement.status" />
<short value="active | completed | entered-in-error | intended | stopped | on-hold" />
<definition value="A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed." />
<comment value="MedicationStatement is a statement at a point in time. The status is only representative at the point when it was asserted. The value set for MedicationStatement.status contains codes that assert the status of the use of the medication by the patient (for example, stopped or on hold) as well as codes that assert the status of the medication statement itself (for example, entered in error).

This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid." />
<min value="1" />
<max value="1" />
<base>
<path value="MedicationStatement.status" />
<min value="1" />
<max value="1" />
</base>
<type>
<code value="code" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isModifier value="true" />
<isSummary value="true" />
<binding>
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
<valueString value="MedicationStatementStatus" />
</extension>
<strength value="required" />
<description value="A coded concept indicating the current status of a MedicationStatement." />
<valueSetReference>
<reference value="http://hl7.org/fhir/ValueSet/medication-statement-status" />
</valueSetReference>
</binding>
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
<mapping>
<identity value="workflow" />
<map value="…status" />
</mapping>
<mapping>
<identity value="rim" />
<map value=".statusCode" />
</mapping>
<mapping>
<identity value="w5" />
<map value="status" />
</mapping>
</element>
<element id="MedicationStatement.category">
<path value="MedicationStatement.category" />
<short value="Type of medication usage" />
<definition value="Indicates where type of medication statement and where the medication is expected to be consumed or administered." />
<comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination." />
<min value="0" />
<max value="1" />
<base>
<path value="MedicationStatement.category" />
<min value="0" />
<max value="1" />
</base>
<type>
<code value="CodeableConcept" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isSummary value="true" />
<binding>
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
<valueString value="MedicationStatementCategory" />
</extension>
<strength value="preferred" />
<description value="A coded concept identifying where the medication included in the medicationstatement is expected to be consumed or administered" />
<valueSetReference>
<reference value="http://hl7.org/fhir/ValueSet/medication-statement-category" />
</valueSetReference>
</binding>
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
<mapping>
<identity value="v2" />
<map value="CE/CNE/CWE" />
</mapping>
<mapping>
<identity value="rim" />
<map value="CD" />
</mapping>
<mapping>
<identity value="orim" />
<map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
</mapping>
<mapping>
<identity value="rim" />
<map value=".inboundRelationship[typeCode=COMP].source[classCode=OBS, moodCode=EVN, code="type of medication usage"].value" />
</mapping>
<mapping>
<identity value="w5" />
<map value="class" />
</mapping>
</element>
<element id="MedicationStatement.medication[x]">
<path value="MedicationStatement.medication[x]" />
<short value="What medication was taken" />
<definition value="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." />
<comment value="If only a code is specified, then it needs to be a code for a specific product. If more information is required, then the use of the medication resource is recommended. For example if you require form or lot number, then you must reference the Medication resource. ." />
<min value="1" />
<max value="1" />
<base>
<path value="MedicationStatement.medication[x]" />
<min value="1" />
<max value="1" />
</base>
<type>
<code value="CodeableConcept" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Medication" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://fhir.de/StructureDefinition/medication-de-basis/0.2" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isSummary value="true" />
<binding>
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
<valueString value="MedicationCode" />
</extension>
<strength value="example" />
<description value="A coded concept identifying the substance or product being taken." />
<valueSetReference>
<reference value="http://hl7.org/fhir/ValueSet/medication-codes" />
</valueSetReference>
</binding>
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
<mapping>
<identity value="v2" />
<map value="CE/CNE/CWE" />
</mapping>
<mapping>
<identity value="rim" />
<map value="CD" />
</mapping>
<mapping>
<identity value="orim" />
<map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
</mapping>
<mapping>
<identity value="workflow" />
<map value="…code" />
</mapping>
<mapping>
<identity value="rim" />
<map value=".participation[typeCode=CSM].role[classCode=ADMM or MANU]" />
</mapping>
<mapping>
<identity value="w5" />
<map value="what" />
</mapping>
</element>
<element id="MedicationStatement.effective[x]">
<path value="MedicationStatement.effective[x]" />
<short value="The date/time or interval when the medication was taken" />
<definition value="The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true)." />
<comment value="This attribute reflects the period over which the patient consumed the medication and is expected to be populated on the majority of Medication Statements. If the medication is still being taken at the time the statement is recorded, the "end" date will be omitted." />
<min value="0" />
<max value="1" />
<base>
<path value="MedicationStatement.effective[x]" />
<min value="0" />
<max value="1" />
</base>
<type>
<code value="dateTime" />
</type>
<type>
<code value="Period" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isSummary value="true" />
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
<mapping>
<identity value="workflow" />
<map value="…occurrence[x]" />
</mapping>
<mapping>
<identity value="rim" />
<map value=".effectiveTime" />
</mapping>
<mapping>
<identity value="w5" />
<map value="when.done" />
</mapping>
</element>
<element id="MedicationStatement.dateAsserted">
<path value="MedicationStatement.dateAsserted" />
<short value="When the statement was asserted?" />
<definition value="The date when the medication statement was asserted by the information source." />
<min value="0" />
<max value="1" />
<base>
<path value="MedicationStatement.dateAsserted" />
<min value="0" />
<max value="1" />
</base>
<type>
<code value="dateTime" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isSummary value="true" />
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
<mapping>
<identity value="rim" />
<map value=".participation[typeCode=AUT].time" />
</mapping>
<mapping>
<identity value="w5" />
<map value="when.recorded" />
</mapping>
</element>
<element id="MedicationStatement.informationSource">
<path value="MedicationStatement.informationSource" />
<short value="Person or organization that provided the information about the taking of this medication" />
<definition value="The person or organization that provided the information about the taking of this medication. Note: Use derivedFrom when a MedicationStatement is derived from other resources, e.g Claim or MedicationRequest." />
<comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
<min value="0" />
<max value="1" />
<base>
<path value="MedicationStatement.informationSource" />
<min value="0" />
<max value="1" />
</base>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://fhir.de/StructureDefinition/patient-de-basis/0.2" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://fhir.de/StructureDefinition/practitioner-de-basis/0.2" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<constraint>
<key value="ref-1" />
<severity value="error" />
<human value="SHALL have a contained resource if a local reference is provided" />
<expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
<xpath value="not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])" />
</constraint>
<mapping>
<identity value="rim" />
<map value="n/a" />
</mapping>
<mapping>
<identity value="rim" />
<map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
</mapping>
<mapping>
<identity value="rim" />
<map value=".participation[typeCode=INF].role[classCode=PAT, or codes for Practioner or Related Person (if PAT is the informer, then syntax for self-reported =true)" />
</mapping>
<mapping>
<identity value="w5" />
<map value="who.source" />
</mapping>
</element>
<element id="MedicationStatement.subject">
<path value="MedicationStatement.subject" />
<short value="Who is/was taking the medication" />
<definition value="The person, animal or group who is/was taking the medication." />
<comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
<min value="1" />
<max value="1" />
<base>
<path value="MedicationStatement.subject" />
<min value="1" />
<max value="1" />
</base>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Group" />
</type>
<type>
<code value="Reference" />
<targetProfile value="http://fhir.de/StructureDefinition/patient-de-basis/0.2" />
</type>
<condition value="ele-1" />
<constraint>
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<constraint>
<key value="ref-1" />
<severity value="error" />
<human value="SHALL have a contained resource if a local reference is provided" />
<expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
<xpath value="not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])" />
</constraint>
<isSummary value="true" />