Implementation Guide
ePA Medication Service
Version 1.3.5 - release

## Extension: ContextExtension

Official URL: https://gematik.de/fhir/epa-medication/StructureDefinition/context-extension | Version: 1.3.0
Active as of 2025-12-15 | Computable Name: ContextExtension
Copyright/Legal: gematik GmbH / Dieses Artefakt ist lizenziert unter Apache License, Version 2.0.

Extension for indicating the context.

Context of Use

This extension may be used on the following element(s):

- Element ID MedicationStatement
- Element ID Medication
- Element ID MedicationRequest

Usage info

Usages:

- Use this Extension: eMP MedicationRequest, eMP Medication and EPA MedicationStatement
- Examples for this Extension: Bundle/example-epa-batch-emp-request-bundle, Bundle/example-epa-batch-emp-response-bundle, Bundle/example-get-medication-list-bundle1, Bundle/example-get-medication-plan-bundle-1... Show 32 more, Bundle/example-searchset-medicationstatement, Medication/13c66845-d0ce-43e1-9b0b-884cbbe8df7f, Medication/87f08ba2-da7e-467e-86aa-404d9035297c, Medication/Technical-Exp-NachtragEmpMedicationEmp, MedicationRequest/266620a9-2c26-41c1-b0cb-a10947b867f5, MedicationRequest/55b8a1f8-daeb-4d1e-a0e1-36279e2d9913, MedicationRequest/71b66f1b-8032-4886-b7bf-e775daee22fb, MedicationRequest/Technical-Exp-NachtragEmpMedicationRequestEmp, MedicationStatement/0fc1f006-5793-4501-81b6-fe3918fcfa2d, MedicationStatement/133c8159-6398-4937-984a-d741e24556ad, MedicationStatement/1b88713c-64cc-40ad-9665-70ca5f7dfb08, MedicationStatement/1cb0f018-178d-4488-a6b4-2be32dbda784, MedicationStatement/405ff43e-bc8e-4109-b370-3e31431c5fe0, MedicationStatement/71601cdb-8a53-4f26-b5d5-e5457b498e76, MedicationStatement/Technical-Exp-NachtragEmlMedicationStatement, MedicationStatement/Technical-Exp-NachtragEmpMedicationStatementEml, MedicationStatement/ab495b80-c9d2-4ed6-a076-b44b8dfae75a, MedicationStatement/b87b0908-7765-4ec0-8662-7d3daff08f6e, MedicationStatement/cfb84928-15d6-468c-8e17-e77f1ed44904, MedicationStatement/f29f1d0c-be05-4b0d-a335-3e508da39c0c, MedicationStatement/f3988023-2313-4645-bd6b-f9e37cfb6fc7, Parameters/7ccb2670-7178-4f82-912a-de70f68ecd51, Parameters/example-epa-op-add-eml-entry-input-parameters-1, Parameters/example-epa-op-add-emp-entry-input-parameters-1, Parameters/example-epa-op-add-emp-entry-with-reference-input-parameters-1, Parameters/example-epa-op-eml-entry-output-parameters-1, Parameters/example-epa-op-emp-entry-output-parameters-1, Parameters/example-epa-op-emp-entry-output-parameters-2, Parameters/example-epa-op-link-emp-entry-output-parameters-1, Parameters/example-epa-op-unlink-emp-entry-output-parameters-1, Parameters/example-epa-op-update-emp-entry-input-parameters-1 and Parameters/invalid-example-history-reference-not-allowed-emp-input
- Search Parameters using this Extension: ContextSP

You can also check for usages in the FHIR IG Statistics

### Formal Views of Extension Content

Description of Profiles, Differentials, Snapshots, and how the XML and JSON presentations work.

- Text Summary
- Differential Table
- Snapshot Table
- All

This structure is derived from Extension

Summary

Simple Extension with the type code: Extension for indicating the context.

This structure is derived from Extension

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Extension |  | 0..* | Extension | Extension
extension |  | 0..0 |  | Extension
url |  | 1..1 | uri | "https://gematik.de/fhir/epa-medication/StructureDefinition/context-extension"
value[x] |  | 1..1 | code | Context of the resource Binding: Context Codes (required)
Documentation for this format

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Extension |  | 0..* | Extension | Extension
id |  | 0..1 | string | Unique id for inter-element referencing
extension |  | 0..0 |  | Extension Slice: Unordered, Open by value:url
url |  | 1..1 | uri | "https://gematik.de/fhir/epa-medication/StructureDefinition/context-extension"
value[x] |  | 1..1 | code | Context of the resource Binding: Context Codes (required)
Documentation for this format

This structure is derived from Extension

Summary

Simple Extension with the type code: Extension for indicating the context.

Differential View

This structure is derived from Extension

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Extension |  | 0..* | Extension | Extension
extension |  | 0..0 |  | Extension
url |  | 1..1 | uri | "https://gematik.de/fhir/epa-medication/StructureDefinition/context-extension"
value[x] |  | 1..1 | code | Context of the resource Binding: Context Codes (required)
Documentation for this format

Snapshot View

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Extension |  | 0..* | Extension | Extension
id |  | 0..1 | string | Unique id for inter-element referencing
extension |  | 0..0 |  | Extension Slice: Unordered, Open by value:url
url |  | 1..1 | uri | "https://gematik.de/fhir/epa-medication/StructureDefinition/context-extension"
value[x] |  | 1..1 | code | Context of the resource Binding: Context Codes (required)
Documentation for this format

Other representations of profile: CSV, Excel, Schematron

#### Terminology Bindings

Path | Status | Usage | ValueSet | Version | Source
Extension.value[x] | Base | required | Context Codes | 📦1.3.0 | This IG

#### Constraints

Id | Grade | Path(s) | Description | Expression
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children | `hasValue() or (children().count() > id.count())`
ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both | `extension.exists() != value.exists()`