Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Page Properties
idpage_properties_method_REST API

Document type

Метод REST API

Document title

[DRAFT] Get Condition by id context [API-007-008-003-02830284]

Guideline ID

GUI-0011

Author

@

Document version

1

Document status

DRAFT

Date of creation

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

Date of update

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

Method API ID

API-007-008-003-02830284

Microservices (namespace)

ME

Component

Patient Summary

Component ID

COM-007-008005

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

https://medicaleventsmisapi.docs.apiary.io/#reference/medical-events/patient-summaryconditions/get-condition-by-idcontext

Resource

{{host}}/api/patients/{{patient_id}}/summary/conditions/{{condition_id}}/context

Scope

patientmedical_event_summarycontext:read

Protocol type

REST

Request type

GET

Sync/Async

SyncAsync

Public/Private

Public

Purpose

N/A

Logic

N/A

Configuration parameters

N/A

Dictionaries

...

eHealth/resources - condition(parameter “id“ in request)

...

eHealth/resources - employee (parameter “asserter“ in response)

...

eHealth/report_origins (parameter “patient“ in response)

...

eHealth/resources - encounter (parameter “context“ in response)

...

eHealth/condition_clinical_statuses (parameter “clinical_status“ in response)

...

eHealth/condition_verification_statuses (parameter “verification_status“ in response)

...

eHealth/condition_severities (parameter “severity“ in response)

...

This method allows to get the context of Condition in order to create approval on episode and receive access to other medical events.

Logic

Service returns context (episode), condition based on:

  • Get Condition object by condition_id from conditions (MongoDB)

  • Get condition.context_episode_id from Condition object

  • Render a response according to specification

Configuration parameters

N/A

Dictionaries

N/A

Input parameters

Input parameter

Mandatory

Type

Description

Example

1

patient_id

 M 

String

Unique MPI patient Patient identifier

7a489bbd70a9e15b-d8e2b71b-48d94caf-92fd8f2e-fcf0102f7b08ff247e8a5677

2

condition_id

 M 

String

Unique condition Condition identifier

340b86fda10aeafb-23f30df2-4a334091-94c5bc83-8ec19d116c33f07e92a100ae

Request structure

See on API-specification

Expand
titleExample
Code Block
languagejson

Headers

See on Headers

Request data validation

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

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

Validate Person

  • Get Person identifier from the URL

  • Check it exists in DB

    • Return 404 ('not_found') in case of error

Validate Encounter

  • Get Condition identifier from the URL

    • Check it exists in DB

      • Return 404 ('not_found') in case of error

    • Check Condition belongs to patient

      • Return 404 ('not_found') in case of error

Processing

N/A

Response structure examples

See on API-specification

Expand
titleExample
Code Block
languagejson
{
  "data": {
    "idepisode": "6fe6d880-f100-4e39-a278-1d14eb8472ef",
    "primary_source": true,
    "asserter": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
              "code": "employeeepisode"
            }
          ],
          "text": ""
        },
        "value": "97d572387c3da506-ffbe804d-43354550-92ea8993-28d4de117ea2bf17f9ee0403"
      }
    },
    "context": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
     
        "code": "encounter"
            }
          ]
        },
        "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
      },
      "display_value": "null"
    },
    "code": {
   
  "coding": [
        {
          "system": "eHealth/ICD10/condition_codes",
          "code": "K87"
        }
      ]
    },
    "clinical_status": "active",
    "verification_status": "provisional",
    "severity": {
      "coding": [
        {
          "system": "eHealth/condition_severities",
       
  "code": "55604002"
        }
      ]
    },
    "body_sites": [
      {
        "coding": [
          {
            "system": "eHealth/body_sites",
            "code": "head"
          }
        ]
      }
    ],
    "onset_date": "2018-10-08T09:46:37.694Z",
    "asserted_date": "2018-10-08T09:46:37.694Z",
    "inserted_at": "2018-08-02T10:45:16.000Z",
    "updated_at": "2018-08-02T10:45:16.000Z",
    "stage": {
      "summary": {
        "coding": [
          {
            "system": "eHealth/condition_stages",
            "code": "14803004"
          }
        ]
      }
    },
    "evidences": [
      {
        "codes": [
          {
            "coding": [
              {
                "system": "eHealth/ICPC2/reasons",
                "code": "169068008"
              }
            ]
          }
        ],
        "details": [
          {
            "identifier": {
              "type": {
                "coding": [
                  {
                    "system": "eHealth/resources",
                    "code": "observation"
                  }
                ]
              },
              "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
            },
            "display_value": "null"
          }
        ]
      }
    ]
  },
  "meta": {
    "code": 200,
    "url": "http://example.com/resource",
    "type": "object",
    "request_id": "req-adasdoijasdojsda"
  }
}

...

Response code

HTTP Status code

Message

Internal name

Description

1

Базові

2

 

 

200

 

 

 

3

 

401

 

Access token validation failed

 

4

 

401

 

Access token expired

 

5

 

403

 

Invalid scope

 

6

Специфічні

Post-processing processes

...