From 1d09bcf2515bb95e2b054317e62ed3d8624f308b Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 22 Apr 2021 23:12:11 +0300 Subject: [PATCH] hot fixes --- .../insurance_approval_screen_patient.dart | 4 +- .../patients/insurance_approvals_details.dart | 4 +- .../radiology/radiology_home_page.dart | 87 ++++++++++--------- .../prescription/prescriptions_page.dart | 18 ++-- lib/screens/procedures/procedure_screen.dart | 6 +- ...rofile_medical_info_widget_in_patient.dart | 8 +- .../profile_medical_info_widget_search.dart | 37 ++++---- 7 files changed, 85 insertions(+), 79 deletions(-) diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 7baa1330..46218594 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -40,7 +40,7 @@ class _InsuranceApprovalScreenNewState String patientType = routeArgs['patientType']; return BaseView( - onModelReady: patientType == "1" + onModelReady: patient.admissionNo != null ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, @@ -54,7 +54,7 @@ class _InsuranceApprovalScreenNewState isShowAppBar: true, baseViewModel: model, appBarTitle: TranslationBase.of(context).approvals, - body: patientType == "1" + body: patient.admissionNo != null ? SingleChildScrollView( child: Container( margin: EdgeInsets.only( diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 1fb13465..1bd00cd6 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -43,7 +43,7 @@ class _InsuranceApprovalsDetailsState extends State { return BaseView( onModelReady: (model) => model.insuranceApprovalInPatient.length == 0 - ? patientType == "1" + ? patient.admissionNo != null ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, @@ -57,7 +57,7 @@ class _InsuranceApprovalsDetailsState extends State { baseViewModel: model, appBar: PatientProfileHeaderNewDesignAppBar( patient, patient.patientType.toString(), patient.arrivedOn), - body: patientType == "1" + body: patient.admissionNo != null ? SingleChildScrollView( child: Container( child: Column( diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index b282a017..cb05d8a6 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -30,7 +30,8 @@ class RadiologyHomePage extends StatelessWidget { String arrivalType = routeArgs['arrivalType']; return BaseView( - onModelReady: (model) => model.getPatientRadOrders(patient,patientType: patientType), + onModelReady: (model) => + model.getPatientRadOrders(patient, patientType: patientType), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], @@ -46,27 +47,29 @@ class RadiologyHomePage extends StatelessWidget { SizedBox( height: 12, ), - if(model.radiologyList.isNotEmpty && patient.patientStatusType != 43) + if (model.radiologyList.isNotEmpty && + patient.patientStatusType != 43) Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Radiology', - style: "caption2", - color: Colors.black, - fontSize: 13, - ), - AppText( - 'Result', - bold: true, - fontSize: 22, - ), - ], + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Radiology', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + AppText( + 'Result', + bold: true, + fontSize: 22, + ), + ], + ), ), - ), - if(patient.patientStatusType == 43) + if (patient.patientStatusType != null && + patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -86,19 +89,21 @@ class RadiologyHomePage extends StatelessWidget { ], ), ), - if (patientType != null && - patientType == '7' && + if (patient.patientStatusType != null && patient.patientStatusType == 43) - AddNewOrder( onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => AddSelectedRadiologyOrder( - patient: patient, - model: model, - )), - ); - },label: 'Apply for Radiology Order',), + AddNewOrder( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddSelectedRadiologyOrder( + patient: patient, + model: model, + )), + ); + }, + label: 'Apply for Radiology Order', + ), ...List.generate( model.radiologyList.length, (index) => InkWell( @@ -111,27 +116,31 @@ class RadiologyHomePage extends StatelessWidget { ), ), ), - child: DoctorCard( + child: DoctorCard( doctorName: model.radiologyList[index].doctorName, profileUrl: model.radiologyList[index].doctorImageURL, invoiceNO: '${model.radiologyList[index].invoiceNo}', branch: '${model.radiologyList[index].projectName}', clinic: model.radiologyList[index].clinicDescription, - appointmentDate: model.radiologyList[index].orderDate ?? model.radiologyList[index].reportData, - ), - )), - if(model.radiologyList.isEmpty && patient.patientStatusType != 43) + appointmentDate: + model.radiologyList[index].orderDate ?? + model.radiologyList[index].reportData, + ), + )), + if (model.radiologyList.isEmpty && + patient.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox(height: 100,), + SizedBox( + height: 100, + ), Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), child: AppText('No Radiology Found'), ) - ], ), ) diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index c0eae3c4..ca2196e3 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -31,16 +31,17 @@ class PrescriptionsPage extends StatelessWidget { String arrivalType = routeArgs['arrivalType']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => patientType == "1" - ? model.getPrescriptionsInPatient(patient) - : model.getPrescriptions(patient, patientType: patientType), + onModelReady: (model) => + patient.admissionNo != null && patient.admissionNo != "0" + ? model.getPrescriptionsInPatient(patient) + : model.getPrescriptions(patient, patientType: patientType), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, backgroundColor: Colors.grey[100], appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType ?? '0', arrivalType), - body: patientType != "1" + body: patient.admissionNo == null ? FractionallySizedBox( widthFactor: 1.0, child: ListView( @@ -70,7 +71,8 @@ class PrescriptionsPage extends StatelessWidget { ], ), ), - if (patient.patientStatusType == 43) + if (patient.patientStatusType != null && + patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -90,8 +92,7 @@ class PrescriptionsPage extends StatelessWidget { ], ), ), - if (patientType != null && - patientType == '7' && + if (patient.patientStatusType != null && patient.patientStatusType == 43) AddNewOrder( onTap: () { @@ -211,7 +212,8 @@ class PrescriptionsPage extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Prescriptions Found'), + child: AppText( + 'No Prescriptions Found In Patentiss'), ) ], ), diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 1371df83..0b3613f0 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -69,7 +69,8 @@ class ProcedureScreen extends StatelessWidget { ], ), ), - if (patient.patientStatusType == 43) + if (patient.patientStatusType != null && + patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -89,8 +90,7 @@ class ProcedureScreen extends StatelessWidget { ], ), ), - if (patientType != null && - patientType == '7' && + if (patient.patientStatusType != null && patient.patientStatusType == 43) InkWell( onTap: () { 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 d5764203..95c7630c 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 @@ -96,8 +96,8 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ORDER_NOTE, - nameLine1:"Order", //"Text", - nameLine2: "Sheet",//TranslationBase.of(context).orders, + nameLine1: "Order", //"Text", + nameLine2: "Sheet", //TranslationBase.of(context).orders, icon: 'patient/Progress_notes.png'), PatientProfileButton( key: key, @@ -126,9 +126,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { arrivalType: arrivalType, isDisable: true, route: MEDICAL_FILE, - nameLine1: "Medical",//Health + nameLine1: "Medical", //Health //TranslationBase.of(context).medicalReport, - nameLine2: "Report",//Report + nameLine2: "Report", //Report //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), PatientProfileButton( diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index 1fe35706..a9ca3d5f 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -51,8 +51,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: MEDICAL_FILE, - nameLine1: "Health" ,//TranslationBase.of(context).medicalReport, - nameLine2: "Summary",//TranslationBase.of(context).summaryReport, + nameLine1: "Health", //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), PatientProfileButton( key: key, @@ -127,7 +127,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'patient/patient_sick_leave.png'), - if (patient.admissionNo!=null && patient.admissionNo!="0") + if (patient.admissionNo != null && patient.admissionNo != "0") PatientProfileButton( key: key, patient: patient, @@ -137,32 +137,27 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'patient/Progress_notes.png'), - - if (patient.admissionNo!=null && patient.admissionNo!="0") + if (patient.admissionNo != null && patient.admissionNo != "0") PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, route: ORDER_NOTE, - nameLine1:"Order", //"Text", + nameLine1: "Order", //"Text", nameLine2: "Sheet", icon: 'patient/Progress_notes.png'), - - if (patient.appointmentNo!=null && patient.appointmentNo!=0) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - // isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - - - + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + // isDisable: patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), ], ), );