Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
REST API method / Метод REST API (настанова) (remove the link block before publishing the
Info
Note

Сторінка знаходиться в процесі розробки. Інформація на ній може бути застарілою.

Info

/wiki/spaces/EN/pages/17591304241 (remove the link block before publishing the document)

Table of Contents

Properties of a REST API method document

Page Properties
idpage_properties_method_REST API

Document type

Метод REST API

Document title

[Document status] REST API [Назва методу] [ID методу]DRAFT] Get Encounter by id [API-007-004-004-0254]

Guideline ID

GUI-0011

Author

@

Document version

1

Document status

DRAFT

Date of creation

ХХ.ХХ.ХХХХ (дата фінальної версії документа – RC або PROD)

Date of update

ХХ.ХХ.ХХХХ (дата зміни версії)

Method API ID

API-007-004-004-0254

Microservices (namespace)

ME

Component

EDP

Component ID

COM-007-004

Link на API-специфікацію

https://ehealthmedicaleventsapimedicaleventsmisapi.docs.apiary.io/#reference/medical-events/encounter/get-encounter-by-id

Resource

{{host}}/api/patients/{{patient_id}}/encounters/{{encounter_id}}

Scope

encounter:read

Protocol type

REST

Request type

GET

Sync/Async

Sync

Public/Private

Public

Purpose

This web service is designed to return encounters by id.

Logic

Description of the working algorithm of the API method and the interaction of services with each other add Service logic (if necessary)

Configuration parameters

Description of the configuration parameters that are used when processing a request in the system

Dictionaries

Provides a list of links to dictionaries that are available in Confluence

Input parameters

Description of input parameters

N/A

Configuration parameters

N/A

Dictionaries

N/A

Input parameters

Input parameter

Mandatory

Type

Description

Example

1

patient_id

 

String

Patient identifier

70a9e15b-b71b-4caf-8f2e-ff247e8a5677

2

encounter_id

 

String

Encounter identifier

a10aeafb-0df2-4091-bc83-f07e92a100ae

Request structure

See on API-specification (посилання на сторінку з API-специфікацією)

See on Apiary

Expand
titleExample
Code Block

Headers

...

Key

...

Value

...

Mandatory

...

Description

...

Example

...

Content-Type

...

application/json

...

M

...

Тип контенту

...

Content-Type:application/json

...

Authorization

...

Bearer {{access_token}}

...

Authorization:Bearer {{access_token}}

...

API-key

...

{{secret}}

...

API-key:{{secret}}

...

Headers

Headers

Request data validation

Authorize

Request to process the request using a token in the headers

  • Verify the validity of access token

    • Return 401 in case validation fails

  • Verify token is not expired

    • in case error return 401 

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

    • Return 403 in case invalid scope(s)

Access to the resource is also managed by ABAC module.

Processing

A list of processes related to receiving, changing or transmitting data according to the logic defined in the REST APIN/A

Response structure examples

See on API-specification (посилання на сторінку з API-специфікацією)Description of the REST API response structure, examplespecification

