Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Оновлено відповідно до CSI-1738.
Table of Contents

...

Page Properties
idAPI_Specification

Link

https://uaehealthapi.docs.apiary.io/#reference/internal.-nhs-admin-v2/persons/get-person-details

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

Resource

/api/nhs_admin/persons/idgraphql

Посилання на ресурс, наприклад: /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

RESTGraphQL

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

Request type

GETPOST

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

Sync/Async

Sync

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

Public/Private/Internal

Private

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

Input parameters

...

Input parameter

...

Values

...

Type

...

Description

...

Example

...

id

...

String

...

Person identifier

...

 b075f148-7f93-4fc2-b2ec-2d81b19a9b7b

Dictionaries

  • GENDER

  • AUTHENTICATION_METHOD

  • DOCUMENT_TYPE

Request structure

...

Logic

This is a graphQl query method used in Administration panel only to get person’s data . Only authenticated and authorized NHS employee with appropriate scope can get person’s data.

Request structure

Example:

Expand
titleRequest example
Code Block
languagejson
{
	"query": "query PersonQuery($id: ID!, $filter: PersonAuthenticationMethodFilter, $after: String, $before: String, $first: Int, $last: Int) { person(id: $id) { ...UserInfo ...AuthMethods ...PersonConfidantPersons ...EmergencyContact ...VerificationDetails __typename } }  fragment AuthMethods on Person { authenticationMethods(filter: $filter, first: $first, last: $last, after: $after, before: $before) { nodes { id alias type startedAt endedAt phoneNumber isActive thirdPerson { databaseId firstName lastName secondName id authenticationMethods(filter: {type: [\"OTP\", \"OFFLINE\", \"NA\"]}, first: 50) { nodes { id type phoneNumber __typename } __typename } __typename } __typename } __typename } __typename }  fragment VerificationDetails on Person { verificationDetails { dracsDeath { verificationComment verificationReason verificationStatus dracsDeathActId unverifiedAt __typename } drfo { result syncedAt unverifiedAt verificationReason verificationStatus __typename } manualRules { unverifiedAt verificationComment verificationReason verificationStatus __typename } __typename } __typename }  fragment PersonConfidantPersons on Person { confidantPersons { relationType firstName lastName secondName gender birthDate birthCountry birthSettlement unzr taxId email secret preferredWayCommunication phones { type number __typename } documents { type number issuedAt issuedBy expirationDate __typename } relationshipDocuments { type number issuedAt issuedBy expirationDate __typename } __typename } __typename }  fragment EmergencyContact on Person { emergencyContact { firstName lastName secondName phones { type number __typename } __typename } __typename }  fragment UserInfo on Person { id databaseId status verificationStatus firstName secondName lastName gender birthDate birthCountry birthSettlement addresses { ...Addresses __typename } taxId noTaxId insertedAt updatedAt unzr email phones { type number __typename } preferredWayCommunication documents { type number issuedAt issuedBy expirationDate __typename } nhsRequestNumber nhsRequestComment deathDate secret __typename }  fragment Addresses on Address { type country area region settlement settlementType settlementId streetType street building apartment zip __typename }",
	"variables": {
		"id": "UGVyc29uOjlkMWYzYzhlLWJlYzctNDUyYS04ZTlmLWNhYjdlOGRjYWU1OA==",
		"first": 10,
		"filter": {
			"isEnded": false
		}
	}
}

Authorize

Request to process the request using a token in the headers.

Headers

Content-Type:application/json

Authorization:Bearer {{access_token}}

Request data validation

Processing

  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. person:read in order to search person

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

Request data validation

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

Check $.personId is ID from MPI.person.id

  • search person $.personId in MPI.person.(id = $.personId) and MPI.person.(id = $.personId).is_active = true then ok

    • in case of error, return "Person not found"

Processing

  1. Get data from mpi DB:

    1. persons by id

  2. Render a response according to specification.

Response structure

Example:

