You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
Version 1
Current »
Purpose
This WS is designed to allow NHS employee with assigned appropriate scopes to update information about global parameters.
Specification
Schema:
globalParameters.graphql
"""
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
}
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 |
reimbursementContractMaxPeriodDay | | Integer | Max number of days for period of Reimbursement contract | 1096 |
capitationContractMaxPeriodDay | | Integer | Max number of days for period of Capitation contract | 366 |
Request structure
Example:
Request example
{
"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:
Response example (success)
{
"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"
}
}
Response example (error)
{
"errors": [
{
"locations": [
{
"column": 105,
"line": 1
}
],
"message": "Argument \"input\" has invalid value $input.\nIn field \"adultAge\": Expected type \"Int\", found \"eighteen\"."
}
],
"extensions": {
"requestId": "e9dac1bf-6eb0-410b-9201-39473f1077f6#12747"
}
}
Response example (authorization error)
{
"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