Merge branch 'reply-doctor_changes' into 'development'

Merge branch 'development' into procedure_refactoring

See merge request Cloud_Solution/doctor_app_flutter!732
merge-requests/735/head
Mohammad Aljammal 5 years ago
commit a74f4a3d5a

@ -163,6 +163,8 @@ class MyReferralPatientModel {
referralDate = AppDateUtils.getDateTimeFromString(json['ReferralDate']); referralDate = AppDateUtils.getDateTimeFromString(json['ReferralDate']);
} catch (e){ } catch (e){
referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']); referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']);
} finally {
referralDate = DateTime.now();
} }
referringDoctorRemarks = json['ReferringDoctorRemarks']; referringDoctorRemarks = json['ReferringDoctorRemarks'];

@ -166,8 +166,9 @@ class MyReferredPatientModel {
referringDoctor = json['ReferringDoctor']; referringDoctor = json['ReferringDoctor'];
referralClinic = json['ReferralClinic']; referralClinic = json['ReferralClinic'];
referringClinic = json['ReferringClinic']; referringClinic = json['ReferringClinic'];
createdOn = json['CreatedOn'];
referralStatus = json["ReferralStatus"] is String?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0 : json['ReferralStatus']; referralStatus = json["ReferralStatus"] is String?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0 : json['ReferralStatus'];
referralDate = json['ReferralDate']; referralDate = json['ReferralDate'] ?? createdOn;
referringDoctorRemarks = json['ReferringDoctorRemarks']; referringDoctorRemarks = json['ReferringDoctorRemarks'];
referredDoctorRemarks = json['ReferredDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks'];
referralResponseOn = json['ReferralResponseOn']; referralResponseOn = json['ReferralResponseOn'];
@ -179,7 +180,6 @@ class MyReferredPatientModel {
appointmentDate = json['AppointmentDate']; appointmentDate = json['AppointmentDate'];
appointmentType = json['AppointmentType']; appointmentType = json['AppointmentType'];
patientMRN = json['PatientMRN']; patientMRN = json['PatientMRN'];
createdOn = json['CreatedOn'];
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
nationalityID = json['NationalityID']; nationalityID = json['NationalityID'];
age = json['Age']; age = json['Age'];

@ -51,8 +51,8 @@ class _AddReplayOnReferralPatientState
void initState() { void initState() {
requestPermissions(); requestPermissions();
super.initState(); super.initState();
replayOnReferralController.text = widget.myReferralInPatientModel.referredDoctorRemarks?? ""; replayOnReferralController.text =
widget.myReferralInPatientModel.referredDoctorRemarks ?? "";
} }
@override @override
@ -60,67 +60,70 @@ class _AddReplayOnReferralPatientState
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView( body: Column(
child: Column( children: [
children: [ Expanded(
Column( child: SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
BottomSheetTitle(title: 'Reply'), children: [
SizedBox( BottomSheetTitle(title: 'Reply'),
height: 10.0, SizedBox(
), height: 10.0,
Center( ),
child: FractionallySizedBox( Center(
widthFactor: 0.9, child: FractionallySizedBox(
child: Column( widthFactor: 0.9,
children: [ child: Column(
Stack( children: [
children: [ Stack(
AppTextFieldCustom( children: [
hintText: 'Reply your responses here', AppTextFieldCustom(
controller: replayOnReferralController, hintText: 'Reply your responses here',
maxLines: 35, controller: replayOnReferralController,
minLines: 25, maxLines: 35,
hasBorder: true, minLines: 25,
validationError: hasBorder: true,
replayOnReferralController.text.isEmpty && validationError: replayOnReferralController
isSubmitted .text.isEmpty &&
? TranslationBase.of(context).emptyMessage isSubmitted
: null, ? TranslationBase.of(context).emptyMessage
), : null,
Positioned(
top: 0, //MediaQuery.of(context).size.height * 0,
right: 15,
child: IconButton(
icon: Icon(
DoctorApp.speechtotext,
color: Colors.black,
size: 35,
),
onPressed: () {
onVoiceText();
},
), ),
) Positioned(
], top: 0,
), //MediaQuery.of(context).size.height * 0,
], right: 15,
child: IconButton(
icon: Icon(
DoctorApp.speechtotext,
color: Colors.black,
size: 35,
),
onPressed: () {
onVoiceText();
},
),
)
],
),
],
),
), ),
), ),
), ],
], ),
), ),
Container( ),
height: replayOnReferralController.text.isNotEmpty ? 130 : 70, Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), height: replayOnReferralController.text.isNotEmpty ? 130 : 70,
child: Column( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
children: <Widget>[ child: Column(
replayOnReferralController.text.isEmpty children: <Widget>[
? SizedBox() replayOnReferralController.text.isEmpty
: Container( ? SizedBox()
margin: EdgeInsets.all(5), : Container(
child: Expanded( margin: EdgeInsets.all(5),
child: AppButton( child: AppButton(
title: TranslationBase.of(context).clearText, title: TranslationBase.of(context).clearText,
onPressed: () { onPressed: () {
@ -128,55 +131,54 @@ class _AddReplayOnReferralPatientState
replayOnReferralController.text = ''; replayOnReferralController.text = '';
}); });
}, },
)), ),
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: AppButton( child: AppButton(
title: 'Submit Reply', title: 'Submit Reply',
color: Color(0xff359846), color: Color(0xff359846),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
onPressed: () async { onPressed: () async {
setState(() { setState(() {
isSubmitted = true; isSubmitted = true;
}); });
if (replayOnReferralController.text.isNotEmpty) { if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel.replay( await widget.patientReferralViewModel.replay(
replayOnReferralController.text.trim(), replayOnReferralController.text.trim(),
widget.myReferralInPatientModel); widget.myReferralInPatientModel);
if (widget.patientReferralViewModel.state == if (widget.patientReferralViewModel.state ==
ViewState.ErrorLocal) { ViewState.ErrorLocal) {
Helpers.showErrorToast( Helpers.showErrorToast(
widget.patientReferralViewModel.error); widget.patientReferralViewModel.error);
} else {
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(
"Your Reply Added Successfully");
Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.push(
context,
FadePage(
page: ReplySummeryOnReferralPatient(
widget.myReferralInPatientModel,
replayOnReferralController.text.trim()),
),
);
}
} else { } else {
Helpers.showErrorToast("You can't add empty reply"); GifLoaderDialogUtils.hideDialog(context);
setState(() { DrAppToastMsg.showSuccesToast(
isSubmitted = false; "Your Reply Added Successfully");
}); Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.push(
context,
FadePage(
page: ReplySummeryOnReferralPatient(
widget.myReferralInPatientModel,
replayOnReferralController.text.trim()),
),
);
} }
})), } else {
], Helpers.showErrorToast("You can't add empty reply");
), setState(() {
isSubmitted = false;
});
}
})),
],
), ),
], ),
), ],
), ),
); );
} }

Loading…
Cancel
Save