Purpose
This WS is designed to allow NHS employee with assigned appropriate scopes to update information about global parameters.
Specification
Schema:
Expand |
---|
title | globalParameters.graphql |
---|
|
Code Block |
---|
| """
Represents global parameters of eHealth.
User must have a scope **global_parameters:read**
"""
type GlobalParameters {
"Age of an adult"
adultAge: Int!
"Calculation date"
billingDate: Int!
"Number of days of validity of a request for a declaration"
declarationRequestExpiration: Int!
"The number of days the employee request has expired"
employeeRequestExpiration: Int!
"Verification request expiration"
verificationRequestExpiration: Int!
"Term of verification request"
verificationRequestTerm: Int!
"Maximum number of declarations"
declarationLimit: Int!
"Term of declaration (years)"
declarationTerm: Int!
"Maximum amount of a persons who can use the same phone number"
phoneNumberAuthLimit: Int!
"Medication dispense period"
medicationDispensePeriod: Int!
"Power BI URL"
biUrl: String!
}
"""
Input for `UpdateGlobalParameters` mutation.
User must have a scope **global_parameters:write**
"""
input UpdateGlobalParametersInput {
"Age of an adult"
adultAge: Int
"Calculation date"
billingDate: Int
"Number of days of validity of a request for a declaration"
declarationRequestExpiration: Int
"The number of days the employee request has expired"
employeeRequestExpiration: Int
"Verification request expiration"
verificationRequestExpiration: Int
"Term of verification request"
verificationRequestTerm: Int
"Maximum number of declarations"
declarationLimit: Int
"Term of declaration (years)"
declarationTerm: Int
"Maximum amount of a persons who can use the same phone number"
phoneNumberAuthLimit: Int
"Medication dispense period"
medicationDispensePeriod: Int
"BI URL"
biUrl: String
}
"""
Return type for `UpdateGlobalParameters` mutation.
"""
type UpdateGlobalParametersPayload {
"Update `GlobalParameters`."
globalParameters: GlobalParameters
}
|
|
Page Properties |
---|
|
Link | - | Посилання на Apiary або Swagger | Resource | /graphql | Посилання на ресурс, наприклад: /api/persons/create | Scope | global_parameters:write | Scope для доступу | Components | GlobalParameters | Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription | Microservices | fe/admin-web | Перелік мікросервісів, які використовує метод 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 | Потрібно зазначити тип методу за ступенем доступності |
|
Logic
This WS is designed for NHS employees. This query is use to update existing global parameters.
Input parameter | Values | Type | Description | Example |
---|
biUrl | | String | BI URL | https://app.powerbi.com/view?r=eyJrIjoiYTkxMWZmOTYtY2M5OS00YTYzLTk4MWItZmQwZTVkOGU1NjZhIiwidCI6IjA0ZWM2MTdmLTkwMWMtNDMzMS04OTVlLWE2YTZmNGJiMWI3YiIsImMiOjl9 |
billingDate | | Integer | Date of formation of the capitation report, day of the month | 2 |
declarationRequestExpiration | | Integer | Validity period of the declaration request to create a declaration (days) | 1 |
employeeRequestExpiration | | Integer | Validity of the employee request to create an employee (days) | 28 |
verificationRequestExpiration | | Integer | The number of days until the declaration is automatically approved | 1 |
declarationLimit | | Integer | Maximum number of declarations per person (doctor) | 2000 |
declarationTerm | | Integer | Validity of the declaration (years) | 99 |
phoneNumberAuthLimit | | Integer | Limit number of declarations registered for one phone | 600 |
medicationDispensePeriod | | Integer | Period of validity of the medication dispense (minutes) | 10 |
adultAge | | Integer | Adult age | 18 |
Request structure
Example:
Expand |
---|
|
Code Block |
---|
| {
"operationName":"UpdateGlobalParametersMutation",
"variables": {
"input": {
"biUrl":"https://app.powerbi.com/view?r=eyJrIjoiYTkxMWZmOTYtY2M5OS00YTYzLTk4MWItZmQwZTVkOGU1NjZhIiwidCI6IjA0ZWM2MTdmLTkwMWMtNDMzMS04OTVlLWE2YTZmNGJiMWI3YiIsImMiOjl9",
"billingDate":2,
"declarationRequestExpiration":1,
"employeeRequestExpiration":28,
"verificationRequestExpiration":1,
"declarationLimit":2000,
"declarationTerm":99,
"phoneNumberAuthLimit":600,
"medicationDispensePeriod":10,
"adultAge":18
}
},
"query":"mutation UpdateGlobalParametersMutation($input: UpdateGlobalParametersInput!) { updateGlobalParameters(input: $input) { globalParameters { ...GlobalParameters __typename } __typename }}fragment GlobalParameters on GlobalParameters { adultAge billingDate declarationRequestExpiration employeeRequestExpiration verificationRequestExpiration declarationLimit declarationTerm phoneNumberAuthLimit medicationDispensePeriod biUrl __typename}"
} |
|
Authorize
Request to process the request using a token in the headers.
Verify the validity of access token
Return 401
in case validation fails
Verify that token is not expired
in case of error - return (401
, 'Invalid access token')
Check user scopes
global_parameters:write
in order to get global parameters
Return 403
in case invalid scope(s) "Your scope does not allow to access this resource. Missing allowances: global_parameters:write“
Content-Type:application/json
Authorization:Bearer {{access_token}}
Request data validation
Processing
Update values of global parameters
Response structure
Examples:
Expand |
---|
title | Response example (success) |
---|
|
Code Block |
---|
{
"data": {
"updateGlobalParameters": {
"__typename": "UpdateGlobalParametersPayload",
"globalParameters": {
"__typename": "GlobalParameters",
"adultAge": 18,
"biUrl": "https://app.powerbi.com/view?r=eyJrIjoiYTkxMWZmOTYtY2M5OS00YTYzLTk4MWItZmQwZTVkOGU1NjZhIiwidCI6IjA0ZWM2MTdmLTkwMWMtNDMzMS04OTVlLWE2YTZmNGJiMWI3YiIsImMiOjl9",
"billingDate": 2,
"declarationLimit": 2000,
"declarationRequestExpiration": 1,
"declarationTerm": 99,
"employeeRequestExpiration": 28,
"medicationDispensePeriod": 10,
"phoneNumberAuthLimit": 600,
"verificationRequestExpiration": 1
}
}
},
"extensions": {
"requestId": "e9dac1bf-6eb0-410b-9201-39473f1077f6#12687"
}
} |
|
...
Expand |
---|
title | Response example (authorization error) |
---|
|
Code Block |
---|
{
"error": {
"message": "Invalid access token",
"type": "access_denied"
},
"meta": {
"code": 401,
"url": "http://api.dev.edenlab.com.ua:8000/graphql",
"request_id": "931c0790-ddfe-45e5-960a-eb6ba9f24e19#65",
"type": "object"
}
} |
|
Post-processing processes
HTTP status codes
Page Properties |
---|
|
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 |
|