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

(GraphQL, NHS) Get Person's DRACS death candidates data

Purpose

This WS is designed to allow NHS employee with assigned appropriate scopes to get person’s DRACS death candidates.

Key points 

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

  2. Only authenticated and authorized NHS employee with appropriate scope can get person’s DRACS death candidates.

Specification

Link

-

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

Resource

/graphql

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

Scope

person:read

Scope для доступу

Components

Patient registry

Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription

Microservices

mpi/api

il/api (rpc)

fe/admin-web

Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC

Protocol type

GraphQL

Тип протоколу, який використовується запитом, наприклад: SOAP | REST

Request type

POST

Тип запиту API, наприклад: GET, POST, PATCH…

Sync/Async

Sync

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

Public/Private/Internal

Private

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

"Reads and enables pagination through a set of `PersonDracsDeathCandidate`." personDracsDeathCandidates( "The method to use when ordering collection items." orderBy: PersonDracsDeathCandidateOrderBy "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 ): PersonDracsDeathCandidateConnection! "Reads a single `PersonDracsDeathCandidate` using its globally unique ID." personDracsDeathCandidate(id: ID!): PersonDracsDeathCandidate "Reads a single `DracsDeathAct` using its globally unique ID." dracsDeathAct(id: ID!): DracsDeathAct
""" Methods to use when ordering `PersonDracsDeathCandidate`. """ enum PersonDracsDeathCandidateOrderBy { "Sort DRACS death candidate by inserted at in ascending order." INSERTED_AT_ASC "Sort DRACS death candidate by inserted at in descending order." INSERTED_AT_DESC "Sort DRACS death candidate by score in ascending order." SCORE_ASC "Sort DRACS death candidate by score in descending order." SCORE_DESC "Sort DRACS death candidate by status in ascending order." STATUS_ASC "Sort DRACS death candidate by status in descending order." STATUS_DESC "Sort DRACS death candidate by updated at in ascending order." UPDATED_AT_ASC "Sort DRACS death candidate by updated at in descending order." UPDATED_AT_DESC } """ A connection to a list of `PersonDracsDeathCandidate` values. """ type PersonDracsDeathCandidateConnection { "Information to aid in pagination." pageInfo: PageInfo! "A list of nodes." nodes: [PersonDracsDeathCandidate] "A list of edges." edges: [PersonDracsDeathCandidateEdge] } """ Reads and enables pagination through a set of `PersonDracsDeathCandidate`. """ type PersonDracsDeathCandidateEdge { "The item at the end of the edge." node: PersonDracsDeathCandidate! "A cursor for use in pagination." cursor: String! } """ Person`s DRACS death candidate. """ type PersonDracsDeathCandidate implements Node { "The ID of an object." id: ID! "Primary key identifier from the database." databaseId: UUID! "Person identifier." person: Person! "Identifier of DRACS death act." deathAct: DracsDeathAct! "Status of DRACS death candidate." status: PersonDracsDeathCandidateStatus! "Reason of DRACS death candidate status, if exists." statusReason: PersonDracsDeathCandidateReason "Logistic regression comparison score." score: Float "Date and time the record was created." insertedAt: Date! "Date and time the record was updated." updatedAt: Date! }
""" DRACS death act. """ type DracsDeathAct implements Node { "The ID of an object." id: ID! "Primary key identifier from the database." databaseId: UUID! "Death act registration date in DRACS registry." arRegDate: Date "Death act registration number in DRACS registry." arRegNumber: String "Date of last operation with death act." opDate: Date "Name of last operation with death act." arOpName: String "Death act number in the book of state registration of deaths." regNumb: String "Death act compose date." composeDate: String "The state organization who composed death act." composeOrg: String "Restored (renewed) flag" isRestore: Int "First name of deceased person." name: String "Last name of deceased person." surname: String "Second name of deceased person." patronymic: String "Birth date of deceased person." dateBirth: String "Birthplace country of deceased person." birthState: String "Birthplace region of deceased person." birthRegion: String "Birthplace district of deceased person." birthDistrict: String "Birthplace locality type of deceased person." birthLocalityType: String "Birthplace locality name of deceased person." birthLocality: String "Gender of deceased person." sex: String "Tax id of deceased person." numident: String "Death date of deceased person." dateDeath: String "Residence country name of deceased person." state: String "Residence area name of deceased person." region: String "Residence district name of deceased person." district: String "Residence settlement type of deceased person." localityType: String "Residence locality name of deceased person." locality: String "Residence street name of deceased person including street type." street: String "Residence house number of deceased person." house: String "Residence apartment number of deceased person." apartment: String "Documents that were seized from a deceased person." docSeizes: DocSeize }

Authorize

  • Verify the validity of access token

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

    • Return (403, 'Your scope does not allow to access this resource. Missing allowances: person:read') in case of invalid scope(s)

Validate legal entity

  • Extract client_id from token.

  • Check legal entity status (status = ACTIVE)

    • In case of error - return 409 ('client_id refers to legal entity that is not active')

Validate request

Validate $.personId

  • Find person in mpi.persons

    • in case of error - return 404 "Such person doesn't exist"

  • Check if person is active: person.status = 'active' and person.is_active = true

    • in case of error - return 409 "Such person isn't active"

Service logic

  1. Get candidates data from mpi.person_verification_candidates table by person_id

  2. Get DRACS death act details from mimir.dracs_death_acts table by verification_candidate.entity_id

  3. Render a response according to specification.

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