From d06cf277243a8f92402b6f75c12d85bf1ac311d6 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Fri, 23 Apr 2021 14:12:49 +0300 Subject: [PATCH 01/10] vital-sign- fixes --- .../profile/vital_sign/vital_sign_item.dart | 31 ++++-- .../vital_sing_chart_blood_pressure.dart | 102 ++++++++++-------- 2 files changed, 76 insertions(+), 57 deletions(-) diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart index a24d1a6b..0208b73c 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -84,17 +85,27 @@ class VitalSignItem extends StatelessWidget { ), Container( width: double.infinity, - child: Align( - alignment: Alignment.topLeft, - child: Container( - margin: EdgeInsets.only(left: 5, right: 5), - child: AppText( - "$des", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.3, - fontWeight: FontWeight.bold, + child: Column( + children: [ + Align( + alignment: Alignment.topRight, + child: Icon( + EvaIcons.eye, + ), ), - ), + Align( + alignment: Alignment.topLeft, + child: Container( + margin: EdgeInsets.only(left: 5, right: 5), + child: AppText( + "$des", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.3, + fontWeight: FontWeight.bold, + ), + ), + ), + ], ), ), ], diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index 291bbcb5..81ff7e16 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign- import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -38,54 +39,54 @@ class VitalSingChartBloodPressure extends StatelessWidget { @override Widget build(BuildContext context) { generateData(); - return Padding( - padding: const EdgeInsets.all(10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) - ), - child: LineChartCurvedBloodPressure( - title: name, - timeSeries1: timeSeriesData1, - timeSeries2: timeSeriesData2, - indexes: timeSeriesData1.length ~/ 5.5, - ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), - padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) - ), + return timeSeriesData1.length != 0 || timeSeriesData2.length != 0 + ? Padding( + padding: const EdgeInsets.all(10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "Graph Details", - fontSize: SizeConfig.textMultiplier * 2.3, - fontWeight: FontWeight.bold, - - fontFamily: 'Poppins', + children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + child: LineChartCurvedBloodPressure( + title: name, + timeSeries1: timeSeriesData1, + timeSeries2: timeSeriesData2, + indexes: timeSeriesData1.length ~/ 5.5, + ), ), - SizedBox(height: 8,), - VitalSignBloodPressureWidget( - vitalList: vitalList, - title1: title1, - title2: title2, - title3: title3, - viewKey1: viewKey1, - viewKey2: viewKey2, + Container( + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Graph Details", + fontSize: SizeConfig.textMultiplier * 2.3, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + SizedBox( + height: 8, + ), + VitalSignBloodPressureWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + title3: title3, + viewKey1: viewKey1, + viewKey2: viewKey2, + ), + ], + ), ), - ], - ), - ), - /*AppExpandableNotifier( + /*AppExpandableNotifier( // isExpand: true, headerWid: LineChartCurvedBloodPressure( title: name, @@ -102,9 +103,16 @@ class VitalSingChartBloodPressure extends StatelessWidget { viewKey2: viewKey2, ), ),*/ - ], - ), - ); + ], + ), + ) + : Container( + width: double.infinity, + height: MediaQuery.of(context).size.height, + child: Center( + child: AppText(TranslationBase.of(context).vitalSignDetailEmpty), + ), + ); } generateData() { From 9e31cf53791796262cb1c479db79b084ead5ffb7 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 23 Apr 2021 15:06:53 +0300 Subject: [PATCH 02/10] first step from modification --- .../profile/note/progress_note_screen.dart | 122 +++++++++++++----- .../patients/profile/note/update_note.dart | 21 ++- 2 files changed, 97 insertions(+), 46 deletions(-) diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index fedbfc56..c80b0566 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -126,6 +126,27 @@ class _ProgressNoteState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText('Update', + fontSize: 10, + ), + SizedBox(width: 10,), + Container( + color:Colors.red[600], + child: AppText('Canceled', + fontSize: 10, + ), + ), + SizedBox(width: 10,), + AppText('Verify', + fontSize: 10, + ), + SizedBox(width: 10,) + ], + ), + SizedBox(height: 15,), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -189,6 +210,72 @@ class _ProgressNoteState extends State { fontSize: 10, ), ), + + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => UpdateNoteOrder( + note: notesList[index], + patientModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: true, + + )), + ); + }, + child: Icon( + DoctorApp.edit, + size: 18, + )), + SizedBox(width: 10,), + InkWell( + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo), + cancelledNote: true, + lineItemNo: notesList[index].lineItemNo, + createdBy: notesList[index].createdBy, + notes: notesList[index].notes, + verifiedNote: false, + patientTypeID: patient.patientType, + patientOutSA: false, + ); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context,model); + GifLoaderDialogUtils.hideDialog(context); + + }, + child: Icon( + FontAwesomeIcons.trash, + size: 18, + )), + SizedBox(width: 10,), + InkWell( + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo), + cancelledNote: false, + lineItemNo: notesList[index].lineItemNo, + createdBy: notesList[index].createdBy, + notes: notesList[index].notes, + verifiedNote: true, + patientTypeID: patient.patientType, + patientOutSA: false, + ); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context,model); + GifLoaderDialogUtils.hideDialog(context); + + }, + child: Icon( + FontAwesomeIcons.check, + size: 18, + )) ], ), ], @@ -227,40 +314,5 @@ class _ProgressNoteState extends State { )); } - // searchData(String str, PatientViewModel model) { - // var strExist = str.length > 0 ? true : false; - // - // if (strExist) { - // filteredNotesList = null; - // filteredNotesList = model.patientProgressNoteList - // .where((note) => - // note["DoctorName"].toString().contains(str.toUpperCase())) - // .toList(); - // setState(() { - // notesList = filteredNotesList; - // }); - // } else { - // setState(() { - // notesList = model.patientProgressNoteList; - // }); - // } - // } - convertDateFormat(String str) { - const start = "/Date("; - const end = "+0300)"; - - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "-" + - date.month.toString().padLeft(2, '0') + - "-" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); - } } diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 5f3ef251..a5289dd3 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -69,8 +69,8 @@ class _UpdateNoteOrderState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ BottomSheetTitle(title: widget.visitType == 3 - ? 'Add Order Sheet' - : 'Add Progress Note',), + ? (widget.isUpdate?'Update':'Add')+' Order Sheet' + : (widget.isUpdate?'Update':'Add')+' Progress Note',), SizedBox( height: 10.0, ), @@ -82,12 +82,12 @@ class _UpdateNoteOrderState extends State { children: [ AppTextFieldCustom( hintText: widget.visitType == 3 - ? 'Add Order Sheet' - : 'Add Progress Note', + ? (widget.isUpdate?'Update':'Add')+' Order Sheet' + : (widget.isUpdate?'Update':'Add')+' Progress Note', //TranslationBase.of(context).addProgressNote, controller: progressNoteController, - maxLines: 25, - minLines: 10, + maxLines: 35, + minLines: 25, hasBorder: true, validationError:progressNoteController.text.isEmpty&&isSubmitted?TranslationBase.of(context).emptyMessage:null , @@ -109,8 +109,8 @@ class _UpdateNoteOrderState extends State { children: [ AppButton( title: widget.visitType == 3 - ? 'Add Order Sheet' - : 'Add Progress Note', + ? (widget.isUpdate?'Update':'Add')+' Order Sheet' + : (widget.isUpdate?'Update':'Add')+' Progress Note', color: Color(0xff359846), // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, @@ -131,11 +131,10 @@ class _UpdateNoteOrderState extends State { admissionNo: int.parse(widget.patient .admissionNo), cancelledNote: false, - lineItemNo: 30, + lineItemNo: widget.note.lineItemNo, createdBy: widget.note.createdBy, - notes: progressNoteController.text + notes: progressNoteController.text, - , verifiedNote: false, patientTypeID: widget.patient.patientType, From 9d00440789b084ecd2e8ec61223a857b4926b6fa Mon Sep 17 00:00:00 2001 From: mosazaid Date: Fri, 23 Apr 2021 16:35:05 +0300 Subject: [PATCH 03/10] referral -re design --- .../patient-vital-sign-viewmodel.dart | 12 ++-- .../my_referred_patient_model.dart | 8 +++ .../profile/patient_profile_screen.dart | 2 +- .../referral/referred-patient-screen.dart | 24 ++++--- .../patient-referral-item-widget.dart | 71 ++++++++++++------- ...-profile-header-new-design_in_patient.dart | 2 +- 6 files changed, 74 insertions(+), 45 deletions(-) diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 14aa1f06..2f1c1c68 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -37,8 +37,8 @@ class VitalSignsViewModel extends BaseViewModel { } } - Future getPatientVitalSignHistory( - PatiantInformtion patient, String from, String to, bool isInPatient) async { + Future getPatientVitalSignHistory(PatiantInformtion patient, String from, + String to, bool isInPatient) async { setState(ViewState.Busy); if (from == null || from == "0") { from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); @@ -47,11 +47,11 @@ class VitalSignsViewModel extends BaseViewModel { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } - // if(isInPatient){ + if (isInPatient) { await _vitalSignService.getInPatientVitalSignHistory(patient); - // }else { - // await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); - // } + } else { + await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); + } if (_vitalSignService.hasError) { error = _vitalSignService.error; diff --git a/lib/models/patient/my_referral/my_referred_patient_model.dart b/lib/models/patient/my_referral/my_referred_patient_model.dart index f7d48c60..129a1bb5 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/models/patient/my_referral/my_referred_patient_model.dart @@ -62,6 +62,8 @@ class MyReferredPatientModel { String nursingStationName; String priorityDescription; String referringClinicDescription; + String referralDoctorName; + String referralClinicDescription; String referringDoctorName; bool isReferralDoctorSameBranch; @@ -127,6 +129,8 @@ class MyReferredPatientModel { this.referringClinicDescription, this.referringDoctorName, this.isReferralDoctorSameBranch, + this.referralDoctorName, + this.referralClinicDescription, }); MyReferredPatientModel.fromJson(Map json) { @@ -190,6 +194,8 @@ class MyReferredPatientModel { priorityDescription = json['PriorityDescription']; referringClinicDescription = json['ReferringClinicDescription']; referringDoctorName = json['ReferringDoctorName']; + referralDoctorName = json['ReferralDoctorName']; + referralClinicDescription = json['ReferralClinicDescription']; } Map toJson() { @@ -254,6 +260,8 @@ class MyReferredPatientModel { data['PriorityDescription'] = this.priorityDescription; data['ReferringClinicDescription'] = this.referringClinicDescription; data['ReferringDoctorName'] = this.referringDoctorName; + data['ReferralDoctorName'] = this.referralDoctorName; + data['ReferralClinicDescription'] = this.referralClinicDescription; return data; } } diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index a14f96e8..fd4c5719 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -58,7 +58,7 @@ class PatientProfileScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - !isFromSearch && patientType == "1" + !isFromSearch && isInpatient/*patientType == "1"*/ ? PatientProfileHeaderNewDesignInPatient( patient, patientType, arrivalType) : PatientProfileHeaderNewDesign( diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index 0bacb1d8..b859d965 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -23,7 +23,7 @@ class ReferredPatientScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox( + Container( height: 100, ), Image.asset('assets/images/no-data.png'), @@ -37,22 +37,24 @@ class ReferredPatientScreen extends StatelessWidget { ], ), ) - : SingleChildScrollView( + : SingleChildScrollView(// DoctorApplication.svc/REST/GtMyReferredPatient child: Container( + margin: EdgeInsets.only(top: 70), child: Column( children: [ - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), + // const Divider( + // color: Color(0xffCCCCCC), + // height: 1, + // thickness: 2, + // indent: 0, + // endIndent: 0, + // ), ...List.generate( model.listMyReferredPatientModel.length, (index) => PatientReferralItemWidget( referralStatus: "${model.getReferralStatusNameByCode(model.getReferredPatientItem(index).referralStatus, context)}", + referralStatusCode: model.getReferredPatientItem(index).referralStatus, patientName: "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", patientGender: model.getReferredPatientItem(index).gender, referredDate: DateUtils.convertDateFromServerFormat(model.getReferredPatientItem(index).referralDate, "dd/MM/yyyy"), @@ -70,8 +72,8 @@ class ReferredPatientScreen extends StatelessWidget { model.getReferredPatientItem(index).nationalityFlagURL, doctorAvatar: model.getReferredPatientItem(index).doctorImageURL, - referralDoctorName: "${model.getReferredPatientItem(index).referringDoctorName}(${model.getReferredPatientItem(index).referringClinicDescription})", - clinicDescription: null, + referralDoctorName: "Dr. ${model.getReferredPatientItem(index).referralDoctorName}", + clinicDescription: model.getReferredPatientItem(index).referralClinicDescription, ), ), ], diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index faddc7f6..0bad54a2 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -12,6 +12,7 @@ import 'package:provider/provider.dart'; class PatientReferralItemWidget extends StatelessWidget { final String referralStatus; + final int referralStatusCode; final String patientName; final int patientGender; final String referredDate; @@ -29,6 +30,7 @@ class PatientReferralItemWidget extends StatelessWidget { PatientReferralItemWidget( {this.referralStatus, + this.referralStatusCode, this.patientName, this.patientGender, this.referredDate, @@ -54,11 +56,11 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ Container( child: CardWithBgWidget( - bgColor: referralStatus != null - ? referralStatus == 'Pending' - ? Color(0xffc4aa54) - : Colors.red[800] - : Colors.grey[500], + bgColor: referralStatusCode == 1 + ? Color(0xffc4aa54) + : referralStatusCode == 46 + ? Colors.green[700] + : Colors.red[700], hasBorder: false, widget: Container( // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), @@ -74,13 +76,11 @@ class PatientReferralItemWidget extends StatelessWidget { fontFamily: 'Poppins', fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, - color: referralStatus != null - ? referralStatus == 'Pending' - ? Color(0xffc4aa54) - : referralStatus == 'Accepted' - ? Colors.green[700] - : Colors.red[700] - : Colors.grey[500], + color: referralStatusCode == 1 + ? Color(0xffc4aa54) + : referralStatusCode == 46 + ? Colors.green[700] + : Colors.red[700], ), AppText( referredDate, @@ -222,6 +222,7 @@ class PatientReferralItemWidget extends StatelessWidget { fontWeight: FontWeight.w700, fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), + maxLines: 1, ), ), ], @@ -246,18 +247,27 @@ class PatientReferralItemWidget extends StatelessWidget { child: Container( width: 40, height: 40, - child: doctorAvatar !=null?ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.network( - doctorAvatar, - height: 25, - width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { - return Text('No Image'); - }, - )):Container(), + child: doctorAvatar != null + ? ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.network( + doctorAvatar, + height: 25, + width: 30, + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { + return Text('No Image'); + }, + )) + : Container( + child: Image.asset( + patientGender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), ), ), Expanded( @@ -266,14 +276,23 @@ class PatientReferralItemWidget extends StatelessWidget { margin: EdgeInsets.only( left: 10, top: 25, right: 10, bottom: 0), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( referralDoctorName, fontFamily: 'Poppins', - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w800, fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), + color: Colors.black, ), + if (clinicDescription != null) + AppText( + clinicDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.4 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), ], ), ), diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart index ca6910ae..b10533f9 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart @@ -185,7 +185,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { fontSize: 1.2 * SizeConfig.textMultiplier, ), AppText( - "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.createdOn)).inDays + 1}", + "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays}", fontSize: 1.4 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700), ], From fceb351b6c24b43e14868419b23ab908e202ff05 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 23 Apr 2021 16:55:39 +0300 Subject: [PATCH 04/10] fix the progress_note_screen --- lib/core/viewModel/patient_view_model.dart | 15 +- lib/screens/doctor/doctor_repaly_chat.dart | 34 +- .../profile/note/progress_note_screen.dart | 411 ++++++++++++------ .../patients/profile/note/update_note.dart | 6 +- 4 files changed, 318 insertions(+), 148 deletions(-) diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index e06b0d9d..3a45036e 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -141,12 +141,21 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getPatientProgressNote(patient) async { - setState(ViewState.Busy); + Future getPatientProgressNote(patient, {bool isLocalBusy = false}) async { + if(isLocalBusy) { + setState(ViewState.BusyLocal); + }else{ + setState(ViewState.Busy); + } + await _patientService.getPatientProgressNote(patient); if (_patientService.hasError) { error = _patientService.error; - setState(ViewState.Error); + if(isLocalBusy) { + setState(ViewState.ErrorLocal); + }else{ + setState(ViewState.Error); + } } else setState(ViewState.Idle); } diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index 46c61001..b5576e69 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -63,22 +63,24 @@ class DoctorReplayChat extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - RichText( - text: TextSpan( - style: TextStyle( - fontSize: 1.6 * - SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: reply.patientName - .toString(), - style: TextStyle( - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 20)), - ], + Expanded( + child: RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: reply.patientName + .toString(), + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 20)), + ], + ), ), ), InkWell( diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index c80b0566..5b806d4e 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -9,15 +9,12 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:hexcolor/hexcolor.dart'; import '../../../../config/shared_pref_kay.dart'; -import '../../../../config/size_config.dart'; import '../../../../models/patient/patiant_info_model.dart'; import '../../../../util/dr_app_shared_pref.dart'; import '../../../../widgets/shared/app_scaffold_widget.dart'; @@ -40,7 +37,7 @@ class _ProgressNoteState extends State { final _controller = TextEditingController(); var _isInit = true; - getProgressNoteList(BuildContext context, PatientViewModel model) async { + getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String token = await sharedPref.getString(TOKEN); @@ -55,7 +52,7 @@ class _ProgressNoteState extends State { tokenID: token, patientTypeID: patient.patientType, languageID: 2); - model.getPatientProgressNote(progressNoteRequest.toJson()).then((c) { + model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) { notesList = model.patientProgressNoteList; }); } @@ -114,43 +111,223 @@ class _ProgressNoteState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ + if (notesList[index].status != 2 && + notesList[index].status != 4) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateNoteOrder( + note: notesList[ + index], + patientModel: + model, + patient: patient, + visitType: widget + .visitType, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.green[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], - Container( - width: MediaQuery.of(context).size.width * 0.65, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Update', + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + confirmFun: () async { + GifLoaderDialogUtils + .showMyDialog( + context, + ); + UpdateNoteReqModel + reqModel = + UpdateNoteReqModel( + admissionNo: + int.parse(patient + .admissionNo), + cancelledNote: true, + lineItemNo: + notesList[index] + .lineItemNo, + createdBy: + notesList[index] + .createdBy, + notes: + notesList[index] + .notes, + verifiedNote: false, + patientTypeID: patient + .patientType, + patientOutSA: false, + ); + await model + .updatePatientProgressNote( + reqModel); + await getProgressNoteList( + context, model, isLocalBusy: true); + GifLoaderDialogUtils + .hideDialog( + context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.red[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], + + child: Row( children: [ - AppText('Update', + Icon( + FontAwesomeIcons.trash, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Cancel', fontSize: 10, + color: Colors.white, ), - SizedBox(width: 10,), - Container( - color:Colors.red[600], - child: AppText('Canceled', - fontSize: 10, - ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog(context: context, confirmFun: () async{ + GifLoaderDialogUtils + .showMyDialog(context); + UpdateNoteReqModel reqModel = + UpdateNoteReqModel( + admissionNo: int.parse( + patient.admissionNo), + cancelledNote: false, + lineItemNo: notesList[index] + .lineItemNo, + createdBy: notesList[index] + .createdBy, + notes: + notesList[index].notes, + verifiedNote: true, + patientTypeID: + patient.patientType, + patientOutSA: false, + ); + await model + .updatePatientProgressNote( + reqModel); + await getProgressNoteList( + context, model, isLocalBusy: true); + GifLoaderDialogUtils + .hideDialog(context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + FontAwesomeIcons.check, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, ), - SizedBox(width: 10,), - AppText('Verify', + AppText( + 'Verify', fontSize: 10, + color: Colors.white, ), - SizedBox(width: 10,) ], ), - SizedBox(height: 15,), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ) + ], + ), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.65, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ Row( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment + .start, children: [ - AppText('Created By: ', + AppText( + 'Created By: ', fontSize: 10, ), Expanded( @@ -159,8 +336,12 @@ class _ProgressNoteState extends State { ), ], ), + if(notesList[index].status == 4) + AppText( + 'Canceled',fontWeight: FontWeight.w600, color: Colors.red.shade700,fontSize: 12,), + if(notesList[index].status == 2) AppText( - notesList[index].status == 4?'Canceled':'',fontWeight: FontWeight.w600, color: Colors.red.shade700,fontSize: 12,), + 'verified',fontWeight: FontWeight.w600, color: Colors.grey.shade700,fontSize: 12,), ], ), ), @@ -200,84 +381,6 @@ class _ProgressNoteState extends State { SizedBox( height: 8, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - notesList[index].notes, - fontSize: 10, - ), - ), - - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => UpdateNoteOrder( - note: notesList[index], - patientModel: model, - patient: patient, - visitType: widget.visitType, - isUpdate: true, - - )), - ); - }, - child: Icon( - DoctorApp.edit, - size: 18, - )), - SizedBox(width: 10,), - InkWell( - onTap: () async { - GifLoaderDialogUtils.showMyDialog(context); - UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(patient.admissionNo), - cancelledNote: true, - lineItemNo: notesList[index].lineItemNo, - createdBy: notesList[index].createdBy, - notes: notesList[index].notes, - verifiedNote: false, - patientTypeID: patient.patientType, - patientOutSA: false, - ); - await model.updatePatientProgressNote(reqModel); - await getProgressNoteList(context,model); - GifLoaderDialogUtils.hideDialog(context); - - }, - child: Icon( - FontAwesomeIcons.trash, - size: 18, - )), - SizedBox(width: 10,), - InkWell( - onTap: () async { - GifLoaderDialogUtils.showMyDialog(context); - UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(patient.admissionNo), - cancelledNote: false, - lineItemNo: notesList[index].lineItemNo, - createdBy: notesList[index].createdBy, - notes: notesList[index].notes, - verifiedNote: true, - patientTypeID: patient.patientType, - patientOutSA: false, - ); - await model.updatePatientProgressNote(reqModel); - await getProgressNoteList(context,model); - GifLoaderDialogUtils.hideDialog(context); - - }, - child: Icon( - FontAwesomeIcons.check, - size: 18, - )) - ], - ), ], ), ), @@ -291,28 +394,84 @@ class _ProgressNoteState extends State { ), ), ], - ), - ), + ), + ), ), ); } - InputDecoration buildInputDecoration(BuildContext context, hint) { - return InputDecoration( - prefixIcon: Icon(Icons.search, color: Colors.black), - filled: true, - fillColor: Colors.white, - hintText: hint, - hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: HexColor('#CCCCCC')), - ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey), //), + showMyDialog({BuildContext context, Function confirmFun, isCancel = true}) { + showDialog( + context: context, + child: Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * 0.8, + height: MediaQuery + .of(context) + .size + .height * 0.5, + child: AppScaffold( + isShowAppBar: false, + body: Container( + color: Colors.white, + + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // SizedBox(height: 20,), + Container( + padding: EdgeInsets.all(20), + color: Colors.white, + child: Expanded( + child: AppText( + 'Are you sure you want to do this action?', + fontSize: 15, + textAlign: TextAlign.center, + ), + ), + ), + SizedBox(height: MediaQuery + .of(context) + .size + .height * 0.2,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + FlatButton( + child: AppText( + "Cancel", fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16,),//Text("Cancel"), + onPressed: () { + Navigator.of(context).pop(); + }), + FlatButton( + child: AppText( + "Confirm", fontWeight: FontWeight.w600, + color: Colors.red.shade700, + fontSize: 16,), //Text("Confirm", ), + onPressed: () async { + await confirmFun(); + Navigator.of(context).pop(); + }) + + ], + ) + ], + ), + ), + ), + ), + ), )); } + + } diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index a5289dd3..90b94ab3 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -8,7 +8,6 @@ import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -178,11 +177,12 @@ class _UpdateNoteOrderState extends State { GifLoaderDialogUtils.hideDialog(context); Navigator.of(context).pop(); } - } - ), + }), ], ), ), ); } + + } From 714c569a13957746517a6fc5b4e1a7c0e11596be Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Fri, 23 Apr 2021 18:16:32 +0300 Subject: [PATCH 05/10] hot fix --- lib/screens/procedures/ProcedureCard.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 0f865701..5684f527 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -57,7 +57,7 @@ class ProcedureCard extends StatelessWidget { bottomLeft: Radius.circular(10), ), color: - entityList.orderType == 1 ? Colors.red[500] : Colors.black, + entityList.orderType == 0 ? Colors.black : Colors.red[500], ), ), Expanded( From 6d530301b638a672e73c2ad2f6094b06f1771a55 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Fri, 23 Apr 2021 18:44:09 +0300 Subject: [PATCH 06/10] done first page in ReferralInPatient --- lib/config/config.dart | 4 +- lib/config/localized_values.dart | 1 + lib/core/model/MyReferralPatientModel.dart | 258 ++++++++++++++++++ .../service/MyReferralPatientService.dart | 69 +++++ .../viewModel/patient-referral-viewmodel.dart | 24 +- lib/locator.dart | 2 + .../my-referral-inpatient-screen.dart | 92 +++++++ .../referral/patient_referral_screen.dart | 4 +- lib/util/date-utils.dart | 4 + lib/util/translations_delegate_base.dart | 4 +- .../patient-referral-item-widget.dart | 12 +- 11 files changed, 458 insertions(+), 16 deletions(-) create mode 100644 lib/core/model/MyReferralPatientModel.dart create mode 100644 lib/core/service/MyReferralPatientService.dart create mode 100644 lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 8b4bf1f9..e48bc953 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -235,6 +235,8 @@ const GET_BOX_QUANTITY = ///GET ECG const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; +const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; + const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; @@ -319,7 +321,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 5.5; +const VERSION_ID = 5.6; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index b2c201e1..a19008e9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -859,4 +859,5 @@ const Map> localizedValues = { "noOfDays": {"en": "No of days", "ar": "عدد الأيام"}, "numOfDays": {"en": "Number of Days", "ar": "عدد الأيام"}, "replayBefore": {"en": "Replay Before", "ar": "رد قبل"}, + "refClinic": {"en": "Ref Clinic", "ar": "Ref Clinic"}, }; diff --git a/lib/core/model/MyReferralPatientModel.dart b/lib/core/model/MyReferralPatientModel.dart new file mode 100644 index 00000000..f2c9c425 --- /dev/null +++ b/lib/core/model/MyReferralPatientModel.dart @@ -0,0 +1,258 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; + +class MyReferralPatientModel { + dynamic rowID; + int projectID; + int lineItemNo; + int doctorID; + int patientID; + String doctorName; + dynamic doctorNameN; + String firstName; + String middleName; + String lastName; + dynamic firstNameN; + dynamic middleNameN; + dynamic lastNameN; + int gender; + String dateofBirth; + String mobileNumber; + String emailAddress; + String patientIdentificationNo; + int patientType; + String admissionNo; + String admissionDate; + String roomID; + String bedID; + dynamic nursingStationID; + dynamic description; + String nationalityName; + dynamic nationalityNameN; + String clinicDescription; + String clinicDescriptionN; + int referralDoctor; + int referringDoctor; + int referralClinic; + int referringClinic; + int referralStatus; + DateTime referralDate; + String referringDoctorRemarks; + String referredDoctorRemarks; + String referralResponseOn; + int priority; + int frequency; + String mAXResponseTime; + int episodeID; + int appointmentNo; + String appointmentDate; + int appointmentType; + int patientMRN; + String createdOn; + int clinicID; + String nationalityID; + String age; + String doctorImageURL; + String frequencyDescription; + String genderDescription; + bool isDoctorLate; + bool isDoctorResponse; + String nationalityFlagURL; + String nursingStationName; + String priorityDescription; + String referringClinicDescription; + String referringDoctorName; + + MyReferralPatientModel( + {this.rowID, + this.projectID, + this.lineItemNo, + this.doctorID, + this.patientID, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomID, + this.bedID, + this.nursingStationID, + this.description, + this.nationalityName, + this.nationalityNameN, + this.clinicDescription, + this.clinicDescriptionN, + this.referralDoctor, + this.referringDoctor, + this.referralClinic, + this.referringClinic, + this.referralStatus, + this.referralDate, + this.referringDoctorRemarks, + this.referredDoctorRemarks, + this.referralResponseOn, + this.priority, + this.frequency, + this.mAXResponseTime, + this.episodeID, + this.appointmentNo, + this.appointmentDate, + this.appointmentType, + this.patientMRN, + this.createdOn, + this.clinicID, + this.nationalityID, + this.age, + this.doctorImageURL, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nationalityFlagURL, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName}); + + MyReferralPatientModel.fromJson(Map json) { + rowID = json['RowID']; + projectID = json['ProjectID']; + lineItemNo = json['LineItemNo']; + doctorID = json['DoctorID']; + patientID = json['PatientID']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + gender = json['Gender']; + dateofBirth = json['DateofBirth']; + mobileNumber = json['MobileNumber']; + emailAddress = json['EmailAddress']; + patientIdentificationNo = json['PatientIdentificationNo']; + patientType = json['PatientType']; + admissionNo = json['AdmissionNo']; + admissionDate = json['AdmissionDate']; + roomID = json['RoomID']; + bedID = json['BedID']; + nursingStationID = json['NursingStationID']; + description = json['Description']; + nationalityName = json['NationalityName']; + nationalityNameN = json['NationalityNameN']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionN = json['ClinicDescriptionN']; + referralDoctor = json['ReferralDoctor']; + referringDoctor = json['ReferringDoctor']; + referralClinic = json['ReferralClinic']; + referringClinic = json['ReferringClinic']; + referralStatus = json['ReferralStatus']; + referralDate = DateUtils.convertStringToDate(json['ReferralDate']); + referringDoctorRemarks = json['ReferringDoctorRemarks']; + referredDoctorRemarks = json['ReferredDoctorRemarks']; + referralResponseOn = json['ReferralResponseOn']; + priority = json['Priority']; + frequency = json['Frequency']; + mAXResponseTime = json['MAXResponseTime']; + episodeID = json['EpisodeID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = json['AppointmentDate']; + appointmentType = json['AppointmentType']; + patientMRN = json['PatientMRN']; + createdOn = json['CreatedOn']; + clinicID = json['ClinicID']; + nationalityID = json['NationalityID']; + age = json['Age']; + doctorImageURL = json['DoctorImageURL']; + frequencyDescription = json['FrequencyDescription']; + genderDescription = json['GenderDescription']; + isDoctorLate = json['IsDoctorLate']; + isDoctorResponse = json['IsDoctorResponse']; + nationalityFlagURL = json['NationalityFlagURL']; + nursingStationName = json['NursingStationName']; + priorityDescription = json['PriorityDescription']; + referringClinicDescription = json['ReferringClinicDescription']; + referringDoctorName = json['ReferringDoctorName']; + } + + Map toJson() { + final Map data = new Map(); + data['RowID'] = this.rowID; + data['ProjectID'] = this.projectID; + data['LineItemNo'] = this.lineItemNo; + data['DoctorID'] = this.doctorID; + data['PatientID'] = this.patientID; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['Gender'] = this.gender; + data['DateofBirth'] = this.dateofBirth; + data['MobileNumber'] = this.mobileNumber; + data['EmailAddress'] = this.emailAddress; + data['PatientIdentificationNo'] = this.patientIdentificationNo; + data['PatientType'] = this.patientType; + data['AdmissionNo'] = this.admissionNo; + data['AdmissionDate'] = this.admissionDate; + data['RoomID'] = this.roomID; + data['BedID'] = this.bedID; + data['NursingStationID'] = this.nursingStationID; + data['Description'] = this.description; + data['NationalityName'] = this.nationalityName; + data['NationalityNameN'] = this.nationalityNameN; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['ReferralDoctor'] = this.referralDoctor; + data['ReferringDoctor'] = this.referringDoctor; + data['ReferralClinic'] = this.referralClinic; + data['ReferringClinic'] = this.referringClinic; + data['ReferralStatus'] = this.referralStatus; + data['ReferralDate'] = this.referralDate; + data['ReferringDoctorRemarks'] = this.referringDoctorRemarks; + data['ReferredDoctorRemarks'] = this.referredDoctorRemarks; + data['ReferralResponseOn'] = this.referralResponseOn; + data['Priority'] = this.priority; + data['Frequency'] = this.frequency; + data['MAXResponseTime'] = this.mAXResponseTime; + data['EpisodeID'] = this.episodeID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentType'] = this.appointmentType; + data['PatientMRN'] = this.patientMRN; + data['CreatedOn'] = this.createdOn; + data['ClinicID'] = this.clinicID; + data['NationalityID'] = this.nationalityID; + data['Age'] = this.age; + data['DoctorImageURL'] = this.doctorImageURL; + data['FrequencyDescription'] = this.frequencyDescription; + data['GenderDescription'] = this.genderDescription; + data['IsDoctorLate'] = this.isDoctorLate; + data['IsDoctorResponse'] = this.isDoctorResponse; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NursingStationName'] = this.nursingStationName; + data['PriorityDescription'] = this.priorityDescription; + data['ReferringClinicDescription'] = this.referringClinicDescription; + data['ReferringDoctorName'] = this.referringDoctorName; + return data; + } + + get patientName { + return this.firstName+" "+this.lastName; + } +} diff --git a/lib/core/service/MyReferralPatientService.dart b/lib/core/service/MyReferralPatientService.dart new file mode 100644 index 00000000..3401130a --- /dev/null +++ b/lib/core/service/MyReferralPatientService.dart @@ -0,0 +1,69 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/MyReferralPatientModel.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; + +class MyReferralInPatientService extends BaseService { + List myReferralPatients = List(); + + Future getMyReferralPatientService() async { + hasError = false; + Map body = Map(); + await getDoctorProfile(); + body['DoctorID'] = doctorProfile.doctorID; + body['FirstName'] = "0"; + body['MiddleName'] = "0"; + body['LastName'] = "0"; + body['PatientMobileNumber'] = "0"; + body['PatientIdentificationID'] = "0"; + body['PatientID'] = 0; + body['From'] = "0"; + body['To'] = "0"; + body['stamp'] = "2021-04-23T15:03:34.189Z";//DateTime.now().toIso8601String(); + body['IsLoginForDoctorApp'] = true; + body['IPAdress'] = "11.11.11.11"; + body['PatientOutSA'] = false; + body['PatientTypeID'] = 1; + myReferralPatients.clear(); + await baseAppClient.post( + GET_MY_REFERRAL_INPATIENT, + onSuccess: (dynamic response, int statusCode) { + if (response['List_MyReferralPatient'] != null) { + response['List_MyReferralPatient'].forEach((v) { + myReferralPatients.add(MyReferralPatientModel.fromJson(v)); + }); + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: body, + ); + } + + Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async { + await getDoctorProfile(); + + RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); + + _requestAddReferredDoctorRemarks.projectID = referral.projectID; + _requestAddReferredDoctorRemarks.admissionNo = referral.admissionNo.toString(); + _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; + _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; + _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; + _requestAddReferredDoctorRemarks.patientID = referral.patientID; + _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor; + await baseAppClient.post( + ADD_REFERRED_DOCTOR_REMARKS, + body: _requestAddReferredDoctorRemarks.toJson(), + onSuccess: (dynamic body, int statusCode) { + + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + ); + } +} diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index c4666f6f..72e0facc 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -1,5 +1,7 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/MyReferralPatientModel.dart'; +import 'package:doctor_app_flutter/core/service/MyReferralPatientService.dart'; import 'package:doctor_app_flutter/core/service/ReferralService.dart'; import 'package:doctor_app_flutter/core/service/patient-doctor-referral-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; @@ -17,20 +19,21 @@ class PatientReferralViewModel extends BaseViewModel { PatientReferralService _referralPatientService = locator(); - ReferralService _referralService = - locator(); + ReferralService _referralService = locator(); + + MyReferralInPatientService _myReferralService = locator(); List get branchesList => _referralPatientService.projectsList; List get clinicsList => _referralPatientService.clinicsList; - List get referralFrequencyList => - _referralPatientService.frequencyList; + List get referralFrequencyList => _referralPatientService.frequencyList; List doctorsList = []; - List get clinicDoctorsList => - _referralPatientService.doctorsList; + List get clinicDoctorsList => _referralPatientService.doctorsList; + + List get myReferralPatients => _myReferralService.myReferralPatients; List get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel; @@ -142,6 +145,15 @@ class PatientReferralViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + Future getMyReferralPatientService() async { + setState(ViewState.Busy); + await _myReferralService.getMyReferralPatientService(); + if (_myReferralService.hasError) { + error = _myReferralService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } Future responseReferral( PendingReferral pendingReferral, bool isAccepted) async { diff --git a/lib/locator.dart b/lib/locator.dart index 79efbb9a..2890a38e 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:get_it/get_it.dart'; import 'core/service/InsuranceCardService.dart'; +import 'core/service/MyReferralPatientService.dart'; import 'core/service/PatientMuseService.dart'; import 'core/service/ReferralService.dart'; import 'core/service/SOAP_service.dart'; @@ -74,6 +75,7 @@ void setupLocator() { locator.registerLazySingleton(() => RadiologyService()); locator.registerLazySingleton(() => PrescriptionsService()); locator.registerLazySingleton(() => ReferralService()); + locator.registerLazySingleton(() => MyReferralInPatientService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart new file mode 100644 index 00000000..ff12738e --- /dev/null +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -0,0 +1,92 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-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:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; + +import '../../../../routes.dart'; + +class MyReferralInPatientScreen extends StatelessWidget { + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getMyReferralPatientService(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + appBarTitle: TranslationBase.of(context).referPatient, + body: model.myReferralPatients.isEmpty + ? Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + TranslationBase.of(context).referralEmptyMsg, + color: Theme.of(context).errorColor, + ), + ) + ], + ), + ) + : SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(top: 70), + // color: Colors.white, + // height: MediaQuery.of(context).size.height, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // SizedBox(height: 50), + ...List.generate( + model.myReferralPatients.length, + (index) => InkWell( + onTap: () { + //TODO build the nwe page + + }, + child: PatientReferralItemWidget( + referralStatus: model.getReferralStatusNameByCode(model.myReferralPatients[index].referralStatus,context), + referralStatusCode: model.myReferralPatients[index].referralStatus, + patientName: model.myReferralPatients[index].patientName, + patientGender: model.myReferralPatients[index].gender, + referredDate: DateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate), + referredTime: DateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate), + patientID: "${model.myReferralPatients[index].patientID}", + isSameBranch: false, + isReferral: true, + isReferralClinic: true, + referralClinic:"${model.myReferralPatients[index].referringClinicDescription}", + remark: model.myReferralPatients[index].referringDoctorRemarks, + nationality: model.myReferralPatients[index].nationalityName, + nationalityFlag: model.myReferralPatients[index].nationalityFlagURL, + doctorAvatar: model.myReferralPatients[index].doctorImageURL, + referralDoctorName: model.myReferralPatients[index].referringDoctorName, + clinicDescription: model.myReferralPatients[index].referringClinicDescription, + infoIcon: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black), + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index ef18866c..ecd85db2 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -7,6 +7,8 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'my-referral-inpatient-screen.dart'; + class PatientReferralScreen extends StatefulWidget { @override _PatientReferralScreen createState() => _PatientReferralScreen(); @@ -89,7 +91,7 @@ class _PatientReferralScreen extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - MyReferralPatientScreen(), + MyReferralInPatientScreen(), ReferredPatientScreen(), // MyReferredPatient(), ], diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 35748638..fef77333 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -349,6 +349,10 @@ class DateUtils { return ""; } + static String getTimeHHMMA(DateTime dateTime){ + return DateFormat('hh:mm a').format(dateTime); + } + static String getTimeFormated(DateTime dateTime) { print(dateTime); if (dateTime != null) diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index f40ce841..30b968c2 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -568,8 +568,8 @@ class TranslationBase { String get referTo => localizedValues['referTo'][locale.languageCode]; - String get referredFrom => - localizedValues['referredFrom'][locale.languageCode]; + String get referredFrom => localizedValues['referredFrom'][locale.languageCode]; + String get refClinic => localizedValues['refClinic'][locale.languageCode]; String get branch => localizedValues['branch'][locale.languageCode]; diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 0bad54a2..1ec1a199 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -20,6 +20,8 @@ class PatientReferralItemWidget extends StatelessWidget { final String patientID; final isSameBranch; final bool isReferral; + final bool isReferralClinic; + final String referralClinic; final String remark; final String nationality; final String nationalityFlag; @@ -44,7 +46,7 @@ class PatientReferralItemWidget extends StatelessWidget { this.doctorAvatar, this.referralDoctorName, this.clinicDescription, - this.infoIcon}); + this.infoIcon,this.isReferralClinic=false,this.referralClinic}); @override Widget build(BuildContext context) { @@ -157,17 +159,15 @@ class PatientReferralItemWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).referredFrom, + isSameBranch ? TranslationBase.of(context).referredFrom :TranslationBase.of(context).refClinic, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), + AppText( - isSameBranch - ? TranslationBase.of(context).sameBranch - : TranslationBase.of(context) - .otherBranch, + !isReferralClinic? isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch: " "+referralClinic, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.8 * SizeConfig.textMultiplier, From 2d4cb00716b4f1a063576272467fd800b95bdb69 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 23 Apr 2021 19:14:29 +0300 Subject: [PATCH 07/10] fix design issue --- ios/Podfile.lock | 2 +- lib/config/config.dart | 4 +-- lib/screens/doctor/doctor_reply_screen.dart | 16 +++++------ .../profile/note/progress_note_screen.dart | 27 ++++++++++++------- lib/widgets/doctor/doctor_reply_widget.dart | 14 +++++----- 5 files changed, 36 insertions(+), 27 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 878a1850..2f4607e0 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -322,4 +322,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.0.rc.1 diff --git a/lib/config/config.dart b/lib/config/config.dart index d350f66f..85e474eb 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -316,8 +316,8 @@ const PRIMARY_COLOR = 0xff515B5D; const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; -const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 5.5; +const IP_ADDRESS = '11.11.11.11'; +const VERSION_ID = 5.6; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index 283ce7cd..f60f464c 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -51,14 +51,14 @@ class DoctorReplyScreen extends StatelessWidget { onTap: reply.status != 2 ? null : () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - DoctorReplayChat( - reply: reply, - previousModel: model, - ))); + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (BuildContext context) => + // DoctorReplayChat( + // reply: reply, + // previousModel: model, + // ))); }, child: DoctorReplyWidget(reply: reply), ); diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 5b806d4e..45e35079 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; @@ -171,6 +172,7 @@ class _ProgressNoteState extends State { onTap: () async { showMyDialog( context: context, + actionName: "cancel", confirmFun: () async { GifLoaderDialogUtils .showMyDialog( @@ -241,7 +243,7 @@ class _ProgressNoteState extends State { ), InkWell( onTap: () async { - showMyDialog(context: context, confirmFun: () async{ + showMyDialog(context: context, actionName: "verify",confirmFun: () async{ GifLoaderDialogUtils .showMyDialog(context); UpdateNoteReqModel reqModel = @@ -400,7 +402,7 @@ class _ProgressNoteState extends State { ); } - showMyDialog({BuildContext context, Function confirmFun, isCancel = true}) { + showMyDialog({BuildContext context, Function confirmFun, String actionName}) { showDialog( context: context, child: Center( @@ -412,7 +414,7 @@ class _ProgressNoteState extends State { height: MediaQuery .of(context) .size - .height * 0.5, + .height * 0.3, child: AppScaffold( isShowAppBar: false, body: Container( @@ -420,25 +422,32 @@ class _ProgressNoteState extends State { child: Center( child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ // SizedBox(height: 20,), + SizedBox(height: 5,), + AppText( + "Confirm", fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16,), + SizedBox(height: 5,), + DividerWithSpacesAround(), Container( padding: EdgeInsets.all(20), color: Colors.white, child: Expanded( child: AppText( - 'Are you sure you want to do this action?', + 'Are you sure you want $actionName this order?', fontSize: 15, textAlign: TextAlign.center, ), ), ), - SizedBox(height: MediaQuery - .of(context) - .size - .height * 0.2,), + + SizedBox(height: 30,), + DividerWithSpacesAround(), + // SizedBox(height: 30,), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index 5e8fb8cf..b346a827 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -220,15 +220,15 @@ class _DoctorReplyWidgetState extends State { Container( width: MediaQuery.of(context).size.width * 0.5, child: RichText( - maxLines: 2, - overflow: TextOverflow.ellipsis, + // maxLines: 2, + // overflow: TextOverflow.ellipsis, text: new TextSpan( style: new TextStyle( fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( - text: TranslationBase.of(context).doctorResponse + " : ", + text:"Patient Question :" ,//TranslationBase.of(context).doctorResponse + " : ", style: TextStyle(fontSize: 14, fontFamily: 'Poppins', color: Color(0xFF575757),fontWeight: FontWeight.bold)), new TextSpan( @@ -244,10 +244,10 @@ class _DoctorReplyWidgetState extends State { ],) ], ), - Container( - alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, - child: Icon(FontAwesomeIcons.arrowRight, - size: 20, color: Colors.black),) + // Container( + // alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, + // child: Icon(FontAwesomeIcons.arrowRight, + // size: 20, color: Colors.black),) ], ), // onTap: onTap, From 4a6503c2cf965ee0ece0cf637d14921885258f72 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 23 Apr 2021 19:44:37 +0300 Subject: [PATCH 08/10] fix design issue --- .../profile/note/progress_note_screen.dart | 84 ++++++++++--------- .../patients/profile/note/update_note.dart | 5 +- 2 files changed, 47 insertions(+), 42 deletions(-) diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 45e35079..588c3079 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -411,10 +411,7 @@ class _ProgressNoteState extends State { .of(context) .size .width * 0.8, - height: MediaQuery - .of(context) - .size - .height * 0.3, + height: 200, child: AppScaffold( isShowAppBar: false, body: Container( @@ -422,54 +419,61 @@ class _ProgressNoteState extends State { child: Center( child: Column( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ // SizedBox(height: 20,), - SizedBox(height: 5,), - AppText( - "Confirm", fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16,), - SizedBox(height: 5,), + SizedBox(height: 10,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + "Confirm", fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16,), + ], + ), + SizedBox(height: 10,), DividerWithSpacesAround(), + SizedBox(height: 12,), + Container( padding: EdgeInsets.all(20), color: Colors.white, - child: Expanded( - child: AppText( - 'Are you sure you want $actionName this order?', - fontSize: 15, - textAlign: TextAlign.center, - ), + child: AppText( + 'Are you sure you want $actionName this order?', + fontSize: 15, + textAlign: TextAlign.center, ), ), - SizedBox(height: 30,), + SizedBox(height: 8,), DividerWithSpacesAround(), - // SizedBox(height: 30,), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - FlatButton( - child: AppText( - "Cancel", fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16,),//Text("Cancel"), - onPressed: () { - Navigator.of(context).pop(); - }), - FlatButton( - child: AppText( - "Confirm", fontWeight: FontWeight.w600, - color: Colors.red.shade700, - fontSize: 16,), //Text("Confirm", ), - onPressed: () async { - await confirmFun(); - Navigator.of(context).pop(); - }) + FractionallySizedBox( + widthFactor: 0.75, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + FlatButton( + child: AppText( + "Cancel", fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16,),//Text("Cancel"), + onPressed: () { + Navigator.of(context).pop(); + }), + FlatButton( + child: AppText( + "Confirm", fontWeight: FontWeight.w600, + color: Colors.red.shade700, + fontSize: 16,), //Text("Confirm", ), + onPressed: () async { + await confirmFun(); + Navigator.of(context).pop(); + }) - ], + ], + ), ) ], ), diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 90b94ab3..30019a19 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -159,7 +160,7 @@ class _UpdateNoteOrderState extends State { if (widget.patientModel.state == ViewState.ErrorLocal) { Helpers.showErrorToast( - Helpers.generateContactAdminMsg()); + widget.patientModel.error ); } else { ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( @@ -173,8 +174,8 @@ class _UpdateNoteOrderState extends State { await widget.patientModel.getPatientProgressNote( progressNoteRequest.toJson()); } - GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast("Your Order added Successfully"); Navigator.of(context).pop(); } }), From 23cb01daf5948146aaab2029cbf7b41d2370d046 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 23 Apr 2021 20:39:21 +0300 Subject: [PATCH 09/10] prevent add spaces --- lib/screens/doctor/doctor_repaly_chat.dart | 131 ++++++++++-------- lib/screens/doctor/doctor_reply_screen.dart | 20 ++- .../patients/profile/note/update_note.dart | 4 +- lib/widgets/doctor/doctor_reply_widget.dart | 18 ++- 4 files changed, 100 insertions(+), 73 deletions(-) diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index b5576e69..2c614b29 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -20,6 +20,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:url_launcher/url_launcher.dart'; class DoctorReplayChat extends StatelessWidget { @@ -107,7 +108,7 @@ class DoctorReplayChat extends StatelessWidget { SizedBox(height: 30,), Container( // color: Color(0xFF2B353E), - width: MediaQuery.of(context).size.width * 0.8, + width: MediaQuery.of(context).size.width * 0.9, padding: EdgeInsets.all(10), decoration: BoxDecoration( color: Color(0xFF2B353E), @@ -135,7 +136,7 @@ class DoctorReplayChat extends StatelessWidget { width: 60, height: 60, child: Image.asset( - 1 == 1 + reply.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -144,7 +145,7 @@ class DoctorReplayChat extends StatelessWidget { Divider(), SizedBox(width: 10,), Container( - width: MediaQuery.of(context).size.width * 0.30, + width: MediaQuery.of(context).size.width * 0.35, child: AppText( reply.patientName .toString(), @@ -154,7 +155,19 @@ class DoctorReplayChat extends StatelessWidget { fontWeight: FontWeight.bold, // fontSize: 18 ), - ) + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 4), + child: InkWell( + onTap: () { + launch("tel://" +reply.mobileNumber); + }, + child: Icon( + Icons.phone, + color: Colors.white, + ), + ), + ), ], ), Column( @@ -218,61 +231,61 @@ class DoctorReplayChat extends StatelessWidget { ), ), - Positioned( - bottom: 0, - child: Container( - width:MediaQuery.of(context).size.width * 1, - // height: MediaQuery.of(context).size.height * 0.12, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - FractionallySizedBox( - child: Container( - - child: TextFields( - borderRadius: 0, - hintText: TranslationBase - .of(context) - .typeHereToReply, - fontSize: 13.5, - - suffixIcon: FontAwesomeIcons.arrowRight, - suffixIconColor: Colors.green, - onSuffixTap: ()async { - GifLoaderDialogUtils.showMyDialog(context); - await model.replay(msgController.text, reply); - if(model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast("An error happened while you are replaying"); - } else { - DrAppToastMsg.showSuccesToast("Thank you for your replay "); - await previousModel.getDoctorReply(); - Navigator.pop(context); - } - GifLoaderDialogUtils.hideDialog(context); - - - - - }, - // 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; - }), - - ), - ), - ], - ), - ), - ) + // Positioned( + // bottom: 0, + // child: Container( + // width:MediaQuery.of(context).size.width * 1, + // // height: MediaQuery.of(context).size.height * 0.12, + // child: Column( + // mainAxisSize: MainAxisSize.min, + // children: [ + // FractionallySizedBox( + // child: Container( + // + // child: TextFields( + // borderRadius: 0, + // hintText: TranslationBase + // .of(context) + // .typeHereToReply, + // fontSize: 13.5, + // + // suffixIcon: FontAwesomeIcons.arrowRight, + // suffixIconColor: Colors.green, + // onSuffixTap: ()async { + // GifLoaderDialogUtils.showMyDialog(context); + // await model.replay(msgController.text, reply); + // if(model.state == ViewState.ErrorLocal) { + // Helpers.showErrorToast("An error happened while you are replaying"); + // } else { + // DrAppToastMsg.showSuccesToast("Thank you for your replay "); + // await previousModel.getDoctorReply(); + // Navigator.pop(context); + // } + // GifLoaderDialogUtils.hideDialog(context); + // + // + // + // + // }, + // // 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; + // }), + // + // ), + // ), + // ], + // ), + // ), + // ) ], diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index f60f464c..f522561f 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -48,17 +48,15 @@ class DoctorReplyScreen extends StatelessWidget { children: model.listDoctorWorkingHoursTable.map((reply) { return InkWell( - onTap: reply.status != 2 - ? null - : () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (BuildContext context) => - // DoctorReplayChat( - // reply: reply, - // previousModel: model, - // ))); + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + DoctorReplayChat( + reply: reply, + previousModel: model, + ))); }, child: DoctorReplyWidget(reply: reply), ); diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 30019a19..5c67b153 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -118,7 +118,7 @@ class _UpdateNoteOrderState extends State { setState(() { isSubmitted = true; }); - if (progressNoteController.text.isNotEmpty) { + if (progressNoteController.text.trim().isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); @@ -177,6 +177,8 @@ class _UpdateNoteOrderState extends State { GifLoaderDialogUtils.hideDialog(context); DrAppToastMsg.showSuccesToast("Your Order added Successfully"); Navigator.of(context).pop(); + } else { + Helpers.showErrorToast("You cant add only spaces"); } }), ], diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index b346a827..8ad3a071 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -11,6 +11,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; class DoctorReplyWidget extends StatefulWidget { final ListGtMyPatientsQuestions reply; @@ -104,6 +105,7 @@ class _DoctorReplyWidgetState extends State { ], ), Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: AppText( @@ -113,6 +115,18 @@ class _DoctorReplyWidgetState extends State { fontFamily: 'Poppins', ), ), + Container( + margin: EdgeInsets.symmetric(horizontal: 4), + child: InkWell( + onTap: () { + launch("tel://" +widget.reply.mobileNumber); + }, + child: Icon( + Icons.phone, + color: Colors.black87, + ), + ), + ), SizedBox( width: 4, ), @@ -220,8 +234,8 @@ class _DoctorReplyWidgetState extends State { Container( width: MediaQuery.of(context).size.width * 0.5, child: RichText( - // maxLines: 2, - // overflow: TextOverflow.ellipsis, + maxLines: 3, + overflow: TextOverflow.ellipsis, text: new TextSpan( style: new TextStyle( fontSize: 2.0 * SizeConfig.textMultiplier, From 8f871898b866a13f86f8649b45ddac2a3fce564e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 23 Apr 2021 20:56:41 +0300 Subject: [PATCH 10/10] return config back --- lib/config/config.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 85e474eb..d350f66f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -316,8 +316,8 @@ const PRIMARY_COLOR = 0xff515B5D; const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; -const IP_ADDRESS = '11.11.11.11'; -const VERSION_ID = 5.6; +const IP_ADDRESS = '9.9.9.9'; +const VERSION_ID = 5.5; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true;