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

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

Version 1 Current »

Purpose

This WS allows to get detailed Medication registry Job info from Admin panel.

Key points

  1. This is a graphQl query used in the Administration panel only

  2. Only authenticated and authorized NHS employee with appropriate scope can get Medication registry Job details.

  3. Query returns single Medication registry Job by job identifier.

Specification

Link

graphQl method

Посилання на Apiary або Swagger

Resource

graphQl method

Посилання на ресурс, наприклад: /api/persons/create

Scope

medication_registry_job:read

Scope для доступу

Components

ePrescpription

Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: 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

Метод є синхронним чи асинхронним?

Public/Private/Internal

Internal

Потрібно зазначити тип методу за ступенем доступності

 Specification for medicationRegistryJobQuery
  "Reads a single `MedicationRegistryJob` using its globally unique ID."
  medicationRegistryJob(id: ID!): MedicationRegistryJob 
"""
An object for MedicationRegistryJob.
"""
type MedicationRegistryJob implements Node {
  "The ID of an object"
  id: ID!
  "Primary key identifier from the database"
  databaseId: UUID!
  "Job name."
  name: String
  "Medication registry Job status."
  status: JobStatus!
  "Job execution strategy."
  strategy: JobStrategy!
  "Date and time when the job starts."
  startedAt: DateTime!
  "Date and time when the job ends."
  endedAt: DateTime
  "Tasks within this job."
  tasks(
    "A condition to be used in determining which values should be returned by the collection."
    filter: TaskFilter
    "The method to use when ordering collection items."
    orderBy: TaskOrderBy
    "Read all values in the set after (below) this cursor."
    after: String
    "Read all values in the set before (above) this cursor."
    before: String
    "Only read the first _n_ values of the set."
    first: Int
    "Only read the last _n_ values of the set."
    last: Int
  ): TaskConnection!
  "Type of register originating medication registry data. The value should be present in the `REGISTER_TYPE` dictionary."
  registerType: String!
  "Medication registry job reason description."
  reasonDescription: String!
}

Logic

  1. Get Medication registry job by id

  2. Render detailed Medication registry job data according to schema

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 = 'medication_registry_job:read')

    • return 403 (“Your scope does not allow to access this resource. Missing allowances: medication_registry_job:read”) in case of invalid scope(s)

Request data validation

Validate legal entity

  • Extract client_id from token.

  • Check client scopes in order to perform this action (scope = 'medication_registry_job:read')

    • in case of error - return 403 (“Your scope does not allow to access this resource. Missing allowances: medication_registry_job:read”)

  • Check client type (type = NHS)

    • In case of error - return 403 ('You don't have permission to access this resource')

HTTP status codes

HTTP status code

Message

What caused the error

401

 Invalid access token

 

403

  •  Your scope does not allow to access this resource. Missing allowances: medication_registry_job:read

  • You don't have permission to access this resource

 

  • No labels