fist commit ftc staff app clone
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/models/clients/careNoteFormsRequests/ABC_form_html_request.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'common_care_note_forms_controller.dart';
|
||||
|
||||
class ABCFormScreenController extends CommonCareNoteFormsController {
|
||||
final antecedentEventsController = TextEditingController();
|
||||
final behaviourController = TextEditingController();
|
||||
final consequenceEventsController = TextEditingController();
|
||||
|
||||
ABCFormScreenController({required CommonCareNoteFormArgs args})
|
||||
: super(args: args);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
antecedentEventsController.dispose();
|
||||
behaviourController.dispose();
|
||||
consequenceEventsController.dispose();
|
||||
Get.delete<ABCFormScreenController>();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> onSaveButtonTap() async {
|
||||
// if (super.date == null || super.time == null) {
|
||||
if (super.date == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select date and time first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (antecedentEventsController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Antecedent Events field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (behaviourController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Behaviour field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (consequenceEventsController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Consequence Events field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
super.removeFocus();
|
||||
|
||||
await onFormSubmit(
|
||||
request: CreateCarePlanRequest(
|
||||
isHTML: true,
|
||||
flag: false,
|
||||
title: "",
|
||||
noteDetails: ABCFormHtmlRequest(
|
||||
antecedentEvents: antecedentEventsController.text.trim(),
|
||||
behaviour: behaviourController.text.trim(),
|
||||
consequenceEvents: consequenceEventsController.text.trim(),
|
||||
).toHtml()),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import 'dart:developer';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/models/clients/careNoteFormsRequests/physical_intervention_form_html_request.dart';
|
||||
import 'package:ftc_mobile_app/models/clients/careNoteFormsRequests/safeguarding_form_html_request.dart';
|
||||
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
|
||||
import 'package:ftc_mobile_app/web_services/client_services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../../models/clients/body_points_category.dart';
|
||||
import 'common_care_note_forms_controller.dart';
|
||||
|
||||
class CategorySubcategoryWidgetController extends GetxController {
|
||||
final bodyPointsCategoryList = RxList<BodyPointsCategory>();
|
||||
final selectedBodyPart = Rx<BodyPointsCategory?>(null);
|
||||
final selectedSubcategory = Rx<SubCat?>(null);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
Get.delete<CategorySubcategoryWidgetController>();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
getBodyParts() async {
|
||||
var result = await ClientService().getBodyPointsCategoryList().showLoader();
|
||||
if (result is List && result is List<BodyPointsCategory>) {
|
||||
log('---------------bodyPointsCategoryList length before set -----------${bodyPointsCategoryList.length}');
|
||||
|
||||
List<BodyPointsCategory> uniqueList = removeDuplicates(result);
|
||||
bodyPointsCategoryList.value = uniqueList;
|
||||
// selectedBodyPart.value = bodyPointsCategoryList.first;
|
||||
}
|
||||
}
|
||||
|
||||
List<BodyPointsCategory> removeDuplicates(List<BodyPointsCategory> list) {
|
||||
List<BodyPointsCategory> uniqueList = [];
|
||||
Set<String> enumedSet = {};
|
||||
|
||||
for (var category in list) {
|
||||
if (!enumedSet.contains(category.idOne)) {
|
||||
uniqueList.add(category);
|
||||
enumedSet.add(category.idOne);
|
||||
}
|
||||
}
|
||||
|
||||
return uniqueList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
import 'dart:convert';
|
||||
import 'package:adoptive_calendar/adoptive_calendar.dart';
|
||||
import 'package:ftc_mobile_app/models/response_model.dart';
|
||||
import 'package:ftc_mobile_app/models/user_model.dart';
|
||||
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
|
||||
import 'package:ftc_mobile_app/web_services/client_services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../../models/create_care_plan_request.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../utilities/export_utilities.dart';
|
||||
|
||||
export '../../../utilities/export_utilities.dart';
|
||||
export '../../../models/create_care_plan_request.dart';
|
||||
|
||||
class CommonCareNoteFormArgs {
|
||||
final String serviceUserId;
|
||||
final String noteType;
|
||||
|
||||
CommonCareNoteFormArgs({required this.serviceUserId, required this.noteType});
|
||||
}
|
||||
|
||||
abstract class CommonCareNoteFormsController extends GetxController {
|
||||
final GlobalKey<ScaffoldState> screenKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
final dateController = TextEditingController();
|
||||
|
||||
DateTime? date;
|
||||
|
||||
final CommonCareNoteFormArgs args;
|
||||
|
||||
CommonCareNoteFormsController({required this.args});
|
||||
|
||||
void removeFocus() {
|
||||
FocusScope.of(screenKey.currentContext!).unfocus();
|
||||
}
|
||||
|
||||
selectDate(context) async {
|
||||
Get.focusScope?.unfocus();
|
||||
final DateTime? d = await showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AdoptiveCalendar(
|
||||
initialDate: DateTime.now(),
|
||||
action: true,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
if (d != null) {
|
||||
date = d;
|
||||
dateController.text = FrequentFunctions.careNoteDateFormatter.format(d);
|
||||
}
|
||||
}
|
||||
|
||||
Future<dynamic> onFormSubmit({required CreateCarePlanRequest request}) async {
|
||||
// final userJson = LocalStorageManager.getSessionToken(
|
||||
// tokenKey: LocalStorageKeys.kUserModelKey,
|
||||
// );
|
||||
// print("userJson: $userJson");
|
||||
// final userModel = UserModel.fromJson(jsonDecode(userJson));
|
||||
request.addedby = LocalStorageManager.userId;
|
||||
request.userId = args.serviceUserId;
|
||||
request.noteType = args.noteType;
|
||||
if (date == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select date and time first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
request.eventDateTime = date!.toUtc().millisecondsSinceEpoch;
|
||||
|
||||
final response =
|
||||
await ClientService().createCarePlan(request: request).showLoader();
|
||||
|
||||
if (response is ResponseModel) {
|
||||
Navigator.pop(screenKey.currentContext!);
|
||||
Navigator.pop(screenKey.currentContext!);
|
||||
FrequentFunctions.showToast(message: response.statusDescription);
|
||||
} else {
|
||||
FrequentFunctions.showToast(message: response['message']);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
dateController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,285 @@
|
||||
import 'package:adoptive_calendar/adoptive_calendar.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import '../../../models/clients/careNoteFormsRequests/HtmlTableOption.dart';
|
||||
import '../../../models/clients/careNoteFormsRequests/consent_capacity_html_request.dart';
|
||||
import 'common_care_note_forms_controller.dart';
|
||||
import 'package:flutter/services.dart' show rootBundle;
|
||||
|
||||
class ConsentCapacityFormScreenController
|
||||
extends CommonCareNoteFormsController {
|
||||
final commentsController = TextEditingController();
|
||||
final mentalCapacityAssessmentDetailController = TextEditingController();
|
||||
final specificDecisionDetailController = TextEditingController();
|
||||
final roleController = TextEditingController();
|
||||
final organisationController = TextEditingController();
|
||||
final addressController = TextEditingController();
|
||||
final telController = TextEditingController();
|
||||
final emailController = TextEditingController();
|
||||
final lackCapacityToMakeParticularDecisionDetailController =
|
||||
TextEditingController();
|
||||
final recordYourEvidenceDescribeController = TextEditingController();
|
||||
final viableOptionsConsideredController = TextEditingController();
|
||||
final explainWhyTickedBoxController = TextEditingController();
|
||||
final impairmentDescribeController = TextEditingController();
|
||||
final describeCanPersonDecisionInfoController = TextEditingController();
|
||||
final describeCanTheyRetainController = TextEditingController();
|
||||
final describeCanTheyUseController = TextEditingController();
|
||||
final describeCanTheyCommunicateController = TextEditingController();
|
||||
final evidenceController = TextEditingController();
|
||||
final whatIsYourEvidenceController = TextEditingController();
|
||||
final seekingManagementDescribeController = TextEditingController();
|
||||
final recordInterviewDescribeController = TextEditingController();
|
||||
final requireIMCAController = TextEditingController();
|
||||
final designationController = TextEditingController();
|
||||
final baseAddressController = TextEditingController();
|
||||
final contactDetailsController = TextEditingController();
|
||||
|
||||
final name1Controller = TextEditingController();
|
||||
final dontHaveDecisionNameController = TextEditingController();
|
||||
final haveDecisionNameController = TextEditingController();
|
||||
final assessorsName4Controller = TextEditingController();
|
||||
|
||||
final assessmentDateTimeController = TextEditingController();
|
||||
final dontHaveDecisionDateController = TextEditingController();
|
||||
final haveDecisionDateController = TextEditingController();
|
||||
final whyIMCARequiredDateController = TextEditingController();
|
||||
|
||||
//Yes/No radio selected options
|
||||
final selectedMCARequiredOption = Rx<String?>(null);
|
||||
final selectedImpairmentOption = Rx<String?>(null);
|
||||
final selectedCanPersonDecisionInfoOption = Rx<String?>(null);
|
||||
final selectedCanTheyRetainOption = Rx<String?>(null);
|
||||
final selectedCanTheyUseOption = Rx<String?>(null);
|
||||
final selectedCanTheyCommunicateOption = Rx<String?>(null);
|
||||
final selectedDoYouHaveConcernOption = Rx<String?>(null);
|
||||
final selectedDoesRequireIMCAOption = Rx<String>("No");
|
||||
|
||||
List<HtmlTableOption> canDecisionBeDelayedOptions = [
|
||||
HtmlTableOption(id: '1', requirements: 'The decision can be delayed'),
|
||||
HtmlTableOption(
|
||||
id: '2', requirements: 'Not appropriate to delay the decision'),
|
||||
HtmlTableOption(
|
||||
id: '3',
|
||||
requirements: 'Person not likely to gain or develop capacity '),
|
||||
];
|
||||
|
||||
List<HtmlTableOption> causativeNexusOptions = [
|
||||
HtmlTableOption(id: '1', requirements: 'Yes, there is a causative link '),
|
||||
HtmlTableOption(
|
||||
id: '2',
|
||||
requirements:
|
||||
'No, there is not a causative link, so the person has capacity to make the relevant decision. The decision may therefore be an unwise decision. '),
|
||||
];
|
||||
|
||||
DateTime? assessmentDateTime;
|
||||
DateTime? dontHaveDecisionDateTime;
|
||||
DateTime? haveDecisionDateTime;
|
||||
DateTime? whyIMCARequiredDateTime;
|
||||
|
||||
String consentCapacityHtml = "";
|
||||
|
||||
ConsentCapacityFormScreenController({required CommonCareNoteFormArgs args})
|
||||
: super(args: args);
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
loadConsentCapacityHtmlFile();
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
commentsController.dispose();
|
||||
mentalCapacityAssessmentDetailController.dispose();
|
||||
specificDecisionDetailController.dispose();
|
||||
roleController.dispose();
|
||||
organisationController.dispose();
|
||||
addressController.dispose();
|
||||
telController.dispose();
|
||||
emailController.dispose();
|
||||
assessmentDateTimeController.dispose();
|
||||
lackCapacityToMakeParticularDecisionDetailController.dispose();
|
||||
recordYourEvidenceDescribeController.dispose();
|
||||
viableOptionsConsideredController.dispose();
|
||||
explainWhyTickedBoxController.dispose();
|
||||
impairmentDescribeController.dispose();
|
||||
describeCanPersonDecisionInfoController.dispose();
|
||||
describeCanTheyRetainController.dispose();
|
||||
describeCanTheyUseController.dispose();
|
||||
describeCanTheyCommunicateController.dispose();
|
||||
evidenceController.dispose();
|
||||
whatIsYourEvidenceController.dispose();
|
||||
seekingManagementDescribeController.dispose();
|
||||
recordInterviewDescribeController.dispose();
|
||||
requireIMCAController.dispose();
|
||||
designationController.dispose();
|
||||
baseAddressController.dispose();
|
||||
contactDetailsController.dispose();
|
||||
|
||||
name1Controller.dispose();
|
||||
dontHaveDecisionNameController.dispose();
|
||||
haveDecisionNameController.dispose();
|
||||
assessorsName4Controller.dispose();
|
||||
|
||||
dontHaveDecisionDateController.dispose();
|
||||
haveDecisionDateController.dispose();
|
||||
whyIMCARequiredDateController.dispose();
|
||||
|
||||
Get.delete<ConsentCapacityFormScreenController>();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future loadConsentCapacityHtmlFile() async {
|
||||
final htmlString =
|
||||
await rootBundle.loadString(AssetsManager.kConsentCapacityFormHtml);
|
||||
consentCapacityHtml = htmlString;
|
||||
}
|
||||
|
||||
Future<DateTime?> _unFocusAndPickDate(BuildContext context) async {
|
||||
Get.focusScope?.unfocus();
|
||||
return await showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AdoptiveCalendar(
|
||||
initialDate: DateTime.now(),
|
||||
action: true,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
selectAssessmentDateTime(BuildContext context) async {
|
||||
final d = await _unFocusAndPickDate(context);
|
||||
|
||||
if (d != null) {
|
||||
assessmentDateTime = d;
|
||||
assessmentDateTimeController.text =
|
||||
FrequentFunctions.careNoteDateFormatter.format(d);
|
||||
}
|
||||
}
|
||||
|
||||
selectDontHaveDecisionDateTime(BuildContext context) async {
|
||||
final d = await _unFocusAndPickDate(context);
|
||||
|
||||
if (d != null) {
|
||||
dontHaveDecisionDateTime = d;
|
||||
dontHaveDecisionDateController.text =
|
||||
FrequentFunctions.careNoteDateFormatter.format(d);
|
||||
}
|
||||
}
|
||||
|
||||
selectHaveDecisionDateTime(BuildContext context) async {
|
||||
final d = await _unFocusAndPickDate(context);
|
||||
|
||||
if (d != null) {
|
||||
haveDecisionDateTime = d;
|
||||
haveDecisionDateController.text =
|
||||
FrequentFunctions.careNoteDateFormatter.format(d);
|
||||
}
|
||||
}
|
||||
|
||||
selectDateTimeOfWhyIMCARequired(BuildContext context) async {
|
||||
final d = await _unFocusAndPickDate(context);
|
||||
|
||||
if (d != null) {
|
||||
whyIMCARequiredDateTime = d;
|
||||
whyIMCARequiredDateController.text =
|
||||
FrequentFunctions.careNoteDateFormatter.format(d);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> onSaveButtonTap() async {
|
||||
// if (super.date == null || super.time == null) {
|
||||
if (super.date == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select date and time first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (commentsController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Comments field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
super.removeFocus();
|
||||
final formatter = DateFormat("dd/MM/yyyy / hh:mm aa");
|
||||
|
||||
final consentCapacityHtmlString = ConsentCapacityHtmlRequest(
|
||||
isMCARequired: selectedMCARequiredOption()!,
|
||||
comments: commentsController.text.trim(),
|
||||
mentalCapacityAssessmentDetail:
|
||||
mentalCapacityAssessmentDetailController.text.trim(),
|
||||
specificDecisionDetail: specificDecisionDetailController.text.trim(),
|
||||
personUndertakingName: name1Controller.text.trim(),
|
||||
personUndertakingRole: roleController.text.trim(),
|
||||
organisation: organisationController.text.trim(),
|
||||
address: addressController.text.trim(),
|
||||
tel: telController.text.trim(),
|
||||
email: emailController.text.trim(),
|
||||
dateAndTimeOfAssessment: (assessmentDateTime != null)
|
||||
? formatter.format(assessmentDateTime!)
|
||||
: "",
|
||||
lackCapacityToMakeParticularDecisionDetail:
|
||||
lackCapacityToMakeParticularDecisionDetailController.text.trim(),
|
||||
recordYourEvidenceDescribe:
|
||||
recordYourEvidenceDescribeController.text.trim(),
|
||||
viableOptionsConsidered: viableOptionsConsideredController.text.trim(),
|
||||
explainWhyTickedBox: explainWhyTickedBoxController.text.trim(),
|
||||
canDecisionBeDelayedOptions: canDecisionBeDelayedOptions,
|
||||
selectedImpairmentOption: selectedImpairmentOption() ?? "",
|
||||
impairmentDescribe: impairmentDescribeController.text.trim(),
|
||||
selectedCanPersonDecisionInfoOption:
|
||||
selectedCanPersonDecisionInfoOption() ?? "",
|
||||
describeCanPersonDecisionInfo:
|
||||
describeCanPersonDecisionInfoController.text.trim(),
|
||||
selectedCanTheyRetainOption: selectedCanTheyRetainOption() ?? "",
|
||||
describeCanTheyRetain: describeCanTheyRetainController.text.trim(),
|
||||
selectedCanTheyUseOption: selectedCanTheyUseOption() ?? "",
|
||||
describeCanTheyUse: describeCanTheyUseController.text.trim(),
|
||||
selectedCanTheyCommunicateOption:
|
||||
selectedCanTheyCommunicateOption() ?? "",
|
||||
describeCanTheyCommunicate:
|
||||
describeCanTheyCommunicateController.text.trim(),
|
||||
causativeNexusOptions: causativeNexusOptions,
|
||||
evidence: evidenceController.text.trim(),
|
||||
selectedDoYouHaveConcernOption: selectedDoYouHaveConcernOption() ?? "",
|
||||
whatIsYourEvidence: whatIsYourEvidenceController.text.trim(),
|
||||
seekingManagementDescribe:
|
||||
seekingManagementDescribeController.text.trim(),
|
||||
recordInterviewDescribe: recordInterviewDescribeController.text.trim(),
|
||||
section9DontHaveDecisionNameData:
|
||||
dontHaveDecisionNameController.text.trim(),
|
||||
section9DontHaveDecisionDateData: (dontHaveDecisionDateTime != null)
|
||||
? formatter.format(dontHaveDecisionDateTime!)
|
||||
: "",
|
||||
section9HaveDecisionNameData: haveDecisionNameController.text.trim(),
|
||||
section9HaveDecisionDateData: (haveDecisionDateTime != null)
|
||||
? formatter.format(haveDecisionDateTime!)
|
||||
: "",
|
||||
isIMCARequired: selectedDoesRequireIMCAOption(),
|
||||
giveWhyIMCARequiredReason: requireIMCAController.text.trim(),
|
||||
whyIMCARequiredDateTime: (whyIMCARequiredDateTime != null)
|
||||
? formatter.format(whyIMCARequiredDateTime!)
|
||||
: "",
|
||||
section9AssessorsName: assessorsName4Controller.text.trim(),
|
||||
assessorsDesignation: designationController.text.trim(),
|
||||
assessorsBaseAddress: baseAddressController.text.trim(),
|
||||
assessorsContactDetailsData: contactDetailsController.text.trim(),
|
||||
).toHtml(consentCapacityHtml);
|
||||
|
||||
// log("consentCapacityHtmlString: $consentCapacityHtmlString");
|
||||
await onFormSubmit(
|
||||
request: CreateCarePlanRequest(
|
||||
isHTML: true,
|
||||
flag: false,
|
||||
title: "",
|
||||
noteDetails: consentCapacityHtmlString,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'common_care_note_forms_controller.dart';
|
||||
|
||||
class FreeTextEntriesFormScreenController
|
||||
extends CommonCareNoteFormsController {
|
||||
final titleController = TextEditingController();
|
||||
final noteDetailsController = TextEditingController();
|
||||
|
||||
final flagForHandover = false.obs;
|
||||
|
||||
FreeTextEntriesFormScreenController({required CommonCareNoteFormArgs args})
|
||||
: super(args: args);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
titleController.dispose();
|
||||
noteDetailsController.dispose();
|
||||
Get.delete<FreeTextEntriesFormScreenController>();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> onSaveButtonTap() async {
|
||||
// if (super.date == null || super.time == null) {
|
||||
if (super.date == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select date and time first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (titleController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Title field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (noteDetailsController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Note Details field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
super.removeFocus();
|
||||
|
||||
await onFormSubmit(
|
||||
request: CreateCarePlanRequest(
|
||||
title: titleController.text.trim(),
|
||||
noteDetails: noteDetailsController.text.trim(),
|
||||
flag: flagForHandover(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/models/clients/careNoteFormsRequests/health_appointments_form_html_request.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'common_care_note_forms_controller.dart';
|
||||
|
||||
class HealthAppointmentsFormScreenController
|
||||
extends CommonCareNoteFormsController {
|
||||
final reasonController = TextEditingController();
|
||||
final commentsController = TextEditingController();
|
||||
|
||||
final appointmentWith = [
|
||||
"GP",
|
||||
"CAMHS",
|
||||
"Psychologist",
|
||||
"A&E",
|
||||
"Sexual Health",
|
||||
"Social Worker",
|
||||
"Other"
|
||||
];
|
||||
|
||||
String? selectedAppointmentWith;
|
||||
|
||||
HealthAppointmentsFormScreenController({required CommonCareNoteFormArgs args})
|
||||
: super(args: args);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
reasonController.dispose();
|
||||
commentsController.dispose();
|
||||
Get.delete<HealthAppointmentsFormScreenController>();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> onSaveButtonTap() async {
|
||||
// if (super.date == null || super.time == null) {
|
||||
if (super.date == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select date and time first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (selectedAppointmentWith == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select appointment with",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (reasonController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Reason for appointment field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (commentsController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Comments field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
super.removeFocus();
|
||||
|
||||
await onFormSubmit(
|
||||
request: CreateCarePlanRequest(
|
||||
isHTML: true,
|
||||
flag: false,
|
||||
title: "",
|
||||
noteDetails: HealthAppointmentsFormHtmlRequest(
|
||||
appointmentWith: selectedAppointmentWith!,
|
||||
reason: reasonController.text.trim(),
|
||||
comments: commentsController.text.trim(),
|
||||
).toHtml(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'category_subcategory_widget_controller.dart';
|
||||
import 'common_care_note_forms_controller.dart';
|
||||
|
||||
class InjuryHealthIssueFormScreenController
|
||||
extends CommonCareNoteFormsController {
|
||||
final nameOfWitnesses = TextEditingController();
|
||||
final placeOfAccident = TextEditingController();
|
||||
final accidentDescription = TextEditingController();
|
||||
final recordOfInjury = TextEditingController();
|
||||
final conditionOfPatient = TextEditingController();
|
||||
final nameOfParentContacted = TextEditingController();
|
||||
final parentContactedTime = TextEditingController();
|
||||
|
||||
final isParentContacted = RxString("No");
|
||||
final howParentContacted = Rx<String?>(null);
|
||||
|
||||
final catSubCatController = Get.put(CategorySubcategoryWidgetController());
|
||||
|
||||
InjuryHealthIssueFormScreenController({required CommonCareNoteFormArgs args})
|
||||
: super(args: args);
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
catSubCatController.getBodyParts();
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
nameOfWitnesses.dispose();
|
||||
placeOfAccident.dispose();
|
||||
accidentDescription.dispose();
|
||||
recordOfInjury.dispose();
|
||||
conditionOfPatient.dispose();
|
||||
nameOfParentContacted.dispose();
|
||||
parentContactedTime.dispose();
|
||||
|
||||
catSubCatController.dispose();
|
||||
|
||||
Get.delete<InjuryHealthIssueFormScreenController>();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
selectParentContactTime(context) async {
|
||||
Get.focusScope?.unfocus();
|
||||
TimeOfDay? timeOfDay = await FrequentFunctions.selectTime(context,
|
||||
selectedTime: TimeOfDay.now(),
|
||||
themeColor: Get.theme.colorScheme.primary);
|
||||
|
||||
if (timeOfDay != null) {
|
||||
parentContactedTime.text = timeOfDay.format(context);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> onSaveButtonTap() async {
|
||||
if (super.date == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select date and time first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (nameOfWitnesses.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Name of witnesses/adults present field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (placeOfAccident.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Place accident occured field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (accidentDescription.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Description how the accident occured field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (catSubCatController.selectedBodyPart() == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select category first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (catSubCatController.selectedBodyPart()!.subCategory.isNotEmpty &&
|
||||
catSubCatController.selectedSubcategory() == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select subcategory",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (isParentContacted() == "Yes" &&
|
||||
nameOfParentContacted.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Name of parent contacted field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (isParentContacted() == "Yes" &&
|
||||
parentContactedTime.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select parent contacted time",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (isParentContacted() == "Yes" && howParentContacted() == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select how parent was contacted",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
super.removeFocus();
|
||||
|
||||
await onFormSubmit(
|
||||
request: CreateCarePlanRequest(
|
||||
isHTML: true,
|
||||
flag: false,
|
||||
title: "",
|
||||
category: catSubCatController.selectedSubcategory()?.id ??
|
||||
catSubCatController.selectedBodyPart()!.id,
|
||||
noteDetails: CreateCarePlanRequest.injuryHealthIssueHtmlReq(
|
||||
nameOfWitnesses: nameOfWitnesses.text.trim(),
|
||||
placeOfAccident: placeOfAccident.text.trim(),
|
||||
accidentDescription: accidentDescription.text.trim(),
|
||||
recordOfInjury: recordOfInjury.text.trim(),
|
||||
conditionOfPatient: conditionOfPatient.text.trim(),
|
||||
isParentContacted: isParentContacted(),
|
||||
nameOfParentContacted: isParentContacted() != "Yes"
|
||||
? null
|
||||
: nameOfParentContacted.text.trim(),
|
||||
parentContactedTime: isParentContacted() != "Yes"
|
||||
? null
|
||||
: parentContactedTime.text.trim(),
|
||||
howParentContacted:
|
||||
isParentContacted() != "Yes" ? null : howParentContacted()!,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import '../../../models/mood_rating_data.dart';
|
||||
import 'common_care_note_forms_controller.dart';
|
||||
|
||||
class MoodRatingFormController extends CommonCareNoteFormsController {
|
||||
MoodRatingFormController({required super.args});
|
||||
|
||||
final ratings = <MoodRatingData>[
|
||||
MoodRatingData(icon: AssetsManager.ratingsIcAngry, name: 'Angry'),
|
||||
MoodRatingData(icon: AssetsManager.ratingsIcBored, name: 'Bored'),
|
||||
MoodRatingData(icon: AssetsManager.ratingsIcCalm, name: 'Calm'),
|
||||
MoodRatingData(icon: AssetsManager.ratingsIcConfident, name: 'Confident'),
|
||||
MoodRatingData(icon: AssetsManager.ratingsIcExcited, name: 'Excited'),
|
||||
MoodRatingData(icon: AssetsManager.ratingsIcHappy, name: 'Happy'),
|
||||
MoodRatingData(icon: AssetsManager.ratingsIcHopeful, name: 'Hopeful'),
|
||||
MoodRatingData(icon: AssetsManager.ratingsIcNervous, name: 'Nervous'),
|
||||
MoodRatingData(icon: AssetsManager.ratingsIcProud, name: 'Proud'),
|
||||
MoodRatingData(icon: AssetsManager.ratingsIcRelaxed, name: 'Relaxed'),
|
||||
MoodRatingData(icon: AssetsManager.ratingsIcSad, name: 'Sad'),
|
||||
MoodRatingData(icon: AssetsManager.ratingsIcScared, name: 'Scared'),
|
||||
MoodRatingData(icon: AssetsManager.ratingsIcTired, name: 'Tired'),
|
||||
MoodRatingData(icon: AssetsManager.ratingsIcWorried, name: 'Worried'),
|
||||
];
|
||||
|
||||
final Rx<MoodRatingData?> selectedRating = Rx<MoodRatingData?>(null);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
Get.delete<MoodRatingFormController>();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> onSaveButtonTap() async {
|
||||
// if (super.date == null || super.time == null) {
|
||||
if (super.date == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select date and time first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (selectedRating() == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select your mood rating",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
super.removeFocus();
|
||||
|
||||
await onFormSubmit(
|
||||
request: CreateCarePlanRequest(
|
||||
title: "Mood Rating is ${selectedRating()!.name}",
|
||||
noteDetails:
|
||||
"Mood Rating is ${selectedRating()!.name} at ${DateFormat("hh:mm aa on dd/MM/yyyy").format(date!)}",
|
||||
moodRating: selectedRating()!.name,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/models/clients/careNoteFormsRequests/nutrition_hydration_form_html_request.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'common_care_note_forms_controller.dart';
|
||||
|
||||
abstract class NutritionHydrationType {
|
||||
static const String food = "Food";
|
||||
static const String fluid = "Fluid";
|
||||
}
|
||||
|
||||
class NutritionHydrationFormScreenController
|
||||
extends CommonCareNoteFormsController {
|
||||
final mealDrinkTypeController = TextEditingController();
|
||||
final amountController = TextEditingController();
|
||||
final commentsController = TextEditingController();
|
||||
|
||||
final selectedType = RxString(NutritionHydrationType.food);
|
||||
|
||||
final typeOptions = [
|
||||
NutritionHydrationType.food,
|
||||
NutritionHydrationType.fluid
|
||||
];
|
||||
|
||||
NutritionHydrationFormScreenController({required CommonCareNoteFormArgs args})
|
||||
: super(args: args);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
mealDrinkTypeController.dispose();
|
||||
amountController.dispose();
|
||||
commentsController.dispose();
|
||||
Get.delete<NutritionHydrationFormScreenController>();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> onSaveButtonTap() async {
|
||||
if (super.date == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select date and time first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (commentsController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Comments field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
super.removeFocus();
|
||||
|
||||
await onFormSubmit(
|
||||
request: CreateCarePlanRequest(
|
||||
isHTML: true,
|
||||
flag: false,
|
||||
title: "",
|
||||
noteDetails: NutritionHydrationFormHtmlRequest(
|
||||
nutritionHydrationType: selectedType(),
|
||||
foodFluidType: mealDrinkTypeController.text.trim(),
|
||||
foodFluidAmount: amountController.text.trim(),
|
||||
comments: commentsController.text.trim(),
|
||||
).toHtml(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/models/clients/careNoteFormsRequests/observations_form_html_request.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'common_care_note_forms_controller.dart';
|
||||
|
||||
class ObservationsFormScreenController extends CommonCareNoteFormsController {
|
||||
final heartRateController = TextEditingController();
|
||||
final bloodPressureController = TextEditingController();
|
||||
final respiratoryRateController = TextEditingController();
|
||||
final oxygenController = TextEditingController();
|
||||
final temperatureController = TextEditingController();
|
||||
final bloodSugarController = TextEditingController();
|
||||
|
||||
ObservationsFormScreenController({required CommonCareNoteFormArgs args})
|
||||
: super(args: args);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
heartRateController.dispose();
|
||||
bloodPressureController.dispose();
|
||||
respiratoryRateController.dispose();
|
||||
oxygenController.dispose();
|
||||
temperatureController.dispose();
|
||||
bloodSugarController.dispose();
|
||||
|
||||
Get.delete<ObservationsFormScreenController>();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> onSaveButtonTap() async {
|
||||
// if (super.date == null || super.time == null) {
|
||||
if (super.date == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select date and time first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (heartRateController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Heart Rate field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (bloodPressureController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Blood Pressure field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (respiratoryRateController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Respiratory Rate field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (oxygenController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Oxygen field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (temperatureController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Temperature field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (bloodSugarController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Blood Sugar field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
super.removeFocus();
|
||||
|
||||
await onFormSubmit(
|
||||
request: CreateCarePlanRequest(
|
||||
isHTML: true,
|
||||
flag: false,
|
||||
title: "",
|
||||
noteDetails: ObservationsFormHtmlReq(
|
||||
heartRate: heartRateController.text.trim(),
|
||||
bloodPressure: bloodPressureController.text.trim(),
|
||||
respiratoryRate: respiratoryRateController.text.trim(),
|
||||
oxygen: oxygenController.text.trim(),
|
||||
temperature: temperatureController.text.trim(),
|
||||
bloodSugar: bloodSugarController.text.trim(),
|
||||
).toHtml(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/models/clients/careNoteFormsRequests/physical_intervention_form_html_request.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../../models/clients/careNoteFormsRequests/HtmlTableOption.dart';
|
||||
import 'category_subcategory_widget_controller.dart';
|
||||
import 'common_care_note_forms_controller.dart';
|
||||
|
||||
class PhysicalInterventionFormScreenController
|
||||
extends CommonCareNoteFormsController {
|
||||
final durationOfIncidentController = TextEditingController();
|
||||
final staffDebriefFormNumberController = TextEditingController();
|
||||
final nameOfWitnessController = TextEditingController();
|
||||
final incidentPlaceController = TextEditingController();
|
||||
final whatWasUsedController = TextEditingController();
|
||||
final wasThePbsFollowedController = TextEditingController();
|
||||
final reasonForPhysicalInterventionController = TextEditingController();
|
||||
final staffInvolvedController = TextEditingController();
|
||||
final conditionOfServiceUserController = TextEditingController();
|
||||
final userClamedController = TextEditingController();
|
||||
final explainController = TextEditingController();
|
||||
final commentsController = TextEditingController();
|
||||
|
||||
final nameOfParentContacted = TextEditingController();
|
||||
final parentContactedTime = TextEditingController();
|
||||
|
||||
final isParentContacted = RxString("No");
|
||||
final howParentContacted = Rx<String?>(null);
|
||||
final howFormSharedRx = Rx<String?>(null);
|
||||
|
||||
final catSubCatController = Get.put(CategorySubcategoryWidgetController());
|
||||
|
||||
List<HtmlTableOption> whyForceNecessaryOptions = [
|
||||
HtmlTableOption(
|
||||
id: '1', requirements: 'Service User was placing themselves at risk'),
|
||||
HtmlTableOption(
|
||||
id: '2', requirements: 'Service User was placing others at risk'),
|
||||
HtmlTableOption(
|
||||
id: '3', requirements: 'Significant Damage to property'),
|
||||
HtmlTableOption(
|
||||
id: '4', requirements: 'Illegal offence was being carried out'),
|
||||
HtmlTableOption(id: '5', requirements: 'Other'),
|
||||
];
|
||||
|
||||
final isParentContactedOptions = ['Yes', 'No'];
|
||||
final howParentContactedOptions = [
|
||||
'Call',
|
||||
'Email',
|
||||
'Other',
|
||||
'Upon collection/drop off'
|
||||
];
|
||||
final howFormSharedOptions = ['Paper', 'Email', 'Other'];
|
||||
|
||||
PhysicalInterventionFormScreenController(
|
||||
{required CommonCareNoteFormArgs args})
|
||||
: super(args: args);
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
catSubCatController.getBodyParts();
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
durationOfIncidentController.dispose();
|
||||
staffDebriefFormNumberController.dispose();
|
||||
nameOfWitnessController.dispose();
|
||||
incidentPlaceController.dispose();
|
||||
whatWasUsedController.dispose();
|
||||
wasThePbsFollowedController.dispose();
|
||||
reasonForPhysicalInterventionController.dispose();
|
||||
staffInvolvedController.dispose();
|
||||
conditionOfServiceUserController.dispose();
|
||||
userClamedController.dispose();
|
||||
explainController.dispose();
|
||||
commentsController.dispose();
|
||||
nameOfParentContacted.dispose();
|
||||
parentContactedTime.dispose();
|
||||
|
||||
catSubCatController.dispose();
|
||||
|
||||
Get.delete<PhysicalInterventionFormScreenController>();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
selectParentContactTime(context) async {
|
||||
Get.focusScope?.unfocus();
|
||||
TimeOfDay? timeOfDay = await FrequentFunctions.selectTime(context,
|
||||
selectedTime: TimeOfDay.now(),
|
||||
themeColor: Get.theme.colorScheme.primary);
|
||||
|
||||
if (timeOfDay != null) {
|
||||
parentContactedTime.text = timeOfDay.format(context);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> onSaveButtonTap() async {
|
||||
if (super.date == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select date and time first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (durationOfIncidentController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Concerns about the service user field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (staffDebriefFormNumberController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Voice of the service user field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (nameOfWitnessController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Are there any immediate risks field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (catSubCatController.selectedBodyPart() == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select category first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (catSubCatController.selectedBodyPart()!.subCategory.isNotEmpty &&
|
||||
catSubCatController.selectedSubcategory() == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select subcategory",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (isParentContacted() == "Yes" &&
|
||||
nameOfParentContacted.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Name of parent contacted field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (isParentContacted() == "Yes" &&
|
||||
parentContactedTime.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select parent contacted time",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (isParentContacted() == "Yes" && howParentContacted() == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select how parent was contacted",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (howFormSharedRx() == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select How was this form shared with parents/carers?",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
super.removeFocus();
|
||||
|
||||
await onFormSubmit(
|
||||
request: CreateCarePlanRequest(
|
||||
isHTML: true,
|
||||
flag: false,
|
||||
title: "",
|
||||
category: catSubCatController.selectedSubcategory()?.id ??
|
||||
catSubCatController.selectedBodyPart()!.id,
|
||||
noteDetails: PhysicalInterventionFormHtmlRequest(
|
||||
durationOfIncidents: durationOfIncidentController.text.trim(),
|
||||
staffDebriefFormNumber:
|
||||
staffDebriefFormNumberController.text.trim(),
|
||||
nameOfWitnesses: nameOfWitnessController.text.trim(),
|
||||
placeOfIncident: incidentPlaceController.text.trim(),
|
||||
priorToIntervention: whatWasUsedController.text.trim(),
|
||||
pbsFollowed: wasThePbsFollowedController.text.trim(),
|
||||
reasonForPhysicalIntervention:
|
||||
reasonForPhysicalInterventionController.text.trim(),
|
||||
staffInvolvedInPI: staffInvolvedController.text.trim(),
|
||||
conditionOfSU: conditionOfServiceUserController.text.trim(),
|
||||
howSuCalmed: userClamedController.text.trim(),
|
||||
useOfForceNecessary: whyForceNecessaryOptions,
|
||||
pleaseExplain: explainController.text.trim(),
|
||||
isParentContacted: isParentContacted(),
|
||||
nameOfParentContacted: isParentContacted() != "Yes"
|
||||
? ""
|
||||
: nameOfParentContacted.text.trim(),
|
||||
parentContactedTime: isParentContacted() != "Yes"
|
||||
? ""
|
||||
: parentContactedTime.text.trim(),
|
||||
howParentContacted:
|
||||
isParentContacted() != "Yes" ? "" : howParentContacted()!,
|
||||
parentCarersComments: commentsController.text.trim(),
|
||||
howFormWasShared: howFormSharedRx()!)
|
||||
.toHtml(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
import 'package:adoptive_calendar/adoptive_calendar.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/models/clients/careNoteFormsRequests/safeguarding_form_html_request.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'category_subcategory_widget_controller.dart';
|
||||
import 'common_care_note_forms_controller.dart';
|
||||
|
||||
class SafeguardingFormScreenController extends CommonCareNoteFormsController {
|
||||
final concernAboutServiceUserController = TextEditingController();
|
||||
final voiceOfServiceUserController = TextEditingController();
|
||||
final anyImmediateRisksController = TextEditingController();
|
||||
final qActionTakenController = TextEditingController();
|
||||
final commentsController = TextEditingController();
|
||||
final nameController1 = TextEditingController();
|
||||
final nameController2 = TextEditingController();
|
||||
final anyWitnessesController = TextEditingController();
|
||||
final reportingDateTimeController = TextEditingController();
|
||||
final actionTakenController = TextEditingController();
|
||||
|
||||
final catSubCatController = Get.put(CategorySubcategoryWidgetController());
|
||||
|
||||
SafeguardingFormScreenController({required CommonCareNoteFormArgs args})
|
||||
: super(args: args);
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
catSubCatController.getBodyParts();
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
concernAboutServiceUserController.dispose();
|
||||
voiceOfServiceUserController.dispose();
|
||||
anyImmediateRisksController.dispose();
|
||||
qActionTakenController.dispose();
|
||||
commentsController.dispose();
|
||||
nameController1.dispose();
|
||||
nameController2.dispose();
|
||||
anyWitnessesController.dispose();
|
||||
reportingDateTimeController.dispose();
|
||||
actionTakenController.dispose();
|
||||
catSubCatController.dispose();
|
||||
|
||||
Get.delete<SafeguardingFormScreenController>();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
selectDateAndTimeOfReporting(context) async {
|
||||
Get.focusScope?.unfocus();
|
||||
final DateTime? d = await showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AdoptiveCalendar(
|
||||
initialDate: DateTime.now(),
|
||||
action: true,
|
||||
);
|
||||
},
|
||||
);
|
||||
// final d = await CommonCode.datePicker(context);
|
||||
|
||||
if (d != null) {
|
||||
reportingDateTimeController.text =
|
||||
FrequentFunctions.careNoteDateFormatter.format(d).toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> onSaveButtonTap() async {
|
||||
// if (super.date == null || super.time == null) {
|
||||
if (super.date == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select date and time first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (concernAboutServiceUserController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Concerns about the service user field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (voiceOfServiceUserController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Voice of the service user field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (anyImmediateRisksController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Are there any immediate risks field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (catSubCatController.selectedBodyPart() == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select category first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (catSubCatController.selectedBodyPart()!.subCategory.isNotEmpty &&
|
||||
catSubCatController.selectedSubcategory() == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select subcategory",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
super.removeFocus();
|
||||
|
||||
await onFormSubmit(
|
||||
request: CreateCarePlanRequest(
|
||||
isHTML: true,
|
||||
flag: false,
|
||||
title: "",
|
||||
category: catSubCatController.selectedSubcategory()?.id ??
|
||||
catSubCatController.selectedBodyPart()!.id,
|
||||
noteDetails: SafeguardingFormHtmlRequest(
|
||||
concernsAboutServiceUser:
|
||||
concernAboutServiceUserController.text.trim(),
|
||||
voiceOfTheServiceUser: voiceOfServiceUserController.text.trim(),
|
||||
areThereAnyImmediateRisks: anyImmediateRisksController.text.trim(),
|
||||
whatActionDoYouFeel: qActionTakenController.text.trim(),
|
||||
comments: commentsController.text.trim(),
|
||||
yourName: nameController1.text.trim(),
|
||||
anyWitnesses: anyWitnessesController.text.trim(),
|
||||
dateTimeReporting: reportingDateTimeController.text.trim(),
|
||||
yourNameDslDdsl: nameController2.text.trim(),
|
||||
actionTaken: actionTakenController.text.trim(),
|
||||
).toHtml(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/models/clients/careNoteFormsRequests/showering_and_bath_form_html_request.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'common_care_note_forms_controller.dart';
|
||||
|
||||
class ShoweringBathFormScreenController extends CommonCareNoteFormsController {
|
||||
final commentsController = TextEditingController();
|
||||
|
||||
final selectedOption = Rx<String>('Bath');
|
||||
|
||||
ShoweringBathFormScreenController({required CommonCareNoteFormArgs args})
|
||||
: super(args: args);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
commentsController.dispose();
|
||||
Get.delete<ShoweringBathFormScreenController>();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> onSaveButtonTap() async {
|
||||
// if (super.date == null || super.time == null) {
|
||||
if (super.date == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select date and time first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (commentsController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Comments field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
super.removeFocus();
|
||||
|
||||
await onFormSubmit(
|
||||
request: CreateCarePlanRequest(
|
||||
isHTML: true,
|
||||
flag: false,
|
||||
title: "",
|
||||
noteDetails: ShoweringAndBathFormHtmlRequest(
|
||||
showeringBathType: selectedOption(),
|
||||
comments: commentsController.text.trim(),
|
||||
).toHtml(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ftc_mobile_app/models/clients/careNoteFormsRequests/toileting_form_html_request.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'common_care_note_forms_controller.dart';
|
||||
|
||||
class ToiletingNoteFormScreenController extends CommonCareNoteFormsController {
|
||||
final commentsController = TextEditingController();
|
||||
|
||||
final selectedOption = Rx<String?>(null);
|
||||
final assistanceRequired = false.obs;
|
||||
|
||||
ToiletingNoteFormScreenController({required CommonCareNoteFormArgs args})
|
||||
: super(args: args);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
commentsController.dispose();
|
||||
Get.delete<ToiletingNoteFormScreenController>();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> onSaveButtonTap() async {
|
||||
// if (super.date == null || super.time == null) {
|
||||
if (super.date == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select date and time first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (assistanceRequired() && commentsController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Comments field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
super.removeFocus();
|
||||
|
||||
await onFormSubmit(
|
||||
request: CreateCarePlanRequest(
|
||||
isHTML: true,
|
||||
flag: false,
|
||||
title: "",
|
||||
noteDetails: ToiletingFormHtmlRequest(
|
||||
assistanceRequired: assistanceRequired(),
|
||||
assistanceType: !assistanceRequired() ? "" : (selectedOption() ?? ""),
|
||||
comments: !assistanceRequired() ? "" : commentsController.text.trim(),
|
||||
).toHtml(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'common_care_note_forms_controller.dart';
|
||||
|
||||
class WeightHeightFormScreenController extends CommonCareNoteFormsController {
|
||||
final heightController = TextEditingController();
|
||||
final weightController = TextEditingController();
|
||||
final commentsController = TextEditingController();
|
||||
|
||||
final appointmentWith = [
|
||||
"GP",
|
||||
"CAMHS",
|
||||
"Psychologist",
|
||||
"A&E",
|
||||
"Sexual Health",
|
||||
"Social Worker",
|
||||
"Other"
|
||||
];
|
||||
|
||||
WeightHeightFormScreenController({required CommonCareNoteFormArgs args})
|
||||
: super(args: args);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
heightController.dispose();
|
||||
weightController.dispose();
|
||||
commentsController.dispose();
|
||||
Get.delete<WeightHeightFormScreenController>();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> onSaveButtonTap() async {
|
||||
// if (super.date == null || super.time == null) {
|
||||
if (super.date == null) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Please select date and time first",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (heightController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Height field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (weightController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Weight field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (commentsController.text.trim().isEmpty) {
|
||||
FrequentFunctions.showToast(
|
||||
message: "Comments field is required",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
super.removeFocus();
|
||||
|
||||
await onFormSubmit(
|
||||
request: CreateCarePlanRequest(
|
||||
isHTML: true,
|
||||
flag: false,
|
||||
title: "",
|
||||
noteDetails: CreateCarePlanRequest.heightWeightHtmlReq(
|
||||
heightController.text.trim(),
|
||||
weightController.text.trim(),
|
||||
commentsController.text.trim(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user