ЕСОЗ - публічна документація
Create Program Service
Purpose
This WS is designed to create program service.
Specification
Schema:
Link | - | Посилання на Apiary або Swagger |
Resource | /graphql | Посилання на ресурс, наприклад: /api/persons/create |
Scope | program_service:write | Scope для доступу |
Components | Program Services | Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription |
Microservices | API paragraph not found | Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC |
Protocol type | GraphQL | Тип протоколу, який використовується запитом, наприклад: SOAP | REST |
Request type | POST | Тип запиту API, наприклад: GET, POST, PATCH… |
Sync/Async | API paragraph not found | Метод є синхронним чи асинхронним? |
Public/Private/Internal | Private | Потрібно зазначити тип методу за ступенем доступності |
Preconditions
Before this the program and service should be created by NHS
Logic
This WS is designed for NHS employees.
The query is use to create program service.
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
medicalProgramId |
| String | Medical program identifier | d290f1ee-6c54-4b01-90e6-d701748f0851 |
serviceId |
| String | Service identifier | d290f1ee-6c54-4b01-90e6-d701748f0851 |
serviceGroupId |
| String | Service group identifier | d290f1ee-6c54-4b01-90e6-d701748f0851 |
description |
| String | Description of program service |
|
requestAllowed | true/false | Boolean | Is service request allowed |
|
consumerPrice |
| number | Price | 10 |
Request structure
Example:
Authorize
Verify the validity of access token
in case of error return 401 error “Access denied”
Check user scope program_service:write in order to perform this action
in case of error generate 403 error “Your scope does not allow to access this resource. Missing allowances: program_service:write”
Headers
Наприклад:
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
Request data validation
Validate Service:
$.service_id exists in PRM.services
In case of error - return error (message: "Service is not found")
Check whether `Service` is_active = 'true' by $.service_id.
In case of error - return error (message: "Service is not active")
Check whether `Service` request_allowed = 'true' by $.service_id.
if invalid - return error (message: "Service is not request to allowed")
Validate Service group:
$.service_group_id exists in PRM.service_group
In case of error - return error (message: "Service group is not found")
Check whether `Service group` is_active = 'true' by $.service_group_id.
if invalid - return error (message: "Service group is not active")
Check whether `Service group` request_allowed = 'true' by $.service_group_id.
if invalid - return error (message: "Service group is not request to allowed")
Validate Medical program:
$.medical_program_id exists in PRM.medical_programs
In case of error - return error (message: "Medical program is not found")
Check whether `Medical_programs` is_active = 'true' by $.medical_program_id
if invalid - return error (message: "Medical program is not active")
Check whether `Medical_programs` request_allowed = 'true' by $.medical_program_id
if invalid - return error (message: "Medical program is not request to allowed")
Validate uniqueness Service/Service group within Medical Program
Service(or Service group) with field $.requestAllowed
= TRUE must be unique in active program. In case of duplication the error must be shown.
Check uniqueness by $.service_id($.service_group_id, $.
requestAllowed
= TRUE and $.medical_program_id( where $.is_active = TRUE)if invalid - return error (message: "Service(Service group) is already a participant of the program")
Validate one of two( service and service group) must be in medical program
User can add only one of service or group to the program at once.
If $.service_id and $.service_group_id are present
return error (message: "ProgramService cannot belong to Service and ServiceGroup simultaneously")
Validate Service Group
Check Service group don't have active subgroup:
if invalid - return error (message: "ServiceGroup should not have active subgroups")
If add service group to program, check that all services which include in this service group must be in medical program
if invalid - return error (message: "Only ServiceGroup which services are already present in medical program can take part in medical program")
Validate price
consumer_price>=0
Only Service have consumer_price
Check by $.service_id, and $.medical_program_id
if invalid - return error (message: "ProgramService for a Service should have a consumer price"
Check by $.service_group_id, $consumer_price and $.medical_program_id
if invalid - return error (message: "ProgramService for a ServiceGroup should not have a consumer price"
Processing
Response structure
Examples:
Post-processing processes
HTTP status codes
HTTP status code | Message | What caused the error |
---|---|---|
200 | Response |
|
401 | Access denied | Invalid token |
403 | Your scope does not allow to access this resource. Missing allowances: {{scope}} | Scope is missing |
ЕСОЗ - публічна документація