Problem IMPLEMENTATION START
Problem IMPLEMENTATION START
This program is designed to input the Name of the Region, the name of the Health Facility,
Patient ID and Type of virus each patient contracted, determine and output which Northern
Regional Health Authority has the largest number of contracted viruses, the Total number of
patients who contacted each virus and a list of patients who contracted the virus in that RHA
(the list includes Patient ID, Type of virus and Health Facility Name).
Problem-Solving Process
1. Input Requirements:
o The algorithm should accept inputs:
Name of the Region (Northern RHA, NCRHA, NWRHA, etc.)
Health Facility Name
PatientID
Type of Virus contracted by each patient.
2. Processing Requirements:
o For each region, calculate the total number of virus cases.
o Identify the region with the highest number of contracted viruses.
o For each virus type within each RHA, create a list of patients including their
PatientID, Virus Type, and Health Facility.
3. Output Requirements:
o Display the region with the highest number of virus cases.
o Display the total count of patients per virus type.
o Display a list of patients per virus type for each RHA, showing their
PatientID, Virus Type, and Health Facility Name.
4. Defining Diagram:
o Input: Region Name, Health Facility Name, PatientID, Virus Type
o Process:
Count virus cases by region.
Identify the RHA with the most cases.
Generate a list of patient details by virus type for each region.
o Output: Largest virus count by RHA, total cases by virus, and detailed patient
lists.
List of Variables
Input Variables:
Data Structures:
*rhaData: Dictionary – This is a dictionary where the keys are region names, and the
values are dictionaries containing:
*patientCount: Dictionary – Stores the count of patients for each type of virus.
*patients: List – A list of tuples, where each tuple contains (patientID, virusType,
healthFacilityName).
Output Variables:
largestRHA: String – The name of the RHA that has the highest number of
contracted viruses.
*totalPatientsPerVirus: Dictionary – A dictionary that holds the total number of
patients for each type of virus within the largest RHA.
Extra information
Data Structures: Arrays (lists, dictionaries) to store and organize data by region,
virus type, and patient details.
Loops: To iterate through patient data.
Conditionals: To compare virus counts and identify the region with the most cases.
Sorting: (If necessary) for organizing lists by virus or patient details.
Pseudocode Algorithm
1.Input Loop:
The algorithm continues to gather data until the user chooses to stop. It checks if the region is
already present in the `rhaData` dictionary and initializes it if it's not.
2.Data Storage:
For each patient, the algorithm updates the virus count and adds the patient's information (ID,
virus type, and health facility) to the appropriate list.
4.Output:
At the end, the algorithm outputs the RHA with the most virus cases, the total number of
patients for each virus type, and a detailed list of patients who contracted viruses within that
RHA.
Initialization:
Create an empty list, data, to store patient records.
Initialize virus_count as an empty dictionary to track the number of cases for each
virus.
Initialize rha_count as an empty dictionary to track virus cases by region.
Initialize patient_details as an empty dictionary to store detailed information for each
region.
Input Details:
Region: NCRHA
Health Facility:
Patient ID: ArimAP775
Virus Type: Dengue
Process Data:
1. Add the patient record to data.
2. Increment the count for Dengue in virus_count.
3. Update the count for NCRHA in rha_count.
4. Add the patient's details to the list for NCRHA in patient_details.
5. Repeat for each additional patient, ensuring counts and details are updated
accordingly.
Input Details:
Region:
Health Facility:
Patient ID:
Virus Type: Dengue
Process Data:
1. Add the patient record to data.
2. Increment the count for Dengue in virus_count.
3. Update the count for NWRHA in rha_count.
4. Add the patient's details to the list for NWRHA in patient_details.
5. Repeat for each additional patient, ensuring counts and details are updated
accordingly.