ЕСОЗ - публічна документація

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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
}

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 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

REIMBURSEMENT_CONTRACT_MAX_PERIOD_DAY

3096

Integer

Maximum reimbursement contract period (in days)

3096

СAPITATION_CONTRACT_MAX_PERIOD_DAY

366

Integer

Maximum capitation contract period (in days)

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.

  1. Verify the validity of access token

    1. Return 401 in case validation fails

  2. Verify that token is not expired

    1. in case of error - return (401, 'Invalid access token')

  3. Check user scopes

    1. global_parameters:write in order to get global parameters

      1. Return 403 in case invalid scope(s) "Your scope does not allow to access this resource. Missing allowances: global_parameters:write

Headers

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

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

  • No labels