Versions Compared

Key

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

...

  • A user of MSP, PRIMARY_CARE, OUTPATIENT (DOCTOR, SPECIALIST, etc) can see all Medication request from the user's legal entity.

  • A user of MSP, PRIMARY_CARE (DOCTOR, etc) can see all the Medication requests of the patients whom he has an active declaration with by yourself a doctor (employee_id).

  • Users of PHARMACY can see all Medication requests (without limitations).

  • Users of MSP, PRIMARY_CARE, OUTPATIENT (DOCTOR, SPECIALIST, etc) can see all Medication requests based on the approval of the care plan that is contained in the Medication request.

...

Page Properties

Link

https://ehealthmisapi1.docs.apiary.io/#reference/public.-reimbursement/medication-request/get-medication-request-by-id

Посилання на Apiary або Swagger

Resource

/api/medication_requests/{{id}}

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

Scope

medication_request:details

Scope для доступу

Components

ePrescription

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

Microservices

API paragraph not found

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

Protocol type

REST

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

Request type

GET

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

Sync/Async

Sync

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

Public/Private/Internal

Public

Logic

  1. Verify the validity of access token

    1. Return 401 in case validation fails

  2. Check user scopes in order to perform this action (scope = 'medication_request:details')

    1. Return 403 in case invalid scope(s)

  3. Get `client_type` from `mithril.clients`

  4. Get `my_party_id`  from `$.context.user_id`

  5. Get list from `prm.employees` for this `party_id`  & `$.context.legal_entity_id`

  6. Search Medication requests by filters:

    Code Block
    SELECT * FROM medication_request MR
        INNER JOIN employees E
            ON E.party_id = my_party_id
                AND (E.id = $.employee_id OR $.employee_id IS NULL)
                AND (E.legal_entity_id == $.context.legal_entity_id OR $.context.legal_entity_id IS NULL)
        LEFT JOIN declarations D
            ON D.Employee_id = E.id 
                AND E.status = ACTIVE
                AND D.status = ACTIVE
                AND MR.person_id = D.person_id
    WHERE (MR.id = $.id OR MR.request_number = $.id) 
        AND MR.employee_id == E.id
        AND MR.is_active = TRUE

...

  1. Read data from `ops.medication_requests` by `id`

  2. Validate legal_entity_id - legal_entity_id exists

    • Return 422 in case validation fails (422 EView)

  3. Validate employee_id - employee_id exists

    • Return 422 in case validation fails (422 EView)

  4. Validate division_id - division_id exists

    • Return 422 in case validation fails (422 EView)

  5. Validate medical_program_id - medical_program_id exists

    • Return 422 in case validation fails (422 EView)

  6. Validate all medication_id - medication_id exists

    • Return 422 in case validation fails (422 EView)

  7. Validate person_id - mpi_id exists

    • Return 422 in case validation fails (422 EView)

Parameters that are used when processing the request

Configuration parameters

Access to the method is defined by the scope medication_request:details. Permission for this scope is determined by the System administrator by configuring scopes in the context of clients and roles.

Dictionaries

...

Processing

API paragraph not found

...