This repository has been archived on 2024-10-18. You can view files and clone it, but cannot push or open issues or pull requests.
ftc_patient_app/lib/controllers/clients/care_notes_screen_controlle...

274 lines
9.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/utilities/enums/care_note_form_type.dart';
import 'package:get/get.dart';
import '../../ftc_mobile_app.dart';
import '../../models/clients/care_note_category.dart';
class CareNotesScreenController extends GetxController {
final GlobalKey<ScaffoldState> screenKey = GlobalKey<ScaffoldState>();
final List<CareNoteCategory> categories = [];
final categoriesMapList = [
{
"iconPath": AssetsManager.kIcHealth,
"category": "Health",
"subcategories": [
{
"iconPath": AssetsManager.kIcInjury,
"name": "Injury / Health Issue",
"formType": CareNotesFormType.injuryHealthIssueForm.text,
"apiValue": CareNotesFormType.injuryHealthIssueForm.apiValue,
},
{
"iconPath": AssetsManager.kIcWeightHeight,
"name": "Weight / Height",
"formType": CareNotesFormType.weightHeightForm.text,
"apiValue": CareNotesFormType.weightHeightForm.apiValue,
},
{
"iconPath": AssetsManager.kIcAppointment,
"name": "Health appointments",
"formType": CareNotesFormType.healthAppointmentForm.text,
"apiValue": CareNotesFormType.healthAppointmentForm.apiValue,
},
{
"iconPath": AssetsManager.kIcSearch,
"name": "Observations",
"formType": CareNotesFormType.observationsForm.text,
"apiValue": CareNotesFormType.observationsForm.apiValue,
},
{
"iconPath": AssetsManager.kIcOthers,
"name": "Others",
"formType": CareNotesFormType.healthOtherForm.text,
"apiValue": CareNotesFormType.healthOtherForm.apiValue,
}
]
},
{
"iconPath": AssetsManager.kIcGeneral,
"category": "General",
"subcategories": [
{
"iconPath": AssetsManager.kIcNote,
"name": "General Note",
"formType": CareNotesFormType.generalNoteForm.text,
"apiValue": CareNotesFormType.generalNoteForm.apiValue,
},
{
"iconPath": AssetsManager.kIcActivity,
"name": "Activities",
"formType": CareNotesFormType.activitiesForm.text,
"apiValue": CareNotesFormType.activitiesForm.apiValue,
},
{
"iconPath": AssetsManager.kIcSleep,
"name": "Sleep",
"formType": CareNotesFormType.sleepForm.text,
"apiValue": CareNotesFormType.sleepForm.apiValue,
},
{
"iconPath": AssetsManager.kIcSafeguarding,
"name": "Safeguarding",
"formType": CareNotesFormType.safeguardingForm.text,
"apiValue": CareNotesFormType.safeguardingForm.apiValue,
},
{
"iconPath": AssetsManager.kIcOthers,
"name": "Others",
"formType": CareNotesFormType.generalOtherForm.text,
"apiValue": CareNotesFormType.generalOtherForm.apiValue,
}
]
},
{
"iconPath": AssetsManager.kIcPersonalCare,
"category": "Personal Care",
"subcategories": [
{
"iconPath": AssetsManager.kIcToileting,
"name": "Toileting",
"formType": CareNotesFormType.toiletingNoteForm.text,
"apiValue": CareNotesFormType.toiletingNoteForm.apiValue,
},
{
"iconPath": AssetsManager.kIcShower,
"name": "Showering / Bath",
"formType": CareNotesFormType.showeringBathForm.text,
"apiValue": CareNotesFormType.showeringBathForm.apiValue,
},
{
"iconPath": AssetsManager.kIcMouthHygiene,
"name": "Mouth Hygiene",
"formType": CareNotesFormType.mouthHygieneForm.text,
"apiValue": CareNotesFormType.mouthHygieneForm.apiValue,
},
{
"iconPath": AssetsManager.kIcOthers,
"name": "Others",
"formType": CareNotesFormType.personalCareOtherForm.text,
"apiValue": CareNotesFormType.personalCareOtherForm.apiValue,
}
]
},
{
"iconPath": AssetsManager.kIcMentalWellbeing,
"category": "Mental Wellbeing",
"subcategories": [
{
"iconPath": AssetsManager.kIcMood,
"name": "Mood Rating",
"formType": CareNotesFormType.moodRatingForm.text,
"apiValue": CareNotesFormType.moodRatingForm.apiValue,
},
{
"iconPath": AssetsManager.kIcAbc,
"name": "ABC",
"formType": CareNotesFormType.ABCForm.text,
"apiValue": CareNotesFormType.ABCForm.apiValue,
},
{
"iconPath": AssetsManager.kIcPhysicalIntervention,
"name": "Physical Intervention",
"formType": CareNotesFormType.physicalInterventionForm.text,
"apiValue": CareNotesFormType.physicalInterventionForm.apiValue,
},
{
"iconPath": AssetsManager.kIcConsent,
"name": "Consent, Capacity, MCA & DOLS",
"formType": CareNotesFormType.consentCapacityForm.text,
"apiValue": CareNotesFormType.consentCapacityForm.apiValue,
},
{
"iconPath": AssetsManager.kIcOthers,
"name": "Others",
"formType": CareNotesFormType.mentalWellbeingOtherForm.text,
"apiValue": CareNotesFormType.mentalWellbeingOtherForm.apiValue,
}
]
},
{
"iconPath": AssetsManager.kIcIntractions,
"category": "Professional/family Interactions",
"subcategories": [
{
"iconPath": AssetsManager.kIcMeeting,
"name": "Meetings",
"formType": CareNotesFormType.meetingsForm.text,
"apiValue": CareNotesFormType.meetingsForm.apiValue,
},
{
"iconPath": AssetsManager.kIcTelephone,
"name": "Telephone Calls",
"formType": CareNotesFormType.telephoneCallsForm.text,
"apiValue": CareNotesFormType.telephoneCallsForm.apiValue,
},
{
"iconPath": AssetsManager.kIcReviews,
"name": "Reviews",
"formType": CareNotesFormType.reviewsForm.text,
"apiValue": CareNotesFormType.reviewsForm.apiValue,
},
{
"iconPath": AssetsManager.kIcEmail,
"name": "Emails",
"formType": CareNotesFormType.emailsForm.text,
"apiValue": CareNotesFormType.emailsForm.apiValue,
},
{
"iconPath": AssetsManager.kIcOtherInteractions,
"name": "All other interactions",
"formType": CareNotesFormType.allOtherInteractionsForm.text,
"apiValue": CareNotesFormType.allOtherInteractionsForm.apiValue,
},
{
"iconPath": AssetsManager.kIcOthers,
"name": "Others",
"formType":
CareNotesFormType.professionalFamilyInteractionsOtherForm.text,
"apiValue":
CareNotesFormType.professionalFamilyInteractionsOtherForm.apiValue,
}
]
},
{
"iconPath": AssetsManager.kIcIndependentLiving,
"category": "Independent Living",
"subcategories": [
{
"iconPath": AssetsManager.kIcLaundry,
"name": "Laundry",
"formType": CareNotesFormType.laundryForm.text,
"apiValue": CareNotesFormType.laundryForm.apiValue,
},
{
"iconPath": AssetsManager.kIcCooking,
"name": "Cooking",
"formType": CareNotesFormType.cookingForm.text,
"apiValue": CareNotesFormType.cookingForm.apiValue,
},
{
"iconPath": AssetsManager.kIcHydration,
"name": "Nutrition / Hydration",
"formType": CareNotesFormType.nutritionHydrationForm.text,
"apiValue": CareNotesFormType.nutritionHydrationForm.apiValue,
},
{
"iconPath": AssetsManager.kIcCleaning,
"name": "Cleaning",
"formType": CareNotesFormType.cleaningForm.text,
"apiValue": CareNotesFormType.cleaningForm.apiValue,
},
{
"iconPath": AssetsManager.kIcFinance,
"name": "Finance",
"formType": CareNotesFormType.financeForm.text,
"apiValue": CareNotesFormType.financeForm.apiValue,
},
{
"iconPath": AssetsManager.kIcPublicInteraction,
"name": "Public interaction (including transport)",
"formType": CareNotesFormType.publicInteractionForm.text,
"apiValue": CareNotesFormType.publicInteractionForm.apiValue,
},
{
"iconPath": AssetsManager.kIcEducation,
"name": "Education",
"formType": CareNotesFormType.educationForm.text,
"apiValue": CareNotesFormType.educationForm.apiValue,
},
{
"iconPath": AssetsManager.kIcOthers,
"name": "Others",
"formType": CareNotesFormType.independentLivingOtherForm.text,
"apiValue": CareNotesFormType.independentLivingOtherForm.apiValue,
}
]
}
];
@override
void onInit() {
for (var e in categoriesMapList) {
categories.add(CareNoteCategory.fromJson(e));
}
super.onInit();
}
void removeFocus() {
FocusScope.of(screenKey.currentContext!).unfocus();
}
@override
void dispose() {
Get.delete<CareNotesScreenController>();
super.dispose();
}
void backButtonPressed(BuildContext context) {
Get.delete<CareNotesScreenController>();
Navigator.of(context).pop();
}
}