/
REST API PRIVATE SPACE Private. Get Medication Requests [API-005-008-002-0161]

ЕСОЗ - публічна документація

REST API PRIVATE SPACE Private. Get Medication Requests [API-005-008-002-0161]

Properties of a REST API method document

Document type

Метод REST API

Document title

REST API PRIVATE SPACE Private. Get Medication Requests [API-005-008-002-0161]

Guideline ID

GUI-0011

Author

@Iryna Lishtaba (SoE eHealth)

Document version

1

Document status

DRAFT

Date of creation

04.03.2025

Date of update

04.03.2025

Method API ID

API-005-008-002-0161

Microservices (namespace)

IL

Link на API-специфікацію

https://esoz.docs.apiary.io/#reference/medical-events/medication-request/private-get-medication-requests

Resource

{{host}}/api/admin/medication_requests

Scope

medication_request_admin:read

Protocol type

REST

Request type

GET

Sync/Async

Sync

Public/Private

Private

Purpose

This WS is designed to search (get list) of Medication requests for NHS_ADMIN. In the response of these endpoint person_id is return in hashed form.

According to requirements user of NHS_ADMIN can see all Medication request (without limitations)

Logic

  1. Verify the validity of access token

    1. Return 401 in case validation fails

  2. Check user scopes in order to perform this action (scope = 'medication_request_admin:read')
    Return 403 in case invalid scope(s)

  3. Search Medication requests by filters: 

    SELECT * FROM medication_requests MR WHERE (MR.employee_id == $.employee_id OR $.employee_id IS NULL) AND (MR.status == $.status OR $.status IS NULL) AND (MR.patient_id == $.patient_id OR $.patient_id IS NULL) AND (MR.medication_id = $.medication_id OR $.medication_id IS NULL) AND (MR.number = $.request_number OR $.request_number IS NULL) AND (MR.created_at >= $.created_from OR $.created_from IS NULL) AND (MR.created_at <= $.created_to OR $.created_to IS NULL) AND (MR.legal_entity_id == $.legal_entity_id OR $.legal_entity_id IS NULL)

Configuration parameters

N/A

Dictionaries

N/A

Input parameters

Input parameter

Mandatory

Type

Description

Example

Input parameter

Mandatory

Type

Description

Example

1

id

O

String

Medication dispense ID

a89f6a26-4221-4597-a1d2-542d5e40b565

2

medication_request_id

O

String

Medication request ID

a89f6a26-4221-4597-a1d2-542d5e40b565

3

legal_entity_id

O

String

legal entity identifier

d290f1ee-6c54-4b01-90e6-d701748f0851

4

employee_id

O

String

user_id of a doctor

7124259c-eeb1-4cbb-acac-ada2162675d1

5

person_id

O

String

hash of person_id of a patient

01352B970879A80E19B60C15C8E488DA26CABC3B9F7FA71684904A99DBD5ACE4

6

status

O

Enum

Status

ACTIVE

7

request_number

O

String

Public medication request human readable number

0000-243P-1X53-EH38

8

created_from

O

String

Medication request creation date period start, which is determined by the external system. Format DATE '2017-08-17'

2017-08-17

9

medication_id

O

String

innm dosage id

b075f148-7f93-4fc2-b2ec-2d81b19a9b5b

10

intent

O

String

Medication request intent

order

11

care_plan_id

O

String

care plan identifier

8838982b-6a77-4cb5-87cd-cdb82eb55364

12

encounter_id

O

String

encounter identifier

7075e0e2-6b57-47fd-aff7-324806efa7e5

13

page

O

Number

Page number

2

14

page_size

Number

 A limit on the number of objects to be returned, between 1 and 300. Default: 50

50 

Request structure

See on API-specification

Headers

Headers

Request data validation

  1. If according to filters requests are not found, WS returns empty data array.

    1. WS also returns pagination data - for technical info.

Processing

N/A

Response structure examples

See on API-specification

HTTP status codes

Response code

HTTP Status code

Message

Internal name

Description

Response code

HTTP Status code

Message

Internal name

Description

1

Базові

2

 

401

validation fails

 

Помилка валідації

3

 

403

invalid scope(s)

 

Відсутній доступ

4

Специфічні

5

 

 

 

 

 

Post-processing processes

  1. Return object with responce structure from WS Sign Medication Request.

Technical modules where the method is used

 

Related content

REST API PRIVATE SPACE [AR] Private. Get Medication Request by Id [API-005-008-002-0160]
REST API PRIVATE SPACE [AR] Private. Get Medication Request by Id [API-005-008-002-0160]
More like this
REST API Get Medication Requests by Search Params [API-005-008-002-0146]
REST API Get Medication Requests by Search Params [API-005-008-002-0146]
More like this
[DRAFT] REST API Get Medication Request by Id [API-005-008-002-0154]
[DRAFT] REST API Get Medication Request by Id [API-005-008-002-0154]
More like this
REST API Reject Medication Request by Pharmacy User [API-005-008-002-0150]
REST API Reject Medication Request by Pharmacy User [API-005-008-002-0150]
Read with this
REST API Get Medication Request Requests in care plan context [API-005-008-003-0164]
REST API Get Medication Request Requests in care plan context [API-005-008-003-0164]
More like this

ЕСОЗ - публічна документація