|
|
|
|
@ -50,6 +50,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
|
|
|
|
|
String clinicError;
|
|
|
|
|
String doctorError;
|
|
|
|
|
String frequencyError;
|
|
|
|
|
String remarkError;
|
|
|
|
|
stt.SpeechToText speech = stt.SpeechToText();
|
|
|
|
|
var recognizedWord;
|
|
|
|
|
var event = RobotProvider();
|
|
|
|
|
@ -127,15 +128,15 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
|
|
dynamic priority1 = {
|
|
|
|
|
"ParameterCode": 0,
|
|
|
|
|
"ParameterCode": 1,
|
|
|
|
|
"Description": TranslationBase.of(context).veryUrgent.toUpperCase(),
|
|
|
|
|
};
|
|
|
|
|
dynamic priority2 = {
|
|
|
|
|
"ParameterCode": 1,
|
|
|
|
|
"ParameterCode": 2,
|
|
|
|
|
'Description': TranslationBase.of(context).urgent.toUpperCase(),
|
|
|
|
|
};
|
|
|
|
|
dynamic priority3 = {
|
|
|
|
|
"ParameterCode": 2,
|
|
|
|
|
"ParameterCode": 0,
|
|
|
|
|
'Description': TranslationBase.of(context).routine.toUpperCase(),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -506,6 +507,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
|
|
|
|
|
Stack(
|
|
|
|
|
children: [
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
validationError: remarkError,
|
|
|
|
|
hintText: "Remarks",
|
|
|
|
|
controller: _remarksController,
|
|
|
|
|
inputType: TextInputType.multiline,
|
|
|
|
|
@ -554,77 +556,91 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
bottomSheet: BottomSheetDialogButton(
|
|
|
|
|
label: "${TranslationBase.of(context).refer}",
|
|
|
|
|
onTap: () async {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (_referTo == null) {
|
|
|
|
|
branchError =
|
|
|
|
|
TranslationBase.of(context).fieldRequired;
|
|
|
|
|
} else {
|
|
|
|
|
branchError = null;
|
|
|
|
|
}
|
|
|
|
|
if (_selectedBranch == null) {
|
|
|
|
|
hospitalError =
|
|
|
|
|
TranslationBase.of(context).fieldRequired;
|
|
|
|
|
} else {
|
|
|
|
|
hospitalError = null;
|
|
|
|
|
}
|
|
|
|
|
if (_selectedClinic == null) {
|
|
|
|
|
clinicError =
|
|
|
|
|
TranslationBase.of(context).fieldRequired;
|
|
|
|
|
} else {
|
|
|
|
|
clinicError = null;
|
|
|
|
|
}
|
|
|
|
|
if (_selectedDoctor == null) {
|
|
|
|
|
doctorError =
|
|
|
|
|
TranslationBase.of(context).fieldRequired;
|
|
|
|
|
} else {
|
|
|
|
|
doctorError = null;
|
|
|
|
|
bottomSheet:
|
|
|
|
|
model.state != ViewState.Idle
|
|
|
|
|
? Container(
|
|
|
|
|
height: 0,
|
|
|
|
|
)
|
|
|
|
|
:BottomSheetDialogButton(
|
|
|
|
|
label: "${TranslationBase.of(context).refer}",
|
|
|
|
|
onTap: () async {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (_referTo == null) {
|
|
|
|
|
branchError =
|
|
|
|
|
TranslationBase.of(context).fieldRequired;
|
|
|
|
|
} else {
|
|
|
|
|
branchError = null;
|
|
|
|
|
}
|
|
|
|
|
if (_selectedBranch == null) {
|
|
|
|
|
hospitalError =
|
|
|
|
|
TranslationBase.of(context).fieldRequired;
|
|
|
|
|
} else {
|
|
|
|
|
hospitalError = null;
|
|
|
|
|
}
|
|
|
|
|
if (_selectedClinic == null) {
|
|
|
|
|
clinicError =
|
|
|
|
|
TranslationBase.of(context).fieldRequired;
|
|
|
|
|
} else {
|
|
|
|
|
clinicError = null;
|
|
|
|
|
}
|
|
|
|
|
if (_selectedDoctor == null) {
|
|
|
|
|
doctorError =
|
|
|
|
|
TranslationBase.of(context).fieldRequired;
|
|
|
|
|
} else {
|
|
|
|
|
doctorError = null;
|
|
|
|
|
}
|
|
|
|
|
if (_selectedFrequency == null) {
|
|
|
|
|
frequencyError =
|
|
|
|
|
TranslationBase.of(context).fieldRequired;
|
|
|
|
|
} else {
|
|
|
|
|
frequencyError = null;
|
|
|
|
|
}
|
|
|
|
|
if (_selectedPriority == null) {
|
|
|
|
|
remarkError =
|
|
|
|
|
TranslationBase.of(context).fieldRequired;
|
|
|
|
|
} else {
|
|
|
|
|
remarkError = null;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (_selectedFrequency == null ||
|
|
|
|
|
_selectedPriority == null ||
|
|
|
|
|
_selectedBranch == null ||
|
|
|
|
|
_selectedClinic == null ||
|
|
|
|
|
_selectedDoctor == null ||
|
|
|
|
|
_remarksController.text == null ||
|
|
|
|
|
_extController.text == null) return;
|
|
|
|
|
{
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.makeInPatientReferral(
|
|
|
|
|
patient: patient,
|
|
|
|
|
projectID: _selectedBranch['facilityId'],
|
|
|
|
|
clinicID: _selectedClinic['ClinicID'],
|
|
|
|
|
doctorID: _selectedDoctor['DoctorID'],
|
|
|
|
|
frequencyCode:
|
|
|
|
|
_selectedFrequency['ParameterCode'],
|
|
|
|
|
ext: _extController.text,
|
|
|
|
|
remarks: _remarksController.text,
|
|
|
|
|
priority: _activePriority,
|
|
|
|
|
referralDate: appointmentDate,
|
|
|
|
|
isLocalBusy: true);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal)
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);
|
|
|
|
|
else {
|
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.referralSuccessMsg);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (_selectedFrequency == null) {
|
|
|
|
|
frequencyError =
|
|
|
|
|
TranslationBase.of(context).fieldRequired;
|
|
|
|
|
} else {
|
|
|
|
|
frequencyError = null;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (_selectedFrequency == null ||
|
|
|
|
|
_selectedBranch == null ||
|
|
|
|
|
_selectedClinic == null ||
|
|
|
|
|
_selectedDoctor == null ||
|
|
|
|
|
_remarksController.text == null ||
|
|
|
|
|
_extController.text == null) return;
|
|
|
|
|
{
|
|
|
|
|
await model.makeInPatientReferral(
|
|
|
|
|
patient: patient,
|
|
|
|
|
projectID: _selectedBranch['facilityId'],
|
|
|
|
|
clinicID: _selectedClinic['ClinicID'],
|
|
|
|
|
doctorID: _selectedDoctor['DoctorID'],
|
|
|
|
|
frequencyCode:
|
|
|
|
|
_selectedFrequency['ParameterCode'],
|
|
|
|
|
ext: _extController.text,
|
|
|
|
|
remarks: _remarksController.text,
|
|
|
|
|
priority: _activePriority,
|
|
|
|
|
referralDate: appointmentDate);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal)
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);
|
|
|
|
|
else {
|
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.referralSuccessMsg);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|