From 288bef5a5ff2f7080a317877932f8f0e12d124b4 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 19 Sep 2021 11:30:31 +0300 Subject: [PATCH] fix all special result --- lib/config/config.dart | 4 +- .../lab_order/labs_service.dart | 3 +- .../all_lab_special_result_page.dart | 133 +++++++++--------- .../profile_gird_for_InPatient.dart | 84 +++-------- .../profile_gird_for_other.dart | 2 +- .../profile_gird_for_search.dart | 2 +- .../profile/profile_medical_info_widget.dart | 2 +- pubspec.lock | 6 +- 8 files changed, 100 insertions(+), 136 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 407d4ff6..b8e34330 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index dd6b91d6..0a10eb31 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -211,7 +211,8 @@ class LabsService extends BaseService { _allSpecialLab.clear(); await baseAppClient.post(ALL_SPECIAL_LAB_RESULT, onSuccess: (dynamic response, int statusCode) { response['ListPLSRALL'].forEach((lab) { - _allSpecialLab.add(AllSpecialLabResultModel.fromJson(lab)); + var labs = AllSpecialLabResultModel.fromJson(lab); + if (labs.invoiceNo != "0") _allSpecialLab.add(AllSpecialLabResultModel.fromJson(lab)); }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index 468c2d76..31746051 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -82,75 +82,78 @@ class _AllLabSpecialResultState extends State { ], ), ), - ...List.generate( - model.allSpecialLabList.length, - (index) => Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(8.0), - ), - color: Colors.white), - child: Row( - children: [ - Container( - width: 20, - height: 160, - decoration: BoxDecoration( - color: model.allSpecialLabList[index].isLiveCareAppointment - ? Colors.red[900] - : !model.allSpecialLabList[index].isInOutPatient - ? Colors.black - : Color(0xffa9a089), - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), - bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), - topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), - bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), - ), - child: RotatedBox( - quarterTurns: 3, - child: Center( - child: Text( - model.allSpecialLabList[index].isLiveCareAppointment - ? TranslationBase.of(context).liveCare.toUpperCase() - : !model.allSpecialLabList[index].isInOutPatient - ? TranslationBase.of(context).inPatientLabel.toUpperCase() - : TranslationBase.of(context).outpatient.toUpperCase(), - style: TextStyle(color: Colors.white), - ), - )), - ), - Expanded( - child: DoctorCard( - isNoMargin: true, - onTap: () => Navigator.push( - context, - FadePage( - page: SpecialLabResultDetailsPage( - resultData: model.allSpecialLabList[index].resultDataHTML, - patient: patient, + ListView.builder( + itemCount: model.allSpecialLabList.length, + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), + child: Row( + children: [ + Container( + width: 20, + height: 160, + decoration: BoxDecoration( + color: model.allSpecialLabList[index].isLiveCareAppointment + ? Colors.red[900] + : !model.allSpecialLabList[index].isInOutPatient + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), + bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + model.allSpecialLabList[index].isLiveCareAppointment + ? TranslationBase.of(context).liveCare.toUpperCase() + : !model.allSpecialLabList[index].isInOutPatient + ? TranslationBase.of(context).inPatientLabel.toUpperCase() + : TranslationBase.of(context).outpatient.toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), + ), + Expanded( + child: DoctorCard( + isNoMargin: true, + onTap: () => Navigator.push( + context, + FadePage( + page: SpecialLabResultDetailsPage( + resultData: model.allSpecialLabList[index].resultDataHTML, + patient: patient, + ), + ), ), + doctorName: model.allSpecialLabList[index].doctorName, + invoiceNO: ' ${model.allSpecialLabList[index].invoiceNo}', + profileUrl: model.allSpecialLabList[index].doctorImageURL, + branch: model.allSpecialLabList[index].projectName, + clinic: model.allSpecialLabList[index].clinicDescription, + appointmentDate: model.allSpecialLabList[index].orderDate, + orderNo: model.allSpecialLabList[index].orderNo, + isShowTime: false, ), ), - doctorName: model.allSpecialLabList[index].doctorName, - invoiceNO: ' ${model.allSpecialLabList[index].invoiceNo}', - profileUrl: model.allSpecialLabList[index].doctorImageURL, - branch: model.allSpecialLabList[index].projectName, - clinic: model.allSpecialLabList[index].clinicDescription, - appointmentDate: model.allSpecialLabList[index].orderDate, - orderNo: model.allSpecialLabList[index].orderNo, - isShowTime: false, - ), + ], ), - ], - ), - ), - ), + ); + }), if (model.allSpecialLabList.isEmpty && patient.patientStatusType != 43) Center( child: Column( diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index f1d29ffb..5ac21f91 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -35,69 +35,36 @@ class ProfileGridForInPatient extends StatelessWidget { @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel( - TranslationBase.of(context).vital, - TranslationBase.of(context).signs, - VITAL_SIGN_DETAILS, + PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).result, - LAB_RESULT, - 'patient/lab_results.png', + TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).specialResult, - ALL_SPECIAL_LAB_RESULT, - 'patient/lab_results.png', + PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, + ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).radiology, - TranslationBase.of(context).result, - RADIOLOGY_PATIENT, - 'patient/health_summary.png', + PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).result, + RADIOLOGY_PATIENT, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).prescription, - ORDER_PRESCRIPTION_NEW, - 'patient/order_prescription.png', + PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription, + ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).progress, - TranslationBase.of(context).note, - PROGRESS_NOTE, + PatientProfileCardModel(TranslationBase.of(context).progress, TranslationBase.of(context).note, PROGRESS_NOTE, 'patient/Progress_notes.png', - isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient), - PatientProfileCardModel( - TranslationBase.of(context).order, - TranslationBase.of(context).sheet, - ORDER_NOTE, + isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), + PatientProfileCardModel(TranslationBase.of(context).order, TranslationBase.of(context).sheet, ORDER_NOTE, 'patient/Progress_notes.png', - isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, - ORDER_PROCEDURE, - 'patient/Order_Procedures.png', + isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), + PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, + ORDER_PROCEDURE, 'patient/Order_Procedures.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, - HEALTH_SUMMARY, + PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).medical, - TranslationBase.of(context).report, - PATIENT_MEDICAL_REPORT, - 'patient/health_summary.png', - isInPatient: isInpatient, - isDisable: false), + PatientProfileCardModel(TranslationBase.of(context).medical, TranslationBase.of(context).report, + PATIENT_MEDICAL_REPORT, 'patient/health_summary.png', + isInPatient: isInpatient, isDisable: false), PatientProfileCardModel( TranslationBase.of(context).referral, TranslationBase.of(context).patient, @@ -106,19 +73,12 @@ class ProfileGridForInPatient extends StatelessWidget { isInPatient: isInpatient, isDisable: isDischargedPatient || isFromSearch, ), - PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).approvals, - PATIENT_INSURANCE_APPROVALS_NEW, - 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).approvals, + PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).discharge, - TranslationBase.of(context).report, - null, + PatientProfileCardModel(TranslationBase.of(context).discharge, TranslationBase.of(context).report, null, 'patient/patient_sick_leave.png', - isInPatient: isInpatient, - isDisable: true), + isInPatient: isInpatient, isDisable: true), PatientProfileCardModel( TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index 1b3ab187..a374898c 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -39,7 +39,7 @@ class ProfileGridForOther extends StatelessWidget { PatientProfileCardModel( TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).specialResult, + PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index 09637c00..5bcc398d 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -29,7 +29,7 @@ class ProfileGridForSearch extends StatelessWidget { PatientProfileCardModel( TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).specialResult, + PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 14469581..a7832481 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -67,7 +67,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { arrivalType: arrivalType, route: ALL_SPECIAL_LAB_RESULT, nameLine1: TranslationBase.of(context).lab, - nameLine2: 'Special Result', + nameLine2: TranslationBase.of(context).special, icon: 'patient/lab_results.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( diff --git a/pubspec.lock b/pubspec.lock index e2215d0c..0229e774 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -664,7 +664,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -956,7 +956,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" sticky_headers: dependency: "direct main" description: @@ -1154,5 +1154,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0"