Versions Compared

Key

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

...

This WS is designed to reject previously created Medication request Request (patch)Request.

Key points

  1. Only authenticated and authorized user with appropriate scope can reject Medication request Request.

  2. Medication request Request can be rejected only from ‘NEW' status.

Specification

Page Properties
Taras Khometa (Unlicensed)Status

Project Name

Електронний рецепт

COVID-certificate

Project abreviation

ePrescription

SVC

Developer

API paragraph not foundEdenlab

Розробник методу API. Наприклад, Edenlab

Project Manager

API paragraph not foundMari Hulko (Unlicensed)

Mykhailo Zhushman (Unlicensed)

Tech Lead

API paragraph not foundMynchenko Andrii (SoE eHealth)

Product Owner

API paragraph not foundIgor Kostyria

Yevhen Batura NHSU

Вusiness analyst

API paragraph not found

Iryna Lishtaba (SoE eHealth) Oleksandr Zhuk (SoE eHealth) Oksana Demchenko

Taras Khometa (Unlicensed)

Status

Status
colourGreen
titleAPPROVED

Status
colourGreen
titleAPPROVED

Version

API paragraph not found

1.0

Date of release

API paragraph not foundPROD

Link

https://uaehealthapiehealthmisapi1.docs.apiary.io/#reference/public.-reimbursement/medication-request-requests/reject-medication-request-request

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

Resource

/api/medication_request_requests/{{id}}/actions/reject

Наприклад: /api/persons/create

Scope

medication_request_request:reject

Зазначається потрібний scope

Components

ePrescription, Reimbursement

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

Microservices

API paragraph not found

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

Protocol type

REST

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

Request type

PATCH

Тип HTTP методу, який використовується запитом, наприклад: POST | GET…

Sync/Async

Sync

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

Logic

API paragraph not found

...

  1. Verify the validity of access tokenCheck user scope 

    • in case of error - return 401 (“Invalid access token”) in case of validation fails.

  2. Verify that token is not expired

    • in case of error - return 401 (“Invalid access token”).

  3. Check user scopes in order to perform this action (scope = 'medication_request_request:reject') in order to perform this action

    1. In case error - generate 401 response

    Check user's legal entity is legal entity where Medication request Request has been created (

    • return 403 (“Your scope does not allow to access this resource. Missing allowances: medication_request_request

    .data.legal_entity_id = client_id from token)
    1. In case error - generate 403 response “Medication request Request can not be rejected by employee from another legal entity”

    • :reject”) in case of invalid scope(s).

Headers

Content-Type:application/json

Authorization:Bearer c2778f3064753ea70de870a53795f5c9

Validate request

...

Request data validation

Validate user

Medication request request rejection is allowed for user if he has one of the following active and approved approved employee that that:

  • is an

...

  • author

...

  • of the Medication request

...

  • request (medication_request_request.employee_id);

  • has an

...

  • approval on write Care plan if Medication request

...

  • request based on the Care plan (medication_request_request.based_on);

...

  • is med_admin from legal entity where Medication request request is created

    • in case of error - return 409 ("

...

Request data validation

Validation transition

...

For info - status charts: Medication_request_Request

...

Get Request for Medication request status by $.id

Check status == NEW

...

    • Employee is not author of medication request request, doesn't have approval or required employee type").

Validate transition

  • Get status of Medication request request by $.id in IL DB. Check that Medication request request is in status 'NEW'

    • in case of error - return 409 ("Invalid status Request for Medication request for reject transition!")

...

For more information look at Medication request status model .

Parameters that are used when processing the request

...

Processing

Update status

  1. Update (Set values) Request for Medication request request data in IL DB:

    1. set status  =  REJECTED 'REJECTED'

    2. updated_by = user_id

    3. updated_at = timestampnow()

Response structure

See on Apiary

...

HTTP status code

Message

What caused the error

200

Response

 

401

Invalid access token

 

403

Invalid scope

409

ErrorYour scope does not allow to access this resource. Missing allowances: medication_request_request:reject

409

  • Invalid status Request for Medication request for reject transition!

  • Employee is not author of medication request request, doesn't have approval or required employee type

Backward compatibility

API paragraph not found