From 9c018d3c55fa5e006f911f63274e1c5ecee06347 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 17 Dec 2020 12:45:37 +0200 Subject: [PATCH 1/9] first step from patient arrival --- lib/client/base_app_client.dart | 1 + lib/config/config.dart | 12 ++++-- lib/core/service/patient_service.dart | 4 +- lib/core/viewModel/patient_view_model.dart | 2 +- lib/lookups/patient_lookup.dart | 1 + ...et_patient_arrival_list_request_model.dart | 40 +++++++++++++++++++ .../patients/patient_search_screen.dart | 13 +----- lib/screens/patients/patients_screen.dart | 31 ++++++++------ 8 files changed, 73 insertions(+), 31 deletions(-) create mode 100644 lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 454f4d04..ee4e9882 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -50,6 +50,7 @@ class BaseAppClient { body['ClinicID'] = doctorProfile?.clinicID; } body['TokenID'] = token ?? ''; + body['VidaAuthTokenID'] = ""; String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') diff --git a/lib/config/config.dart b/lib/config/config.dart index 8af0a4a5..17a3ae44 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -88,7 +88,8 @@ var SERVICES_PATIANT = [ "GtMyReferredPatient", "GtMyDischargeReferralPatient", "GtMyTomorrowPatient", - "GtMyReferralPatient" + "GtMyReferralPatient", + "PatientArrivalList" ]; var SERVICES_PATIANT2 = [ "List_MyOutPatient", @@ -97,7 +98,8 @@ var SERVICES_PATIANT2 = [ "List_MyReferredPatient", "List_MyDischargeReferralPatient", "List_MyTomorrowPatient", - "List_MyReferralPatient" + "List_MyReferralPatient", + "patientArrivalList" ]; var SERVICES_PATIANT_HEADER = [ "Search Out-Patient", @@ -106,7 +108,8 @@ var SERVICES_PATIANT_HEADER = [ "Referred", "Referral Discharge", "Tomorrow", - "Referral" + "Referral", + "Arrival Patient" ]; var SERVICES_PATIANT_HEADER_AR = [ "المريض الخارجي", @@ -115,7 +118,8 @@ var SERVICES_PATIANT_HEADER_AR = [ "المريض المحول الي", "المريض المحال المعافى", "مريض الغد", - "المريض المحول مني" + "المريض المحول مني", + "المريض الواصل" ]; //****************** diff --git a/lib/core/service/patient_service.dart b/lib/core/service/patient_service.dart index b16753f5..a847b95d 100644 --- a/lib/core/service/patient_service.dart +++ b/lib/core/service/patient_service.dart @@ -84,7 +84,7 @@ class PatientService extends BaseService { RequestSchedule _requestSchedule = RequestSchedule(); - Future getPatientList(PatientModel patient, patientType) async { + Future getPatientList( patient, patientType) async { hasError = false; int val = int.parse(patientType); @@ -98,7 +98,7 @@ class PatientService extends BaseService { hasError = true; super.error = error; }, - body: { + body:val ==7?patient: { "ProjectID": patient.ProjectID, "ClinicID": patient.ClinicID, "DoctorID": patient.DoctorID, diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index f39a3d48..46232bbf 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -46,7 +46,7 @@ class PatientViewModel extends BaseViewModel { get doctorsList => _patientService.doctorsList; get referalFrequancyList => _patientService.referalFrequancyList; - Future getPatientList(PatientModel patient, patientType, + Future getPatientList( patient, patientType, {bool isBusyLocal = false}) async { if(isBusyLocal) { setState(ViewState.BusyLocal); diff --git a/lib/lookups/patient_lookup.dart b/lib/lookups/patient_lookup.dart index 189535ce..dfcaa305 100644 --- a/lib/lookups/patient_lookup.dart +++ b/lib/lookups/patient_lookup.dart @@ -10,6 +10,7 @@ const PATIENT_TYPE = const [ }, {"text": "Tomorrow Patient", "text_ar": "مريض الغد", "val": "5"}, {"text": "Referral", "text_ar": "المريض المحول مني", "val": "6"}, + {"text": "Arrival", "text_ar": "المريض الواصل", "val": "7"}, ]; const LOCATIONS = const [ diff --git a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart new file mode 100644 index 00000000..393790dd --- /dev/null +++ b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart @@ -0,0 +1,40 @@ +class GetPatientArrivalListRequestModel { + String vidaAuthTokenID; + String from; + String to; + String doctorID; + int pageIndex; + int pageSize; + int clinicID; + + GetPatientArrivalListRequestModel( + {this.vidaAuthTokenID, + this.from, + this.to, + this.doctorID, + this.pageIndex, + this.pageSize, + this.clinicID}); + + GetPatientArrivalListRequestModel.fromJson(Map json) { + vidaAuthTokenID = json['VidaAuthTokenID']; + from = json['From']; + to = json['To']; + doctorID = json['DoctorID']; + pageIndex = json['PageIndex']; + pageSize = json['PageSize']; + clinicID = json['ClinicID']; + } + + Map toJson() { + final Map data = new Map(); + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['From'] = this.from; + data['To'] = this.to; + data['DoctorID'] = this.doctorID; + data['PageIndex'] = this.pageIndex; + data['PageSize'] = this.pageSize; + data['ClinicID'] = this.clinicID; + return data; + } +} diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 204d2336..450a32f7 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -65,12 +65,9 @@ class _PatientSearchScreenState extends State { PatientOutSA: false); void _validateInputs() async { -//print("============== _selectedType============"+ _selectedType); + try { - //==================== - //_selectedType=='3'? - //===================== Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = @@ -79,20 +76,13 @@ class _PatientSearchScreenState extends State { _formKey.currentState.save(); sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); - print('************_selectedType*************'); - print('_selectedType${_selectedType}'); String token = await sharedPref.getString(TOKEN); _patientSearchFormValues.TokenID = token; _patientSearchFormValues.ProjectID = doctorProfile.projectID; //15 _patientSearchFormValues.DoctorID = doctorProfile.doctorID; _patientSearchFormValues.ClinicID = doctorProfile.clinicID; - //===================== - // _patientSearchFormValues. - //===================== - print("=============doctorProfile.clinicID=" + - doctorProfile.clinicID.toString()); Navigator.of(context).pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, @@ -105,7 +95,6 @@ class _PatientSearchScreenState extends State { } } catch (err) { error = err; - // handelCatchErrorCase(err); } } diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 4ca3e587..7b27d746 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -9,11 +9,12 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -48,7 +49,6 @@ class _PatientsScreenState extends State { final String avatarFemale = 'user_female.svg'; final String assetName = 'assets/image.svg'; - // List _locations = ['Today', 'Old Date', 'YESTERDAY']; List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; int _activeLocation = 0; @@ -66,14 +66,6 @@ class _PatientsScreenState extends State { PatientModel patient; -/* - *@author: Amjad Amireh - *@Date:2/5/2020 - *@param: - *@return:PatientsScreen Search textbox filter - - *@desc: - */ searchData(String str) { this.responseModelList = this.responseModelList2; @@ -277,11 +269,26 @@ class _PatientsScreenState extends State { return BaseView( onModelReady: (model) { // TODO : change all the logic here to make it work with the model and remove future - model.getPatientList(patient, patientType).then((res) { + int val2 = int.parse(patientType); + GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; + if (val2 == 7) { + getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel( + from: patient.From, to: patient.To, pageIndex: 0, pageSize: 0); + } + + model + .getPatientList( + val2 == 7 + ? getPatientArrivalListRequestModel.toJson() + : patient, + patientType) + .then((res) { setState(() { _isLoading = false; if (res['MessageStatus'] == 1) { - int val2 = int.parse(patientType); + if (val2 == 7) { + print("Assad"); + } lItems = res[SERVICES_PATIANT2[val2]]; parsed = lItems; responseModelList = new ModelResponse.fromJson(parsed).list; From 94093e775eaeb3fb1e7d124975afd92e2d131b38 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 17 Dec 2020 15:16:08 +0200 Subject: [PATCH 2/9] add vital-sign files --- lib/core/service/base/base_service.dart | 2 + .../service/patient-vital-signs-service.dart | 45 +++++++++++++++++++ .../patient-vital-sign-viewModel.dart | 27 +++++++++++ lib/locator.dart | 4 ++ 4 files changed, 78 insertions(+) create mode 100644 lib/core/service/patient-vital-signs-service.dart create mode 100644 lib/core/viewModel/patient-vital-sign-viewModel.dart diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index c4cb240d..885398f5 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -1,8 +1,10 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; class BaseService { String error; bool hasError = false; BaseAppClient baseAppClient = BaseAppClient(); + DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); //TODO add the user login model when we need it } diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart new file mode 100644 index 00000000..72619fa4 --- /dev/null +++ b/lib/core/service/patient-vital-signs-service.dart @@ -0,0 +1,45 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; + +class VitalSignsService extends BaseService{ + + List patientVitalSignList = []; + List patientVitalSignOrderdSubList = []; + + Future getPatientVitalSign(patient) async { + hasError = false; + await baseAppClient.post( + GET_PATIENT_VITAL_SIGN, + onSuccess: (dynamic response, int statusCode) { + patientVitalSignList = []; + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignList.add(new VitalSignResModel.fromJson(v)); + }); + + if (patientVitalSignList.length > 0) { + List patientVitalSignOrderdSubListTemp = []; + patientVitalSignOrderdSubListTemp = patientVitalSignList; + patientVitalSignOrderdSubListTemp + .sort((VitalSignResModel a, VitalSignResModel b) { + return b.vitalSignDate.microsecondsSinceEpoch - + a.vitalSignDate.microsecondsSinceEpoch; + }); + patientVitalSignOrderdSubList.clear(); + int length = patientVitalSignOrderdSubListTemp.length >= 20 + ? 20 + : patientVitalSignOrderdSubListTemp.length; + for (int x = 0; x < length; x++) { + patientVitalSignOrderdSubList + .add(patientVitalSignOrderdSubListTemp[x]); + } + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: patient, + ); + } +} \ No newline at end of file diff --git a/lib/core/viewModel/patient-vital-sign-viewModel.dart b/lib/core/viewModel/patient-vital-sign-viewModel.dart new file mode 100644 index 00000000..255ab5bd --- /dev/null +++ b/lib/core/viewModel/patient-vital-sign-viewModel.dart @@ -0,0 +1,27 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/patient-vital-signs-service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; + +import '../../locator.dart'; + +class VitalSignsViewModel extends BaseViewModel{ + VitalSignsService _vitalSignService = locator(); + + List get patientVitalSignList => + _vitalSignService.patientVitalSignList; + + List get patientVitalSignOrderdSubList => + _vitalSignService.patientVitalSignOrderdSubList; + + Future getPatientVitalSign(patient) async { + setState(ViewState.Busy); + await _vitalSignService.getPatientVitalSign(patient); + if (_vitalSignService.hasError) { + error = _vitalSignService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + +} \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index 550b4666..9ca9d8db 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -4,11 +4,13 @@ import 'package:get_it/get_it.dart'; import 'core/service/doctor_reply_service.dart'; import 'core/service/medicine_service.dart'; +import 'core/service/patient-vital-signs-service.dart'; import 'core/service/referral_patient_service.dart'; import 'core/service/referred_patient_service.dart'; import 'core/service/schedule_service.dart'; import 'core/viewModel/doctor_replay_view_model.dart'; import 'core/viewModel/medicine_view_model.dart'; +import 'core/viewModel/patient-vital-sign-viewModel.dart'; import 'core/viewModel/referral_view_model.dart'; import 'core/viewModel/referred_view_model.dart'; import 'core/viewModel/schedule_view_model.dart'; @@ -24,6 +26,7 @@ void setupLocator() { locator.registerLazySingleton(() => ReferredPatientService()); locator.registerLazySingleton(() => MedicineService()); locator.registerLazySingleton(() => PatientService()); + locator.registerLazySingleton(() => VitalSignsService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -32,4 +35,5 @@ void setupLocator() { locator.registerFactory(() => ReferredPatientViewModel()); locator.registerFactory(() => MedicineViewModel()); locator.registerFactory(() => PatientViewModel()); + locator.registerFactory(() => VitalSignsViewModel()); } From 44779e6ee7dc88f1c5eb83d1470846a72cd0e65b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 17 Dec 2020 19:17:20 +0200 Subject: [PATCH 3/9] patient screen --- lib/client/base_app_client.dart | 21 +++++----- lib/screens/patients/patients_screen.dart | 49 +++++++++++++---------- 2 files changed, 40 insertions(+), 30 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index ee4e9882..876226ce 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -50,7 +50,7 @@ class BaseAppClient { body['ClinicID'] = doctorProfile?.clinicID; } body['TokenID'] = token ?? ''; - body['VidaAuthTokenID'] = ""; + body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiMDBmMDI3NjQtZDczMi00NDA0LThkYmUtZWViZDkwY2EzM2JiIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1NzYyMDYiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODIyMjUwNiwiZXhwIjoxNjA5MDg2NTA2LCJpYXQiOjE2MDgyMjI1MDZ9.X_66vZw08tiH4DmhKUPXzIiIMrnadE2IHe0wOA0GM6g"; String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') @@ -80,16 +80,19 @@ class BaseAppClient { onFailure('Error While Fetching data', statusCode); } else { var parsed = json.decode(response.body.toString()); - if (!parsed['IsAuthenticated']) { - await helpers.logout(); + // TODO: return it back when backend fixed + // if (!parsed['IsAuthenticated']) { + // await helpers.logout(); + // + // helpers.showErrorToast('Your session expired Please login agian'); + // } else - helpers.showErrorToast('Your session expired Please login agian'); - } else if (parsed['MessageStatus'] == 1) { + // if (parsed['MessageStatus'] == 1) { onSuccess(parsed, statusCode); - } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], - statusCode); - } + // } else { + // onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + // statusCode); + // } } } else { onFailure('Please Check The Internet Connection', -1); diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 7b27d746..8b02ab3d 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -285,25 +285,33 @@ class _PatientsScreenState extends State { .then((res) { setState(() { _isLoading = false; - if (res['MessageStatus'] == 1) { - if (val2 == 7) { - print("Assad"); + // if (res['MessageStatus'] == 1) { + if (val2 == 7) { + print("Assad"); + if (res[SERVICES_PATIANT2[val2]] == null) { + _isError = true; + _isLoading = false; + this.error = error.toString(); + } else { + lItems = res[SERVICES_PATIANT2[val2]]["entityList"]; } - lItems = res[SERVICES_PATIANT2[val2]]; - parsed = lItems; - responseModelList = new ModelResponse.fromJson(parsed).list; - responseModelList2 = responseModelList; - _isError = false; } else { - _isError = true; - error = res['ErrorEndUserMessage'] ?? res['ErrorMessage']; + lItems = res[SERVICES_PATIANT2[val2]]; } + parsed = lItems; + responseModelList = new ModelResponse.fromJson(parsed).list; + responseModelList2 = responseModelList; + _isError = false; + // } else { + // _isError = true; + // error = res['ErrorEndUserMessage'] ?? res['ErrorMessage']; + // } }); }).catchError((error) { setState(() { _isError = true; _isLoading = false; - this.error = error; + this.error = error.toString(); }); }); }, @@ -315,16 +323,15 @@ class _PatientsScreenState extends State { : _isError ? DrAppEmbeddedError(error: error) : lItems == null || lItems.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase - .of(context) - .youDontHaveAnyPatient) - : Container( - child: ListView( - scrollDirection: Axis.vertical, - children: [ - Container( - child: lItems == null + ? DrAppEmbeddedError( + error: + TranslationBase.of(context).youDontHaveAnyPatient) + : Container( + child: ListView( + scrollDirection: Axis.vertical, + children: [ + Container( + child: lItems == null ? Column( crossAxisAlignment: CrossAxisAlignment.start, From a71da8e4ef3acb556a3149a0829cf541f3fdd66f Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 28 Dec 2020 13:38:13 +0200 Subject: [PATCH 4/9] working on vital signs --- .../service/patient-vital-signs-service.dart | 6 ++---- .../patient-vital-sign-viewModel.dart | 20 +++++++++++-------- .../vital_sign/patient-vital-sign-data.dart | 8 +++----- lib/routes.dart | 3 +++ .../referral/refer-patient-screen.dart | 10 ++-------- lib/screens/patients/vital-signs-screen.dart | 12 +++++++++++ lib/screens/patients/vital-signs.dart | 9 --------- lib/util/helpers.dart | 4 ++-- .../profile/profile_medical_info_widget.dart | 2 +- 9 files changed, 37 insertions(+), 37 deletions(-) create mode 100644 lib/screens/patients/vital-signs-screen.dart delete mode 100644 lib/screens/patients/vital-signs.dart diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index 2c7188a4..578aea88 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -45,12 +45,10 @@ class VitalSignsService extends BaseService{ ); } // Vit*/ - Future getPatientVitalSign(patient) async { + Future getPatientVitalSign(/*PatientArrivalEntity patientArrivalEntity*/) async { hasError = false; Map body = Map(); - body['PatientMRN'] = 1; - body['AppointmentNo'] = 1; - body['EpisodeID'] = 1; + body['PatientMRN'] = 50377782; await baseAppClient.post( GET_PATIENT_VITAL_SIGN_DATA, diff --git a/lib/core/viewModel/patient-vital-sign-viewModel.dart b/lib/core/viewModel/patient-vital-sign-viewModel.dart index 255ab5bd..30f979f3 100644 --- a/lib/core/viewModel/patient-vital-sign-viewModel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewModel.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient-vital-signs-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; import '../../locator.dart'; @@ -8,20 +9,23 @@ import '../../locator.dart'; class VitalSignsViewModel extends BaseViewModel{ VitalSignsService _vitalSignService = locator(); - List get patientVitalSignList => - _vitalSignService.patientVitalSignList; + VitalSignData get patientVitalSigns => + _vitalSignService.patientVitalSigns; - List get patientVitalSignOrderdSubList => - _vitalSignService.patientVitalSignOrderdSubList; - - Future getPatientVitalSign(patient) async { + Future getPatientVitalSign() async { setState(ViewState.Busy); - await _vitalSignService.getPatientVitalSign(patient); + await _vitalSignService.getPatientVitalSign(); if (_vitalSignService.hasError) { error = _vitalSignService.error; setState(ViewState.Error); - } else + } else { + if(patientVitalSigns == null) { + _vitalSignService.patientVitalSigns = VitalSignData( + appointmentNo: 2016053265, bloodPressureCuffLocation: 0, bloodPressureCuffSize: 0, bloodPressureHigher: 38, + ); + } setState(ViewState.Idle); + } } } \ No newline at end of file diff --git a/lib/models/patient/vital_sign/patient-vital-sign-data.dart b/lib/models/patient/vital_sign/patient-vital-sign-data.dart index b5c46aa6..5d20e017 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-data.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-data.dart @@ -1,5 +1,4 @@ class VitalSignData { - int appointmentNo; int bloodPressureCuffLocation; int bloodPressureCuffSize; @@ -33,7 +32,7 @@ class VitalSignData { int weightKg; VitalSignData( - this.appointmentNo, + {this.appointmentNo, this.bloodPressureCuffLocation, this.bloodPressureCuffSize, this.bloodPressureHigher, @@ -63,7 +62,7 @@ class VitalSignData { this.temperatureCelcius, this.temperatureCelciusMethod, this.waistSizeInch, - this.weightKg); + this.weightKg}); VitalSignData.fromJson(Map json) { appointmentNo = json['appointmentNo']; @@ -134,5 +133,4 @@ class VitalSignData { data['weightKg'] = this.weightKg; return data; } - -} \ No newline at end of file +} diff --git a/lib/routes.dart b/lib/routes.dart index 5d8b730a..257db6fc 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -40,6 +40,7 @@ import 'screens/doctor/doctor_reply_screen.dart'; import 'screens/live_care/panding_list.dart'; import 'screens/patients/profile/referral/my-referral-detail-screen.dart'; import 'screens/patients/profile/referral/refer-patient-screen.dart'; +import 'screens/patients/vital-signs-screen.dart'; const String INIT_ROUTE = ROOT; const String ROOT = 'root'; @@ -74,6 +75,7 @@ const String PATIENT_ORDERS = 'patients/patient_orders'; const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; +const String PATIENT_VITAL_SIGN = 'patients/vital-sign-data'; const String CREATE_EPISODE = 'patients/create-episode'; const String BODY_MEASUREMENTS = 'patients/body-measurements'; @@ -113,6 +115,7 @@ var routes = { PATIENT_ORDERS: (_) => PatientsOrdersScreen(), PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), + PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), CREATE_EPISODE:(_)=>AddSOAPIndex(), BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index b6287cd9..2ab7cc18 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -6,6 +6,7 @@ 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/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -64,14 +65,7 @@ class _PatientMakeReferralScreenState extends State { children: [ Column( children: [ - Container( - height: 75, - child: AppText( - "This is where upper view for avatar.. etc placed", - fontWeight: FontWeight.normal, - fontSize: 16, - ), - ), + PatientPageHeaderWidget(patient), const Divider( color: Color(0xffCCCCCC), height: 1, diff --git a/lib/screens/patients/vital-signs-screen.dart b/lib/screens/patients/vital-signs-screen.dart new file mode 100644 index 00000000..6aeb5b3e --- /dev/null +++ b/lib/screens/patients/vital-signs-screen.dart @@ -0,0 +1,12 @@ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:flutter/material.dart'; + +class PatientVitalSignScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + + return Container(); + } +} diff --git a/lib/screens/patients/vital-signs.dart b/lib/screens/patients/vital-signs.dart deleted file mode 100644 index b6df3236..00000000 --- a/lib/screens/patients/vital-signs.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:flutter/material.dart'; - -class PatientVitalSignScreen extends StatelessWidget { - @override - Widget build(BuildContext context) { - - return Container(); - } -} diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 0c3f1b5f..5c2d6615 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -348,7 +348,7 @@ class Helpers { String lang = await sharedPref.getString(APP_Language); await clearSharedPref(); sharedPref.setString(APP_Language, lang); - // Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN); - Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN))); + Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN); + // Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN))); } } diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index d9c0f796..9d97a1ad 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -39,7 +39,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patient: patient, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, + route: PATIENT_VITAL_SIGN, icon: 'heartbeat.png'), PatientProfileButton( key: key, From 78e2c662c84994a517d5b5a9cc1a46287442a7fc Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 30 Dec 2020 11:33:19 +0200 Subject: [PATCH 5/9] finish vital sign feature, and adding makeReferralResponse --- lib/config/config.dart | 3 +++ .../patient-doctor-referral-service.dart | 25 +++++++++++++++++++ .../viewModel/patient-referral-viewmodel.dart | 10 ++++++++ .../referral/my-referral-detail-screen.dart | 8 ++++-- 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index e5ed9690..4a4a2d1c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -68,6 +68,9 @@ const GET_PENDING_REFERRAL_PATIENT = const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; +const RESPONSE_PENDING_REFERRAL_PATIENT = + 'Services/DoctorApplication.svc/REST/CreateReferral'; + const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index ad108c3b..a15ed05a 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -162,6 +162,31 @@ class PatientReferralService extends LookupService { ); } + Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { + hasError = false; + DoctorProfileModel doctorProfile = await getDoctorProfile(); + + Map body = Map(); + body['IsAccepted'] = isAccepted; + body['AppointmentNo'] = pendingReferral.sourceAppointmentNo; + body['PatientMRN'] = pendingReferral.patientID; + body['PatientName'] = pendingReferral.patientName; + body['ReferralResponse'] = pendingReferral.remarksFromSource; + body['SetupID'] = pendingReferral.sourceSetupID; + body['DoctorName'] = doctorProfile.doctorName; + + await baseAppClient.post( + RESPONSE_PENDING_REFERRAL_PATIENT, + onSuccess: (dynamic response, int statusCode) { + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: body, + ); + } + Future makeReferral( PatientArrivalEntity patientArrivalEntity, String isoStringDate, diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 6fa72f6f..9662a910 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -107,6 +107,16 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { + setState(ViewState.Busy); + await _referralPatientService.responseReferral(pendingReferral, isAccepted); + if (_referralPatientService.hasError) { + error = _referralPatientService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + Future getPatientArrivalList(String date) async { setState(ViewState.Busy); await _referralPatientService.getPatientArrivalList(date); diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 5f38f190..4c9d41e0 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -119,7 +119,9 @@ class MyReferralDetailScreen extends StatelessWidget { fontSize: 16, hPadding: 8, vPadding: 12, - handler: null, + handler: (){ + model.responseReferral(pendingReferral, true); + }, ), ), SizedBox( @@ -133,7 +135,9 @@ class MyReferralDetailScreen extends StatelessWidget { fontSize: 16, hPadding: 8, vPadding: 12, - handler: null, + handler: (){ + model.responseReferral(pendingReferral, false); + }, ), ), ], From 04ed76069c46a73517beb95330c7dcdcc8d73de4 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 30 Dec 2020 15:39:05 +0200 Subject: [PATCH 6/9] hack login --- lib/client/base_app_client.dart | 36 ++--- lib/core/viewModel/project_view_model.dart | 22 +-- lib/root_page.dart | 2 +- lib/screens/dashboard_screen.dart | 125 +++++++++--------- .../profile/profile-welcome-widget.dart | 7 +- 5 files changed, 99 insertions(+), 93 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index eacf3e8d..f9f683b8 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -36,20 +36,21 @@ class BaseAppClient { }) async { String url = BASE_URL + endPoint; try { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - String token = await sharedPref.getString(TOKEN); - if (profile != null) { - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - if (body['DoctorID'] == null) - body['DoctorID'] = doctorProfile?.doctorID; - body['EditedBy'] = doctorProfile?.doctorID; - if (body['ProjectID'] == null) { - body['ProjectID'] = doctorProfile?.projectID; - } - if (body['ClinicID'] == null) - body['ClinicID'] = doctorProfile?.clinicID; - } - body['TokenID'] = token ?? ''; + //TODO change it edit By Jammal + // Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + // String token = await sharedPref.getString(TOKEN); + // if (profile != null) { + // DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + // if (body['DoctorID'] == null) + body['DoctorID'] = 4709;//doctorProfile?.doctorID; + body['EditedBy'] = 4709;//doctorProfile?.doctorID; + //if (body['ProjectID'] == null) { + body['ProjectID'] = 15;//doctorProfile?.projectID; + // } + // if (body['ClinicID'] == null) + body['ClinicID'] = 1;//doctorProfile?.clinicID; + // } + body['TokenID'] = "@dm!n";//token ?? ''; String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') body['LanguageID'] = 1; @@ -63,9 +64,10 @@ class BaseAppClient { body['SessionID'] = SESSION_ID; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = 0; // PATIENT_OUT_SA; - body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); - body['VidaRefreshTokenID'] = - await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU"; + //await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + body['VidaRefreshTokenID'] ="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU"; + //await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); print("URL : $url"); print("Body : ${json.encode(body)}"); diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index 267f823a..1448fb47 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -101,7 +101,7 @@ class ProjectViewModel with ChangeNotifier { localRes = response; }, onFailure: (String error, int statusCode) { throw error; - }, body: {}); + }, body: Map()); return Future.value(localRes); } catch (error) { @@ -111,18 +111,18 @@ class ProjectViewModel with ChangeNotifier { } void getProfile() async { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - ProfileReqModel docInfo = new ProfileReqModel( - doctorID: doctorProfile.doctorID, - clinicID: doctorProfile.clinicID, - license: true, - projectID: doctorProfile.projectID, - tokenID: '', - languageID: 2); + // Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + // DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); + // ProfileReqModel docInfo = new ProfileReqModel( + // doctorID: doctorProfile.doctorID, + // clinicID: doctorProfile.clinicID, + // license: true, + // projectID: doctorProfile.projectID, + // tokenID: '', + // languageID: 2); Provider.of(AppGlobal.CONTEX, listen: false) - .getDocProfiles(docInfo.toJson()) + .getDocProfiles(ProfileReqModel().toJson()) .then((res) async { sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); }).catchError((err) { diff --git a/lib/root_page.dart b/lib/root_page.dart index fe35a246..0f44dc4d 100644 --- a/lib/root_page.dart +++ b/lib/root_page.dart @@ -22,7 +22,7 @@ class RootPage extends StatelessWidget { ); break; case APP_STATUS.UNAUTHENTICATED: - return Loginsreen(); + return LandingPage(); break; case APP_STATUS.AUTHENTICATED: return LandingPage(); diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index b6bbc6cf..c55b5afa 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -115,68 +115,69 @@ class _DashboardScreenState extends State { SizedBox( height: 4, ), - InkWell( - onTap: () async { - showCupertinoPicker( - decKey: '', - context: context, - actionList: projectsProvider - .doctorClinicsList); - }, - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - child: AppText( - authProvider.selectedClinicName != - null - ? authProvider - .selectedClinicName - : authProvider.doctorProfile - .clinicDescription, - fontSize: - SizeConfig.textMultiplier * - 1.7, - color: Colors.white, - textAlign: TextAlign.center, - ), - alignment: projectsProvider.isArabic - ? Alignment.topRight - : Alignment.topLeft, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - InkWell( - child: Container( - margin: EdgeInsets.only( - left: 5, - top: projectsProvider - .isArabic - ? 0 - : 5, - right: 10, - bottom: projectsProvider - .isArabic - ? 15 - : 7), - child: Icon( - DoctorApp.sync_icon, - color: Colors.white, - size: SizeConfig - .textMultiplier * - 1.8, - )), - ), - ], - ), - ]), - ), + //TODO change it edit By Jammal + // InkWell( + // onTap: () async { + // showCupertinoPicker( + // decKey: '', + // context: context, + // actionList: projectsProvider + // .doctorClinicsList); + // }, + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // Container( + // child: AppText( + // authProvider.selectedClinicName != + // null + // ? authProvider + // .selectedClinicName + // : authProvider.doctorProfile + // .clinicDescription, + // fontSize: + // SizeConfig.textMultiplier * + // 1.7, + // color: Colors.white, + // textAlign: TextAlign.center, + // ), + // alignment: projectsProvider.isArabic + // ? Alignment.topRight + // : Alignment.topLeft, + // ), + // Row( + // mainAxisAlignment: + // MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.max, + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // InkWell( + // child: Container( + // margin: EdgeInsets.only( + // left: 5, + // top: projectsProvider + // .isArabic + // ? 0 + // : 5, + // right: 10, + // bottom: projectsProvider + // .isArabic + // ? 15 + // : 7), + // child: Icon( + // DoctorApp.sync_icon, + // color: Colors.white, + // size: SizeConfig + // .textMultiplier * + // 1.8, + // )), + // ), + // ], + // ), + // ]), + // ), ], ), ]), diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index fae705f4..90141080 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -43,7 +43,8 @@ final double height; mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - 'Dr. ${authProvider.doctorProfile.doctorName}', + //TODO change it edit By Jammal + 'Dr. ',//${authProvider.doctorProfile.doctorName}', fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.5, color: Colors.white, @@ -71,7 +72,9 @@ final double height; height: 50, width: 60, child: Image.network( - authProvider.doctorProfile.doctorImageURL, + //TODO change it edit By Jammal + 'https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg' + // authProvider.doctorProfile.doctorImageURL, // fit: BoxFit.fill, ), ), From df4eb940426fb9b90881a9606a689e8f61772dbd Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 30 Dec 2020 15:52:03 +0200 Subject: [PATCH 7/9] work with patient model --- lib/models/patient/patiant_info_model.dart | 203 ++++++++++++--------- 1 file changed, 115 insertions(+), 88 deletions(-) diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 2b2fd876..f1a53d8b 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,98 +1,112 @@ -import 'dart:convert'; - -//PatiantInformtion patiantInformtionFromJson(String str) => PatiantInformtion.fromJson(json.decode(str)); - -////String patiantInformtionToJson(PatiantInformtion data) => json.encode(data.toJson()); -//****************************** */ - -/* - *@author: Amjad Amireh - *@Date:27/4/2020 - *@param: - *@return:Patian information Model - - *@desc: - */ +// TODO : it have to be changed. class PatiantInformtion { final List list; - int projectId; - int clinicId; - int doctorId; - int patientId; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - int gender; - String dateofBirth; - String nationalityId; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomId; - String bedId; - String nursingStationId; - String description; - String clinicDescription; - String clinicDescriptionN; - String nationalityName; - String nationalityNameN; - String age; - String genderDescription; - String nursingStationName; - String appointmentDate; - String startTime; - - PatiantInformtion({ - this.list, - this.projectId, - this.clinicId, - 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.nationalityId, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.roomId, - this.bedId, - this.nursingStationId, - this.description, - this.clinicDescription, - this.clinicDescriptionN, - this.nationalityName, - this.nationalityNameN, - this.age, - this.genderDescription, - this.nursingStationName, - this.appointmentDate, - this.startTime, + int genderInt; + String age; + String appointmentDate; + int appointmentNo; + String appointmentType; + String arrivedOn; + int clinicGroupId; + String companyName; + Null dischargeStatus; + Null doctorDetails; + int doctorId; + String endTime; + int episodeNo; + int fallRiskScore; + bool isSigned; + int medicationOrders; + String mobileNumber; + String nationality; + int projectId; + int clinicId; + int patientId; + String doctorName; + String doctorNameN; + String firstName; + String middleName; + String lastName; + String firstNameN; + String middleNameN; + String lastNameN; + int gender; + String dateofBirth; + String nationalityId; + String emailAddress; + String patientIdentificationNo; + int patientType; + String admissionNo; + String admissionDate; + String roomId; + String bedId; + String nursingStationId; + String description; + String clinicDescription; + String clinicDescriptionN; + String nationalityName; + String nationalityNameN; + String genderDescription; + String nursingStationName; + String startTime; - }); + PatiantInformtion({ + this.list, + this.projectId, + this.clinicId, + 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.nationalityId, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomId, + this.bedId, + this.nursingStationId, + this.description, + this.clinicDescription, + this.clinicDescriptionN, + this.nationalityName, + this.nationalityNameN, + this.age, + this.genderDescription, + this.nursingStationName, + this.appointmentDate, + this.startTime, + this.appointmentNo, + this.appointmentType, + this.arrivedOn, + this.clinicGroupId, + this.companyName, + this.dischargeStatus, + this.doctorDetails, + this.endTime, + this.episodeNo, + this.fallRiskScore, + this.genderInt, + this.isSigned, + this.medicationOrders, + this.nationality, + }); - factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( + factory PatiantInformtion.fromJson(Map json) => + PatiantInformtion( projectId: json["ProjectID"], clinicId: json["ClinicID"], doctorId: json["DoctorID"], @@ -127,6 +141,19 @@ class PatiantInformtion { nursingStationName: json["NursingStationName"], appointmentDate: json["AppointmentDate"]?? '', startTime: json["StartTime"], + appointmentNo :json['appointmentNo'], + appointmentType :json['appointmentType'], + arrivedOn :json['arrivedOn'], + clinicGroupId :json['clinicGroupId'], + companyName :json['companyName'], + dischargeStatus :json['dischargeStatus'], + doctorDetails :json['doctorDetails'], + endTime :json['endTime'], + episodeNo :json['episodeNo'], + fallRiskScore :json['fallRiskScore'], + isSigned :json['isSigned'], + medicationOrders :json['medicationOrders'], + nationality :json['nationality'], ); From 806682b9214863546bc3d011043f868176b8da28 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 30 Dec 2020 16:03:54 +0200 Subject: [PATCH 8/9] hack login --- .../patients/patient_search_screen.dart | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 9de384b6..b8dfe225 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -71,28 +71,28 @@ class _PatientSearchScreenState extends State { //==================== //_selectedType=='3'? //===================== - - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - new DoctorProfileModel.fromJson(profile); + // + // Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + // DoctorProfileModel doctorProfile = + // new DoctorProfileModel.fromJson(profile); if (_formKey.currentState.validate()) { _formKey.currentState.save(); - sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); - print('************_selectedType*************'); - print('_selectedType${_selectedType}'); - String token = await sharedPref.getString(TOKEN); - - _patientSearchFormValues.TokenID = token; - _patientSearchFormValues.ProjectID = doctorProfile.projectID; //15 - _patientSearchFormValues.DoctorID = doctorProfile.doctorID; - _patientSearchFormValues.ClinicID = doctorProfile.clinicID; - //===================== - // _patientSearchFormValues. - //===================== - - print("=============doctorProfile.clinicID=" + - doctorProfile.clinicID.toString()); + // sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); + // print('************_selectedType*************'); + // print('_selectedType${_selectedType}'); + // String token = await sharedPref.getString(TOKEN); + // + // _patientSearchFormValues.TokenID = token; + // _patientSearchFormValues.ProjectID = doctorProfile.projectID; //15 + // _patientSearchFormValues.DoctorID = doctorProfile.doctorID; + // _patientSearchFormValues.ClinicID = doctorProfile.clinicID; + // //===================== + // // _patientSearchFormValues. + // //===================== + // + // print("=============doctorProfile.clinicID=" + + // doctorProfile.clinicID.toString()); Navigator.of(context).pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, From 61209663f3660dd85021d365a85358aaf5388e8e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 30 Dec 2020 18:26:51 +0200 Subject: [PATCH 9/9] Finish arrived --- lib/core/viewModel/patient_view_model.dart | 2 +- lib/models/patient/patiant_info_model.dart | 60 +++++++++++----------- lib/screens/patients/patients_screen.dart | 9 +++- 3 files changed, 39 insertions(+), 32 deletions(-) diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index a1221266..9672da83 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -49,7 +49,7 @@ class PatientViewModel extends BaseViewModel { List get referralFrequencyList => _patientService.referalFrequancyList; - Future getPatientList(PatientModel patient, patientType, + Future getPatientList( patient, patientType, {bool isBusyLocal = false}) async { if (isBusyLocal) { setState(ViewState.BusyLocal); diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index f1a53d8b..d1f10ce0 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -107,36 +107,36 @@ class PatiantInformtion { factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( - projectId: json["ProjectID"], - clinicId: json["ClinicID"], - 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"], - nationalityId: json["NationalityID"], - 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"], - clinicDescription: json["ClinicDescription"], - clinicDescriptionN: json["ClinicDescriptionN"], - nationalityName: json["NationalityName"], - nationalityNameN: json["NationalityNameN"], - age: json["Age"], + projectId: json["ProjectID"] ?? json["projectID"], + clinicId: json["ClinicID"]?? json["clinicID"], + doctorId: json["DoctorID"]?? json["doctorID"], + patientId: json["PatientID"]?? json["patientID"], + doctorName: json["DoctorName"]?? json["doctorName"], + doctorNameN: json["DoctorNameN"]?? json["doctorNameN"], + firstName: json["FirstName"]?? json["firstName"], + middleName: json["MiddleName"]?? json["middleName"], + lastName: json["LastName"]?? json["lastName"], + firstNameN: json["FirstNameN"]?? json["firstNameN"], + middleNameN: json["MiddleNameN"]?? json["middleNameN"], + lastNameN: json["LastNameN"]?? json["lastNameN"], + gender: json["Gender"]?? json["gender"], + dateofBirth: json["DateofBirth"]?? json["dob"], + nationalityId: json["NationalityID"]?? json["nationalityID"], + mobileNumber: json["MobileNumber"]?? json["mobileNumber"], + emailAddress: json["EmailAddress"]?? json["emailAddress"], + patientIdentificationNo: json["PatientIdentificationNo"]?? json["patientIdentificationNo"], + patientType: json["PatientType"]?? json["patientType"], + admissionNo: json["AdmissionNo"]?? json["admissionNo"], + admissionDate: json["AdmissionDate"]?? json["admissionDate"], + roomId: json["RoomID"]?? json["roomID"], + bedId: json["BedID"]?? json["bedID"], + nursingStationId: json["NursingStationID"]?? json["nursingStationID"], + description: json["Description"]?? json["description"], + clinicDescription: json["ClinicDescription"]?? json["clinicDescription"], + clinicDescriptionN: json["ClinicDescriptionN"]?? json["clinicDescriptionN"], + nationalityName: json["NationalityName"]?? json["nationalityName"], + nationalityNameN: json["NationalityNameN"]?? json["nationalityNameN"], + age: json["Age"]?? json["age"], genderDescription: json["GenderDescription"], nursingStationName: json["NursingStationName"], appointmentDate: json["AppointmentDate"]?? '', diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 85c0947c..cb0c7248 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -282,7 +282,14 @@ class _PatientsScreenState extends State { _isLoading = false; this.error = error.toString(); } else { - lItems = res[SERVICES_PATIANT2[val2]]["entityList"]; + + var localList=[]; + res["patientArrivalList"]["entityList"].forEach((v) { + Map mergedPatient= {...v,...v["patientDetails"]}; + localList.add(mergedPatient); + }); + print(localList.toString()); + lItems = localList;//res[SERVICES_PATIANT2[val2]]["entityList"]; } } else { lItems = res[SERVICES_PATIANT2[val2]];