ЕСОЗ - публічна документація

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »


Reports Logic

Using replicated tables from fraud data mart and BI tool the reports with outliers must be shown. Until there is no enough statistic to use statistical methods to find outliers, the top least(5%, 25 rows) can be shown instead.

For now there are 3 reports are required - for autorization, doctors and phone_numbers.

Predefine views with aggregation

1. Doctor aggregation  

  • number of patients per doctor (total_patients_doctor)

Conditions: employee, declarations

  • employee.id=declarations.employee_id
  • employee.employee_type='DOCTOR'
  • employee.is_active=true
  • employee.status='APPROVED'
  • declarations.is_active=true
  • declarations.status='active'

Fields:

SOURCEFIELDNAMEDESCRIPTION
employeeparty_idparty_id
employeelegal_entity_idlegal_entity_id
declarationscount(person_id)patients_qtyqty patients by doctor (total till report date)
declarations

sum(qty_person_id_30)/

avg(qty_person_id_60)

patient_increase_30d

For each doctor calculate lifetime - (report_date-inserted_at)

If doctor lifetime <=90 days  - then null 

if doctor lifetime >= 90 days:

sum(qty_person_id_30) - total number of patients for doctor for the last 30 days

avg(qty_person_id_60) - average number of patients for doctor for 60 days before last 30 days

if avg(qty_person_id_60)=0 then 9999

declarationssum(qty_person_id_30)patient_increase_30d_0if avg(qty_person_id_60)=0 then sum(qnty_person_id_30)

$inserted_atreport_datethe date when calculated
  • number and percentage of patients per doctor that have set offline authorization method (autorization_doctor)

Conditions:

  • employee.id=declarations.employee_id
  • declarations.person_id=presons.id
  • employee.division_id=divisions.id
  • employee.employee_type='DOCTOR'
  • employee.is_active=true
  • employee.status='APPROVED'
  • declarations.is_active=true
  • declarations.status='active'
  • divisions.addresses.{type:"RESIDINCE"}


Fields:

SOURCEFIELDNAMEDESCRIPTION
employeeparty_idparty_id
employeelegal_entity_idlegal_entity_id
divisions

residence_settlement_type

residence_settlement_type 


when type<>'CITY' then 'OTHER' else type
persons
count(authentication_methods.type='OFFLINE'.person_id)

offline_patients_qty

authentication_methods.type='OFFLINE'
personscount(authentication_methods.type='OFFLINE'.person_id)/count(person_id)ratio_offline_patients_qtyratio of patients with offline method of authorization within particular doctor 
personscount(person_id)patients_qtyqty patients by doctor (total till report date)

$inserted_atreport_datethe date when calculated

2. Patient aggregation  

  • number of patients with same phone number (patients_phonenumber)

The table recalculates on daily basis

Conditions:

  • declarations.person_id=presons.id
  • declarations.is_active=true
  • declarations.status='active'

Fields:

SOURCEFIELDNAMEDESCRIPTION
personsphones.{number}phone_number
personscount(id)patients_qty

$inserted_atreport_datethe date when calculated

3. Legal entity aggregation  

  • number and percentage of patients per legal_entity that have set offline authorization method (autorization_legal_entity)

Conditions:

  • employee.id=declarations.employee_id
  • declarations.person_id=presons.id
  • employee.division_id=divisions.id
  • employee.employee_type='DOCTOR'
  • employee.is_active=true
  • employee.status='APPROVED'
  • declarations.is_active=true
  • declarations.status='active'
  • divisions.addresses.{type:"RESIDINCE"}


Fields:

SOURCEFIELDNAMEDESCRIPTION
employeelegal_entity_idlegal_entity_id
divisions

divisions.addresses.residence_settlement_type

residence_settlement_type


when type<>'CITY' then 'OTHER' else type
persons
count(authentication_methods.type='OFFLINE'.person_id)

offline_patients_qty

authentication_methods.type='OFFLINE'
personscount(authentication_methods.{type}='OFFLINE'.person_id)/count(person_id)ratio_offline_patients_qtyratio of patients with offline method of authorization within particular legal entity 
personscount(person_id)patients_qtyqty patients by legal entity (total till report date)

$inserted_atreport_datethe date when calculated


Authorizations_fraud report

Using 

  • autorization_legal_entity table - legal entities with patients_qty<= 50 are not taken into account.
  • autorization_doctor table - doctors with patients_qty<= 10 are not taken into account.

Required input filter parameters:

  • settlement_type ['CITY', 'OTHER']
  • type ['DOCTOR', 'LEGAL_ENTITY']   

Order by ratio_offline_patients_qty desc and show least(5%, 25 rows) with the highest value. 

Output fields:

  • id (based on input type it can be party_id or legal_entity_id)
  • settlement_type
  • offline_patients_qty
  • ratio_offline_patients_qty
  • report_date

Phone_numbers_fraud report

Using 

  • patients_phonenumber table - phone numbers with patients_qty<= 1 are not taken into account.

Order by ratio_offline_patients_qty desc and show least(5%, 25 rows) with the highest value.

Output fields:

  • phone_number
  • patients_qty
  • report_date

Doctors_fraud report

Using

  • total_patients_doctor table - doctors with patients_qty<= 10 are not taken into account.

Optional input query parameters (filter by):

  • patients_qty
  • patient_increase_30d
  • patient_increase_30d_0

Output fields:

  • party_id
  • legal_entity_id
  • one of [patients_qty, patient_increase_30d, patient_increase_30d_0]
  • report_date
  • No labels