diff --git a/lib/config/config.dart b/lib/config/config.dart index 7a9b7d75..3d34fd7c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -240,7 +240,7 @@ const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; -const GET_MY_DISCHARGE_PATIENT = "/Services/DoctorApplication.svc/REST/GtMyDischargePatient"; +const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; @@ -272,6 +272,8 @@ const GET_PRESCRIPTION_IN_PATIENT = const GET_INSURANCE_IN_PATIENT = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/core/model/DischargeReferralPatient.dart b/lib/core/model/DischargeReferralPatient.dart index 44d22bfc..523d8d0a 100644 --- a/lib/core/model/DischargeReferralPatient.dart +++ b/lib/core/model/DischargeReferralPatient.dart @@ -1,3 +1,5 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; + class DischargeReferralPatient { dynamic rowID; int projectID; @@ -31,7 +33,7 @@ class DischargeReferralPatient { int referralClinic; int referringClinic; int referralStatus; - String referralDate; + DateTime referralDate; String referringDoctorRemarks; String referredDoctorRemarks; String referralResponseOn; @@ -137,7 +139,7 @@ class DischargeReferralPatient { referralClinic = json['ReferralClinic']; referringClinic = json['ReferringClinic']; referralStatus = json['ReferralStatus']; - referralDate = json['ReferralDate']; + referralDate = DateUtils.convertStringToDate(json['ReferralDate']); referringDoctorRemarks = json['ReferringDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks']; referralResponseOn = json['ReferralResponseOn']; diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index 75e8bfe2..dcf365fe 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -9,6 +9,7 @@ class FinalRadiology { dynamic doctorID; dynamic clinicID; DateTime orderDate; + DateTime reportDate; dynamic reportData; dynamic imageURL; dynamic procedureID; @@ -52,6 +53,7 @@ class FinalRadiology { this.doctorID, this.clinicID, this.orderDate, + this.reportDate, this.reportData, this.imageURL, this.procedureID, @@ -95,6 +97,7 @@ class FinalRadiology { doctorID = json['DoctorID']; clinicID = json['ClinicID']; orderDate = DateUtils.convertStringToDate(json['OrderDate']); + reportDate = DateUtils.convertStringToDate(json['ReportDate']); reportData = json['ReportData']; imageURL = json['ImageURL']; procedureID = json['ProcedureID']; diff --git a/lib/core/model/sick_leave_patient_model.dart b/lib/core/model/sick_leave_patient_model.dart new file mode 100644 index 00000000..e0637845 --- /dev/null +++ b/lib/core/model/sick_leave_patient_model.dart @@ -0,0 +1,144 @@ +class SickLeavePatientModel { + String setupID; + int projectID; + int patientID; + int patientType; + int clinicID; + int doctorID; + int requestNo; + String requestDate; + int sickLeaveDays; + int appointmentNo; + int admissionNo; + int actualDoctorRate; + String appointmentDate; + String clinicName; + String doctorImageURL; + String doctorName; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isLiveCareAppointment; + int noOfPatientsRate; + dynamic patientName; + String projectName; + String qR; + List speciality; + String strRequestDate; + + SickLeavePatientModel( + {this.setupID, + this.projectID, + this.patientID, + this.patientType, + this.clinicID, + this.doctorID, + this.requestNo, + this.requestDate, + this.sickLeaveDays, + this.appointmentNo, + this.admissionNo, + this.actualDoctorRate, + this.appointmentDate, + this.clinicName, + this.doctorImageURL, + this.doctorName, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.isLiveCareAppointment, + this.noOfPatientsRate, + this.patientName, + this.projectName, + this.qR, + this.speciality, + this.strRequestDate}); + + SickLeavePatientModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + patientType = json['PatientType']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + requestNo = json['RequestNo']; + requestDate = json['RequestDate']; + sickLeaveDays = json['SickLeaveDays']; + appointmentNo = json['AppointmentNo']; + admissionNo = json['AdmissionNo']; + actualDoctorRate = json['ActualDoctorRate']; + appointmentDate = json['AppointmentDate']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatient = json['IsInOutPatient']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + noOfPatientsRate = json['NoOfPatientsRate']; + patientName = json['PatientName']; + projectName = json['ProjectName']; + qR = json['QR']; + speciality = json['Speciality'].cast(); + strRequestDate = json['StrRequestDate']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['RequestNo'] = this.requestNo; + data['RequestDate'] = this.requestDate; + data['SickLeaveDays'] = this.sickLeaveDays; + data['AppointmentNo'] = this.appointmentNo; + data['AdmissionNo'] = this.admissionNo; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['AppointmentDate'] = this.appointmentDate; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatient'] = this.isInOutPatient; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['PatientName'] = this.patientName; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; + data['StrRequestDate'] = this.strRequestDate; + return data; + } +} diff --git a/lib/core/model/sick_leave_patient_request_model.dart b/lib/core/model/sick_leave_patient_request_model.dart new file mode 100644 index 00000000..ec588316 --- /dev/null +++ b/lib/core/model/sick_leave_patient_request_model.dart @@ -0,0 +1,60 @@ +class SickLeavePatientRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + int deviceTypeID; + int patientType; + int patientTypeID; + String tokenID; + int patientID; + String sessionID; + + SickLeavePatientRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.deviceTypeID, + this.patientType, + this.patientTypeID, + this.tokenID, + this.patientID, + this.sessionID}); + + SickLeavePatientRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + deviceTypeID = json['DeviceTypeID']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + tokenID = json['TokenID']; + patientID = json['PatientID']; + sessionID = json['SessionID']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + data['TokenID'] = this.tokenID; + data['PatientID'] = this.patientID; + data['SessionID'] = this.sessionID; + return data; + } +} diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 1ea8669a..bba9b31f 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -1,4 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/sick_leave_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/sick_leave_patient_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; @@ -16,6 +18,7 @@ class SickLeaveService extends BaseService { List reasonse = []; List get getAllSickLeave => _getAllsickLeave; List _getAllsickLeave = []; + List get coveringDoctorsList => _coveringDoctors; List _coveringDoctors = []; @@ -27,6 +30,14 @@ class SickLeaveService extends BaseService { dynamic get sickLeaveResponse => _sickLeaveResponse; dynamic _sickLeaveResponse; + + List get getAllSickLeavePatient => + _getAllsickLeavePatient; + List _getAllsickLeavePatient = []; + + SickLeavePatientRequestModel _sickLeavePatientRequestModel = + SickLeavePatientRequestModel(); + Future getStatistics(appoNo, patientMRN) async { hasError = false; await baseAppClient.post( @@ -104,6 +115,27 @@ class SickLeaveService extends BaseService { ); } + // Future getSickLeavePatient(patientMRN) async { + // _sickLeavePatientRequestModel = + // SickLeavePatientRequestModel(patientID: patientMRN, patientType: 1); + // hasError = false; + // await baseAppClient.post( + // GET_SICK_LEAVE_PATIENT, + // onSuccess: (dynamic response, int statusCode) { + // Future.value(response); + // _getAllsickLeavePatient.clear(); + // response['List_SickLeave'].forEach((v) { + // _getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v)); + // }); + // }, + // onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, + // body: _sickLeavePatientRequestModel.toJson(), + // ); + // } + Future getRescheduleLeave() async { hasError = false; await baseAppClient.post( diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart index 76d7e40a..e4eba2fb 100644 --- a/lib/core/viewModel/DischargedPatientViewModel.dart +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -13,37 +13,34 @@ class DischargedPatientViewModel extends BaseViewModel { List get myDischargedPatient => _dischargedPatientService.myDischargedPatients; - List get myDischargeReferralPatient => - _dischargedPatientService.myDischargeReferralPatients; - List filterData = []; + + + List get filterData => filterData2.isNotEmpty? filterData2:myDischargedPatient; + + List filterData2 = []; searchData(String str) { - // this.responseModelList = this.responseModelList2; - // var strExist = str.length > 0 ? true : false; - // if (strExist) { - // List filterData = []; - // - // for (var i = 0; i < responseModelList2.length; i++) { - // String firstName = responseModelList[i].firstName.toUpperCase(); - // String lastName = responseModelList[i].lastName.toUpperCase(); - // String mobile = responseModelList[i].mobileNumber.toUpperCase(); - // String patientID = responseModelList[i].patientId.toString(); - // - // if (firstName.contains(str.toUpperCase()) || - // lastName.contains(str.toUpperCase()) || - // mobile.contains(str) || - // patientID.contains(str)) { - // filterData.add(responseModelList[i]); - // } - // } - // - // // setState(() { - // // this.responseModelList = filterData; - // // }); - // } else { - // filterData = myDischargedPatient; - // notifyListeners(); - // } + var strExist = str.length > 0 ? true : false; + if (strExist) { + filterData2 = []; + for (var i = 0; i < myDischargedPatient.length; i++) { + String firstName = myDischargedPatient[i].firstName.toUpperCase(); + String lastName = myDischargedPatient[i].lastName.toUpperCase(); + String mobile = myDischargedPatient[i].mobileNumber.toUpperCase(); + String patientID = myDischargedPatient[i].patientId.toString(); + + if (firstName.contains(str.toUpperCase()) || + lastName.contains(str.toUpperCase()) || + mobile.contains(str) || + patientID.contains(str)) { + filterData2.add(myDischargedPatient[i]); + } + } + notifyListeners(); + } else { + filterData2 = myDischargedPatient; + notifyListeners(); + } } diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 2ecd1d1f..aaa0d35e 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -1,6 +1,8 @@ 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/DischargeReferralPatient.dart'; import 'package:doctor_app_flutter/core/model/MyReferralPatientModel.dart'; +import 'package:doctor_app_flutter/core/service/DischargedPatientService.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'; @@ -24,6 +26,10 @@ class PatientReferralViewModel extends BaseViewModel { MyReferralInPatientService _myReferralService = locator(); + DischargedPatientService _dischargedPatientService = locator(); + List get myDischargeReferralPatient => + _dischargedPatientService.myDischargeReferralPatients; + List get branchesList => _referralPatientService.projectsList; List get clinicsList => _referralPatientService.clinicsList; @@ -261,6 +267,16 @@ class PatientReferralViewModel extends BaseViewModel { } } + Future gtMyDischargeReferralPatient() async { + setState(ViewState.Busy); + await _dischargedPatientService.gtMyDischargeReferralPatient(); + if (_dischargedPatientService.hasError) { + error = _dischargedPatientService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + String getReferralStatusNameByCode(int statusCode, BuildContext context) { switch (statusCode) { case 1: @@ -329,4 +345,30 @@ class PatientReferralViewModel extends BaseViewModel { patient.clinicDescription = referredPatient.clinicDescription; return patient; } + + PatiantInformtion getPatientFromDischargeReferralPatient( + DischargeReferralPatient referredPatient) { + PatiantInformtion patient = PatiantInformtion(); + patient.doctorId = referredPatient.doctorID; + patient.doctorName = referredPatient.doctorName; + patient.patientId = referredPatient.patientID; + patient.firstName = referredPatient.firstName; + patient.middleName = referredPatient.middleName; + patient.lastName = referredPatient.lastName; + patient.gender = referredPatient.gender; + patient.dateofBirth = referredPatient.dateofBirth; + patient.mobileNumber = referredPatient.mobileNumber; + patient.emailAddress = referredPatient.emailAddress; + patient.patientIdentificationNo = referredPatient.patientIdentificationNo; + patient.patientType = referredPatient.patientType; + patient.admissionNo = referredPatient.admissionNo; + patient.admissionDate = referredPatient.admissionDate; + patient.roomId = referredPatient.roomID; + patient.bedId = referredPatient.bedID; + patient.nationalityName = referredPatient.nationalityName; + patient.nationalityFlagURL = '';// TODO from backend referredPatient.nationalityFlagURL; + patient.age = referredPatient.age; + patient.clinicDescription = referredPatient.clinicDescription; + return patient; + } } diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 77dc19c4..eb41f950 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -14,6 +14,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart'; +import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -547,51 +548,53 @@ class _HomeScreenState extends State { }, ), HomePageCard( - color: Colors.black, + color: Colors.red[800], margin: EdgeInsets.all(5), child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsets.only( top: 10, left: 10, right: 0), child: Icon( - DoctorApp.search, - size: 32, + DoctorApp.referral_1, + size: 35, color: Colors.white, )), Container( padding: EdgeInsets.all(10), child: AppText( TranslationBase.of(context) - .searchmedicinepatient, + .patientsreferral, color: Colors.white, textAlign: TextAlign.start, - fontSize: 13, + fontSize: 15, )) ], ), hasBorder: false, onTap: () { Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - SearchMedicinePatientScreen(), - )); + context, + MaterialPageRoute( + builder: (context) => + PatientReferralScreen(), + // MyReferredPatient(), + ), + ); }, ), HomePageCard( - color: Colors.red[800], + color: Colors.grey[300], margin: EdgeInsets.all(5), child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsets.only( @@ -599,14 +602,13 @@ class _HomeScreenState extends State { child: Icon( DoctorApp.referral_1, size: 35, - color: Colors.white, + color: Colors.black, )), Container( padding: EdgeInsets.all(10), child: AppText( - TranslationBase.of(context) - .patientsreferral, - color: Colors.white, + 'Discharged Patients', + color: Colors.black, textAlign: TextAlign.start, fontSize: 15, )) @@ -618,7 +620,7 @@ class _HomeScreenState extends State { context, MaterialPageRoute( builder: (context) => - PatientReferralScreen(), + DischargedPatient(), // MyReferredPatient(), ), ); @@ -629,9 +631,9 @@ class _HomeScreenState extends State { margin: EdgeInsets.all(5), child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsets.only( @@ -644,7 +646,7 @@ class _HomeScreenState extends State { Container( padding: EdgeInsets.all(10), child: AppText( - 'DischargedPatient', + 'Referral Discharged', color: Colors.white, textAlign: TextAlign.start, fontSize: 15, @@ -657,31 +659,53 @@ class _HomeScreenState extends State { context, MaterialPageRoute( builder: (context) => - DischargedPatient(), + ReferralDischargedPatientPage(), // MyReferredPatient(), ), ); }, ), - ])), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ + HomePageCard( + color: Colors.black, + margin: EdgeInsets.all(5), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.search, + size: 32, + color: Colors.white, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .searchmedicinepatient, + color: Colors.white, + textAlign: TextAlign.start, + fontSize: 13, + )) + ], + ), + hasBorder: false, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + SearchMedicinePatientScreen(), + )); + }, + ), - // ], - // ), - // SizedBox( - // height: 10, - // ), - // Row( - // children: [ + ])), - // ], - // ), - // SizedBox( - // height: 20, - // ), Row( // mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 6cc558d8..0ba791c6 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -30,284 +30,302 @@ class _DischargedPatientState extends State { backgroundColor: Colors.grey[200], isShowAppBar: true, baseViewModel: model, - body: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(height: 12,), - Container( - width: double.maxFinite, - height: 75, - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: Color(0xffCCCCCC), - ), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - left: 10, top: 10), - child: AppText( - TranslationBase.of( - context) - .searchPatientName, - fontSize: 13, - )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), + body: model.filterData.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( + 'No Discharged Patient', + color: Theme.of(context).errorColor, + ), + ) + ], + ), + ):Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 12,), + Container( + width: double.maxFinite, + height: 75, + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: Color(0xffCCCCCC), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, top: 10), + child: AppText( + TranslationBase.of( + context) + .searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, ), - onChanged: (String str) { - //this.searchData(str); - }), - ])), - ...List.generate( - model.myDischargedPatient.length, - (index) => InkWell( - onTap: () { - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model.myDischargedPatient[index], - "patientType": "1", - "isSearch": false, - "isInpatient":true, - "isDischargedPatient":true - }); + iconSize: 20, + padding: + EdgeInsets.only( + bottom: 30), + ), + onChanged: (String str) { + model.searchData(str); + }), + ])), + SizedBox(height: 5,), + Expanded( + child: ListView.builder( + itemCount: model.filterData.length, + itemBuilder: (context,index)=>InkWell( + onTap: () { + Navigator.of(context) + .pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model.filterData[index], + "patientType": "1", + "isSearch": false, + "isInpatient":true, + "isDischargedPatient":true + }); - }, - child: Container( - width: double.maxFinite, - margin: EdgeInsets.all(8), - padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), - color: Colors.white, - ), - child: Column( - children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row(children: [ - Container( - width: 170, - child: AppText( - (Helpers.capitalize(model - .myDischargedPatient[index] - .firstName) + - " " + - Helpers.capitalize(model - .myDischargedPatient[index] - .lastName)), - fontSize: 16, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - textOverflow: TextOverflow.ellipsis, - ), - ), - model.myDischargedPatient[index].gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - ]), - Row( - children: [ - AppText( - model.myDischargedPatient[index].nationalityName != null - ? model.myDischargedPatient[index].nationalityName.trim() - : model.myDischargedPatient[index].nationality != null - ? model.myDischargedPatient[index].nationality.trim() - : model.myDischargedPatient[index].nationalityId != null - ? model.myDischargedPatient[index].nationalityId - : "", - fontWeight: FontWeight.bold, - fontSize: 14, - textOverflow: TextOverflow.ellipsis, + }, + child: Container( + width: double.maxFinite, + margin: EdgeInsets.all(8), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row(children: [ + Container( + width: 170, + child: AppText( + (Helpers.capitalize(model + .filterData[index] + .firstName) + + " " + + Helpers.capitalize(model + .filterData[index] + .lastName)), + fontSize: 16, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + textOverflow: TextOverflow.ellipsis, + ), ), - model.myDischargedPatient[index] - .nationality != - null || - model.myDischargedPatient[index] - .nationalityId != - null - ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), - child: Image.network( - model.myDischargedPatient[index].nationalityFlagURL != null ? - model.myDischargedPatient[index].nationalityFlagURL - : '', - height: 25, - width: 30, - errorBuilder: - (BuildContext context, - Object exception, - StackTrace stackTrace) { - return AppText( - '', - fontSize: 10, - ); - }, - )) - : SizedBox() - ], - ) - ], - )), - Row( - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.asset( - model.myDischargedPatient[index].gender == - 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, + model.filterData[index].gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, ), - ), - ), - ], - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context) - .fileNumber, - style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), - new TextSpan( - text: model - .myDischargedPatient[index] - .patientId - .toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], + ]), + Row( + children: [ + AppText( + model.filterData[index].nationalityName != null + ? model.filterData[index].nationalityName.trim() + : model.filterData[index].nationality != null + ? model.filterData[index].nationality.trim() + : model.filterData[index].nationalityId != null + ? model.filterData[index].nationalityId + : "", + fontWeight: FontWeight.bold, + fontSize: 14, + textOverflow: TextOverflow.ellipsis, + ), + model.filterData[index] + .nationality != + null || + model.filterData[index] + .nationalityId != + null + ? ClipRRect( + borderRadius: + BorderRadius.circular(20.0), + child: Image.network( + model.filterData[index].nationalityFlagURL != null ? + model.filterData[index].nationalityFlagURL + : '', + height: 25, + width: 30, + errorBuilder: + (BuildContext context, + Object exception, + StackTrace stackTrace) { + return AppText( + '', + fontSize: 10, + ); + }, + )) + : SizedBox() + ], + ) + ], + )), + Row( + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + model.filterData[index].gender == + 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, ), ), ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: + ], + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context) + .fileNumber, + style: TextStyle( + fontSize: 14, + fontFamily: 'Poppins')), + new TextSpan( + text: model + .filterData[index] + .patientId + .toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], ), - children: [ - new TextSpan( - text: model.myDischargedPatient[index].admissionDate == null ? "" : - TranslationBase.of(context).admissionDate + " : ", - style: TextStyle(fontSize: 14)), - new TextSpan( - text: model.myDischargedPatient[index].admissionDate == null ? "" - : "${DateUtils.convertDateFromServerFormat(model.myDischargedPatient[index].admissionDate.toString(), 'yyyy-MM-dd')}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 15)), - ], ), ), - ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: + 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: model.filterData[index].admissionDate == null ? "" : + TranslationBase.of(context).admissionDate + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: model.filterData[index].admissionDate == null ? "" + : "${DateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ], ), - children: [ - new TextSpan( - text: model.myDischargedPatient[index].dischargeDate == null ? "" - : "Discharge Date : ", - style: TextStyle(fontSize: 14)), - new TextSpan( - text: model.myDischargedPatient[index].dischargeDate == null ? "" - : "${DateUtils.convertDateFromServerFormat(model.myDischargedPatient[index].dischargeDate.toString(), 'yyyy-MM-dd')}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 15)), - ], ), ), - ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).numOfDays}: ", - fontSize: 14,fontWeight: FontWeight.w300, + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: + 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: model.filterData[index].dischargeDate == null ? "" + : "Discharge Date : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: model.filterData[index].dischargeDate == null ? "" + : "${DateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ], + ), ), - AppText( - "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(model.myDischargedPatient[index].admissionDate)).inDays + 1}", - fontSize: 15, - fontWeight: FontWeight.w700), - ], - ), - ], - ), - ) - ], - ) - ], + ), + Row( + children: [ + AppText( + "${TranslationBase.of(context).numOfDays}: ", + fontSize: 14,fontWeight: FontWeight.w300, + ), + AppText( + "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", + fontSize: 15, + fontWeight: FontWeight.w700), + ], + ), + ], + ), + ) + ], + ) + ], + ), ), - ), - ), - ) - ], - ), + )), + ), + + ], ), ), ), diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart new file mode 100644 index 00000000..6deef61d --- /dev/null +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -0,0 +1,591 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/DischargeReferralPatient.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.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/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.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'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import '../../routes.dart'; + + + +class ReferralDischargedPatientDetails extends StatelessWidget { + final DischargeReferralPatient referredPatient; + + ReferralDischargedPatientDetails(this.referredPatient,); + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Container( + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + (Helpers.capitalize( + "${referredPatient.firstName} ${referredPatient.lastName}")), + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + ), + referredPatient.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + InkWell( + onTap: () { + PatiantInformtion patient = + model.getPatientFromDischargeReferralPatient(referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patient, + "patientType": "1", + "isInpatient": true, + "arrivalType": "1", + "from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + }); + }, + child: Icon( + Icons.account_circle, + size: 25, + ), + ) + ]), + ), + + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + //TODO from backend + // Padding( + // padding: EdgeInsets.only(left: 12.0), + // child: Container( + // width: 60, + // height: 60, + // child: Image.network( + // referredPatient.doctorImageURL + // ), + // ), + // ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + AppText( + "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", + fontFamily: 'Poppins', + fontSize: 1.9 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700, + color: referredPatient.referralStatus == 1 + ? Color(0xffc4aa54) + : referredPatient.referralStatus == 46 + ? Colors.green[700] + : Colors.red[700], + ), + AppText( + DateUtils.getDayMonthYearDateFormatted(referredPatient.referralDate,), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Color(0XFF28353E), + ) + ], + ), + + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Admission Date: ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + DateUtils.convertDateFromServerFormat( + referredPatient.admissionDate, + "dd MMM,yyyy"), + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Discharge Date: ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + DateUtils.convertDateFromServerFormat( + referredPatient.dischargeDate, + "dd MMM,yyyy"), + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Number of Days: ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + DateUtils.convertDateFromServerFormat( + referredPatient.dischargeDate, + "dd MMM,yyyy"), + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Referring Doctor ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient.referringDoctorName, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .fileNumber, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: + 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + AppText( + "${referredPatient.patientID}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ], + ), + + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).refClinic}: ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * + SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + AppText( + referredPatient + .referringClinicDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.8 * + SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .frequency + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * + SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient + .frequencyDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.8 * + SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + ], + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).priority + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient.priorityDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Referring Clinic ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient.referringClinicDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Frequency ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient.frequency.toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Priority ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient.frequency.toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + + + + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .maxResponseTime + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + DateUtils.convertDateFromServerFormat( + referredPatient.mAXResponseTime, + "dd MMM,yyyy"), + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: + EdgeInsets.only(left: 10, right: 0), + child: Image.asset( + 'assets/images/patient/ic_ref_arrow_left.png', + height: 50, + width: 30, + ), + ), + //TODO from backend + // Container( + // margin: EdgeInsets.only( + // left: 0, + // top: 25, + // right: 0, + // bottom: 0), + // padding: EdgeInsets.only( + // left: 4.0, right: 4.0), + // child: referredPatient.doctorImageURL != + // null + // ? ClipRRect( + // borderRadius: + // BorderRadius.circular(20.0), + // child: Image.network( + // referredPatient.doctorImageURL, + // height: 25, + // width: 30, + // errorBuilder: + // (BuildContext context, + // Object exception, + // StackTrace stackTrace) { + // return Text('No Image'); + // }, + // )) + // : Container( + // child: Image.asset( + // referredPatient.gender == 1 + // ? 'assets/images/male_avatar.png' + // : 'assets/images/female_avatar.png', + // fit: BoxFit.cover, + // ), + // ), + // ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only( + left: 10, + top: 30, + right: 10, + bottom: 0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "Dr ${referredPatient.referringDoctorName}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w800, + fontSize: 1.5 * + SizeConfig.textMultiplier, + color: Colors.black, + ), + AppText( + referredPatient + .referringClinicDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.3 * + SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ], + ), + ), + ), + ], + ), + ], + ), + ), + ], + ), + ], + ), + ), + ), + Expanded( + child: SingleChildScrollView( + child: Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + border: Border.fromBorderSide(BorderSide( + color: Colors.white, + width: 1.0, + )), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).remarks, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 2.4 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + AppText( + referredPatient.referringDoctorRemarks, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + SizedBox( + height: 8, + ), + + ], + ), + ), + ), + ), + + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/ReferralDischargedPatientPage.dart b/lib/screens/patients/ReferralDischargedPatientPage.dart new file mode 100644 index 00000000..0b1be823 --- /dev/null +++ b/lib/screens/patients/ReferralDischargedPatientPage.dart @@ -0,0 +1,105 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/DischargedPatientViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/referral_patient_detail_in-paint.dart'; +import 'package:doctor_app_flutter/util/date-utils.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/patients/patient-referral-item-widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +import '../../routes.dart'; +import 'ReferralDischargedPatientDetails.dart'; + +class ReferralDischargedPatientPage extends StatefulWidget { + @override + _ReferralDischargedPatientPageState createState() => _ReferralDischargedPatientPageState(); +} + +class _ReferralDischargedPatientPageState extends State { + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.gtMyDischargeReferralPatient(), + builder: (_, model, w) => AppScaffold( + appBarTitle: 'Referral Discharged ', + backgroundColor: Colors.grey[200], + isShowAppBar: true, + baseViewModel: model, + body: model.myDischargeReferralPatient.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( + 'No Discharged Patient', + color: Theme.of(context).errorColor, + ), + ) + ], + ), + ):Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 5,), + Expanded( + child: ListView.builder( + itemCount: model.myDischargeReferralPatient.length, + itemBuilder: (context,index)=>InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: ReferralDischargedPatientDetails(model.myDischargeReferralPatient[index]), + ), + ); + }, + child: PatientReferralItemWidget( + referralStatus: model.getReferralStatusNameByCode(model.myDischargeReferralPatient[index].referralStatus,context), + referralStatusCode: model.myDischargeReferralPatient[index].referralStatus, + patientName: model.myDischargeReferralPatient[index].firstName+" "+model.myDischargeReferralPatient[index].lastName, + patientGender: model.myDischargeReferralPatient[index].gender, + referredDate: DateUtils.getDayMonthYearDateFormatted(model.myDischargeReferralPatient[index].referralDate), + referredTime: DateUtils.getTimeHHMMA(model.myDischargeReferralPatient[index].referralDate), + patientID: "${model.myDischargeReferralPatient[index].patientID}", + isSameBranch: false, + isReferral: true, + isReferralClinic: true, + referralClinic:"${model.myDischargeReferralPatient[index].referringClinicDescription}", + remark: model.myDischargeReferralPatient[index].referringDoctorRemarks, + nationality: model.myDischargeReferralPatient[index].nationalityName, + nationalityFlag: '',//model.myDischargeReferralPatient[index].nationalityFlagURL, //TODO From backend + doctorAvatar: '',//model.myDischargeReferralPatient[index].doctorImageURL, //TODO From backend + referralDoctorName: model.myDischargeReferralPatient[index].referringDoctorName, + clinicDescription: model.myDischargeReferralPatient[index].referringClinicDescription, + infoIcon: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black), + ), + )), + ), + + ], + ), + ), + ), + ); + } + + +} diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 19ae8dd5..8ed61267 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -124,8 +124,8 @@ class RadiologyHomePage extends StatelessWidget { branch: '${model.radiologyList[index].projectName}', clinic: model.radiologyList[index].clinicDescription, appointmentDate: - model.radiologyList[index].orderDate ?? - model.radiologyList[index].reportData, + !isInpatient?model.radiologyList[index].orderDate : + model.radiologyList[index].reportDate, ), )), if (model.radiologyList.isEmpty && diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 0b3613f0..617e17d6 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -182,8 +182,7 @@ class ProcedureScreen extends StatelessWidget { doctorName: doctorNameP, ), ), - if (model.procedureList.length != 0 && - patient.patientStatusType != 43) + if (model.procedureList.isEmpty) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -194,7 +193,7 @@ class ProcedureScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Procedure Found'), + child: AppText('No Procedure Found 0000'), ) ], ), diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 8931972c..a9db021f 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -132,7 +132,7 @@ class PatientProfileButton extends StatelessWidget { 'patientType': patientType, 'arrivalType': arrivalType, 'isInpatient': isInPatient, - 'isDischargedPatient;': isDischargedPatient, + 'isDischargedPatient': isDischargedPatient, }); } } diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart index 62941d86..d622dd0b 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart @@ -105,6 +105,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, nameLine1: "Order", //"Text", nameLine2: "Sheet", //TranslationBase.of(context).orders, icon: 'patient/Progress_notes.png'),