Table of Contents |
---|
Purpose
This WS is designed to search Episodes of Care grouped by Groups of Diagnoses. If the user has approval on the Group of Diagnoses, he will receive a list of short Episodes of Care which contain diagnoses from this Group. To receive full Episode of Care data user must have the approval and use Get Episode by id endpoint.
...
period_from. Filter Episodes of Care where
period.start
is greater thanperiod_from
.period_to. Filter Episodes of Care where
period.end
is less thanperiod_to
.diagnoses_group_id.
Get
diagnoses_codes
array fromgroup
(PRM.diagnoses_group_codes DB) bydiagnoses_group_id
.For each diagnose in
diagnoses_group
(from previous step) getcode
andsystem
values. Save diagnose todiagnoses_codes
listSelect Episodes of Care where diagnose (
diagnoses_history.coding.code
anddiagnoses_history.coding.system
) is indiagnoses_codes
array list.
managing_organization_id. Filter Episodes of Care where
managing_organization.identifier.value
is likemanaging_organization_id
.
...
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
diagnoses_groups
from ME.approvals (Mongo DB), where these employees referenced asgranted_to
.Get
diagnoses_codes
array from For each diagnose indiagnoses_groups
(PRM.diagnoses_group_codes DB) getcode
andsystem
values. Save diagnose todiagnoses_codes
list.Get Episodes of Care by person_id from ME.episodes (Mongo DB) where:
status
is "active"at least one codefrom Select Episodes of Care where diagnose (
diagnoses_history.coding.code
anddiagnoses_history.coding.system
) is indiagnoses_codes
array and wherediagnoses_history.status
== "active". list
Filter Episodes of Care by submitted search params (period_from, period_to, diagnoses_group_id, managing_organization_id).
Order Episodes of Care by
inserted_at
and render a response according to specification:diagnoses
block should contain diagnoses with codes fromdiagnoses_codes
array only.