Purpose
The main goal of the Fraud Detection mechanism is to provide a possibility to identify and prevent possible financial losses due to fraud activities. In order to be able to do that there is a necessity to create fraud DB and using it implement triggers which automatically shows who is likely to be fraud.
Based on current tables next data must be aggregated and analyzed:
- Number of patients per doctor
- Number of patients registered for the same phone number
- Number and percentage of patients per doctor that have set offline authorization method
- Number and percentage of patients per legal entity that have set offline authorization method
Fraud DB structure
To simplify report creation and data analysis current tables should be denormalized and aggregated.
Table for replication
- prm_db
- legal_entities
- divisions
- employees
- parties
- party_users
- black_list_users
- audit_log
- ops_db
- declarations
- declarations_status_hstr
- il_db
- declaration_requests
- employee_requests
- dictionaries
- mpi_db
- persons
Mapping:
- prm_db
legal_entities
field_origin table_field_name description id id name name short_name short_name public_name public_name status status type type owner_property_type owner_property_type legal_form legal_form edrpou edrpou kveds kveds to_string(kveds) addresses.country registration_country type='REGISTRATION' addresses.area registration_area type='REGISTRATION' addresses.region registration_region type='REGISTRATION' addresses.settlement registration_settlement type='REGISTRATION' addresses.settlement_type registration_settlement_type type='REGISTRATION' addresses.settlement_id registration_settlement_id type='REGISTRATION' addresses.street_type registration_street_type type='REGISTRATION' addresses.street registration_street type='REGISTRATION' addresses.building&addresses.apartment registration_building type='REGISTRATION', to_char(addresses.building&', '&addresses.apartment) addresses.zip registration_zip type='REGISTRATION' addresses.country residence_country type='RESIDENCE' addresses.area residence_area type='RESIDENCE' addresses.region residence_region type='RESIDENCE' addresses.settlement residence_settlement type='RESIDENCE' addresses.settlement_type residence_settlement_type type='RESIDENCE' addresses.settlement_id residence_settlement_id type='RESIDENCE' addresses.street_type residence_street_type type='RESIDENCE' addresses.street residence_street type='RESIDENCE' addresses.building&addresses.apartment residence_building type='RESIDENCE', to_char(addresses.building&', '&addresses.apartment) addresses.zip residence_zip type='RESIDENCE' phones mobile_phone type='MOBILE' phones land_line_phone type='LAND_LINE' email email is_active is_active inserted_by inserted_by updated_by updated_by inserted_at inserted_at updated_at updated_at capitation_contract_id capitation_contract_id created_by_mis_client_id created_by_mis_client_id mis_verified mis_verified nhs_verified nhs_verified divisions
field_origin table_field_name description id id external_id external_id name name type type mountain_group mountain_group addresses.country residence_country type='RESIDENCE' addresses.area residence_area type='RESIDENCE' addresses.region residence_region type='RESIDENCE' addresses.settlement residence_settlement type='RESIDENCE' addresses.settlement_type residence_settlement_type type='RESIDENCE' addresses.settlement_id residence_settlement_id type='RESIDENCE' addresses.street_type residence_street_type type='RESIDENCE' addresses.street residence_street type='RESIDENCE' addresses.building&addresses.apartment residence_building type='RESIDENCE', to_char(addresses.building&', '&addresses.apartment) addresses.zip residence_zip type='RESIDENCE' addresses.country registration_country type='REGISTRATION' addresses.area registration_area type='REGISTRATION' addresses.region registration_region type='REGISTRATION' addresses.settlement registration_settlement type='REGISTRATION' addresses.settlement_type registration_settlement_type type='REGISTRATION' addresses.settlement_id registration_settlement_id type='REGISTRATION' addresses.street_type registration_street_type type='REGISTRATION' addresses.street registration_street type='REGISTRATION' addresses.building&addresses.apartment registration_building type='REGISTRATION', to_char(addresses.building&', '&addresses.apartment) addresses.zip registration_zip type='REGISTRATION' phones mobile_phone type='MOBILE' phones
land_line_phone type='LAND_LINE' email email inserted_at inserted_at updated_at updated_at legal_entity_id legal_entity_id location location status status is_active is_active employees
field_origin table_field_name description id id position position status status employee_type employee_type is_active is_active inserted_by inserted_by updated_by updated_by start_date start_date end_date end_date legal_entity_id legal_entity_id division_id division_id party_id party_id inserted_at
inserted_at updated_at updated_at status_reason status_reason additional_info.educations educations additional_info.educations additional_info.educations educations_qty additional_info.educations[count] - count items in the array additional_info.qualifications qualifications additional_info.qualifications additional_info.qualifications qualifications_qty additional_info.qualifications[count] - count items in the array additional_info.specialities specialities additional_info.specialities additional_info.specialities specialities_qty additional_info.specialities[count] - count items in the array additional_info.specialities.speciality speciality_officio additional_info.specialities.speciality_officio=true additional_info.specialities.valid_to_date speciality_officio_valid_to_date additional_info.specialities.speciality_officio=true additional_info.science_degree science_degree additional_info.science_degree parties
field_origin table_field_name description id id first_name first_name second_name second_name last_name last_name birth_date birth_date gender gender tax_id tax_id documents.number passport_number documents.type='PASSPORT' documents.number national_id_number documents.type='NATIONAL_ID' documents.number birth_certificate_number documents.type='BIRTH_CERTIFICATE' documents.number
temporary_certificate_number documents.type='TEMPORARY_CERTIFICATE' phones mobile_phone type='MOBILE' phones
land_line_phone type='LAND_LINE' inserted_by inserted_by updated_by updated_by inserted_at inserted_at updated_at updated_at party_users- without changes
audit_log
field_origin table_field_name description id id actor_id actor_id resource resource resource_id resource_id changeset changeset to_char(changeset) inserted_at inserted_at
- ops_db
- declarations - without changes
- declarations_status_hstr - without changes
- il_db
declaration_requests
field_origin table_field_name description id id declaration_id declaration_id authentication_method_current.type auth_method authentication_method_current.type authentication_method_current.number auth_number authentication_method_current.{type='OTP'}.number status status inserted_by inserted_by inserted_at inserted_at updated_by updated_by updated_at updated_at employee_requests
field_origin table_field_name description id id employee_id employee_id status status inserted_at inserted_at updated_at updated_at - black_list_users - without changes
- dictionaries
4. persons
field_origin | table_field_name | description |
---|---|---|
id | id | |
first_name | first_name | |
last_name | last_name | |
second_name | second_name | |
birth_date | birth_date | |
birth_country | birth_country | |
birth_settlement | birth_settlement | |
gender | gender | |
tax_id | tax_id | |
national_id | national_id | |
death_date | death_date | |
is_active | is_active | |
secret | secret | |
status | status | |
patient_signed | patient_signed | |
process_disclousure_data_consent | process_disclousure_data_consent | |
documents.number | passport_number | documents.type='PASSPORT' |
documents.number | national_id_number | documents.type='NATIONAL_ID' |
documents.number | birth_certificate_number | documents.type='BIRTH_CERTIFICATE' |
documents.number | temporary_certificate_number | documents.type='TEMPORARY_CERTIFICATE' |
addresses.country | registration_country | type='REGISTRATION' |
addresses.area | registration_area | type='REGISTRATION' |
addresses.region | registration_region | type='REGISTRATION' |
addresses.settlement | registration_settlement | type='REGISTRATION' |
addresses.settlement_type | registration_settlement_type | type='REGISTRATION' |
addresses.settlement_id | registration_settlement_id | type='REGISTRATION' |
addresses.street_type | registration_street_type | type='REGISTRATION' |
addresses.street | registration_street | type='REGISTRATION' |
addresses.building&addresses.apartment | registration_building | type='REGISTRATION', to_char(addresses.building&', '&addresses.apartment) |
addresses.zip | registration_zip | type='REGISTRATION' |
addresses.country | residence_country | type='RESIDENCE' |
addresses.area | residence_area | type='RESIDENCE' |
addresses.region | residence_region | type='RESIDENCE' |
addresses.settlement | residence_settlement | type='RESIDENCE' |
addresses.settlement_type | residence_settlement_type | type='RESIDENCE' |
addresses.settlement_id | residence_settlement_id | type='RESIDENCE' |
addresses.street_type | residence_street_type | type='RESIDENCE' |
addresses.street | residence_street | type='RESIDENCE' |
addresses.building&addresses.apartment | residence_building | type='RESIDENCE', to_char(addresses.building&', '&addresses.apartment) |
addresses.zip | residence_zip | type='RESIDENCE' |
phones | mobile_phone | type='MOBILE' |
phones | land_line_phone | type='LAND_LINE' |
authentication_methods | authentication_methods | |
status | status | |
emergency_contact.first_name | ec_first_name | |
emergency_contact.last_name | ec_last_name | |
emergency_contact.second_name | ec_second_name | |
emergency_contact.phones.number | ec_mobile_phone | type='MOBILE' |
emergency_contact.phones.number | ec_land_line_phone | type='LAND_LINE' |
confidant_person.first_name | cp1_first_name | confidant_person.relation_type='PRIMARY' |
confidant_person.last_name | cp1_last_name | relation_type='PRIMARY' |
confidant_person.second_name | cp1_second_name | relation_type='PRIMARY' |
confidant_person.birth_date | cp1_birth_date | relation_type='PRIMARY' |
confidant_person.birth_country | cp1_birth_country | relation_type='PRIMARY' |
confidant_person.birth_settlement | cp1_birth_settlement | relation_type='PRIMARY' |
confidant_person.gender | cp1_gender | relation_type='PRIMARY' |
confidant_person.tax_id | cp1_tax_id | relation_type='PRIMARY' |
confidant_person.secret | cp1_secret | relation_type='PRIMARY' |
confidant_person.documents.number | cp1_passport_number | relation_type='PRIMARY' & documents.type='PASSPORT' |
confidant_person.documents.number | cp1_national_id_number | relation_type='PRIMARY' & documents.type='NATIONAL_ID' |
confidant_person.documents.number | cp1_birth_certificate_number | relation_type='PRIMARY' & documents.type='BIRTH_CERTIFICATE' |
confidant_person.documents.number | cp1_temporary_certificate_number | relation_type='PRIMARY' & documents.type='TEMPORARY_CERTIFICATE' |
confidant_person.documents_relationship | cp1_doc_relationship_document_number | relation_type='PRIMARY' & documents_relationship.type='DOCUMENT' |
confidant_person.documents_relationship | cp1_doc_relationship_court_decision_number | relation_type='PRIMARY' & documents_relationship.type='COURT_DECISION' |
confidant_person.documents_relationship | cp1_doc_relationship_birth_cert_number | relation_type='PRIMARY' & documents_relationship.type='BIRTH_CERTIFICATE' |
confidant_person.documents_relationship | cp1_doc_relationship_confidant_cert_number | relation_type='PRIMARY' & documents_relationship.type='CONFIDANT_CERTIFICATE' |
confidant_person.phones | cp1_mobile_phone | relation_type='PRIMARY' & phones.type='MOBILE' |
confidant_person.phones | cp1_land_line_phone | relation_type='PRIMARY' & phones.type='MOBILE' |
confidant_person.first_name... | cp2_first_name | confidant_person.relation_type='SECONDARY' |
same block as for confidant_person with relation_type='PRIMARY, but with relation_type='SECONDARY' and field_name cp2_ | ||
authentication_method_current.type | auth_method | authentication_method_current.type |
authentication_method_current.number | auth_number | authentication_method_current.{type='OTP'}.number |
inserted_by | inserted_by | |
updated_by | updated_by | |
inserted_at | inserted_at | |
updated_at | updated_at |