Versions Compared

Key

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

Required parameters are marked with "*"

...

Purpose*

This WS allows to get detailed encounter info from Admin panel.

Specification*

...

Link

...

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

...

Resource

...

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

...

Scope

...

encounter:read

...

Components

...

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

...

Microservices

...

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

...

Protocol type

...

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

...

Request type

...

GET

...

Sync/Async

...

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

Logic*

  1. Get encounter by id and patient id

  2. Render detailed encounter data according to schema

Key points

  1. this is a graphQl query used in Administration panel only

  2. Only authenticated and authorized NHS employee with appropriate scope can get episode details.

  3. Query returns single episode by person (mpi id) and episode identifier.

  4. Filtration with forbidden group items is worked here. So NHS employee should have an approval from patient to see an episode with forbidden elements.

  5. Query should be invoked only if /wiki/spaces/AFC/pages/16680386561 for monitoring exists for current user and corresponding patient (ABAC rule_-2).

Input parameters

...

Input parameter

...

Values

...

Type

...

Description

...

Example

...

patient_id

...

String

...

Patient identifier

...

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

...

encounter_id

...

String

...

Encounter identifier

...

a10aeafb-0df2-4091-bc83-f07e92a100ae

Request structure*

API paragraph not found

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 = 'encounter:practical_monitor')

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

Check user has access to resource according to @rule_-2 in ABAC

...

Table of Contents
minLevel1
maxLevel3

Purpose

This web service is designed to return encounters by id.

Specification

Page Properties

Link

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

Resource

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

Scope

encounter:read

Components

Episode of Care

Microservices

API paragraph not found

Protocol type

REST

Request type

GET

Sync/Async

Async

Public/Private/Internal

Public

Input parameters

Input parameter

Values

Type

Description

Example

patient_id

String

Patient identifier

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

encounter_id

String

Encounter identifier

a10aeafb-0df2-4091-bc83-f07e92a100ae

Request structure

See on Apiary

Authorize

Request to process the request using a token in the headers

Headers*

Наприклад:

  • Content-Type:application/json

  • Authorization:Bearer mF_9.B5f-4.1JqM

Request data validation*

Validate legal entity

  • Extract client_id from token.

  • Check client 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:practical_monitor')

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

  • Check legal entity status (status = ACTIVE)

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

Validate request

  • Check required personId submitted.

    • return 404 (“not found“) in case not exist

  • Check required encounter Id submitted.

    • return 404 (“not found“) in case not exist or not related to the person

    • return 403 (“Access denied“) in case encounter has forbidden group items. Take into account approvals granted to NHS employee on forbidden groups (look at Medical Events filtration by Forbidden groups for details)

...

  • read')

    • Return 403 in case invalid scope(s)

Headers

Наприклад:

  • Content-Type:application/json

  • Authorization:Bearer {{access_token}}

  • API-key:{{secret}}

Request data validation

Access to the resource is also managed by ABAC module.

Processing

API paragraph not found

Response structure

...

See on Apiary

Example:

Expand
titleResponse example
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"
  }
}

Post-processing processes

...

API paragraph not found

HTTP status codes*

HTTP status code

Message

What caused the error

 200

 

 

401

 

Access token validation failed

403

 

Invalid scope