ЕСОЗ - публічна документація
IL.Report stats
Get Main Stats
Detailed spec:
{
"data": {
"declarations": select count(*) from declarations where inserted_at <= end_date and status in('active', 'pending_verification')
"msps": select count(*) from legal_entities where type ='MSP' and is_active = true and status='ACTIVE'
"doctors": select count(*) from employees where is_active = TRUE and employee_type = 'DOCTOR' and status = 'APPROVED'
"pharmacies": select count(*) from legal_entities where type ='PHARMACY' and is_active = TRUE and status='ACTIVE'
"pharmacists": select count(*) from employees where is_active = TRUE and employee_type = 'PHARMACIST' and status = 'APPROVED'
"active medication requests": select count(*) from medication_requests where status = 'ACTIVE'
"completed medication requests": select count(*) from medication_requests where status = 'COMPLETED'
},
}
Get Main Stats by Regions
Detailed spec
"declarations": select area, count(id) from
(select d.id,d.division_id, da.area from declarations d
left join division_addresses da on da.division_id=d.division_id
where d.status in('active', 'pending_verification') ) a
group by area
"msps": legal_entities.[type='MSP' and status='ACTIVE'].addreses['REGISTRATION'].region_ID
"doctors": 15 --> employees.[employee_type='DOCTOR' & is_active=true and status='APPROVED'].division_id-->divisions.addreses['RESIDENCE'].region_ID
"pharmacies": 2, --> legal_entities.[type='PHARMACY' and status='ACTIVE'].addreses['REGISTRATION'].region_ID
"pharmacists": 15 --> employees.[employee_type='PHARMACIST' & is_active=true and status='APPROVED'].division_id-->divisions.addreses['RESIDENCE'].region_ID
"medication_requests": 30 -->medication_requests.employee_id-->division_id-->divisions.addreses['REGISTRATION'].region_ID
"active medication requests":
select area, count(id) from
(select mr.id,mr.division_id, da.area from medication_requests mrleft join division_addresses da on da.division_id=mr.division_id and type = 'RESIDENCE'where status = 'ACTIVE') a
group by area;
"completed medication requests":
select area, count(id) from
(select mr.id,mr.division_id, da.area from medication_requests mrleft join division_addresses da on da.division_id=mr.division_id and type = 'RESIDENCE'where status = 'COMPLETED') a
group by area;
Get Main Stats by Division
ЕСОЗ - публічна документація