...
Select list of employees from PRM.employees related to the current user in the current legal_entity, using data from the token.
Select all active approvals on
service_groups
from ME.approvals (Mongo DB), where these employees referenced asgranted_to
.Get
services
(PRM.service_inclusions DB) byservice_group_id
. Save service toservices
list.Get Procedures by person_id from ME.procedures (Mongo DB) where:
code.identifier.value is in
services
list (from previous step)
Filter Procedures by submitted search params (diagnosesservice_group_id, managing_organization_id…).
Order Proedures by
inserted_at
and render a response according to specification