Expand
titleResponse example. Code: 200
Code Block
languagejson
{
    "data": {
        "person": {
            "__typename": "Person",
            "metaaddresses": [
                {
                    "__typename": "Address",
"code": 200,                    "apartment": "4",
                    "area": "Рівненська",
                    "building": "77",
                    "urlcountry": "UA",
       "https://example.com/resource",             "region": "Хмельницька",
                    "typesettlement": "objectДніпро",
    "request_id                "settlementId": "6617aeec429731cc-15e2e019-4d6f44d6-b9bd-53559c358f97#17810"
  },
  "data": {
    "id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
    "status": "active",
    "first_name": "Петро",
    "last_name": "Іванов",
    "second_name": "Миколайович",
    "birth_date": "1991-08-19",
    "birth_country": "Україна",
    "birth_settlement": "Вінниця",
    "tax_id": "3126509816",
    "unzr": "19910819-00011",
    "gender": "FEMALE",
    "authentication_method_current": {
      "type": "OTP",
      "number": "+380937777785"
    },a17e-3d8c16b78dba",
                    "settlementType": "CITY",
                    "street": "Абрикосова",
                    "streetType": "AVENUE",
                    "type": "RESIDENCE",
                    "zip": "82529"
                }
            ],
            "authenticationMethods": {
                "__typename": "PersonAuthenticationMethodConnection",
                "nodes": [
                    {
                        "__typename": "PersonAuthenticationMethod",
                        "alias": "OTP",
                        "endedAt": null,
                        "id": "UGVyc29uQXV0aGVudGljYXRpb25NZXRob2Q6YTZiZDczZDQtN2Q4NS00MzlkLTk1NjktZjEwYjVlY2QyNzAy",
                        "isActive": true,
                        "phoneNumber": "+380941455543",
                        "startedAt": null,
                        "thirdPerson": null,
                        "type": "OTP"
                    }
                ]
            },
            "birthCountry": "Україна",
            "birthDate": "1975-06-15",
            "birthSettlement": "Луцьк",
            "confidantPersons": [
                {
                    "__typename": "ConfidantPerson",
                    "birthCountry": "Україна",
                    "birthDate": "1996-12-12",
                    "birthSettlement": "Дніпро",
                    "documents": [
                        {
                            "__typename": "PersonDocument",
                            "expirationDate": null,
                            "issuedAt": "2013-03-15",
                            "issuedBy": "Херсон РОУ ВМУ МВС в Рівненська області",
                            "number": "ОП324030",
                            "type": "PASSPORT"
                        }
                    ],
                    "email": null,
                    "firstName": "Юлія",
                    "gender": "FEMALE",
                    "lastName": "Басок",
                    "phones": [
                        {
                            "__typename": "Phone",
                            "number": "+380904035005",
                            "type": "LAND_LINE"
                        }
                    ],
                    "preferredWayCommunication": null,
                    "relationType": "PRIMARY",
                    "relationshipDocuments": [
                        {
                            "__typename": "PersonDocument",
                            "expirationDate": null,
                            "issuedAt": "2011-03-16",
                            "issuedBy": "Луганьск РОУ ВМУ МВС в Хмельницька області",
                            "number": "ВБ361517",
                            "type": "DOCUMENT"
                        }
                    ],
                    "secondName": "Корнелійовна",
                    "secret": "secret",
                    "taxId": "3541011501",
                    "unzr": null
                }
            ],
            "databaseId": "9d1f3c8e-bec7-452a-8e9f-cab7e8dcae58",
            "deathDate": null,
            "documents": [
                {
                    "__typename": "PersonDocument",
                    "expirationDate": null,
                    "issuedAt": "2011-03-16",
                    "issuedBy": "Міколаїв РОУ ВМУ МВС в Чернівецька області",
                    "number": "ИЬ614450",
                    "type": "PASSPORT"
                }
            ],
            "email": null,
            "emergencyContact": {
                "__typename": "EmergencyContact",
                "firstName": "Світлана",
                "lastName": "Боровик",
                "phones": [
                    {
                        "__typename": "Phone",
                        "number": "АА120518+380383752740",
           "expiration_date             "type": "LAND_LINE"
                    }
                ],
                "secondName": "Йосиповна"
            },
            "firstName": "Павло",
            "gender": "MALE",
            "id": "UGVyc29uOjlkMWYzYzhlLWJlYzctNDUyYS04ZTlmLWNhYjdlOGRjYWU1OA==",
            "insertedAt": "2021-0203-13T19:44:28.426485Z",
            "lastName": "Сироїд",
        "issued_by": "Рокитнянським РВ ГУ МВС Київської області",    "nhsRequestComment": "",
            "nhsRequestNumber": "",
            "noTaxId": null,
            "phones": [
                {
                    "__typename": "Phone",
                    "number": "+380954591106",
           "issued_at         "type": "LAND_LINE"
                }
            ],
            "preferredWayCommunication": null,
            "secondName": "Пилипович",
            "secret": "secret",
            "status": "ACTIVE",
            "taxId": null,
            "unzr": null,
            "updatedAt": "20172023-02-28"
 04-26T16:12:01.740166Z",
            "verificationDetails": {
                "__typename": "PersonVerificationDetail",
                "dracsDeath": {
                    "__typename": "PersonDracsDeathVerification",
                    "dracsDeathActId": null,
                    "unverifiedAt": null,
                    "verificationComment": " ",
                    "verificationReason": "MANUAL_NOT_CONFIRMED",
                    "verificationStatus": "VERIFIED"
                },
                "drfo": {
                    "__typename": "PersonDrfoVerification",
                    "result": null,
                    "syncedAt": null,
                    "unverifiedAt": null,
                    "verificationReason": "ONLINE_TRIGGERED",
                    "verificationStatus": "VERIFICATION_NEEDED"
                },
                "manualRules": {
                    "__typename": "PersonManualRulesVerification",
                    "unverifiedAt": null,
                    "verificationComment": null,
                    "verificationReason": "RULES_PASSED",
                    "verificationStatus": "VERIFIED"
                }
            },
            "verificationStatus": "VERIFICATION_NEEDED"
        }
    },
    "extensions": {
 ]       "requestId": "f211af74-f3f9-40dc-baef-793532d4023a#18633"
    }
}

HTTP status codes

Page Properties
idAPI_HTTP status codes

HTTP status code

Message

What caused the error

 200

 Response

 

 

 

...

401

Invalid access token

 Invalid token

403

Your scope does not allow to access this resource. Missing allowances: {{scope}}

Scope is missing

409

client_id refers to legal entity that is not active

Legal entity is not active