hamyar_paygah.controllers.widgets.region_analyzer_tab_controller

Controller for the region analyzer tab.

Attributes

COUNT_PERSIAN_TEXT

Persian text for the word (count)

Classes

RegionAnalyzerTab

Tab that analyzes a region and shows its details.

Module Contents

hamyar_paygah.controllers.widgets.region_analyzer_tab_controller.COUNT_PERSIAN_TEXT: str = 'تعداد'

Persian text for the word (count)

class hamyar_paygah.controllers.widgets.region_analyzer_tab_controller.RegionAnalyzerTab

Bases: PySide6.QtWidgets.QWidget

Tab that analyzes a region and shows its details.

ui
_populate_region_picker()

Populates the region picker with regions dictionary.

Return type:

None

on_from_date_picker_userDateChanged(new_date)

Ensure from date is always equal or less than the to date.

Parameters:

new_date (PySide6.QtCore.QDate) – User input date when from date picker is changed.

Return type:

None

on_to_date_picker_userDateChanged(new_date)

Ensure to date is always equal or more that the from date.

Parameters:

new_date (PySide6.QtCore.QDate) – User input date when to date picker is changed.

Return type:

None

async on_load_button_clicked()

Dynamically load the missions list from the server and build the tabs based on it.

Return type:

None

_clear_data()

Clears all the fields and checkboxes in the UI.

Return type:

None

_group_missions_by_ambulance_code(missions_list)

Groups the missions by ambulance code.

Parameters:

missions_list (list[Mission]) – List of missions to be grouped.

Returns:

A dictionary where the keys are ambulance codes and the values are lists of missions.

Return type:

dict[int, list[Mission]]

_sorted_counter(counter)
Parameters:

counter (collections.Counter[Any])

Return type:

list[tuple[str, int]]

async _process_missions(missions_list, progress_callback)

Process missions asynchronously with progress reporting.

Parameters:
Return type:

dict[str, int | list[tuple[str, int]] | collections.Counter[Any]]

async _summarize_missions(missions_list)

Compute basic statistics from the missions list.

Parameters:

missions_list (list[hamyar_paygah.models.mission_model.Mission])

Return type:

dict[str, int | list[tuple[str, int]] | collections.Counter[Any]] | None

async _build_tabs(missions_list)

Build dynamic tabs per ambulance and one overall tab.

Parameters:

missions_list (list[hamyar_paygah.models.mission_model.Mission])

Return type:

None

async _create_summary_widget(missions_list)

Create a simple summary display widget for a mission list.

Parameters:

missions_list (list[hamyar_paygah.models.mission_model.Mission])

Return type:

PySide6.QtWidgets.QWidget | None

_populate_mission_per_hospital_table(missions_per_hospital, ui)

Populate the missions per hospital table with the given data.

Parameters:
Return type:

None

_populate_mission_per_result_table(missions_per_result, ui)

Populate the missions per result table with the given data.

Parameters:
Return type:

None

_populate_consumables_table(table, consumables_list)
Parameters:
Return type:

None

_populate_drugs_table(table, drugs_list)
Parameters:
Return type:

None

_populate_caller_numbers_table(table, numbers_list)
Parameters:
Return type:

None

_populate_location_types_table(table, location_types_list)
Parameters:
Return type:

None

_populate_accident_types_table(table, accident_types_list)
Parameters:
Return type:

None

_populate_illness_types_table(table, illness_types_list)
Parameters:
Return type:

None

_populate_vehicle_types_table(table, vehicle_types_list)
Parameters:
Return type:

None

_populate_injury_types_table(table, injury_types_list)
Parameters:
Return type:

None

_populate_chief_complaints_table(table, chief_complaints_list)
Parameters:
Return type:

None

_populate_missions_address_table(table, addresses_list)
Parameters:
Return type:

None