Find out what resources were exported during the $export operation
This guide explains how to find out what resources certain Bulk client had access to
$export operation is used to export huge amounts of patient data directly to S3 buckets. Sometimes it is important to clarify what resources certain Bulk client had access to.
In the guide we analyze the behavior of the inferno-my-clinic-bulk-client
client
When the client used $export
To clarify when our client exported the data:
Open the
kibana
UIEnter the search request like
w_cid:inferno-my-clinic-bulk-client and w_m:get and w_url like /bulk-api/Group//$export
w_cid
is the id of out client
Define the dates range
Press the
Refresh
button
When the request list appears, collect if of the exported groups and timestamps.
Extract group id from the
w_url
property/tenant/my-clinic/bulk-api/Group/test-group-1/$export
->test-group-1
Extract timestamp from the
ts
property ->Dec 5, 2022 @ 16:34:30.417
Get list of patients
To get list of affected by the $export patient records:
Open the
REST Console
in AidboxPerform the
GET /Group/test-group-1/_history
request for each group collected on the previous stepSearch for the version being active during the export (
ts
property). The matching version haslastUpdated
less thants
. If there are several versions, the closes tots
should be takenList of patient are held in the
members
section
Get list of the resource were exported
List of resource types client had access to
List of resources types are defined with the scope
attribute.
Open the
REST Console
in AidboxPerform the
GET /Client/inferno-my-clinic-bulk-client/_history
requestSearch for the version being active during the export (
ts
property). The matching version haslastUpdated
less thants
. If there are several versions, the closes tots
should be takenList of resources the client had access to is defined by the
scope
propertyConvert scopes to the resource types
system/Observation.read
->Observation
resource type
See how system/*.read
expands
List the id of resources
This should be done for every patient and resource type
To build the list of patient compartment resources:
Open the
REST Console
in AidboxClarify how to search for the patient's resources (see patient compartment)
Get the list of the resources. For example,
GET /fhir/Observation?subject=test-pt-1&_elements=id
Collect all the ids related to the patient and a resource type.
The output could be a table like this.
test-pt-1
Observation
test-obs-1
test-pt-1
Observation
test-obs-2
Location
loc-1
test-pt-1
Patient
test-pt-1
Location
here is the example of the resource not in the compartment so the patient_id
is empty
Get the exported resources details
This should be done for every row on the table above
To get the exported resources you should repeat those steps changing the resource type
Open the
REST Console
in AidboxPerform the
GET /fhir/{resource_type}/{resource_id}/_history
request. For example,GET /fhir/Observation/test-obs-1/_history
Search for the version being active during the export (
ts
property). The matching version haslastUpdated
less thants
. If there are several versions, the closes tots
should be taken
Last updated