VA-38902 fix

ipd-changes-for-vida-plus
parent 4e42ea7bcc
commit 476033c925

@ -47,7 +47,10 @@ class ReferralService extends BaseService {
await baseAppClient.post( await baseAppClient.post(
REFER_TO_DOCTOR, REFER_TO_DOCTOR,
onSuccess: (dynamic response, int statusCode) {}, onSuccess: (dynamic response, int statusCode) {
hasError = false;
},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -55,7 +55,9 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
String? clinicError; String? clinicError;
String? doctorError; String? doctorError;
String? frequencyError; String? frequencyError;
String? priorityError;
String? remarkError; String? remarkError;
String? extError;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var recognizedWord; var recognizedWord;
var event = RobotProvider(); var event = RobotProvider();
@ -394,7 +396,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
dropDownText: _selectedPriority != null ? _selectedPriority['Description'] : null, dropDownText: _selectedPriority != null ? _selectedPriority['Description'] : null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: frequencyError, validationError: priorityError,
onClick: () { onClick: () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: _priorityList, list: _priorityList,
@ -511,6 +513,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
height: 10, height: 10,
), ),
AppTextFieldCustom( AppTextFieldCustom(
validationError: extError,
hintText: TranslationBase.of(context).ext, hintText: TranslationBase.of(context).ext,
controller: _extController, controller: _extController,
inputType: TextInputType.text, inputType: TextInputType.text,
@ -581,11 +584,13 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
), ),
), ),
), ),
bottomSheet: model.state != ViewState.Idle bottomSheet:
? Container( // model.state != ViewState.Idle
height: 0, // ? Container(
) // height: 0,
: CustomBottomSheetContainer( // )
// :
CustomBottomSheetContainer(
label: "${TranslationBase.of(context).refer}", label: "${TranslationBase.of(context).refer}",
onTap: () async { onTap: () async {
setState(() { setState(() {
@ -615,10 +620,20 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
frequencyError = null; frequencyError = null;
} }
if (_selectedPriority == null) { if (_selectedPriority == null) {
priorityError = TranslationBase.of(context).fieldRequired;
} else {
priorityError = null;
}
if (_remarksController.text.isEmpty ) {
remarkError = TranslationBase.of(context).fieldRequired; remarkError = TranslationBase.of(context).fieldRequired;
} else { } else {
remarkError = null; remarkError = null;
} }
if (_extController.text.isEmpty ) {
extError = TranslationBase.of(context).fieldRequired;
} else {
extError = null;
}
}); });
if (_selectedFrequency == null || if (_selectedFrequency == null ||
_selectedPriority == null || _selectedPriority == null ||
@ -626,8 +641,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
_selectedClinic == null || _selectedClinic == null ||
_selectedDoctor == null || _selectedDoctor == null ||
( isVidaPlusProject && selectedDiagnosis == null) || ( isVidaPlusProject && selectedDiagnosis == null) ||
_remarksController.text == null || _remarksController.text.isEmpty ||
_extController.text == null) return; _extController.text.isEmpty) return;
{ {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.makeInPatientReferral( await model.makeInPatientReferral(

Loading…
Cancel
Save