Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Purpose

This WS allows to get getting details about an unidentified person from eHealth.

Specification

Page Properties
idAPI_Specification

...

або Swagger

Resource

/api/prepersons/{{id}}

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

Scope

preperson:read

Scope для доступу

Components

Patient registry

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

Microservices

mpi/api

il/api (rpc)

fe/admin-web

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

Protocol type

REST

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

Request type

GET

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

Sync/Async

Sync

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

Public/Private/Internal

Public

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

Logic

  1. Only authenticated and authorized

...

  1. SPECIALIST, ASSISTANT, RECEPTIONIST

...

  1. employees can get preperson.

  2. Preperson could be got only in OUTPATIENT or EMERGENCY legal entity type, if

...

  1. identifier of preperson is being known (returns after Create preperson).

  2. Only

...

  1. preperson’s table fields can be recieved.

Input parameters

Input parameter

Values

Type

Description

Example

id

String

MPI identifier of the preperson.

...

Required

7c3da506-804d-4550-8993-bf17f9ee0402

Dictionaries

  • GENDER

  • PHONE_TYPE

Request structure

See on Apiary

Authorize

  1. Verify the validity of access token

...

    • return 401 in case validation fails

  1. Check user scopes in order to perform this action (scope = 'preperson:read')

...

    • return 403 in case invalid scope(s)

...

Headers

Content-Type:application/json

Authorization:Bearer {{access_token}}

api-key:{{secret}}

Request data validation

Validate preperson_id

  1. Check

...

  1. preperson_id

...

  1. exists

    1. In case error - return

...

Generate patient_id from person_id. Check if patient_id exists in patients collection.

  1. In case of error - return 404

Prepare response

...

    1. 404

Processing

Prepare response

Render response.

Response structure

See on Apiary

Example:

Expand
titleResponse example
Code Block
{
  "meta": {
    "code": 200,
    "url": "https://example.com/resource",
    "type": "object",
    "request_id": "6617aeec-15e2-4d6f-b9bd-53559c358f97#17810"
  },
  "data": {
    "id": "7c3da506-804d-4550-8993-bf17f9ee0402",
    "external_id": "#1234-FDS-aa",
    "first_name": "Петро",
    "last_name": "Іванов",
    "second_name": "Миколайович",
    "gender": "MALE",
    "birth_date": "1980-01-01",
    "emergency_contact": {
      "first_name": "Петро",
      "last_name": "Іванов",
      "second_name": "Миколайович",
      "phones": [
        {
          "type": "MOBILE",
          "number": "+380503410870"
        }
      ]
    },
    "note": "Registered in SmartMed clinic at 01.01.2019 16:40. Male, 40 years old approximately, tatoo with sport motorcycle on the right forearm",
    "status": "ACTIVE",
    "death_date": "2018-11-11",
    "inserted_at": "2017-04-20T19:14:13Z",
    "inserted_by": "e1453f4c-1077-4e85-8c98-c13ffca0063e",
    "updated_at": "2017-04-20T19:14:13Z",
    "updated_by": "2922a240-63db-404e-b730-09222bfeb2dd"
  }
}

HTTP status codes

Page Properties
idAPI_HTTP status codes

HTTP status code

Message

What caused the error

200

 Response

 

401

 

Access token validation fails

403

Invalid scope(s)

404

Check if the preperson_id exists failed