From 369eecb0a3708dc53d5b2d4793ee99cfd429f1c4 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 5 Aug 2021 12:01:42 +0300 Subject: [PATCH 1/6] return special Clinical function --- .../patient_muse/PatientSearchRequestModel.dart | 2 +- lib/core/viewModel/dashboard_view_model.dart | 3 ++- lib/screens/home/home_screen.dart | 2 +- lib/screens/patients/PatientsInPatientScreen.dart | 12 ++++++------ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index e8d32cf0..dcb9b31c 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -64,7 +64,7 @@ class PatientSearchRequestModel { data['SearchType'] = this.searchType; data['MobileNo'] = this.mobileNo; data['IdentificationNo'] = this.identificationNo; - //data['NursingStationID'] = this.nursingStationID; + data['NursingStationID'] = this.nursingStationID; data['ClinicID'] = this.clinicID; data['ProjectID'] = this.projectID; return data; diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 7df01bf9..8ca4df2e 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -106,7 +106,8 @@ class DashboardViewModel extends BaseViewModel { GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId){ GetSpecialClinicalCareListResponseModel special ; specialClinicalCareList.forEach((element) { - if(element.clinicID == 1){ + //TODO Elham* make the check == clinicId + if(element.clinicID == 81){ special = element; } }); diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 3efd0243..42f8e7f3 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -71,7 +71,7 @@ class _HomeScreenState extends State { await model.getDashboard(); await model.getDoctorProfile(isGetProfile: true); await model.checkDoctorHasLiveCare(); - // await model.getSpecialClinicalCareList(); + await model.getSpecialClinicalCareList(); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index ae0fbb59..d5d7d758 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -65,12 +65,12 @@ class _PatientInPatientScreenState extends State return BaseView( onModelReady: (model) async { model.clearPatientList(); - // if (widget.specialClinic != null) { - // await model.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID); - // requestModel.nursingStationID = - // model.specialClinicalCareMappingList[0].nursingStationID; - // requestModel.clinicID = 0; - // } + if (widget.specialClinic != null) { + await model.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID); + requestModel.nursingStationID = + model.specialClinicalCareMappingList[0].nursingStationID; + requestModel.clinicID = 0; + } model.getInPatientList(requestModel); }, builder: (_, model, w) => From 0ae0650acbc628a282bc612a86fa0f477febdc3d Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 9 Aug 2021 09:14:52 +0300 Subject: [PATCH 2/6] fix id --- lib/core/viewModel/dashboard_view_model.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 8ca4df2e..611ffc4f 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -107,7 +107,7 @@ class DashboardViewModel extends BaseViewModel { GetSpecialClinicalCareListResponseModel special ; specialClinicalCareList.forEach((element) { //TODO Elham* make the check == clinicId - if(element.clinicID == 81){ + if(element.clinicID == clinicId){ special = element; } }); From 3626857317392b9301655e505957434c596ffe7d Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 9 Aug 2021 11:38:20 +0300 Subject: [PATCH 3/6] finish fix Special Clinical --- .../viewModel/PatientSearchViewModel.dart | 2 +- lib/core/viewModel/dashboard_view_model.dart | 1 - lib/screens/patients/InPatientPage.dart | 38 +++++++++---------- .../patients/PatientsInPatientScreen.dart | 4 +- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 0ee76cb4..29bbc6aa 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -155,7 +155,7 @@ class PatientSearchViewModel extends BaseViewModel { setState(ViewState.Error); } } else { - // setDefaultInPatientList(); + setDefaultInPatientList(); setState(ViewState.Idle); } } diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 611ffc4f..8346e33d 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -106,7 +106,6 @@ class DashboardViewModel extends BaseViewModel { GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId){ GetSpecialClinicalCareListResponseModel special ; specialClinicalCareList.forEach((element) { - //TODO Elham* make the check == clinicId if(element.clinicID == clinicId){ special = element; } diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart index a88d3007..f06aabac 100644 --- a/lib/screens/patients/InPatientPage.dart +++ b/lib/screens/patients/InPatientPage.dart @@ -16,14 +16,16 @@ import '../../routes.dart'; class InPatientPage extends StatefulWidget { final bool isMyInPatient; + final PatientSearchViewModel patientSearchViewModel; - InPatientPage(this.isMyInPatient); + InPatientPage(this.isMyInPatient, this.patientSearchViewModel); @override _InPatientPageState createState() => _InPatientPageState(); } class _InPatientPageState extends State { + TextEditingController _searchController = TextEditingController(); bool isSortDes = false; @@ -38,7 +40,7 @@ class _InPatientPageState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - await model.setDefaultInPatientList(); + await widget.patientSearchViewModel.setDefaultInPatientList(); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -65,7 +67,7 @@ class _InPatientPageState extends State { ), controller: _searchController, onChanged: (value) { - model.filterSearchResults(value); + widget.patientSearchViewModel.filterSearchResults(value); }), Positioned( @@ -82,7 +84,7 @@ class _InPatientPageState extends State { // padding: EdgeInsets.only(bottom: 30), onPressed: () { GifLoaderDialogUtils.showMyDialog(context); - model.sortInPatient(isDes: isSortDes); + widget.patientSearchViewModel.sortInPatient(isDes: isSortDes); isSortDes = !isSortDes; GifLoaderDialogUtils.hideDialog(context); }, @@ -91,7 +93,7 @@ class _InPatientPageState extends State { ], ), ), - model.state == ViewState.Idle?model.filteredInPatientItems.length > 0 + widget.patientSearchViewModel.state == ViewState.Idle?widget.patientSearchViewModel.filteredInPatientItems.length > 0 ? Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 16.0), @@ -100,18 +102,17 @@ class _InPatientPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ ...List.generate( - model.filteredInPatientItems.length, (index) { + widget.patientSearchViewModel.filteredInPatientItems.length, (index) { if (!widget.isMyInPatient) return PatientCard( patientInfo: - model.filteredInPatientItems[index], + widget.patientSearchViewModel.filteredInPatientItems[index], patientType: "1", arrivalType: "1", isInpatient: true, - isMyPatient: model - .filteredInPatientItems[index] + isMyPatient: widget.patientSearchViewModel.filteredInPatientItems[index] .doctorId == - model.doctorProfile.doctorID, + widget.patientSearchViewModel.doctorProfile.doctorID, onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -122,8 +123,8 @@ class _InPatientPageState extends State { Navigator.of(context).pushNamed( PATIENTS_PROFILE, arguments: { - "patient": model - .filteredInPatientItems[index], + "patient": widget.patientSearchViewModel. + filteredInPatientItems[index], "patientType": "1", "from": "0", "to": "0", @@ -133,20 +134,20 @@ class _InPatientPageState extends State { }); }, ); - else if (model.filteredInPatientItems[index] + else if (widget.patientSearchViewModel.filteredInPatientItems[index] .doctorId == - model.doctorProfile.doctorID && + widget.patientSearchViewModel.doctorProfile.doctorID && widget.isMyInPatient) return PatientCard( patientInfo: - model.filteredInPatientItems[index], + widget.patientSearchViewModel.filteredInPatientItems[index], patientType: "1", arrivalType: "1", isInpatient: true, - isMyPatient: model + isMyPatient: widget.patientSearchViewModel .filteredInPatientItems[index] .doctorId == - model.doctorProfile.doctorID, + widget.patientSearchViewModel.doctorProfile.doctorID, onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -157,8 +158,7 @@ class _InPatientPageState extends State { Navigator.of(context).pushNamed( PATIENTS_PROFILE, arguments: { - "patient": model - .filteredInPatientItems[index], + "patient": widget.patientSearchViewModel.filteredInPatientItems[index], "patientType": "1", "from": "0", "to": "0", diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index d5d7d758..aaa50783 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -265,8 +265,8 @@ class _PatientInPatientScreenState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - InPatientPage(false), - InPatientPage(true), + InPatientPage(false, model), + InPatientPage(true,model), DischargedPatient(), ], ), From 7b65f1bade340fc3862ede71fa02343ae57b873e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 9 Aug 2021 11:41:56 +0300 Subject: [PATCH 4/6] small fix on in patient --- lib/screens/patients/InPatientPage.dart | 297 ++++++++++++------------ 1 file changed, 146 insertions(+), 151 deletions(-) diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart index f06aabac..2a41414a 100644 --- a/lib/screens/patients/InPatientPage.dart +++ b/lib/screens/patients/InPatientPage.dart @@ -38,164 +38,159 @@ class _InPatientPageState extends State { @override Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) async { - await widget.patientSearchViewModel.setDefaultInPatientList(); - }, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - ), - Container( - margin: EdgeInsets.all(16.0), - child: Stack( - children: [ - AppTextFieldCustom( - hintText: TranslationBase.of(context).searchPatientName, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.black, - ), - onPressed: () {}, - ), - controller: _searchController, - onChanged: (value) { - widget.patientSearchViewModel.filterSearchResults(value); - }), - - Positioned( - right: 35, - top:5, - child: IconButton( + return AppScaffold( + baseViewModel: widget.patientSearchViewModel, + isShowAppBar: false, + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + ), + Container( + margin: EdgeInsets.all(16.0), + child: Stack( + children: [ + AppTextFieldCustom( + hintText: TranslationBase.of(context).searchPatientName, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( icon: Icon( - isSortDes - ? FontAwesomeIcons.sortAmountDown - : FontAwesomeIcons.sortAmountUp, + Icons.search, color: Colors.black, ), - iconSize: 20, - // padding: EdgeInsets.only(bottom: 30), - onPressed: () { - GifLoaderDialogUtils.showMyDialog(context); - widget.patientSearchViewModel.sortInPatient(isDes: isSortDes); - isSortDes = !isSortDes; - GifLoaderDialogUtils.hideDialog(context); - }, + onPressed: () {}, ), - ) - ], - ), - ), - widget.patientSearchViewModel.state == ViewState.Idle?widget.patientSearchViewModel.filteredInPatientItems.length > 0 - ? Expanded( - child: Container( - margin: EdgeInsets.symmetric(horizontal: 16.0), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ...List.generate( - widget.patientSearchViewModel.filteredInPatientItems.length, (index) { - if (!widget.isMyInPatient) - return PatientCard( - patientInfo: - widget.patientSearchViewModel.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: widget.patientSearchViewModel.filteredInPatientItems[index] - .doctorId == - widget.patientSearchViewModel.doctorProfile.doctorID, - onTap: () { - FocusScopeNode currentFocus = - FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } - - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": widget.patientSearchViewModel. - filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); - }, - ); - else if (widget.patientSearchViewModel.filteredInPatientItems[index] - .doctorId == - widget.patientSearchViewModel.doctorProfile.doctorID && - widget.isMyInPatient) - return PatientCard( - patientInfo: - widget.patientSearchViewModel.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: widget.patientSearchViewModel - .filteredInPatientItems[index] - .doctorId == - widget.patientSearchViewModel.doctorProfile.doctorID, - onTap: () { - FocusScopeNode currentFocus = - FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } + controller: _searchController, + onChanged: (value) { + widget.patientSearchViewModel.filterSearchResults(value); + }), - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": widget.patientSearchViewModel.filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); - }, - ); - else - return SizedBox(); - }), - SizedBox( - height: 15, - ) - ], - ), - ), - ), - ) - : Expanded( - child: SingleChildScrollView( - child: Container( - child: ErrorMessage( - error: - TranslationBase.of(context).noDataAvailable)), - ), - ): Center( - child: Container( - height: 300, - width: 300, - child: Image.asset( - "assets/images/progress-loading-red.gif"), + Positioned( + right: 35, + top:5, + child: IconButton( + icon: Icon( + isSortDes + ? FontAwesomeIcons.sortAmountDown + : FontAwesomeIcons.sortAmountUp, + color: Colors.black, ), + iconSize: 20, + // padding: EdgeInsets.only(bottom: 30), + onPressed: () { + GifLoaderDialogUtils.showMyDialog(context); + widget.patientSearchViewModel.sortInPatient(isDes: isSortDes); + isSortDes = !isSortDes; + GifLoaderDialogUtils.hideDialog(context); + }, ), - ], - ), + ) + ], + ), + ), + widget.patientSearchViewModel.state == ViewState.Idle?widget.patientSearchViewModel.filteredInPatientItems.length > 0 + ? Expanded( + child: Container( + margin: EdgeInsets.symmetric(horizontal: 16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ...List.generate( + widget.patientSearchViewModel.filteredInPatientItems.length, (index) { + if (!widget.isMyInPatient) + return PatientCard( + patientInfo: + widget.patientSearchViewModel.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: widget.patientSearchViewModel.filteredInPatientItems[index] + .doctorId == + widget.patientSearchViewModel.doctorProfile.doctorID, + onTap: () { + FocusScopeNode currentFocus = + FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": widget.patientSearchViewModel. + filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else if (widget.patientSearchViewModel.filteredInPatientItems[index] + .doctorId == + widget.patientSearchViewModel.doctorProfile.doctorID && + widget.isMyInPatient) + return PatientCard( + patientInfo: + widget.patientSearchViewModel.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: widget.patientSearchViewModel + .filteredInPatientItems[index] + .doctorId == + widget.patientSearchViewModel.doctorProfile.doctorID, + onTap: () { + FocusScopeNode currentFocus = + FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": widget.patientSearchViewModel.filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else + return SizedBox(); + }), + SizedBox( + height: 15, + ) + ], + ), + ), + ), + ) + : Expanded( + child: SingleChildScrollView( + child: Container( + child: ErrorMessage( + error: + TranslationBase.of(context).noDataAvailable)), + ), + ): Center( + child: Container( + height: 300, + width: 300, + child: Image.asset( + "assets/images/progress-loading-red.gif"), + ), + ), + ], ), ); } From c31db4890b5fe25ae9369cf60362bdf0f99e01f3 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 9 Aug 2021 14:44:41 +0300 Subject: [PATCH 5/6] finish doctor response --- .../service/home/doctor_reply_service.dart | 30 +--- .../viewModel/doctor_replay_view_model.dart | 10 -- .../list_gt_my_patients_question_model.dart | 28 ++-- lib/screens/doctor/doctor_repaly_chat.dart | 128 ++++++++++++++++-- 4 files changed, 134 insertions(+), 62 deletions(-) diff --git a/lib/core/service/home/doctor_reply_service.dart b/lib/core/service/home/doctor_reply_service.dart index 8cf9b010..82bb67e2 100644 --- a/lib/core/service/home/doctor_reply_service.dart +++ b/lib/core/service/home/doctor_reply_service.dart @@ -32,35 +32,7 @@ class DoctorReplyService extends BaseService { }, body: _requestDoctorReply.toJson(),); } - Future replay( - String referredDoctorRemarks, ListGtMyPatientsQuestions model) async { - RequestMyReferralPatientModel _requestMyReferralPatient = - RequestMyReferralPatientModel(); - RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = - RequestAddReferredDoctorRemarks(); - - _requestAddReferredDoctorRemarks.admissionNo = model.admissionNo.toString(); - _requestAddReferredDoctorRemarks.patientID = model.patientID; - _requestAddReferredDoctorRemarks.referredDoctorRemarks = - referredDoctorRemarks; - _requestAddReferredDoctorRemarks.lineItemNo = model.lineItemNo; - _requestAddReferredDoctorRemarks.referringDoctor = model.referringDoctor; - await baseAppClient.post( - ADD_REFERRED_DOCTOR_REMARKS, - body: _requestAddReferredDoctorRemarks.toJson(), - onSuccess: (dynamic body, int statusCode) { - print("succsss"); - // model.referredDoctorRemarks = referredDoctorRemarks; - // listMyReferralPatientModel[listMyReferralPatientModel.indexOf(model)] = - // model; - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - ); - } - Future createDoctorResponse( + Future createDoctorResponse( CreateDoctorResponseModel createDoctorResponseModel) async { hasError = false; await baseAppClient.post( diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index 4a68eb18..876cfdb9 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -22,16 +22,6 @@ class DoctorReplayViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future replay( - String referredDoctorRemarks, ListGtMyPatientsQuestions model) async { - setState(ViewState.BusyLocal); - await _doctorReplyService.replay(referredDoctorRemarks, model); - if (_doctorReplyService.hasError) { - error = _doctorReplyService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } Future createDoctorResponse( String response, ListGtMyPatientsQuestions model) async { diff --git a/lib/models/doctor/list_gt_my_patients_question_model.dart b/lib/models/doctor/list_gt_my_patients_question_model.dart index 35d09812..a3b2ac98 100644 --- a/lib/models/doctor/list_gt_my_patients_question_model.dart +++ b/lib/models/doctor/list_gt_my_patients_question_model.dart @@ -1,9 +1,6 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; - - - class ListGtMyPatientsQuestions { String setupID; int projectID; @@ -26,9 +23,9 @@ class ListGtMyPatientsQuestions { String dateofBirth; String mobileNumber; String emailAddress; - int admissionNo; - int referringDoctor; - int lineItemNo; + int infoStatus; + String infoDesc; + String doctorResponse; String age; String genderDescription; bool isVidaCall; @@ -55,9 +52,9 @@ class ListGtMyPatientsQuestions { this.dateofBirth, this.mobileNumber, this.emailAddress, - this.admissionNo, - this.referringDoctor, - this.lineItemNo, + this.infoStatus, + this.infoDesc, + this.doctorResponse, this.age, this.genderDescription, this.isVidaCall}); @@ -84,9 +81,9 @@ class ListGtMyPatientsQuestions { dateofBirth = json['DateofBirth']; mobileNumber = json['MobileNumber']; emailAddress = json['EmailAddress']; - admissionNo = json['AdmissionNo']; - referringDoctor = json['ReferringDoctor']; - lineItemNo = json['LineItemNo']; + infoStatus = json['InfoStatus']; + infoDesc = json['InfoDesc']; + doctorResponse = json['DoctorResponse']; age = json['Age']; genderDescription = json['GenderDescription']; isVidaCall = json['IsVidaCall']; @@ -115,9 +112,9 @@ class ListGtMyPatientsQuestions { data['DateofBirth'] = this.dateofBirth; data['MobileNumber'] = this.mobileNumber; data['EmailAddress'] = this.emailAddress; - data['AdmissionNo'] = this.admissionNo; - data['ReferringDoctor'] = this.referringDoctor; - data['LineItemNo'] = this.lineItemNo; + data['InfoStatus'] = this.infoStatus; + data['InfoDesc'] = this.infoDesc; + data['DoctorResponse'] = this.doctorResponse; data['Age'] = this.age; data['GenderDescription'] = this.genderDescription; data['IsVidaCall'] = this.isVidaCall; @@ -125,3 +122,4 @@ class ListGtMyPatientsQuestions { } } + diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index a071596b..9c1c5104 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -28,8 +28,13 @@ class DoctorReplayChat extends StatelessWidget { @override Widget build(BuildContext context) { + if(reply.doctorResponse.isNotEmpty){ + msgController.text = reply.doctorResponse; + } return BaseView( - onModelReady: (model) async {}, + onModelReady: (model) async { + model.getDoctorProfile(); + }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, @@ -103,7 +108,7 @@ class DoctorReplayChat extends StatelessWidget { SizedBox(height: 30,), Container( // color: Color(0xFF2B353E), - width: MediaQuery.of(context).size.width * 0.9, + width: MediaQuery.of(context).size.width * 0.8, padding: EdgeInsets.all(10), decoration: BoxDecoration( color: Color(0xFF2B353E), @@ -128,8 +133,8 @@ class DoctorReplayChat extends StatelessWidget { children: [ Container( margin: EdgeInsets.only(top: 5), - width: 60, - height: 60, + width: 50, + height: 50, child: Image.asset( reply.gender == 1 ? 'assets/images/male_avatar.png' @@ -140,7 +145,7 @@ class DoctorReplayChat extends StatelessWidget { Divider(), SizedBox(width: 10,), Container( - width: MediaQuery.of(context).size.width * 0.35, + width: MediaQuery.of(context).size.width * 0.31, child: AppText( reply.patientName .toString(), @@ -152,7 +157,7 @@ class DoctorReplayChat extends StatelessWidget { ), ), Container( - margin: EdgeInsets.symmetric(horizontal: 4), + margin: EdgeInsets.symmetric(horizontal: 0), child: InkWell( onTap: () { launch("tel://" +reply.mobileNumber); @@ -172,7 +177,7 @@ class DoctorReplayChat extends StatelessWidget { AppText( reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight - .w600, + .w500, color: Colors.white, fontSize: 14, ), @@ -217,6 +222,113 @@ class DoctorReplayChat extends StatelessWidget { ), ), SizedBox(height: 30,), + + SizedBox(height: 30,), + Align( + alignment: Alignment.centerRight, + child: Container( + // color: Color(0xFF2B353E), + width: MediaQuery.of(context).size.width * 0.8, + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: HexColor('#707070') , + width: 0.30), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.only(top: 5), + width: 50, + height: 50, + child: Image.asset( + model.doctorProfile.gender == 0 + ? '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.35, + child: AppText( + model.doctorProfile.doctorName, + fontSize: 14, + fontFamily: 'Poppins', + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + // fontSize: 18 + ), + ), + + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + AppText( + reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), + fontWeight: FontWeight + .w500, + color: Color(0xFF2B353E), + fontSize: 14, + ), + AppText( + reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getHour(DateTime.now()), + fontSize: 14, + fontFamily: 'Poppins', + color: Color(0xFF2B353E), + // fontSize: 18 + ), + ], + ), + ], + ), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + width: MediaQuery.of(context).size.width * 0.7, + child: AppText( + reply.doctorResponse, + fontSize: 15, + fontFamily: 'Poppins', + color: Color(0xFF2B353E), + // fontSize: 18 + ), + ), + ), + ], + ), + ], + ), + ], + ), + ), + ), ], ), ), @@ -263,7 +375,7 @@ class DoctorReplayChat extends StatelessWidget { }, // hintColor: Colors.black, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w500, maxLines: 50, minLines: 3, controller: msgController, From 64697b82a623bb5b877a4fdc269aa6f2db847a67 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 9 Aug 2021 15:57:23 +0300 Subject: [PATCH 6/6] fix issue --- lib/core/viewModel/doctor_replay_view_model.dart | 1 + lib/screens/doctor/doctor_repaly_chat.dart | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index 876cfdb9..c6eab29c 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -14,6 +14,7 @@ class DoctorReplayViewModel extends BaseViewModel { Future getDoctorReply() async { setState(ViewState.Busy); + await getDoctorProfile(); await _doctorReplyService.getDoctorReply(); if (_doctorReplyService.hasError) { error = _doctorReplyService.error; diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index 9c1c5104..afe8e750 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -33,7 +33,6 @@ class DoctorReplayChat extends StatelessWidget { } return BaseView( onModelReady: (model) async { - model.getDoctorProfile(); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -256,7 +255,7 @@ class DoctorReplayChat extends StatelessWidget { width: 50, height: 50, child: Image.asset( - model.doctorProfile.gender == 0 + previousModel.doctorProfile.gender == 0 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -267,7 +266,7 @@ class DoctorReplayChat extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.35, child: AppText( - model.doctorProfile.doctorName, + previousModel.doctorProfile.doctorName, fontSize: 14, fontFamily: 'Poppins', color: Color(0xFF2B353E), @@ -360,9 +359,9 @@ class DoctorReplayChat extends StatelessWidget { suffixIconColor: Colors.green, onSuffixTap: ()async { GifLoaderDialogUtils.showMyDialog(context); - await model.createDoctorResponse(msgController.text, reply); - if(model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); + await previousModel.createDoctorResponse(msgController.text, reply); + if(previousModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(previousModel.error); } else { DrAppToastMsg.showSuccesToast("Thank you for your replay "); await previousModel.getDoctorReply();