From f708689d0086704a0d6018a858d4a615279cb1a7 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 25 Apr 2021 13:26:44 +0300 Subject: [PATCH] hot fixes --- lib/config/config.dart | 1 + lib/core/model/labs/patient_lab_orders.dart | 2 +- lib/core/model/radiology/final_radiology.dart | 2 +- .../service/DischargedPatientService.dart | 2 +- lib/screens/patients/patients_screen.dart | 2 +- lib/screens/procedures/procedure_screen.dart | 21 +++---------------- lib/util/date-utils.dart | 9 ++++---- ..._header_with_appointment_card_app_bar.dart | 2 +- 8 files changed, 13 insertions(+), 28 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 3d34fd7c..b89089f0 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -241,6 +241,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/GtMyDischargeReferralPatient"; +const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index 62eac5cc..6f989543 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -72,7 +72,7 @@ class PatientLabOrders { PatientLabOrders.fromJson(Map json) { actualDoctorRate = json['ActualDoctorRate']; - clinicDescription = json['ClinicDescription']; + clinicDescription = json['ClinicDescription']?? json['ClinicName']; clinicDescriptionEnglish = json['ClinicDescriptionEnglish']; clinicDescriptionN = json['ClinicDescriptionN']; clinicID = json['ClinicID']; diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index dcf365fe..1d406b81 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -108,7 +108,7 @@ class FinalRadiology { admissionNo = json['AdmissionNo']; isInOutPatient = json['IsInOutPatient']; actualDoctorRate = json['ActualDoctorRate']; - clinicDescription = json['ClinicDescription']; + clinicDescription = json['ClinicDescription']?? json['ClinicName']; dIAPACSURL = json['DIA_PACS_URL']; doctorImageURL = json['DoctorImageURL']; doctorName = json['DoctorName']; diff --git a/lib/core/service/DischargedPatientService.dart b/lib/core/service/DischargedPatientService.dart index 5eb0fabc..63d3f0de 100644 --- a/lib/core/service/DischargedPatientService.dart +++ b/lib/core/service/DischargedPatientService.dart @@ -28,7 +28,7 @@ class DischargedPatientService extends BaseService { body['PatientTypeID'] = 1; hasError = false; myDischargedPatients.clear(); - await baseAppClient.post(GET_MY_DISCHARGE_PATIENT, + await baseAppClient.post(GET_DISCHARGE_PATIENT, onSuccess: (dynamic response, int statusCode) { if (response['List_MyDischargePatient'] != null) { response['List_MyDischargePatient'].forEach((v) { diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 5cffe283..95cf80f5 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -386,7 +386,7 @@ class _PatientsScreenState extends State { }); }, builder: (_, model, w) => AppScaffold( - appBarTitle: patientTypeTitle, + appBarTitle: isSearch? "Search Patient": patientTypeTitle, isShowAppBar: widget.isAppbar, isLoading: _isLoading, body: _isLoading diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 2e729153..2a3a851c 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -183,23 +183,8 @@ class ProcedureScreen extends StatelessWidget { doctorName: doctorNameP, ), ), - if (model.procedureList.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 Procedure Found 0000'), - ) - ], - ), - ), - if (model.state == ViewState.ErrorLocal) + if (model.state == ViewState.ErrorLocal || (model.procedureList.isNotEmpty && model.procedureList[0].entityList.isEmpty)) + Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -210,7 +195,7 @@ class ProcedureScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(22.0), - child: AppText(model.error), + child: AppText(model.procedureList.isEmpty ? model.error: 'No Procedure Found '), ) ], ), diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index fef77333..d380ee93 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -239,16 +239,15 @@ class DateUtils { static DateTime convertStringToDate(String date) { // /Date(1585774800000+0300)/ + if (date != null) { const start = "/Date("; const end = "+0300)"; final startIndex = date.indexOf(start); final endIndex = date.indexOf(end, startIndex + start.length); - return DateTime.fromMillisecondsSinceEpoch( - int.parse( - date.substring(startIndex + start.length, endIndex), - ), - ); + DateTime newDate = DateTime.fromMillisecondsSinceEpoch( + int.parse(date.substring(startIndex + start.length, endIndex),),); + return newDate; } else return DateTime.now(); } diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index 593f18f0..4ec76475 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -367,7 +367,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget AppText(branch ?? '', fontSize: 12) ], ), - if (isPrescriptions) + if (clinic != null) Row( children: [