add doctor replay

merge-requests/502/head
Elham Rababah 5 years ago
parent 2aba9e79f1
commit 4ecf9fe4b9

@ -33,13 +33,13 @@ class DoctorReplyService extends BaseService {
} }
Future replay( Future replay(
String referredDoctorRemarks, MyReferralPatientModel model) async { String referredDoctorRemarks, ListGtMyPatientsQuestions model) async {
RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel _requestMyReferralPatient =
RequestMyReferralPatientModel(); RequestMyReferralPatientModel();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks =
RequestAddReferredDoctorRemarks(); RequestAddReferredDoctorRemarks();
_requestAddReferredDoctorRemarks.admissionNo = model.admissionNo; _requestAddReferredDoctorRemarks.admissionNo = model.admissionNo.toString();
_requestAddReferredDoctorRemarks.patientID = model.patientID; _requestAddReferredDoctorRemarks.patientID = model.patientID;
_requestAddReferredDoctorRemarks.referredDoctorRemarks = _requestAddReferredDoctorRemarks.referredDoctorRemarks =
referredDoctorRemarks; referredDoctorRemarks;
@ -49,9 +49,10 @@ class DoctorReplyService extends BaseService {
ADD_REFERRED_DOCTOR_REMARKS, ADD_REFERRED_DOCTOR_REMARKS,
body: _requestAddReferredDoctorRemarks.toJson(), body: _requestAddReferredDoctorRemarks.toJson(),
onSuccess: (dynamic body, int statusCode) { onSuccess: (dynamic body, int statusCode) {
model.referredDoctorRemarks = referredDoctorRemarks; print("succsss");
listMyReferralPatientModel[listMyReferralPatientModel.indexOf(model)] = // model.referredDoctorRemarks = referredDoctorRemarks;
model; // listMyReferralPatientModel[listMyReferralPatientModel.indexOf(model)] =
// model;
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -21,7 +21,7 @@ class DoctorReplayViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future replay(String referredDoctorRemarks, MyReferralPatientModel model) async { Future replay(String referredDoctorRemarks, ListGtMyPatientsQuestions model) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _doctorReplyService.replay(referredDoctorRemarks, model); await _doctorReplyService.replay(referredDoctorRemarks, model);
if (_doctorReplyService.hasError) { if (_doctorReplyService.hasError) {

@ -2,6 +2,8 @@ import 'package:doctor_app_flutter/util/helpers.dart';
class ListGtMyPatientsQuestions { class ListGtMyPatientsQuestions {
String setupID; String setupID;
int projectID; int projectID;
@ -24,9 +26,9 @@ class ListGtMyPatientsQuestions {
String dateofBirth; String dateofBirth;
String mobileNumber; String mobileNumber;
String emailAddress; String emailAddress;
String doctorResponse; int admissionNo;
String infoStatus; int referringDoctor;
Null clinicID; int lineItemNo;
String age; String age;
String genderDescription; String genderDescription;
bool isVidaCall; bool isVidaCall;
@ -53,9 +55,9 @@ class ListGtMyPatientsQuestions {
this.dateofBirth, this.dateofBirth,
this.mobileNumber, this.mobileNumber,
this.emailAddress, this.emailAddress,
this.doctorResponse, this.admissionNo,
this.infoStatus, this.referringDoctor,
this.clinicID, this.lineItemNo,
this.age, this.age,
this.genderDescription, this.genderDescription,
this.isVidaCall}); this.isVidaCall});
@ -69,7 +71,6 @@ class ListGtMyPatientsQuestions {
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
requestType = json['RequestType']; requestType = json['RequestType'];
requestDate = Helpers.convertStringToDate(json['RequestDate']) ; requestDate = Helpers.convertStringToDate(json['RequestDate']) ;
requestTime = json['RequestTime']; requestTime = json['RequestTime'];
remarks = json['Remarks']; remarks = json['Remarks'];
status = json['Status']; status = json['Status'];
@ -83,9 +84,9 @@ class ListGtMyPatientsQuestions {
dateofBirth = json['DateofBirth']; dateofBirth = json['DateofBirth'];
mobileNumber = json['MobileNumber']; mobileNumber = json['MobileNumber'];
emailAddress = json['EmailAddress']; emailAddress = json['EmailAddress'];
doctorResponse = json['DoctorResponse']; admissionNo = json['AdmissionNo'];
infoStatus = json['InfoStatus']; referringDoctor = json['ReferringDoctor'];
clinicID = json['ClinicID']; lineItemNo = json['LineItemNo'];
age = json['Age']; age = json['Age'];
genderDescription = json['GenderDescription']; genderDescription = json['GenderDescription'];
isVidaCall = json['IsVidaCall']; isVidaCall = json['IsVidaCall'];
@ -114,12 +115,13 @@ class ListGtMyPatientsQuestions {
data['DateofBirth'] = this.dateofBirth; data['DateofBirth'] = this.dateofBirth;
data['MobileNumber'] = this.mobileNumber; data['MobileNumber'] = this.mobileNumber;
data['EmailAddress'] = this.emailAddress; data['EmailAddress'] = this.emailAddress;
data['DoctorResponse'] = this.doctorResponse; data['AdmissionNo'] = this.admissionNo;
data['InfoStatus'] = this.infoStatus; data['ReferringDoctor'] = this.referringDoctor;
data['ClinicID'] = this.clinicID; data['LineItemNo'] = this.lineItemNo;
data['Age'] = this.age; data['Age'] = this.age;
data['GenderDescription'] = this.genderDescription; data['GenderDescription'] = this.genderDescription;
data['IsVidaCall'] = this.isVidaCall; data['IsVidaCall'] = this.isVidaCall;
return data; return data;
} }
} }

@ -1,9 +1,15 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/doctor/doctor_reply_screen.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -30,6 +36,7 @@ class DoctorReplayChat extends StatelessWidget {
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: Container( body: Container(
height: MediaQuery.of(context).size.height * 1,
color: Color(0XFFF2F2F2), color: Color(0XFFF2F2F2),
child: Stack( child: Stack(
children: [ children: [
@ -81,34 +88,34 @@ class DoctorReplayChat extends StatelessWidget {
color: Color(0xFF2B353E))) color: Color(0xFF2B353E)))
], ],
), ),
Row( // Row(
mainAxisAlignment: // mainAxisAlignment:
MainAxisAlignment.spaceBetween, // MainAxisAlignment.spaceBetween,
children: [ // children: [
InkWell( // InkWell(
onTap: () { // onTap: () {
// TODO: move to doctor profile // // TODO: move to doctor profile
}, // },
child: RichText( // child: RichText(
text: TextSpan( // text: TextSpan(
style: TextStyle( // style: TextStyle(
fontSize: 1.6 * // fontSize: 1.6 *
SizeConfig.textMultiplier, // SizeConfig.textMultiplier,
color: Colors.black), // color: Colors.black),
children: <TextSpan>[ // children: <TextSpan>[
new TextSpan( // new TextSpan(
text: // text:
'Tap here to view patient profile' // 'Tap here to view patient profile'
.toString(), // .toString(),
style: TextStyle( // style: TextStyle(
fontFamily: 'Poppins', // fontFamily: 'Poppins',
fontSize: 12)), // fontSize: 12)),
], // ],
), // ),
), // ),
), // ),
], // ],
), // ),
], ],
), ),
), ),
@ -137,34 +144,57 @@ class DoctorReplayChat extends StatelessWidget {
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Row(
margin: EdgeInsets.only(top: 5), crossAxisAlignment: CrossAxisAlignment.start,
width: 60, mainAxisAlignment: MainAxisAlignment.spaceBetween,
height: 60, children: [
child: Image.asset( Container(
1 == 1 margin: EdgeInsets.only(top: 5),
? 'assets/images/male_avatar.png' width: 60,
: 'assets/images/female_avatar.png', height: 60,
fit: BoxFit.cover, child: Image.asset(
), 1 == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
Divider(),
SizedBox(width: 10,),
Container(
width: MediaQuery.of(context).size.width * 0.30,
child: AppText(
reply.patientName
.toString(),
fontSize: 14,
fontFamily: 'Poppins',
color: Colors.white,
fontWeight: FontWeight.bold,
// fontSize: 18
),
)
],
), ),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
AppText( AppText(
"07 Jan 2021", reply.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(reply.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontSize: 2.5 * SizeConfig.textMultiplier, fontWeight: FontWeight
fontFamily: 'Poppins', .w600,
color: Colors.white, color: Colors.white,
// fontSize: 18 fontSize: 14,
), ),
AppText( AppText(
"07:00 PM", reply.createdOn !=null?DateUtils.getHour(DateUtils.getDateTimeFromServerFormat(reply.createdOn)):DateUtils.getHour(DateTime.now()),
fontSize: 2.5 * SizeConfig.textMultiplier, fontSize: 14,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Colors.white, color: Colors.white,
// fontSize: 18 // fontSize: 18
@ -187,7 +217,7 @@ class DoctorReplayChat extends StatelessWidget {
child: Container( child: Container(
width: MediaQuery.of(context).size.width * 0.7, width: MediaQuery.of(context).size.width * 0.7,
child: AppText( child: AppText(
"This procedure should be taken only when the patient is below 99o", reply.remarks,
fontSize: 15, fontSize: 15,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Colors.white, color: Colors.white,
@ -203,91 +233,91 @@ class DoctorReplayChat extends StatelessWidget {
), ),
), ),
SizedBox(height: 30,), SizedBox(height: 30,),
Row( // Row(
mainAxisAlignment: MainAxisAlignment.end, // mainAxisAlignment: MainAxisAlignment.end,
children: [ // children: [
Container( // Container(
// color: Color(0xFF2B353E), // // color: Color(0xFF2B353E),
width: MediaQuery.of(context).size.width * 0.8, // width: MediaQuery.of(context).size.width * 0.8,
padding: EdgeInsets.all(5), // padding: EdgeInsets.all(5),
decoration: BoxDecoration( // decoration: BoxDecoration(
color: Colors.white,// Color(0xFF2B353E), // color: Colors.white,// Color(0xFF2B353E),
borderRadius: BorderRadius.all( // borderRadius: BorderRadius.all(
Radius.circular(10.0), // Radius.circular(10.0),
), // ),
border: Border.all( // border: Border.all(
color: HexColor('#707070') , // color: HexColor('#707070') ,
width: 0.30), // width: 0.30),
), // ),
child: Column( // child: Column(
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ // children: <Widget>[
Row( // Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ // children: [
Container( // Container(
margin: EdgeInsets.only(top: 5), // margin: EdgeInsets.only(top: 5),
width: 60, // width: 60,
height: 60, // height: 60,
child: Image.asset( // child: Image.asset(
1 == 1 // 1 == 1
? 'assets/images/male_avatar.png' // ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', // : 'assets/images/female_avatar.png',
fit: BoxFit.cover, // fit: BoxFit.cover,
), // ),
), // ),
Column( // Column(
children: [ // children: [
AppText( // AppText(
"07 Jan 2021", // "07 Jan 2021",
fontSize: 2.5 * SizeConfig.textMultiplier, // fontSize: 2.5 * SizeConfig.textMultiplier,
fontFamily: 'Poppins', // fontFamily: 'Poppins',
color: Color(0xFF2B353E), // color: Color(0xFF2B353E),
// fontSize: 18 // // fontSize: 18
), // ),
AppText( // AppText(
"07:00 PM", // "07:00 PM",
fontSize: 2.5 * SizeConfig.textMultiplier, // fontSize: 2.5 * SizeConfig.textMultiplier,
fontFamily: 'Poppins', // fontFamily: 'Poppins',
color: Color(0xFF2B353E), // color: Color(0xFF2B353E),
// fontSize: 18 // // fontSize: 18
), // ),
], // ],
), // ),
], // ],
), // ),
SizedBox( // SizedBox(
height: 10, // height: 10,
), // ),
Row( // Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ // children: [
Column( // Column(
children: [ // children: [
Padding( // Padding(
padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
child: Container( // child: Container(
width: MediaQuery.of(context).size.width * 0.7, // width: MediaQuery.of(context).size.width * 0.7,
child: AppText( // child: AppText(
"This procedure should be taken only when the patient is below 99o", // "This procedure should be taken only when the patient is below 99o",
fontSize: 15, // fontSize: 15,
fontFamily: 'Poppins', // fontFamily: 'Poppins',
color: Color(0xFF2B353E), // color: Color(0xFF2B353E),
// fontSize: 18 // // fontSize: 18
), // ),
), // ),
), // ),
], // ],
), // ),
], // ],
), // ),
], // ],
), // ),
), // ),
], // ],
), // ),
], ],
), ),
), ),
@ -296,48 +326,114 @@ class DoctorReplayChat extends StatelessWidget {
], ],
), ),
), ),
],
), Positioned(
), bottom: 0,
bottomSheet: Container(
width: double.infinity,
// height: MediaQuery.of(context).size.height * 0.12,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
FractionallySizedBox(
child: Container( child: Container(
child: TextFields( width:MediaQuery.of(context).size.width * 1,
borderRadius: 0, // height: MediaQuery.of(context).size.height * 0.12,
hasLabelText: msgController.text != '' child: Column(
? true mainAxisSize: MainAxisSize.min,
: false, children: <Widget>[
showLabelText: false, FractionallySizedBox(
hintText: "\n"+TranslationBase child: Container(
.of(context) child: TextFields(
.typeHereToReply, borderRadius: 0,
fontSize: 13.5, hasLabelText: msgController.text != ''
? true
: false,
showLabelText: false,
hintText: "\n"+TranslationBase
.of(context)
.typeHereToReply,
fontSize: 13.5,
suffixIcon: FontAwesomeIcons.arrowRight, suffixIcon: FontAwesomeIcons.arrowRight,
suffixIconColor: Colors.green, suffixIconColor: Colors.green,
// hintColor: Colors.black, onSuffixTap: ()async {
fontWeight: FontWeight.w600, await model.replay(msgController.text, reply);
maxLines: 50, if(model.state == ViewState.ErrorLocal) {
minLines: 3, helpers.showErrorToast("An error happened while you are replaying");
controller: msgController, } else {
validator: (value) { DrAppToastMsg.showSuccesToast("Thank you for your replay ");
if (value == null || value == "")
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
DoctorReplyScreen()));
}
},
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 50,
minLines: 3,
controller: msgController,
validator: (value) {
if (value == null || value == "")
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
),
],
),
), ),
), )
], ],
), ),
) ),
// bottomSheet: Container(
// width: double.infinity,
// // height: MediaQuery.of(context).size.height * 0.12,
// child: Column(
// mainAxisSize: MainAxisSize.min,
// children: <Widget>[
// FractionallySizedBox(
// child: Container(
// child: TextFields(
// borderRadius: 0,
// hasLabelText: msgController.text != ''
// ? true
// : false,
// showLabelText: false,
// hintText: "\n"+TranslationBase
// .of(context)
// .typeHereToReply,
// fontSize: 13.5,
//
// suffixIcon: FontAwesomeIcons.arrowRight,
// suffixIconColor: Colors.green,
// onSuffixTap: (){
// model.replay(msgController.text, reply);
// },
// // hintColor: Colors.black,
// fontWeight: FontWeight.w600,
// maxLines: 50,
// minLines: 3,
// controller: msgController,
// validator: (value) {
// if (value == null || value == "")
// return TranslationBase.of(context)
// .emptyMessage;
// else
// return null;
// }),
//
// ),
// ),
// ],
// ),
// )
)); ));
} }
} }

@ -39,12 +39,12 @@ class DoctorReplyScreen extends StatelessWidget {
children: children:
model.listDoctorWorkingHoursTable.map((reply) { model.listDoctorWorkingHoursTable.map((reply) {
return InkWell( return InkWell(
onTap: () { onTap: reply.status != 2?null:() {
// Navigator.push( Navigator.push(
// context, context,
// MaterialPageRoute( MaterialPageRoute(
// builder: (BuildContext context) => builder: (BuildContext context) =>
// DoctorReplayChat(reply: reply))); DoctorReplayChat(reply: reply)));
}, },
child: DoctorReplyWidget(reply: reply), child: DoctorReplyWidget(reply: reply),
); );

@ -50,7 +50,7 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
color: Colors.black), color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: widget.reply.status==2 ? TranslationBase.of(context).replied :TranslationBase.of(context).unReplied , text: widget.reply.status==2 ? "Active":widget.reply.status==1?"Hold":"Cancelled",//TranslationBase.of(context).replied :TranslationBase.of(context).unReplied ,
style: TextStyle( style: TextStyle(
color: widget.reply.status == 2 color: widget.reply.status == 2
? Color(0xFF2E303A) ? Color(0xFF2E303A)

Loading…
Cancel
Save