openapi: 3.0.3 info: title: ePA Medication Service (FHIR R4) description: | ### **Prerequisites**: The Health Record System shall provide - name - role ((profession-)oid) - identifier (telematik-id or kvnr) - indication of a valid entitlement of the current user (requestor) for evaluation in operations. Operations mandating a valid entitlement implicitly mandate use of a VAU-channel and a valid ID-Token. If one of these conditions is not met, then the response of the (aborted) operation shall always be '403': 'notEntitled'. ### **Retry interval**: The following retry intervals are suggested in case of an error response:
- '409' Conflict (statusMismatch). - approx. 24 hours - '500' Internal Error - approx. 10 minutes ### **User Agent**: The user agent information (x-useragent) is part of any request, even if not essentially required for the operation (e.g. raw-data collection), and may be considered for provider internal use. ### **Request-ID** Unique ID given by the ePA-Client to identify the request message. The server must return this ID in the response message. ### **Log-Entries** Whenever a _Postcondition_ mandates a log-entry, this entry shall contain data as defined in A_24991*. contact: name: gematik GmbH email: epa@gematik.de url: 'http://www.gematik.de' license: name: Apache 2.0 url: 'https://www.apache.org/licenses/LICENSE-2.0' version: 1.0.3 # version history: # ---------------- # version 1.0.3 # - fixed missing medication search parameter # version 1.0.2 # - fixed useragent regex pattern # version 1.0.1 # - Added details on the mandatory use of absolute URLs or UUID-based URIs in the fullUrl # field of FHIR bundles, and disallowed the use of relative paths. # version 1.0.0 # - first release version servers: - url: 'http://epa4all' tags: - name: Resources description: | ### HL7 FHIR R4 Resources provided by the ePA Medication Service #### [Medication](https://hl7.org/fhir/R4/medication.html) The Medication resource in FHIR (Fast Healthcare Interoperability Resources) is a standard data model used to represent detailed information about medications within healthcare systems. It includes essential details like the type, ingredients, manufacturer, and physical form of the medication. This resource is crucial for managing medication-related data across various healthcare applications, ensuring consistency and accuracy in medication information sharing. ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication|1.0.3) ##### Examples: - [https://simplifier.net/epa-medication/4f9ab221-0eef-4e46-a8a9-38302e0488b1/~json](https://simplifier.net/epa-medication/4f9ab221-0eef-4e46-a8a9-38302e0488b1/~json) - [https://simplifier.net/epa-medication/3b990824-3814-4d75-80b1-e2935827f8f0/~json](https://simplifier.net/epa-medication/3b990824-3814-4d75-80b1-e2935827f8f0/~json) - [https://simplifier.net/epa-medication/4bfef107-7d81-4d36-8aa0-7ea937969046/~json](https://simplifier.net/epa-medication/4bfef107-7d81-4d36-8aa0-7ea937969046/~json) *** #### [MedicationRequest](https://hl7.org/fhir/R4/medicationrequest.html) The MedicationRequest resource is used to record and share orders for medication for a patient. It includes details about the prescribed medication, the insurant to whom it's prescribed, the prescribing healthcare provider, and instructions for use. ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication-request|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication-request|1.0.3) *** #### [MedicationDispense](https://hl7.org/fhir/R4/medicationdispense.html) The MedicationDispense resource is used to record the dispensing of medication to a patient. This includes information about the dispensed medication, the insurant receiving the medication, the healthcare professional who dispensed it, and details about the quantity and timing of the dispensation. ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication-dispense|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/emap-medication-dispense|1.0.3) *** #### [Organization](https://hl7.org/fhir/R4/organization.html) The Organization Resource is designed to represent information about organizations, primarily in the context of healthcare. It typically includes details like the organization's name, type and contact. The Medication Service utilizes the [VZD-FHIR-Directory](https://gematik.de/fhir/directory/StructureDefinition/OrganizationDirectory|0.11.12) Organization Profile. ##### Profile: [https://gematik.de/fhir/directory/StructureDefinition/OrganizationDirectory|0.11.12](https://gematik.de/fhir/directory/StructureDefinition/OrganizationDirectory|0.11.12) ##### Examples: - [https://simplifier.net/VZD-FHIR-Directory/OrganizationExample001/~json](https://simplifier.net/VZD-FHIR-Directory/OrganizationExample001/~json) - [https://simplifier.net/VZD-FHIR-Directory/OrganizationExample/~json](https://simplifier.net/VZD-FHIR-Directory/OrganizationExample/~json) *** #### [Practitioner](https://hl7.org/fhir/R4/practitioner.html) The Practitioner resource is used to represent individuals who are directly or indirectly involved in the delivery of healthcare services. This includes information about their identity, qualifications, and specific roles or functions within the healthcare system, such as doctors or pharmacists. The Medication Service utilizes the [VZD-FHIR-Directory](https://gematik.de/fhir/directory/StructureDefinition/PractitionerDirectory|0.11.12) Practitioner Profile. ##### Profile: [https://gematik.de/fhir/directory/StructureDefinition/PractitionerDirectory|0.11.12](https://gematik.de/fhir/directory/StructureDefinition/PractitionerDirectory|0.11.12) ##### Example: - [https://simplifier.net/VZD-FHIR-Directory/TIPractitionerExample001/~json](https://simplifier.net/VZD-FHIR-Directory/TIPractitionerExample001/~json) *** #### [PractitionerRole](https://hl7.org/fhir/R4/practitionerrole.html) The PractitionerRole resource represents specific roles, positions, or jobs that a healthcare practitioner may hold in a healthcare organization. *** ### **Pagination** The Medication Service supplies the client with page navigation information in its response. ##### **URL parameter**: To implement the pagination function, the URL parameters ***_count*** and ***_offset*** are used. ***_count*** determines the number of entries per page, while ***_offset*** indicates the starting element of the page. Additionally, ***_total*** is a parameter that decides if the total number of entries should be included in the response. | URL parameter | Description | Default | |---------------|-------------|---------| | _count | The client can specify the maximum number of elements to be included on one "page" of the response. This means the Medication Service limits the result set to this maximum specified number. | 25 | | _offset | This parameter indicates the (zero-based) offset of the first returned element in the collection. | 0 | | _total | This parameter controls whether and how the AuditEvent Service returns the total number of search results. The following values can be set: none, estimate, accurate | | Values for ***_total***: - **none** (default): The total number of search hits is not displayed. - **estimate**: The approximate total number of search hits is displayed. - **accurate**: The exact total number of search hits is displayed. **Example**: Request for 10 elements of resource type Medication, starting with element 20 of the list: ``` GET [BASE]/epa/medication/api/v1/fhir/Medication?_count=10&_offset=20 ``` *** **Example**: Request for the first 5 elements: ``` GET [BASE]/epa/medication/api/v1/fhir/Medication?_count=5 ``` *** **Example**: Requesting only the total count of entries: ``` GET [BASE]/epa/medication/api/v1/fhir/Medication?_count=0&_total=accurate ``` *** ##### **Links for page navigation** In a FHIR searchset bundle, the links attribute contains an array of link elements, each serving a specific navigational purpose within the bundle. In a FHIR searchset bundle, the links attribute contains an array of link elements, each serving a specific navigational purpose within the bundle. The following relations are provided according to [Link Relation Types](https://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1). These include: - **self**: A link to the current page of results, representing the query that generated these results. - **first**: Directs to the first page of search results, allowing quick navigation to the start of a result set. **[optional]** - **last**: Takes the user to the last page of results, useful for moving to the end of a large dataset. **[optional]** - **next**: Used for moving forward to the next page of results, following the set pagination. - **previous**: Allows going back to the previous set of results, facilitating backward navigation through pages. Each link comes with a URL to fetch the corresponding set of results, dynamically generated based on the search query and pagination parameters like **_count** and **_offset**. These links simplify client navigation through large data sets by eliminating the need for manual adjustment of query parameters. In addition to standard pagination parameters such as ``_count`` and ``_offset``, each link may also contain other parameters that facilitate pagination within the Medication Service. One example is the parameter ``stateid``, which represents the current state of the result list. This enables the Medication Service to efficiently manage navigation through the results by preserving the context or state of the search. This is particularly useful when ePA clients navigate through large or complexly structured result sets. ###### **Example**: ``` { "resourceType": "Bundle", "type": "searchset", "total": 100, "link": [ { "relation": "self", "url": "/epa/medication/api/v1/fhir/Medication?_count=10&_offset=20" }, { "relation": "first", "url": "/epa/medication/api/v1/fhir/Medication?_count=10&_offset=0" }, { "relation": "previous", "url": "/epa/medication/api/v1/fhir/Medication?_count=10&_offset=10" }, { "relation": "next", "url": "/epa/medication/api/v1/fhir/Medication?_count=10&_offset=30" }, { "relation": "last", "url": "/epa/medication/api/v1/fhir/Medication?_count=10&_offset=90" } ], "entry": [ { "fullUrl": "http://epa4all/epa/medication/api/v1/fhir/Medication/5abff610-a1ad-450d-aa63-a60622b1052e", "resource": { "resourceType": "Medication", "id": "5abff610-a1ad-450d-aa63-a60622b1052e", // Details of the Medication resource } }, // More Medication entries ] } ``` ### **Search** The FHIR interface of the Medication Service supports standard FHIR search operations in line with the guidelines set out in the FHIR R4 documentation ([FHIR R4 Search](https://hl7.org/fhir/R4/search.html)). When a search is conducted, it returns a Searchset Bundle, specifically configured for resources such as Medication, MedicationRequest, MedicationDispense, Organization, and Practitioner. This allows for structured and efficient access to relevant health data and ensures compliance with FHIR standards, ensuring optimal compatibility and interoperability across various health systems. #### fullUrl in FHIR Bundle In every FHIR Bundle, the fullUrl field within each *Entry* ([Bundle.entry.fullUrl](https://www.hl7.org/fhir/r4/bundle-definitions.html#Bundle.entry.fullUrl)) MUST be specified as either an absolute URL server address or a UUID-based URI (urn), as defined in the standard HL7 FHIR specification. Relative paths are NOT permitted in the fullUrl field. An absolute URL server address MUST follow the format `[base]/[ResourceType]/[ResourceId]`. The host for the absolute URL for Bundle.entry.fullUrl field MUST be `epa4all`, for example: `http://epa4all/epa/medication/api/v1/fhir/MedicationRequest/14d77cf8-d275-455b-9fb2-b96cbfcc2cad` A UUID-based URI MUST follow the format urn:uuid:[UUID], for example: `urn:uuid:14d77cf8-d275-455b-9fb2-b96cbfcc2cad` If a UUID-based URI (urn:uuid) is used in Bundle.entry.fullUrl, then all references within the same bundle to that resource MUST also be in the form urn:uuid:[UUID]. There MUST NOT be any mixing of absolute URLs, UUID-based URIs, and relative references within a single bundle. Relative paths such as Literal referencees like `[ResourceType]/[ResourceId]` (e.g., `MedicationRequest/14d77cf8-d275-455b-9fb2-b96cbfcc2cad`) MUST NOT be used in the fullUrl field. All references to resources within the record system MUST be either absolute URLs or UUID-based URIs to ensure that resources are uniquely and consistently referenced. For paginated FHIR bundles, the Bundle.link.url field MAY use relative URLs that refer to the base URL, for example: `/epa/medication/api/v1/fhir/MedicationRequest?_offset=20&_count=10` #### Standard Search parameters for all resources ***_id***: Refers to the logical id of the resource ###### Example ``GET [base]/epa/medication/api/v1/fhir/MedicationRequest?_id=ea01ccbc-aa5d-4c34-8292-d95678d52c98`` *** ***_lastUpdated***: Can be used to select resources based on the last time they were changed ###### Example ``GET [base]/epa/medication/api/v1/fhir/MedicationRequest?_lastUpdated=2025-15-01`` *** #### Including other resources in result ##### *_include*: In FHIR, the *_include* search parameter is used to request that the server return not only the requested resources, but also other resources that are related to them through a specified reference. This parameter is particularly useful for retrieving linked resources in a single query, thereby reducing the need for subsequent requests. For instance, if you query for **MedicationRequest** with an *_include* parameter like **MedicationRequest:medication**, the server will return the requested **MedicationRequest** resources along with the **Medication** resources that are referred to in these MedicationRequest resources. This means you'll get a list of medication requests and, for each request, the specific medication that is being requested. This integrated query approach enhances the comprehensiveness of the search, providing a more connected view of the medication and its associated requests. ###### Example: ``` GET [base]/epa/medication/api/v1/fhir/MedicationRequest?_include=MedicationRequest:medication ``` In this query: 1. ``MedicationRequest`` is the resource type being queried. 2. ``_include=MedicationRequest:medication`` instructs the server to include the **Medication** resources that are referred to in the **MedicationRequest** resources. *** This query returns a bundle containing all **MedicationRequest** resources available in the server's database, along with the **Medication** resources linked to these requests. Note that this could potentially return a large amount of data, depending on how many **MedicationRequest** records are stored on the server. *** ##### *_revinclude*: In FHIR, **_revinclude** is a search parameter that allows you to include resources that refer to the primary resources being retrieved in a search query. This feature is particularly useful for fetching related resources in a single query, thereby reducing the need for multiple separate requests. When you use **_revinclude**, you're essentially asking the FHIR server to return not only the primary resources that match your search criteria but also any other resources that have a reference to these primary resources. ###### Example: ``` GET [base]/epa/medication/api/v1/fhir/MedicationRequest?_revinclude=MedicationDispense:prescription ``` In this query: 1. ``MedicationRequest`` is the FHIR resource type being queried. 2. ``_revinclude=MedicationDispense:prescription`` instructs the server to include MedicationDispense resources that have a *authorizingPrescription* reference pointing back to the *MedicationRequest* resources. *** This query will return a bundle containing *MedicationRequest* resources along with the *MedicationDispense* resources that were authorized by these specific requests. It allows for a comprehensive view of the medication request and its subsequent dispensation. #### Comparators and Precision for Numbers, Dates, and Quantities In a search involving numerical or date parameters, the values used depend on the precision of the provided parameter. For example, for the date 2023-11-11, the range extends from 2023-11-11, at 00:00:00 (inclusive) to 2023-11-12, at 00:00:00 (exclusive). ##### Prefix [FHIR R4 Search Prefix](https://hl7.org/fhir/R4/search.html#prefix) In FHIR, all clinically relevant floating point numbers are represented by types such as [decimal](https://hl7.org/fhir/R4/datatypes.html#decimal) and [quantity](https://hl7.org/fhir/R4/datatypes.html#Quantity), which capture the precision of the stored value. However, this excludes some fields that use simple integers. Search operations in these fields result in exact numerical matches. In numerical ([number](https://hl7.org/fhir/R4/search.html#number), [quantity](https://hl7.org/fhir/R4/search.html#quantity)) comparisons with a singular value, specific prefixes are applicable. When a prefix is not provided, ``eq`` is used as the default. | Prefixes | Description | |----------|-------------| | ``eq`` | The value of the parameter in the resource is equal to the value that has been provided. | | ``ne`` | The value of the parameter in the resource is not equal to the value that has been provided. | | ``gt`` | The value for the parameter in the resource is greater than the value provided | | ``lt`` | The value for the parameter in the resource is less than the value that has been provided | | ``ge`` | The value for the parameter in the resource is greater or equal than the value provided | | ``le`` | The value for the parameter in the resource is greater or less than the value provided | Date values have a range based on their precision (year, month, day). For types like [Range](https://hl7.org/fhir/R4/datatypes.html#Range) or [Period](https://hl7.org/fhir/R4/datatypes.html#Period), clear upper and lower limits are defined. There are specific prefixes for comparisons in these cases. If no prefix is specified, ``eq`` is the default choice. | Prefixes | Description | |----------|-------------| | ``eq`` | The range of the search value fully contains the range of the target value | | ``ne`` | The range of the search value does not fully contain the range of the target value | | ``gt`` | The range above the search value overlaps with the target value's range | | ``lt`` | The range below the search value overlaps with the target value's range | | ``ge`` | The range above the search value either overlaps over or completely includes the range of the target value | | ``le`` | The range below the search value either overlaps over or completely includes the range of the target value | | ``sa`` | The parameter value range starts after the target range | | ``eb`` | The parameter value range ends before the target range | ###### Examples: *All MedicationRequests updated before January 15, 2025.* ``` GET [base]/epa/medication/api/v1/fhir/MedicationRequest?_lastUpdated=lt2025-15-01 ``` *All MedicationDispense that have been dispensed after January 15, 2025.* ``` GET [base]/epa/medication/api/v1/fhir/MedicationDispense?whenhandedover=gt2025-15-01 ``` - name: Operations description: | ### **FHIR Prescription and Dispensation Operations** FHIR Operations are specific functions within the FHIR specification, a standard for exchanging healthcare information. These operations enable specific actions to be performed with FHIR resources, such as creating, reading and updating health data. In addition, FHIR Operations can support complex queries, calculations, or specific business logic that go beyond the basic CRUD (Create, Read, Update, Delete) operations. The Medication Service of the ePA provides the following four operations for the E-Rezept-Fachdienst: **$provide-prescription-erp**, **$provide-dispensation-erp**, **$cancel-prescription-erp** and **$cancel-dispensation-erp**. paths: /epa/medication/api/v1/fhir/Medication: get: tags: - Resources operationId: listMedications_MedicationSvc description: | #### **Allowed user groups [professionOID]** * oid_versicherter * oid_praxis_arzt * oid_krankenhaus * oid_institution-vorsorge-reha * oid_zahnarztpraxis * oid_praxis_psychotherapeut * oid_institution-oegd * oid_öffentliche_apotheke * oid_institution-pflege * oid_institution-geburtshilfe * oid_praxis-physiotherapeut * oid_institution-arbeitsmedizin *** #### **Medication-Specific Search Parameters** | Name | Type | Description | Expression | |------|------|-------------|------------| | identifier | [token](https://hl7.org/fhir/R4/search.html#token) | Return medications with this external identifier | Medication.identifier | | code | [token](https://hl7.org/fhir/R4/search.html#token) | Returns medications for a specific code | Medication.code | | status | [token](https://hl7.org/fhir/R4/search.html#token) | Returns medications for this status | Medication.status | *** #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 ||| | If the insurant objects to the medication process in the ePA system, the Medication Service gets locked. | 423 | locked || | Unknown search parameter | 400 | | OperationOutcome | | Invalid query parameter(s) | 400 | | OperationOutcome | | Invalid request | 400 | | OperationOutcome | | Requestor role is not in the list of allowed user groups | 403 | invalidOid || | Unknown resource type | 404 | | OperationOutcome | | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3) parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' - $ref: '#/components/parameters/_count' - $ref: '#/components/parameters/_offset' - $ref: '#/components/parameters/_total' - $ref: '#/components/parameters/_id' - $ref: '#/components/parameters/_lastUpdated' - $ref: '#/components/parameters/identifier' - $ref: '#/components/parameters/_include' - $ref: '#/components/parameters/_revinclude' - name: code in: query required: false description: Returns medications for a specific code schema: type: string - name: status in: query required: false description: Returns medications for this status schema: type: string responses: '200': description: A list of resources content: application/fhir+json: schema: $ref: '#/components/schemas/MedicationList' '400': $ref: '#/components/responses/OperationOutcome400BadRequest' '403': $ref: '#/components/responses/Error403Forbidden' '404': $ref: '#/components/responses/OperationOutcome404NotFound' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' /epa/medication/api/v1/fhir/Medication/{id}: get: summary: Get a Medication by its ID operationId: getMedicationById_MedicationSvc description: | #### **Allowed user groups [professionOID]** * oid_versicherter * oid_praxis_arzt * oid_krankenhaus * oid_institution-vorsorge-reha * oid_zahnarztpraxis * oid_praxis_psychotherapeut * oid_institution-oegd * oid_öffentliche_apotheke * oid_institution-pflege * oid_institution-geburtshilfe * oid_praxis-physiotherapeut * oid_institution-arbeitsmedizin *** #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 ||| | If the insurant objects to the medication process in the ePA system, the Medication Service gets locked. | 423 | locked || | Unknown search parameter | 400 | | OperationOutcome | | Invalid query parameter(s) | 400 | | OperationOutcome | | Invalid request | 400 | | OperationOutcome | | Requestor role is not in the list of allowed user groups | 403 | invalidOid || | Resource is not known | 404 | | OperationOutcome | | Unknown resource type | 404 | | OperationOutcome | | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.0](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.0) tags: - Resources parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' - $ref: '#/components/parameters/resourceid' responses: '200': description: A resource content: application/fhir+json: schema: $ref: '#/components/schemas/Medication' '400': $ref: '#/components/responses/OperationOutcome400BadRequest' '403': $ref: '#/components/responses/Error403Forbidden' '404': $ref: '#/components/responses/OperationOutcome404NotFound' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' /epa/medication/api/v1/fhir/MedicationRequest: get: tags: - Resources operationId: listMedicationRequests_MedicationSvc description: | #### **Allowed user groups [professionOID]** * oid_versicherter * oid_praxis_arzt * oid_krankenhaus * oid_institution-vorsorge-reha * oid_zahnarztpraxis * oid_praxis_psychotherapeut * oid_institution-oegd * oid_öffentliche_apotheke * oid_institution-pflege * oid_institution-geburtshilfe * oid_praxis-physiotherapeut * oid_institution-arbeitsmedizin *** #### **MedicationRequest-Specific Search Parameters** | Name | Type | Description | Expression | |------|------|-------------|------------| | identifier | [token](https://hl7.org/fhir/R4/search.html#token) | Return medication requests with this external identifier | MedicationRequest.identifier | | authoredon | [date](https://hl7.org/fhir/R4/search.html#date) | Return prescriptions written on this date | MedicationRequest.authoredOn | | status | [token](https://hl7.org/fhir/R4/search.html#token) | Returns medication requests for this status | MedicationRequest.status | | requester | [reference](https://hl7.org/fhir/R4/search.html#reference) | Returns prescriptions prescribed by this prescriber | MedicationRequest.requester (PractitionerRole) | | medication | [reference](https://hl7.org/fhir/R4/search.html#reference) | Return prescriptions for this medication reference | MedicationRequest.medication as Reference | *** #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 ||| | If the insurant objects to the medication process in the ePA system, the Medication Service gets locked. | 423 | locked || | Unknown search parameter | 400 | | OperationOutcome | | Invalid query parameter(s) | 400 | | OperationOutcome | | Invalid request | 400 | | OperationOutcome | | Requestor role is not in the list of allowed user groups | 403 | invalidOid || | Unknown resource type | 404 | | OperationOutcome | | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3) parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' - $ref: '#/components/parameters/_count' - $ref: '#/components/parameters/_offset' - $ref: '#/components/parameters/_total' - $ref: '#/components/parameters/_id' - $ref: '#/components/parameters/_lastUpdated' - $ref: '#/components/parameters/identifier' - $ref: '#/components/parameters/_include' - $ref: '#/components/parameters/_revinclude' - name: authoredon in: query required: false description: Return prescriptions written on this date schema: type: string format: date-time - name: status in: query required: false description: Returns medications for a specific code schema: type: string - name: requester in: query required: false description: Returns prescriptions prescribed by this prescriber schema: type: string - name: medication in: query required: false description: Return prescriptions for this medication reference schema: type: string responses: '200': description: A list of resources content: application/fhir+json: schema: $ref: '#/components/schemas/MedicationRequestList' '400': $ref: '#/components/responses/OperationOutcome400BadRequest' '403': $ref: '#/components/responses/Error403Forbidden' '404': $ref: '#/components/responses/OperationOutcome404NotFound' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' /epa/medication/api/v1/fhir/MedicationRequest/{id}: get: summary: Get a MedicationRequest by its ID operationId: getMedicationRequestById_MedicationSvc description: | #### **Allowed user groups [professionOID]** * oid_versicherter * oid_praxis_arzt * oid_krankenhaus * oid_institution-vorsorge-reha * oid_zahnarztpraxis * oid_praxis_psychotherapeut * oid_institution-oegd * oid_öffentliche_apotheke * oid_institution-pflege * oid_institution-geburtshilfe * oid_praxis-physiotherapeut * oid_institution-arbeitsmedizin *** #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 ||| | If the insurant objects to the medication process in the ePA system, the Medication Service gets locked. | 423 | locked || | Unknown search parameter | 400 | | OperationOutcome | | Invalid query parameter(s) | 400 | | OperationOutcome | | Invalid request | 400 | | OperationOutcome | | Requestor role is not in the list of allowed user groups | 403 | invalidOid || | Resource is not known | 404 | | OperationOutcome | | Unknown resource type | 404 | | OperationOutcome | | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3) tags: - Resources parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' - $ref: '#/components/parameters/resourceid' responses: '200': description: A Medication resource content: application/fhir+json: schema: $ref: '#/components/schemas/MedicationRequest' '400': $ref: '#/components/responses/OperationOutcome400BadRequest' '403': $ref: '#/components/responses/Error403Forbidden' '404': $ref: '#/components/responses/OperationOutcome404NotFound' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' /epa/medication/api/v1/fhir/MedicationDispense: get: tags: - Resources operationId: listMedicationDispenses_MedicationSvc description: | #### **Allowed user groups [professionOID]** * oid_versicherter * oid_praxis_arzt * oid_krankenhaus * oid_institution-vorsorge-reha * oid_zahnarztpraxis * oid_praxis_psychotherapeut * oid_institution-oegd * oid_öffentliche_apotheke * oid_institution-pflege * oid_institution-geburtshilfe * oid_praxis-physiotherapeut * oid_institution-arbeitsmedizin *** #### **MedicationDispense-Specific Search Parameters** | Name | Type | Description | Expression | |------|------|-------------|------------| | identifier | [token](https://hl7.org/fhir/R4/search.html#token) | Return medication dispenses with this external identifier | MedicationDispense.identifier | | whenhandedover | [date](https://hl7.org/fhir/R4/search.html#date) | Returns dispenses handed over on this date | MedicationDispense.whenHandedOver | | prescription | [reference](https://hl7.org/fhir/R4/search.html#reference) | The identity of a prescription to list dispenses from |MedicationDispense.authorizingPrescription (MedicationRequest) | | performer | [reference](https://hl7.org/fhir/R4/search.html#reference) | Returns dispenses performed by a specific individual | MedicationDispense.performer.actor (PractitionerRole) | | status | [token](https://hl7.org/fhir/R4/search.html#token) | Returns dispenses with a specified dispense status | MedicationDispense.status | | medication | [reference](https://hl7.org/fhir/R4/search.html#reference) | Returns dispenses of this medicine resource | MedicationDispense.medication as Reference | *** #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 ||| | If the insurant objects to the medication process in the ePA system, the Medication Service gets locked. | 423 | locked || | Unknown search parameter | 400 | | OperationOutcome | | Invalid query parameter(s) | 400 | | OperationOutcome | | Invalid request | 400 | | OperationOutcome | | Requestor role is not in the list of allowed user groups | 403 | invalidOid || | Unknown resource type | 404 | | OperationOutcome | | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3) parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' - $ref: '#/components/parameters/_count' - $ref: '#/components/parameters/_offset' - $ref: '#/components/parameters/_total' - $ref: '#/components/parameters/_id' - $ref: '#/components/parameters/_lastUpdated' - $ref: '#/components/parameters/identifier' - $ref: '#/components/parameters/_include' - $ref: '#/components/parameters/_revinclude' - name: whenhandedover in: query required: false description: Returns dispenses handed over on this date schema: type: string format: date-time - name: prescription in: query required: false description: The identity of a prescription to list dispenses from schema: type: string - name: performer in: query required: false description: Returns dispenses performed by a specific individual schema: type: string - name: status in: query required: false description: Returns dispenses with a specified dispense status schema: type: string - name: medication in: query required: false description: Returns dispenses of this medicine resource schema: type: string responses: '200': description: A list of resources content: application/fhir+json: schema: $ref: '#/components/schemas/MedicationDispenseList' '400': $ref: '#/components/responses/OperationOutcome400BadRequest' '403': $ref: '#/components/responses/Error403Forbidden' '404': $ref: '#/components/responses/OperationOutcome404NotFound' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' /epa/medication/api/v1/fhir/MedicationDispense/{id}: get: summary: Get a MedicationDispense by its ID operationId: getMedicationDispenseById_MedicationSvc description: | #### **Allowed user groups [professionOID]** * oid_versicherter * oid_praxis_arzt * oid_krankenhaus * oid_institution-vorsorge-reha * oid_zahnarztpraxis * oid_praxis_psychotherapeut * oid_institution-oegd * oid_öffentliche_apotheke * oid_institution-pflege * oid_institution-geburtshilfe * oid_praxis-physiotherapeut * oid_institution-arbeitsmedizin *** #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 ||| | If the insurant objects to the medication process in the ePA system, the Medication Service gets locked. | 423 | locked || | Unknown search parameter | 400 | | OperationOutcome | | Invalid query parameter(s) | 400 | | OperationOutcome | | Invalid request | 400 | | OperationOutcome | | Requestor role is not in the list of allowed user groups | 403 | invalidOid || | Resource is not known | 404 | | OperationOutcome | | Unknown resource type | 404 | | OperationOutcome | | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3) tags: - Resources parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' - $ref: '#/components/parameters/resourceid' responses: '200': description: A resource content: application/fhir+json: schema: $ref: '#/components/schemas/MedicationDispense' '400': $ref: '#/components/responses/OperationOutcome400BadRequest' '403': $ref: '#/components/responses/Error403Forbidden' '404': $ref: '#/components/responses/OperationOutcome404NotFound' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' /epa/medication/api/v1/fhir/Organization: get: tags: - Resources operationId: listOrganizations_MedicationSvc description: | #### **Allowed user groups [professionOID]** * oid_versicherter * oid_praxis_arzt * oid_krankenhaus * oid_institution-vorsorge-reha * oid_zahnarztpraxis * oid_praxis_psychotherapeut * oid_institution-oegd * oid_öffentliche_apotheke * oid_institution-pflege * oid_institution-geburtshilfe * oid_praxis-physiotherapeut * oid_institution-arbeitsmedizin *** #### **Organization-Specific Search Parameters** | Name | Type | Description | Expression | |------|------|-------------|------------| | identifier | [token](https://hl7.org/fhir/R4/search.html#token) | Return organizations with this external identifier | Organization.identifier | | name | [string](https://hl7.org/fhir/R4/search.html#string) | Organization's name or alias | Organization.name or Organization.alias | *** #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 ||| | If the insurant objects to the medication process in the ePA system, the Medication Service gets locked. | 423 | locked || | Unknown search parameter | 400 | | OperationOutcome | | Invalid query parameter(s) | 400 | | OperationOutcome | | Invalid request | 400 | | OperationOutcome | | Requestor role is not in the list of allowed user groups | 403 | invalidOid || | Unknown resource type | 404 | | OperationOutcome | | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3) parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' - $ref: '#/components/parameters/_count' - $ref: '#/components/parameters/_offset' - $ref: '#/components/parameters/_total' - $ref: '#/components/parameters/_id' - $ref: '#/components/parameters/_lastUpdated' - $ref: '#/components/parameters/identifier' - $ref: '#/components/parameters/_include' - $ref: '#/components/parameters/_revinclude' - name: name in: query description: Organization's name or alias. required: false schema: type: string responses: '200': description: A list of resources content: application/fhir+json: schema: $ref: '#/components/schemas/OrganizationList' '400': $ref: '#/components/responses/OperationOutcome400BadRequest' '403': $ref: '#/components/responses/Error403Forbidden' '404': $ref: '#/components/responses/OperationOutcome404NotFound' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' /epa/medication/api/v1/fhir/Organization/{id}: get: summary: Get a Organization by its ID operationId: getOrganizationByIdInMedicationSvc description: | #### **Allowed user groups [professionOID]** * oid_versicherter * oid_praxis_arzt * oid_krankenhaus * oid_institution-vorsorge-reha * oid_zahnarztpraxis * oid_praxis_psychotherapeut * oid_institution-oegd * oid_öffentliche_apotheke * oid_institution-pflege * oid_institution-geburtshilfe * oid_praxis-physiotherapeut * oid_institution-arbeitsmedizin *** #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 ||| | If the insurant objects to the medication process in the ePA system, the Medication Service gets locked. | 423 | locked || | Unknown search parameter | 400 | | OperationOutcome | | Invalid request | 400 | | OperationOutcome | | Requestor role is not in the list of allowed user groups | 403 | invalidOid || | Resource is not known | 404 | | OperationOutcome | | Unknown resource type | 404 | | OperationOutcome | | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3) tags: - Resources parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' - $ref: '#/components/parameters/resourceid' responses: '200': description: A resource content: application/fhir+json: schema: $ref: '#/components/schemas/Organization' '400': $ref: '#/components/responses/OperationOutcome400BadRequest' '403': $ref: '#/components/responses/Error403Forbidden' '404': $ref: '#/components/responses/OperationOutcome404NotFound' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' /epa/medication/api/v1/fhir/Practitioner: get: tags: - Resources operationId: listPractitioners_MedicationSvc description: | #### **Allowed user groups [professionOID]** * oid_versicherter * oid_praxis_arzt * oid_krankenhaus * oid_institution-vorsorge-reha * oid_zahnarztpraxis * oid_praxis_psychotherapeut * oid_institution-oegd * oid_öffentliche_apotheke * oid_institution-pflege * oid_institution-geburtshilfe * oid_praxis-physiotherapeut * oid_institution-arbeitsmedizin *** #### **Practitioner-Specific Search Parameters** | Name | Type | Description | Expression | |------|------|-------------|------------| | identifier | [token](https://hl7.org/fhir/R4/search.html#token) | Return practitioners with this external identifier | Practitioner.identifier | | name | [string](https://hl7.org/fhir/R4/search.html#string) | A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text | Practitioner.name | *** #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 ||| | If the insurant objects to the medication process in the ePA system, the Medication Service gets locked. | 423 | locked || | Unknown search parameter | 400 | | OperationOutcome | | Invalid query parameter(s) | 400 | | OperationOutcome | | Invalid request | 400 | | OperationOutcome | | Requestor role is not in the list of allowed user groups | 403 | invalidOid || | Unknown resource type | 404 | | OperationOutcome | | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3) parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' - $ref: '#/components/parameters/_count' - $ref: '#/components/parameters/_offset' - $ref: '#/components/parameters/_total' - $ref: '#/components/parameters/_id' - $ref: '#/components/parameters/_lastUpdated' - $ref: '#/components/parameters/identifier' - $ref: '#/components/parameters/_include' - $ref: '#/components/parameters/_revinclude' - name: name in: query description: A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text required: false schema: type: string responses: '200': description: A list of resources content: application/fhir+json: schema: $ref: '#/components/schemas/PractitionerList' '400': $ref: '#/components/responses/OperationOutcome400BadRequest' '403': $ref: '#/components/responses/Error403Forbidden' '404': $ref: '#/components/responses/OperationOutcome404NotFound' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' /epa/medication/api/v1/fhir/Practitioner/{id}: get: summary: Get a Practitioner by its ID operationId: getPractitionerById_MedicationSvc description: | #### **Allowed user groups [professionOID]** * oid_versicherter * oid_praxis_arzt * oid_krankenhaus * oid_institution-vorsorge-reha * oid_zahnarztpraxis * oid_praxis_psychotherapeut * oid_institution-oegd * oid_öffentliche_apotheke * oid_institution-pflege * oid_institution-geburtshilfe * oid_praxis-physiotherapeut * oid_institution-arbeitsmedizin *** #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 ||| | If the insurant objects to the medication process in the ePA system, the Medication Service gets locked. | 423 | locked || | Unknown search parameter | 400 | | OperationOutcome | | Invalid query parameter(s) | 400 | | OperationOutcome | | Invalid request | 400 | | OperationOutcome | | Requestor role is not in the list of allowed user groups | 403 | invalidOid || | Resource is not known | 404 | | OperationOutcome | | Unknown resource type | 404 | | OperationOutcome | | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3) tags: - Resources parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' - $ref: '#/components/parameters/resourceid' responses: '200': description: A resource content: application/fhir+json: schema: $ref: '#/components/schemas/Practitioner' '400': $ref: '#/components/responses/OperationOutcome400BadRequest' '403': $ref: '#/components/responses/Error403Forbidden' '404': $ref: '#/components/responses/OperationOutcome404NotFound' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' /epa/medication/api/v1/fhir/PractitionerRole: get: tags: - Resources operationId: listPractitionerRoles_MedicationSvc description: | #### **Allowed user groups [professionOID]** * oid_versicherter * oid_praxis_arzt * oid_krankenhaus * oid_institution-vorsorge-reha * oid_zahnarztpraxis * oid_praxis_psychotherapeut * oid_institution-oegd * oid_öffentliche_apotheke * oid_institution-pflege * oid_institution-geburtshilfe * oid_praxis-physiotherapeut * oid_institution-arbeitsmedizin *** #### **PractitionerRole-Specific Search Parameters** | Name | Type | Description | Expression | |------|------|-------------|------------| | identifier | [token](https://hl7.org/fhir/R4/search.html#token) | Return the practitioner roles with this external identifier | PractitionerRole.identifier | | organization | [reference](https://hl7.org/fhir/R4/search.html#reference) | The identity of the organization the practitioner represents | PractitionerRole.organization | | practitioner | [reference](https://hl7.org/fhir/R4/search.html#reference) | Practitioner that is able to provide the defined services for the organization | PractitionerRole.practitioner | *** #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 ||| | If the insurant objects to the medication process in the ePA system, the Medication Service gets locked. | 423 | locked || | Unknown search parameter | 400 | | OperationOutcome | | Invalid query parameter(s) | 400 | | OperationOutcome | | Invalid request | 400 | | OperationOutcome | | Requestor role is not in the list of allowed user groups | 403 | invalidOid || | Unknown resource type | 404 | | OperationOutcome | | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3) parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' - $ref: '#/components/parameters/_count' - $ref: '#/components/parameters/_offset' - $ref: '#/components/parameters/_total' - $ref: '#/components/parameters/_id' - $ref: '#/components/parameters/_lastUpdated' - $ref: '#/components/parameters/identifier' - $ref: '#/components/parameters/_include' - $ref: '#/components/parameters/_revinclude' - name: organization in: query description: The identity of the organization the practitioner represents required: false schema: type: string - name: practitioner in: query description: Practitioner that is able to provide the defined services for the organization required: false schema: type: string responses: '200': description: A list of resources content: application/fhir+json: schema: $ref: '#/components/schemas/PractitionerRoleList' '400': $ref: '#/components/responses/OperationOutcome400BadRequest' '403': $ref: '#/components/responses/Error403Forbidden' '404': $ref: '#/components/responses/OperationOutcome404NotFound' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' /epa/medication/api/v1/fhir/PractitionerRole/{id}: get: summary: Get a PractitionerRole by its ID operationId: getPractitionerRoleById_MedicationSvc description: | #### **Allowed user groups [professionOID]** * oid_versicherter * oid_praxis_arzt * oid_krankenhaus * oid_institution-vorsorge-reha * oid_zahnarztpraxis * oid_praxis_psychotherapeut * oid_institution-oegd * oid_öffentliche_apotheke * oid_institution-pflege * oid_institution-geburtshilfe * oid_praxis-physiotherapeut * oid_institution-arbeitsmedizin *** #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 ||| | If the insurant objects to the medication process in the ePA system, the Medication Service gets locked. | 423 | locked || | Unknown search parameter | 400 | | OperationOutcome | | Invalid query parameter(s) | 400 | | OperationOutcome | | Invalid request | 400 | | OperationOutcome | | Requestor role is not in the list of allowed user groups | 403 | invalidOid || | Resource is not known | 404 | | OperationOutcome | | Unknown resource type | 404 | | OperationOutcome | | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3) tags: - Resources parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' - $ref: '#/components/parameters/resourceid' responses: '200': description: A resource content: application/fhir+json: schema: $ref: '#/components/schemas/PractitionerRole' '400': $ref: '#/components/responses/OperationOutcome400BadRequest' '403': $ref: '#/components/responses/Error403Forbidden' '404': $ref: '#/components/responses/OperationOutcome404NotFound' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' /epa/medication/api/v1/fhir/$provide-prescription-erp: post: operationId: operation:providePrescription_MedicationSvc summary: "" description: | The **$provide-prescription-erp** operation in the ePA MedicationService is used to add electronic prescriptions to a patient's record. These prescriptions are already made by the E-Rezept-Fachdienst. This operation does not create new patient prescriptions; it just puts the ones made by the E-Rezept-Fachdienst into the patient's ePA, making sure they are stored safely and can be easily accessed. #### **OperationDefinition** [https://gematik.de/fhir/epa-medication/OperationDefinition/provide-prescription-erp-OP|1.0.3](https://gematik.de/fhir/epa-medication/OperationDefinition/provide-prescription-erp-OP|1.0.3) #### **Allowed user groups [professionOID]** * oid_erp-vau #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 || OperationOutcome | | An Operation Error | 400 | | OperationOutcome | | If the insurant objects to the submission of prescription and dispensation data into the ePA system, the Medication Service rejects the submission. | 403 | Forbidden || | Requestor role is not in the list of allowed user groups | 403 | invalidOid || | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3) tags: - Operations parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' requestBody: required: true content: application/fhir+json: schema: $ref: '#/components/schemas/EPAOpProvidePrescriptionERPInputParameters' responses: '200': description: EPAOpRxPrescriptionERPOutputParameters content: application/fhir+json: schema: $ref: '#/components/schemas/EPAOpRxPrescriptionERPOutputParameters' '400': $ref: '#/components/responses/OperationOutcome400OperationsError' '403': $ref: '#/components/responses/Error403Forbidden' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' /epa/medication/api/v1/fhir/$provide-dispensation-erp: post: operationId: operation:provideDispensation_MedicationSvc summary: "" description: | The **$provide-dispensation-erp** operation in the ePA Medication Service is used to record information about the dispensing of medications based on an electronic prescription in the patient's record. This operation comes into play when a patient receives their medication from a pharmacy. It documents that the medication has been dispensed as per the prescription, including details like the quantity, date of dispensing, and pharmacy information. This helps maintaining a comprehensive overview of the patient's medication history. #### **OperationDefinition** [https://gematik.de/fhir/epa-medication/OperationDefinition/provide-dispensation-erp-OP|1.0.3](https://gematik.de/fhir/epa-medication/OperationDefinition/provide-dispensation-erp-OP|1.0.3) #### **Allowed user groups [professionOID]** * oid_erp-vau #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 || OperationOutcome | | An Operation Error | 400 | | OperationOutcome | | If the insurant objects to the submission of prescription and dispensation data into the ePA system, the Medication Service rejects the submission. | 403 | Forbidden || | Requestor role is not in the list of allowed user groups | 403 | invalidOid || | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3) tags: - Operations parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' requestBody: required: true content: application/fhir+json: schema: $ref: '#/components/schemas/EPAOpProvideDispensationERPInputParameters' responses: '200': description: EPAOpRxDispensationERPOutputParameters content: application/fhir+json: schema: $ref: '#/components/schemas/EPAOpRxDispensationERPOutputParameters' '400': $ref: '#/components/responses/OperationOutcome400OperationsError' '403': $ref: '#/components/responses/Error403Forbidden' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' /epa/medication/api/v1/fhir/$cancel-prescription-erp: post: operationId: operation:cancelPrescription_MedicationSvc summary: "" description: | The **$cancel-prescription-erp** operation is used by the E-Rezept-Fachdienst to cancel an already issued electronic prescription. This function is applied when a prescription is no longer needed for various reasons, such as changes in medication or errors in the initial issuance. After cancellation by the E-Rezept-Fachdienst, this information is transmitted to the ePA Medication Service, where the prescription is cancelled. It can then no longer be used for dispensing medication. This process ensures accuracy and safety in the management of medications. #### **OperationDefinition** [https://gematik.de/fhir/epa-medication/OperationDefinition/cancel-prescription-erp-OP|1.0.3](https://gematik.de/fhir/epa-medication/OperationDefinition/cancel-prescription-erp-OP|1.0.3) #### **Allowed user groups [professionOID]** * oid_erp-vau #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 || OperationOutcome | | An Operation Error | 400 | | OperationOutcome | | If the insurant objects to the submission of prescription and dispensation data into the ePA system, the Medication Service rejects the cancellation. | 403 | Forbidden || | Requestor role is not in the list of allowed usergroups | 403 | invalidOid || | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3) tags: - Operations parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' requestBody: required: true content: application/fhir+json: schema: $ref: '#/components/schemas/EPAOpCancelPrescriptionERPInputParameters' responses: '200': description: EPAOpRxPrescriptionERPOutputParameters content: application/fhir+json: schema: $ref: '#/components/schemas/EPAOpRxPrescriptionERPOutputParameters' '400': $ref: '#/components/responses/OperationOutcome400OperationsError' '403': $ref: '#/components/responses/Error403Forbidden' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' /epa/medication/api/v1/fhir/$cancel-dispensation-erp: post: operationId: operation:cancelDispensation_MedicationSvc summary: "" description: | The **$cancel-dispensation-erp** operation, used by the E-Rezept-Fachdienst, in the context of the ePA Medication Service, is applied to cancel or reverse information regarding the dispensation of a medication. This operation is necessary when a medication dispensation is cancelled by a pharmacist or when there is a return of the medication by the insurant. After the E-Rezept-Fachdienst performs this operation, the corresponding dispensation entry for the medication in the patient's ePA is marked as cancelled, which the goal in ensuring an accurate and up-to-date record of the patient's medication data. #### **OperationDefinition** [https://gematik.de/fhir/epa-medication/OperationDefinition/cancel-dispensation-erp-OP|1.0.3](https://gematik.de/fhir/epa-medication/OperationDefinition/cancel-dispensation-erp-OP|1.0.3) #### **Allowed user groups [professionOID]** * oid_erp-vau #### **Error Handling** | Conditions | Status code | Error code | Remarks | |------------|-------------|------------|---------| | Successful operation | 200 || OperationOutcome | | An Operation Error | 400 | | OperationOutcome | | If the insurant objects to the submission of prescription and dispensation data into the ePA system, the Medication Service rejects the cancellation. | 403 | Forbidden || | Requestor role is not in the list of allowed usergroups | 403 | invalidOid || | Health record is not in state ACTIVATED | 409 | statusMismatch | (see 'Retry interval') | | Any other error | 500 | internalError | (see 'Retry interval') | #### **OperationOutcome** ##### Profile: [https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3](https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3) tags: - Operations parameters: - $ref: '#/components/parameters/insurantid' - $ref: '#/components/parameters/useragent' - $ref: '#/components/parameters/requestid' requestBody: required: true content: application/fhir+json: schema: $ref: '#/components/schemas/EPAOpCancelDispensationERPInputParameters' responses: '200': description: EPAOpRxDispensationERPOutputParameters content: application/fhir+json: schema: $ref: '#/components/schemas/EPAOpRxDispensationERPOutputParameters' '400': $ref: '#/components/responses/OperationOutcome400OperationsError' '403': $ref: '#/components/responses/Error403Forbidden' '409': $ref: '#/components/responses/Error409Conflict' '423': $ref: '#/components/responses/Error423Locked' '500': $ref: '#/components/responses/Error500InternalError' components: responses: Error403Forbidden: description: Forbidden. content: application/json: examples: notEntitled: summary: Requestor has no valid entitlement value: errorCode: notEntitled invalidOid: summary: Requestor role is not in the list of allowed usergroups value: errorCode: invalidOid schema: $ref: '#/components/schemas/ErrorType' Error409Conflict: description: Conflict. content: application/json: example: errorCode: statusMismatch schema: $ref: '#/components/schemas/ErrorType' Error423Locked: description: Locked content: application/json: example: errorCode: locked schema: $ref: '#/components/schemas/ErrorType' Error500InternalError: description: Internal Server Error content: application/json: example: errorCode: internalError schema: $ref: '#/components/schemas/ErrorType' OperationOutcome400BadRequest: description: Bad Request content: application/fhir+json:: examples: unknown_search_parameter: summary: Unknown search parameter value: resourceType: OperationOutcome meta: profile: - https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3 issue: - severity: error code: processing details: coding: - system: http://terminology.hl7.org/CodeSystem/operation-outcome code: MSG_PARAM_UNKNOWN diagnostic: "Unknown search parameter" invalid_query_parameter: summary: Invalid query parameter(s) value: resourceType: OperationOutcome meta: profile: - https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3 issue: - severity: error code: processing details: coding: - system: http://terminology.hl7.org/CodeSystem/operation-outcome code: MSG_BAD_SYNTAX diagnostic: "Invalid query parameter(s)" invalid_request: summary: Invalid request value: resourceType: OperationOutcome meta: profile: - https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3 issue: - severity: error code: not-supported details: coding: - system: http://terminology.hl7.org/CodeSystem/operation-outcome code: MSG_BAD_FORMAT diagnostic: "Invalid request" schema: $ref: '#/components/schemas/OperationOutcome' OperationOutcome404NotFound: description: Not found. content: application/fhir+json:: examples: resource_not_known: summary: Resource is not known value: resourceType: OperationOutcome meta: profile: - https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3 issue: - severity: error code: processing details: coding: - system: http://terminology.hl7.org/CodeSystem/operation-outcome code: MSG_RESOURCE_ID_FAIL diagnostic: "Resource is not known" unknown_resource_type: summary: Unknown resource type value: resourceType: OperationOutcome meta: profile: - https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3 issue: - severity: error code: processing details: coding: - system: http://terminology.hl7.org/CodeSystem/operation-outcome code: MSG_UNKNOWN_TYPE diagnostic: "Unknown resource type" schema: $ref: '#/components/schemas/OperationOutcome' OperationOutcome400OperationsError: description: Bad Request content: application/fhir+json:: examples: invalid_request: summary: Invalid request value: resourceType: OperationOutcome meta: profile: - https://gematik.de/fhir/epa-medication/StructureDefinition/epa-ms-operation-outcome|1.0.3 issue: - severity: error code: not-supported details: coding: - system: http://terminology.hl7.org/CodeSystem/operation-outcome code: MSG_BAD_FORMAT diagnostic: "Invalid request" schema: $ref: '#/components/schemas/OperationOutcome' parameters: insurantid: name: x-insurantid in: header description: Health Record Identifier. required: true schema: $ref: '#/components/schemas/InsurantIdType' useragent: name: x-useragent in: header description: user agent information required: false schema: $ref: '#/components/schemas/UserAgentType' requestid: name: X-Request-ID in: header description: UUID of the request message required: true schema: $ref: '#/components/schemas/RequestIDType' resourceid: name: id in: path required: true description: The logical id of the resource schema: type: string _count: name: _count in: query description: | With "_count", the client can specify the maximum number of elements to be included on one "page" of the response. This means the Medication Service limits the result set to this maximum specified number. If no value for "_count" is provided, the default value set is "25". schema: type: integer _offset: name: _offset in: query description: | This URL parameter indicates the (zero-based) offset of the first returned element in the collection. If no value for "_offset" is provided, the default value set is "0". schema: type: integer _total: name: _total in: query description: This parameter controls whether and how the AuditEvent Service returns the total number of search results. schema: type: string _id: name: _id in: query required: false description: Refers to the logical id of the resource schema: type: string _lastUpdated: name: _lastUpdated in: query required: false description: Can be used to select resources based on the last time they were changed schema: type: string format: date-time identifier: name: identifier in: query required: false description: Returns resources with this external identifier schema: type: string _include: name: _include in: query required: false description: Including other resources schema: type: string _revinclude: name: _revinclude in: query required: false description: Reverse include other resources schema: type: string schemas: InsurantIdType: type: string description: |- The health record identifier. For today the record identifier equals the insurant id (kvnr). The record identifier does not include any homeCommunity identification. pattern: '^[A-Z]{1}\d{9}$' example: Z123456789 UserAgentType: description: "Information about client software with: ClientId (1 to 20 characters) + / + VersionNumber (1 to 15 characters)." type: string pattern: '^[a-zA-Z0-9\-]{1,20}\/[a-zA-Z0-9\-\.]{1,15}$' example: CLIENTID1234567890AB/2.1.12-45 RequestIDType: description: "Unique ID given by the ePA-Client to identify the request message. The server must return this ID in the response message." type: string format: uuid example: c3ab12eb-f78d-450b-a56f-a65369cec4cb ErrorType: description: Error object with additional information about the occurred error type: object properties: errorCode: description: Error condition specifier type: string errorDetail: description: Additional details regarding the error condition (if applicable) type: string required: - errorCode Coding: type: object description: A reference to a code defined by a terminology system. properties: system: description: The identification of the code system that defines the meaning of the symbol in the code. type: string code: description: A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). type: string CodeableConcept: type: object description: A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. properties: coding: description: A reference to a code defined by a terminology system. type: array items: $ref: '#/components/schemas/Coding' OperationOutcome: type: object properties: resourceType: type: string example: OperationOutcome meta: description: 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. properties: profile: description: A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]. type: array items: type: string issue: type: array items: type: object properties: severity: type: string code: type: string details: $ref: '#/components/schemas/CodeableConcept' diagnostic: type: string SearchSet_Bundle: description: "Contains a collection of resources + Rule: entry.search only when a search" type: object properties: resourceType: type: string enum: - Bundle type: type: string enum: - searchset total: type: integer minimum: 0 example: 1 link: type: array items: type: object properties: relation: type: string enum: - self - next - previous - first - last url: type: string description: Reference details for the link, A Uniform Resource Locator (RFC 1738 ). Note URLs are accessed directly using the specified protocol. Common URL protocols are http{s}. entry: type: array items: type: object properties: fullUrl: type: string description: "URI for resource (Absolute URL server address or URI for UUID/OID)" resource: type: object search: type: object description: Search related information properties: mode: type: string description: match | include | outcome - why this is in the result set enum: - match - include - outcome example: match Medication: type: object description: 'https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication|1.0.3' example: --> https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication|1.0.3 MedicationList: allOf: - $ref: "#/components/schemas/SearchSet_Bundle" - type: object properties: entry: type: array items: type: object properties: resource: $ref: '#/components/schemas/Medication' MedicationRequest: type: object description: 'https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication-request|1.0.3' example: --> https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication-request|1.0.3 MedicationRequestList: allOf: - $ref: "#/components/schemas/SearchSet_Bundle" - type: object properties: entry: type: array items: type: object properties: resource: $ref: '#/components/schemas/MedicationRequest' MedicationDispense: type: object description: 'https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication-dispense|1.0.3' example: --> https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication-dispense|1.0.3 MedicationDispenseList: allOf: - $ref: "#/components/schemas/SearchSet_Bundle" - type: object properties: entry: type: array items: type: object properties: resource: $ref: '#/components/schemas/MedicationDispense' Organization: type: object description: 'https://gematik.de/fhir/directory/StructureDefinition/OrganizationDirectory|0.11.12' example: --> https://gematik.de/fhir/directory/StructureDefinition/OrganizationDirectory|0.11.12 OrganizationList: allOf: - $ref: "#/components/schemas/SearchSet_Bundle" - type: object properties: entry: type: array items: type: object properties: resource: $ref: '#/components/schemas/Organization' Practitioner: type: object description: 'https://gematik.de/fhir/directory/StructureDefinition/PractitionerDirectory|0.11.12' example: --> https://gematik.de/fhir/directory/StructureDefinition/PractitionerDirectory|0.11.12 PractitionerList: allOf: - $ref: "#/components/schemas/SearchSet_Bundle" - type: object properties: entry: type: array items: type: object properties: resource: $ref: '#/components/schemas/Practitioner' PractitionerRole: type: object description: 'https://hl7.org/fhir/R4/practitionerrole.html' example: --> https://hl7.org/fhir/R4/practitionerrole.html PractitionerRoleList: allOf: - $ref: "#/components/schemas/SearchSet_Bundle" - type: object properties: entry: type: array items: type: object properties: resource: $ref: '#/components/schemas/PractitionerRole' EPAOpProvidePrescriptionERPInputParameters: type: object description: 'https://gematik.de/fhir/epa-medication/StructureDefinition/epa-op-provide-prescription-erp-input-parameters|1.0.3' example: --> https://gematik.de/fhir/epa-medication/StructureDefinition/epa-op-provide-prescription-erp-input-parameters|1.0.3 EPAOpProvideDispensationERPInputParameters: type: object description: 'https://gematik.de/fhir/epa-medication/StructureDefinition/epa-op-provide-dispensation-erp-input-parameters|1.0.3' example: --> https://gematik.de/fhir/epa-medication/StructureDefinition/epa-op-provide-dispensation-erp-input-parameters|1.0.3 EPAOpCancelPrescriptionERPInputParameters: type: object description: 'https://gematik.de/fhir/epa-medication/StructureDefinition/epa-op-cancel-prescription-erp-input-parameters|1.0.3' example: --> https://gematik.de/fhir/epa-medication/StructureDefinition/epa-op-cancel-prescription-erp-input-parameters|1.0.3 EPAOpCancelDispensationERPInputParameters: type: object description: 'https://gematik.de/fhir/epa-medication/StructureDefinition/epa-op-cancel-dispensationn-erp-input-parameters|1.0.3' example: --> https://gematik.de/fhir/epa-medication/StructureDefinition/epa-op-cancel-dispensationn-erp-input-parameters|1.0.3 EPAOpRxDispensationERPOutputParameters: type: object description: 'https://gematik.de/fhir/epa-medication/StructureDefinition/epa-op-rx-dispensation-erp-output-parameters|1.0.3' example: --> https://gematik.de/fhir/epa-medication/StructureDefinition/epa-op-rx-dispensation-erp-output-parameters|1.0.3 EPAOpRxPrescriptionERPOutputParameters: type: object description: 'https://gematik.de/fhir/epa-medication/StructureDefinition/epa-op-rx-prescription-erp-output-parameters|1.0.3' example: --> https://gematik.de/fhir/epa-medication/StructureDefinition/epa-op-rx-prescription-erp-output-parameters|1.0.3