ЕСОЗ - публічна документація
Create medical program
- 1 Purpose
- 1.1 Key points
- 2 Specification
- 3 Logic
- 4 Input parameters
- 5 Filters
- 6 Dictionaries
- 7 GraphQl Specification
- 8 Authorize
- 9 Headers
- 10 Request data validation
- 10.1 Validate legal entity
- 10.2 Validate request
- 11 Processing
- 12 Response structure
- 13 Post-processing processes
- 14 HTTP status codes
- 15 Backward compatibility
Purpose
This WS allows to create a new medical program
Key points
This is a graphQl method used in the Administration panel only.
Only authenticated and authorized NHS employee with an appropriate scope can create a medical program.
A medical program with the type MEDICATION or SERVICE can be created.
Specification
Link | See GraphQl Specification | Посилання на Apiary або Swagger |
Resource | See GraphQl Specification | Посилання на ресурс, наприклад: /api/persons/create |
Scope | medical_program:write | Scope для доступу |
Components | Medical Programs | Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription |
Microservices | API paragraph not found | Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC |
Protocol type | API paragraph not found | Тип протоколу, який використовується запитом, наприклад: SOAP | REST |
Request type | API paragraph not found | Тип запиту API, наприклад: GET, POST, PATCH… |
Sync/Async | API paragraph not found | Метод є синхронним чи асинхронним? |
Public/Private/Internal | Internal |
|
Logic
Create medical program entity in medical_programs table (prm).
Set fields submitted on input: name and type.
Set following fields by default:
id = generate UUID value
is_active = true
medication_request_allowed = true
medication_dispense_allowed = true
medical_program_settings = null
inserted_at, updated_at = current date and time
inserted_by, updated_by = current user (from token).
Input parameters
API paragraph not found
Filters
API paragraph not found
Dictionaries
FUNDING_SOURCE
MR_BLANK_TYPES
PROVIDING_CONDITION
eHealth/clinical_impression_patient_categories
LICENSE_TYPE
MEDICAL_PROGRAM_TYPE
GraphQl Specification
Authorize
Verify the validity of access token
in case of error - return 401 (“Invalid access token”) in case of validation fails.
Verify that token is not expired
in case of error - return 401 (“Invalid access token”).
Check user scopes in order to perform this action (scope = 'medical_program:write')
return 403 (“Your scope does not allow to access this resource. Missing allowances: medical_program:write”) in case of invalid scope(s).
Headers
API paragraph not found
Request data validation
Validate legal entity
Extract client_id from token.
Check client scopes in order to perform this action (scope = 'medical_program:write')
in case of error - return 403 (“Your scope does not allow to access this resource. Missing allowances: medical_program:write”).
Check type = NHS
in case of error - return 403 ('You don’t have permission to access this resource').
Validate request
Validate input according to schema only
Processing
API paragraph not found
Response structure
API paragraph not found
Post-processing processes
API paragraph not found
HTTP status codes
HTTP status code | Message | What caused the error |
---|---|---|
401 | Invalid access token |
|
403 |
|
|
Backward compatibility
API paragraph not found
ЕСОЗ - публічна документація