📋 UC07: Phone Handling

Use Case Uc07 Phone Number Handling In Requests

This document explains how phone numbers are managed in care requests

depending on the user type and the contact person they select.

1. The Two Phone Numbers

Each care request can contain TWO phone numbers:

A) phoneNumber (Primary contact)

B) patientPhoneNumber (Patient's phone - optional)

2. Phone Number Source By Scenario

SCENARIO 1: Patient makes request for themselves

Contact type: "Patient"

The patient IS the contact, so only one number is needed.

SCENARIO 2: Family member makes request

Contact type: "Family"

The nurse will call the family first, then possibly the patient.

SCENARIO 3: Friend makes request

Contact type: "Friend"

Same as family.

SCENARIO 4: Professional makes request (social worker)

Contact type: "Professional"

The nurse will call the professional first.

SCENARIO 5: Nurse makes request

Contact type: "Professional"

Same as professional, the creating nurse is the primary contact.

3. Phone Number Display

FOR PATIENTS (viewing their own request):

made the request for them

FOR NURSES (viewing available request):

4. Selection Logic In Code

File: lib/modules/carerequest/presentation/controllers/carerequest_form_controller.dart

When the request is submitted, the logic is as follows:

// Determine which number to store as primary contact

if (contactPersonType == ContactPersonType.patient) {

// Patient themselves: use their account number

phoneToStore = state.phoneNumber; // from account

} else {

// Other: use the entered number or account number

phoneToStore = patientPhone ?? state.phoneNumber;

In practice:

5. Important Points For Users

For Patients

For Social Workers

For Nurses Creating Requests

6. Technical References

Phone number handling:

Phone number entry screen:

Request entity: