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 Diagnostic Report contexts [API-007-008-006-0289]

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-006-0289

Microservices (namespace)

ME

Component

Patient Summary

Component ID

COM-007-008

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

https://medicaleventsmisapi.docs.apiary.io/#reference/medical-events/patientdiagnostic-summaryreport/get-diagnostic-report-by-idcontexts

Resource

{{host}}/api/patients/{{patient_id}}/summary/diagnostic_reports/{{diagnostic_report_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 - diagnostic_report(parameter “diagnostic_report_id“ in response)

...

eHealth/resources - service_request (parameter “based_on“ in response)

...

eHealth/diagnostic_report_statuses (parameter “status“ in request / response)

...

eHealth/resources - service (parameter “code“ in request / response)

...

eHealth/diagnostic_report_categories (parameter “category“ in response)

...

eHealth/ICD10_AM/condition_codes (parameter “conclusion_code“ in response)

...

eHealth/resources - specimen (parameter “specimens“ in response)

...

eHealth/resources - equipment (parameter “used_references“ in response)

...

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

...

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

...

eHealth/resources - episode (parameter “origin_episode“ in response)

...

eHealth/resources - division (parameter “division“ in response)

...

eHealth/resources - legal_enity (parameter “managing_organization“ in response)

...

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

...

eHealth/report_origins (parameter “report_origin“ in response)

...

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

...

This method allows to get contexts of Diagnostic Report in order to create approval on episode and receive access to other medical events.

Logic

Service returns contexts (episode and origin_episode), diagnostic report based on:

  • Get Diagnostic Report object bydiagnostic_report_id from diagnostic_reports (MongoDB)

  • Get diagnostic_report.encounter.identifier from Diagnostic Report object

  • Call Get Encounter context :

    • Get Encounter objectby diagnostic_report.encounter.identifier (diagnostic_report.encounter.identifier = encounter._id)
      AFTER

    • Get encounter.episode from Encounter object

  • Get diagnostic_report.origin_episode from Diagnostic Report 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

e549c25770a9e15b-232eb71b-4dab4caf-9f1e8f2e-b2322cac3968ff247e8a5677

2

diagnostic_report_id

 M 

String

Unique DR Diagnostic Report identifier

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

Request structure

See on API-specification

Expand
titleExample
Code Block

...

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)

Processing

N/A

Response structure examples

See on API-specification

Expand
titleExample
Code Block
languagejson
{
  "data": {
    "id": "90a9e15b-b71b-4caf-8f2e-ff247e8a5600",
    "based_on (Reference_response, optional)episode": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
              "code": "service_requestepisode"
            }
          ]
        },
        "value": "9183a36b7c3da506-4d45804d-42444550-9339-63d81cd08d9c"
      }
    },
    "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"
    },
    "status": "final",
    "code": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
              "code": "service"
            }
          ]
        },
        "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
      },
      "display_value": "null"
    },
    "category": [
      {
        "coding": [
          {
            "system": "eHealth/diagnostic_report_categories",
            "code": "diagnostic_procedure"
          }
        ]
      }
    ],
    "effective_period": {
      "start": "2018-08-02T10:45:16.000Z",
      "end": "2018-08-02T11:00:00.000Z"
    },
    "issued": "2018-10-08T09:46:37.694Z",
    "conclusion": "At risk of osteoporotic fracture",
    "conclusion_code": {
      "coding": [
        {
          "system": "eHealth/ICD10_AM/condition_codes",
          "code": "H04.2"
        }
      ]
    },
    "recorded_by (Reference_response, required)": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
              "code": "employee"
            }
          ]
        8993-bf17f9ee0403"
      },
        "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
      },
      "display_value": "Опанасенко Олексій Володимирович"
    },
    "inserted_at": "2018-08-02T10:55:00.000Z",
    "updated_at": "2018-08-02T10:55:00.000Z",
    "encounter": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
              "code": "encounter"
            }
          ]
        },
        "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
      },
      "display_value": "null"
    },
    "origin_episode (Reference_response, optional)": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
              "code": "episode"
            }
          ]
        },
        "value": "9183a36b7c3da506-4d45804d-42444550-9339-63d81cd08d9c"
      }
    },
    "division": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
              "code": "division"
            }
          ]
        },
        "value": "9183a36b-4d45-4244-9339-63d81cd08d9c8993-bf17f9ee0403"
      },
      "display_value": "Перше відділення обласної лікарня №1null"
    },
    "managing_organization (Reference_response, optional)": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
              "code": "patient"
            }
          ]
        },
        "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
      },
      "display_value": "Київська обласна лікарня №1"
    },
    "results_interpreter": {
      "reference": {
        "identifier": {
          "type": {
            "coding": [
              {
                "system": "eHealth/resources",
                "code": "employee"
              }
            ]
          },
          "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
        },
        "display_value": "Опанасенко Олексій Володимирович"
      }
    },
    "primary_source": true,
    "explanatory_letter": "Звіт був відмінений у зв'язку з помилкою при виборі пацієнта",
    "cancellation_reason": {
      "coding": [
        {
          "system": "eHealth/cancellation_reasons",
          "code": "misspelling"
        }
      ],
      "text": ""
    }
  },
  "meta": {
    "code": 200,
    "url": "http://example.com/resource",
    "type": "object",
    "request_id": "req-adasdoijasdojsda"
  }
}

...

Post-processing processes

N/A (Not applicable)

Technical modules where the method is used

...