Expand
titleExample
Code Block
{
  "data": {
    "id": "465fb6fe-2dea-4b8a-9ef7-58379d1eaab0",
    "origin_episode": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
              "code": "episode"
            }
          ]
        },
        "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
      },
      "display_value": "null"
    },
    "status": "finised",
    "date": "2018-08-02",
    "incoming_referral": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
              "code": "service_request"
            }
          ]
        },
        "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
      },
      "display_value": "null"
    },
    "paper_referral": {
      "requisition": "1111-2222-3333-4444",
      "requester_legal_entity_name": "Some clinic",
      "requester_legal_entity_edrpou": "12345678",
      "requester_employee_name": "John",
      "service_request_date": "2018-10-08",
      "note": "Some notes"
    },
    "inserted_at": "2018-08-02T10:45:16.000Z",
    "updated_at": "2018-08-02T10:45:16.000Z",
    "visit": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
              "code": "visit"
            }
          ]
        },
        "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
      },
      "display_value": "null"
    },
    "episode": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
              "code": "episode"
            }
          ]
        },
        "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
      },
      "display_value": "null"
    },
    "class": {
      "system": "eHealth/encounter_classes",
      "code": "inpatient"
    },
    "type": {
      "coding": [
        {
          "system": "eHealth/encounter_types",
          "code": "PC"
        }
      ]
    },
    "performer": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
              "code": "employee"
            }
          ]
        },
        "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
      },
      "display_value": "Шевченко Олесь Вікторович"
    },
    "reasons": [
      {
        "coding": [
          {
            "system": "eHealth/ICPC2/reasons",
            "code": "T01"
          }
        ]
      },
      {
        "coding": [
          {
            "system": "eHealth/ICPC2/reasons",
            "code": "T90"
          }
        ]
      }
    ],
    "diagnoses": [
      {
        "condition": {
          "identifier": {
            "type": {
              "coding": [
                {
                  "system": "eHealth/resources",
                  "code": "condition"
                }
              ]
            },
            "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
          },
          "display_value": "null"
        },
        "code": {
          "coding": [
            {
              "system": "eHealth/ICPC2/conditions",
              "code": "A20"
            }
          ]
        },
        "role": {
          "coding": [
            {
              "system": "eHealth/diagnosis_roles",
              "code": "CC"
            }
          ]
        },
        "rank": 1
      }
    ],
    "actions": [
      {
        "coding": [
          {
            "system": "eHealth/ICPC2/actions",
            "code": "T47"
          }
        ]
      },
      {
        "coding": [
          {
            "system": "eHealth/ICPC2/actions",
            "code": "T47"
          }
        ]
      }
    ],
    "action_references": [
      {
        "identifier": {
          "type": {
            "coding": [
              {
                "system": "eHealth/resources",
                "code": "service"
              }
            ]
          },
          "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
        }
      }
    ],
    "division": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
              "code": "division"
            }
          ]
        },
        "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
      },
      "display_value": "null"
    },
    "prescriptions": "'Дієта №1, Омепразолу 40 мг 1 раз на добу + амоксициліну 500 мг + метронідазолу 400 мг при необхідності 500 мг або тинідазолу 500 мг 3 рази на добу протягом 1 тижня'",
    "supporting_info": [
      {
        "identifier": {
          "type": {
            "coding": [
              {
                "system": "eHealth/resources",
                "code": "observation"
              }
            ]
          },
          "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
        },
        "display_value": "null"
      },
      {
        "identifier": {
          "type": {
            "coding": [
              {
                "system": "eHealth/resources",
                "code": "diagnostic_report"
              }
            ]
          },
          "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
        },
        "display_value": "null"
      }
    ],
    "cancellation_reason": {
      "coding": [
        {
          "system": "eHealth/episode_closing_reasons",
          "code": "cured"
        }
      ]
    },
    "explanatory_letter": "Діагноз був відмінений у зв'язку з помилкою при виборі пацієнта",
    "hospitalization": {
      "admit_source": {
        "coding": [
          {
            "system": "Health/encounter_admit_source",
            "code": "default"
          }
        ]
      },
      "re_admission": {
        "coding": [
          {
            "system": "Health/encounter_re_admission",
            "code": "default"
          }
        ]
      },
      "destination": {
        "identifier": {
          "type": {
            "coding": [
              {
                "system": "eHealth/resources",
                "code": "division/legal_entity"
              }
            ]
          },
          "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
        },
        "display_value": "null"
      },
      "discharge_disposition": {
        "coding": [
          {
            "system": "Health/encounter_discharge_disposition",
            "code": "default"
          }
        ]
      },
      "discharge_department": {
        "coding": [
          {
            "system": "Health/encounter_discharge_department",
            "code": "default"
          }
        ]
      },
      "pre_admission_identifier": "12345"
    }
  },
  "meta": {
    "code": 200,
    "url": "http://example.com/resource",
    "type": "object",
    "request_id": "req-adasdoijasdojsda"
  }
}

HTTP status codes

Unauthorized

Response code

HTTP Status code

Message

Internal name

Description

1

Базові

2

200

 

 

3

401

 

Access token validation failed

4

401

Помилка підтвердження

5

403

 

Invalid scope

6

1000

404

Composition not found

COMPOSITION_NOT_FOUND_404

Не знайдено медичний висновок

7

Специфічні

8

422

Only for active MPI record can be created medication request!

5

Специфічні

6

Post-processing processes

Description of actions performed on data after processing

Technical modules where the method is used

List of pages describing technical N/A

Technical modules where the method is used

Page Properties Report
headingsID ТМ, Статус
cqllabel = "tr-mis"

...