Versions Compared

Key

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

Purpose

This WS is designed to search (get list) for(of) Medication requests.

According to requirements:

  • User can see all Medication Requests of which he is an author

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

  • DOCTOR can see all the Medication requests of the patients whom he has an active declaration with doctor (employee_id) 

  • User of NHS_ADMIN can see all Medication requests (without limitations)

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

Specification

...

Project Name

...

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

...

COVID-certificate

...

Project abreviation

...

ePrescription

...

SVC

...

Developer

...

API paragraph not found

...

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

...

Project Manager

...

API paragraph not found

...

Tech Lead

...

API paragraph not found

...

Product Owner

...

API paragraph not found

...

Вusiness analyst

...

API paragraph not found

...

Status

Status
colourGreen
titleAPPROVED
Status
colourGreen
titleAPPROVED

...

Version

...

API paragraph not found

...

1.0

...

Date of release

...

API paragraph not found

...

Table of Contents

Purpose

This WS is designed to search (get list) for(of) Medication requests.

According to requirements:

  • User can see all Medication Requests of which he is an author

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

  • DOCTOR can see all the Medication requests of the patients whom he has an active declaration with doctor (employee_id) 

  • User of NHS_ADMIN can see all Medication requests (without limitations)

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

Specification

Page Properties

Link

https://uaehealthapi.docs.apiary.io/#reference/public.-reimbursement/medication-request/get-medication-requests

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

Resource

/api/medication_requests

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

Scope

medication_request:read

Зазначається потрібний scopeScope для доступу

Components

ePrescription, Reimbursement

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

Microservices

API paragraph not found

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

Protocol type

REST

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

Request type

GET

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

Sync/Async

Sync

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

Logic

Logic WS

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

    1. Return 403 in case invalid scope(s)

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

    1. Return 500 in case ("Not found party for this user!")  

  4. Get list of employees to `my_employees_list` for this `party_id`  & `$.context.legal_entity_id`

    Code Block
    SELECT E.id
    	FROM parties P
    		JOIN employees E
    			ON P.id = E.party_id
    		JOIN party_users PU
    			ON parties.id = party_users.party_id
    WHERE PU.user_id=$.context.user_id
    	AND E.legal_entity_id = $.context.legal_entity.id
    	
    
    

  5. Search Medication requests by filters with use `my_employees_list` : 

    Code Block
    SELECT * FROM medication_request MR 
    	LEFT JOIN declarations D 
    		ON MR.person_id = D.person_id
    			AND D.status = ACTIVE
    WHERE (MR.employee_id IN [my_employees_list] OR D.employee_id IN [my_employees_list] )
    		AND (MR.status = $.status OR $.status IS NULL)
    		AND (MR.person_id = $.person_id OR $.person_id IS NULL)
    		AND (MR.medication_id = $.medication_id OR $.medication_id IS NULL)
    		AND (MR.number = $.request_number OR $.request_number IS NULL)
    		AND (MR.created_at >= $.created_from OR $.created_from IS NULL)
    		AND (MR.created_at <= $.created_to OR $.created_to IS NULL)
    
    
    

...