Versions Compared

Key

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

...

Request to process the request using a token in the headers

Headers*

Наприклад:

  • Content-Type:application/json

  • Authorization:Bearer mF_9.B5f-4.1JqM

  • api-key:aFBLVTZ6Z2dON1V

...

2.1. Get token metadata

  • Extract user_idclient_idclient_type

2.2. Determine the party_id associated with this user_id

Code Block
SELECT pu.party_id FROM party_users pu
WHERE pu.user_id = :user_id;

2.3. Determine employees related to this party_id in current MSP

Code Block
SELECT e.id FROM employees e WHERE e.party_id = :party_id
AND e.legal_entity_id = :client_id;

...

  1. Validate that DS belongs to the requester of encounter

3.1. Determine the party_id associated with requester ($.requester.identifier.value)

...

Implemented by DS validation (see Validate digital signature p.2)

Validate transition

Only active service request can be canceled

...

  1. Save signed content to media storage

  2. Update service request status to entered_in_error (update also updated_at, updated_by)

  3. Write record to status history

  4. Send SMS to patient (if authentication_method_current == SMS)

    1. Template - TBD

  5. Async! Revoke all approvals made by this service request

...