ЕСОЗ - публічна документація

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Specification

Apiary

Purpose

This WS is designed to return Request for Medication request detail.

Input parameters (filters)

  • id 

Validate request

Validate FK

  1. Validate id - medication_request_request_id exists

    • Return 422 in case validation fails (422 EView)

Logic WS

  1. Verify the validity of access token

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

  3. Search Requests for Medication request requests by id in WS url: 

    SELECT * FROM medication_request_requests 
        WHERE id=$.id 
            AND legal_entity_id = $.context.legal_entity_id

Logic WS for medication request requests based on care plan

  1. Get party_id  from $.context.user_id

  2. Get list from $.prm.employees for this party_id

  3. Get care_plan_id from $.medication_request_requests.data_based_on_care_plan_id

  4. Check $.approvals for user's employees (granted_to) on care_plan_id (granted_resources) and $.medication_request_requests.person_id (granted_by)

  5. Search Medication request requests by filters: data_based_on_care_plan_id, person_id.

    SELECT * FROM medication_request_requests MRR
    WHERE MRR.id = $.id 
        AND MRR.data_based_on_care_plan_id = $.id
        AND MRR.person_id = $.id
        AND MRR.is_active = TRUE
  • No labels