Merge branch 'development' into procedure_refactoring

# Conflicts:
#	lib/core/service/patient/LiveCarePatientServices.dart
merge-requests/732/head
mosazaid 4 years ago
parent 1b47b60155
commit 017669c406

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

@ -166,8 +166,9 @@ class MyReferredPatientModel {
referringDoctor = json['ReferringDoctor'];
referralClinic = json['ReferralClinic'];
referringClinic = json['ReferringClinic'];
createdOn = json['CreatedOn'];
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'];
referredDoctorRemarks = json['ReferredDoctorRemarks'];
referralResponseOn = json['ReferralResponseOn'];
@ -179,7 +180,6 @@ class MyReferredPatientModel {
appointmentDate = json['AppointmentDate'];
appointmentType = json['AppointmentType'];
patientMRN = json['PatientMRN'];
createdOn = json['CreatedOn'];
clinicID = json['ClinicID'];
nationalityID = json['NationalityID'];
age = json['Age'];

@ -51,8 +51,8 @@ class _AddReplayOnReferralPatientState
void initState() {
requestPermissions();
super.initState();
replayOnReferralController.text = widget.myReferralInPatientModel.referredDoctorRemarks?? "";
replayOnReferralController.text =
widget.myReferralInPatientModel.referredDoctorRemarks ?? "";
}
@override
@ -60,67 +60,70 @@ class _AddReplayOnReferralPatientState
return AppScaffold(
isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView(
child: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BottomSheetTitle(title: 'Reply'),
SizedBox(
height: 10.0,
),
Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
Stack(
children: [
AppTextFieldCustom(
hintText: 'Reply your responses here',
controller: replayOnReferralController,
maxLines: 35,
minLines: 25,
hasBorder: true,
validationError:
replayOnReferralController.text.isEmpty &&
isSubmitted
? 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();
},
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BottomSheetTitle(title: 'Reply'),
SizedBox(
height: 10.0,
),
Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
Stack(
children: [
AppTextFieldCustom(
hintText: 'Reply your responses here',
controller: replayOnReferralController,
maxLines: 35,
minLines: 25,
hasBorder: true,
validationError: replayOnReferralController
.text.isEmpty &&
isSubmitted
? 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();
},
),
)
],
),
],
),
),
),
),
],
],
),
),
Container(
height: replayOnReferralController.text.isNotEmpty ? 130 : 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column(
children: <Widget>[
replayOnReferralController.text.isEmpty
? SizedBox()
: Container(
margin: EdgeInsets.all(5),
child: Expanded(
),
Container(
height: replayOnReferralController.text.isNotEmpty ? 130 : 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column(
children: <Widget>[
replayOnReferralController.text.isEmpty
? SizedBox()
: Container(
margin: EdgeInsets.all(5),
child: AppButton(
title: TranslationBase.of(context).clearText,
onPressed: () {
@ -128,55 +131,54 @@ class _AddReplayOnReferralPatientState
replayOnReferralController.text = '';
});
},
)),
),
Container(
margin: EdgeInsets.all(5),
child: AppButton(
title: 'Submit Reply',
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () async {
setState(() {
isSubmitted = true;
});
if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel.replay(
replayOnReferralController.text.trim(),
widget.myReferralInPatientModel);
if (widget.patientReferralViewModel.state ==
ViewState.ErrorLocal) {
Helpers.showErrorToast(
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()),
),
);
}
),
),
Container(
margin: EdgeInsets.all(5),
child: AppButton(
title: 'Submit Reply',
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () async {
setState(() {
isSubmitted = true;
});
if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel.replay(
replayOnReferralController.text.trim(),
widget.myReferralInPatientModel);
if (widget.patientReferralViewModel.state ==
ViewState.ErrorLocal) {
Helpers.showErrorToast(
widget.patientReferralViewModel.error);
} else {
Helpers.showErrorToast("You can't add empty reply");
setState(() {
isSubmitted = false;
});
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 {
Helpers.showErrorToast("You can't add empty reply");
setState(() {
isSubmitted = false;
});
}
})),
],
),
],
),
),
],
),
);
}

Loading…
Cancel
Save