...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
This WS allows to create new medication program participant.
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 Program medication.
Program medication can be created only for a medical program with type MEDICATION.
Specification*
...
Link
...
API paragraph not found
...
Посилання на Apiary або Swagger
...
Resource
...
API paragraph not found
...
Посилання на ресурс, наприклад: /api/persons/create
...
Scope
...
program_medication:write
...
Scope для доступу
...
Components
...
ePrescription
...
Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: 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
...
Метод є синхронним чи асинхронним?
Logic
Create new program medication entity: store input into program_medications table (prm). Also, set:
medication_request_allowed = true
is_active = true
inserted_at, updated_at = user_id (from token)
inserted_at, updated_at = current date and time.
Preconditions
API paragraph not found
Global and configurable parameters
No
Input parameters
API paragraph not found
Filters
No
Dictionaries
API paragraph not found
Request structure
...
title | createProgramMedication |
---|
Code Block |
---|
"Creates a single `ProgramMedication`."
createProgramMedication(
input: CreateProgramMedicationInput!
): CreateProgramMedicationPayload |
Code Block |
---|
"""
Input for `createProgramMedication` mutation.
User must have a scope **program_medication:write**
"""
input CreateProgramMedicationInput {
"Id of medication"
medicationId: ID!
"Medical program Identifier"
medicalProgramId: ID!
"Reimbursement information"
reimbursement: CreateReimbursementInput!
"Factory gate price for package of medications"
wholesalePrice: Float
"Consumer price for package of medications"
consumerPrice: Float
"Reimbuersement amount for recommended daily dosage of medication"
reimbursementDailyDosage: Float
"The estimatied amount which patient should pay for package of medications after reimbursement"
estimatedPaymentAmount: Float
"Start date of action for this entry"
startDate: Date
"End date for this entry"
endDate: Date
"General registry identifier"
registryNumber: String
}
"""
Input for `Reimbursement` of `createProgramMedication` mutation.
"""
input CreateReimbursementInput {
"Reimbursement type"
type: ReimbursementType!
"Reimbursement amount"
reimbursementAmount: Float
"Percentage of reimbursement."
percentageDiscount: Float
} |
Code Block |
---|
"""
Return type for `createProgramMedication` mutation.
"""
type CreateProgramMedicationPayload {
"Created `ProgramMedication`."
programMedication: ProgramMedication
}
"""
Program Medication linkes medication and medical program.
In order to obtain details user must have a scope **program_medication:read**
"""
type ProgramMedication implements Node {
"The ID of an object."
id: ID!
"Primary key identifier from the database."
databaseId: UUID!
"MedicalProgram."
medicalProgram: MedicalProgram!
"Medication"
medication: Medication!
"Reimbursement information."
reimbursement: Reimbursement!
"Factory gate price for package of medications"
wholesalePrice: Float
"Consumer price for package of medications"
consumerPrice: Float
"Reimbuersement amount for recommended daily dosage of medication"
reimbursementDailyDosage: Float
"The estimatied amount which patient should pay for package of medications after reimbursement"
estimatedPaymentAmount: Float
"Start date of action for this entry"
startDate: Date
"End date for this entry"
endDate: Date
"General registry identifier"
registryNumber: String
"Whether `ProgramMedication` is active or not?"
isActive: Boolean!
"Whether requesting medications allowed for the `ProgramMedication` or not?"
medicationRequestAllowed: Boolean!
"Date and time when record was inserted"
insertedAt: DateTime!
"Date and time when record was updated"
updatedAt: DateTime!
} |
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 = 'program_medication:write')
return 403 (“Your scope does not allow to access this resource. Missing allowances: program_medication:read”) 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 = 'program_medication:write')
in case of error - return 403 (“Your scope does not allow to access this resource. Missing allowances: program_medication:write”).
Validate request
Check medicalProgramId:
exists in DB
in case of error - return 404 ('not_found')
has type = MEDICATION
in case of error - return 409 ('MedicalProgram type should be MEDICATION')
is_active = true
in case of error - return 409 ('Medical program is not active')
Check start_date < end_date
in case of error - return 422 ('must be earlier than the end date')
Validate reimbursement:
If reimbursement type = FIXED, than reimbursementAmount field required
If reimbursement type = PERCENTAGE, percentageDiscount field required
in case of error - return 422 ('can't be blank')
If percentageDiscount submitted in the reimbursement structure:
Check it’s value in range from 0 to 100
in case of error - return 422 ('expected the value to be <= 100')
Validate medicationId:
Check it is active and it’s type is BRAND
in case of error - return 409 ('Medication is not active')
Validate compliance of INNM_DOSAGE.mr_blank_type of a BRAND to medicalProgram.mr_blank_type:
Check INNM_DOSAGE
There is link of a BRAND to INNM_DOSAGE (in prm.ingredients table) and INNM_DOSAGE exists
in case of error - return 404 ('INNM_DOSAGE of a BRAND not_found')
is_active = true
in case of error - return 409 ('INNM_DOSAGE of a BRAND is not active')
Check compliance of INNM_DOSAGE of a BRAND to medicalProgram
if INNM_DOSAGE.mr_blank_type = medicalProgram.mr_blank_type
(i.eprm.medications.mr_blank_type = prm.medical_programs.mr_blank_type
)in case of error - return 422 ('Dosage form of selected Medication does not comply with mr_blank_type requirement of Medical Program')
Processing
API paragraph not found
Response structure
API paragraph not found
Post-processing processes
No
Table of Contents | ||||||
---|---|---|---|---|---|---|
|
Purpose
This WS allows to create new medication program participant.
Specification
Page Properties | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Logic
Create new program medication entity: store input into program_medications table (prm). Also, set:
medication_request_allowed = true
is_active = true
inserted_at, updated_at = user_id (from token)
inserted_at, updated_at = current date and time.
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 Program medication.
Program medication can be created only for a medical program with type MEDICATION.
GraphQl Specification
Expand | ||||||
---|---|---|---|---|---|---|
| ||||||
|
Request structure
See on Apiary
Expand | ||
---|---|---|
| ||
|
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 = 'program_medication:write')
return 403 (“Your scope does not allow to access this resource. Missing allowances: program_medication:read”) in case of invalid scope(s).
Request to process the request using a token in the headers
Headers
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
Request data validation
Validate legal entity
Extract client_id from token.
Check client scopes in order to perform this action (scope = 'program_medication:write')
in case of error - return 403 (“Your scope does not allow to access this resource. Missing allowances: program_medication:write”).
Validate request
Check medicalProgramId:
exists in DB
in case of error - return 404 ('not_found')
has type = MEDICATION
in case of error - return 409 ('MedicalProgram type should be MEDICATION')
is_active = true
in case of error - return 409 ('Medical program is not active')
Check start_date < end_date
in case of error - return 422 ('must be earlier than the end date')
Validate reimbursement:
If reimbursement type = FIXED, than reimbursementAmount field required
If reimbursement type = PERCENTAGE, percentageDiscount field required
in case of error - return 422 ('can't be blank')
If percentageDiscount submitted in the reimbursement structure:
Check it’s value in range from 0 to 100
in case of error - return 422 ('expected the value to be <= 100')
Validate medicationId:
Check it is active and it’s type is BRAND
in case of error - return 409 ('Medication is not active')
Validate compliance of INNM_DOSAGE.mr_blank_type:
in case when $.medication.type is BRAND:
Check INNM_DOSAGE
There is link of a BRAND to INNM_DOSAGE (in prm.ingredients table) and INNM_DOSAGE exists
in case of error - return 404 ('INNM_DOSAGE of a BRAND not_found')
is_active = true
in case of error - return 409 ('INNM_DOSAGE of a BRAND is not active')
in case when $.medication.type is INNM_DOSAGE:
Check INNM_DOSAGE
INNM_DOSAGE exists
in case of error - return 404 ('INNM_DOSAGE not_found')
is_active = true
in case of error - return 409 ('INNM_DOSAGE is not active')
Check compliance of INNM_DOSAGE
of a BRANDto medicalProgramif INNM_DOSAGE.mr_blank_type = medicalProgram.mr_blank_type
(i.eprm.medications.mr_blank_type = prm.medical_programs.mr_blank_type
)in case of error - return 422 ('Dosage form of selected Medication does not comply with mr_blank_type requirement of Medical Program')
Response structure
See on Apiary
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
HTTP status codes
Page Properties | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Backward compatibility
...