From bfd36b1c77321a2f594c4816f720b27db0e9050b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 19:04:39 +0300 Subject: [PATCH] fix scrolling step 3 --- .../profile/patient_profile_screen.dart | 1469 ++++++++++++----- 1 file changed, 1019 insertions(+), 450 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 6d7a7845..3c2fab57 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -16,13 +16,13 @@ import 'package:flutter/material.dart'; import '../../../routes.dart'; - class PatientProfileScreen extends StatefulWidget { @override _PatientProfileScreenState createState() => _PatientProfileScreenState(); } -class _PatientProfileScreenState extends Statewith SingleTickerProviderStateMixin { +class _PatientProfileScreenState extends State + with SingleTickerProviderStateMixin { PatiantInformtion patient; bool isFromSearch = false; @@ -39,9 +39,10 @@ class _PatientProfileScreenState extends Statewith SingleT int _activeTab = 0; @override void initState() { - _tabController = TabController(length: 2,vsync:this); + _tabController = TabController(length: 2, vsync: this); super.initState(); } + @override void dispose() { _tabController.dispose(); @@ -52,11 +53,11 @@ class _PatientProfileScreenState extends Statewith SingleT void didChangeDependencies() { super.didChangeDependencies(); final routeArgs = ModalRoute.of(context).settings.arguments as Map; - patient = routeArgs['patient']; - patientType = routeArgs['patientType']; - arrivalType = routeArgs['arrivalType']; - from = routeArgs['from']; - to = routeArgs['to']; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + from = routeArgs['from']; + to = routeArgs['to']; if (routeArgs.containsKey("isSearch")) { isFromSearch = routeArgs['isSearch']; } @@ -66,7 +67,7 @@ class _PatientProfileScreenState extends Statewith SingleT if (routeArgs.containsKey("isDischargedPatient")) { isDischargedPatient = routeArgs['isDischargedPatient']; } - if(isInpatient) + if (isInpatient) _activeTab = 0; else _activeTab = 1; @@ -78,47 +79,55 @@ class _PatientProfileScreenState extends Statewith SingleT return BaseView( builder: (_, patientViewModel, w) => AppScaffold( baseViewModel: patientViewModel, - appBarTitle: TranslationBase.of(context).patientProfile, - isShowAppBar: false,//TODO fix button location - // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), + appBarTitle: TranslationBase + .of(context) + .patientProfile, + isShowAppBar: false, + //TODO fix button location + // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), body: Column( children: [ Stack( children: [ Column( children: [ - PatientProfileHeaderNewDesignAppBar( - patient, - arrivalType ?? '0', - patientType, - isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : 0, - ), - Container( - height: MediaQuery.of(context).size.height *0.69, + PatientProfileHeaderNewDesignAppBar( + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : 0, + ), + if(isFromSearch) + tabsBar(context, screenSize), + Container( + height: isFromSearch ? MediaQuery + .of(context) + .size + .height * 0.60 : MediaQuery + .of(context) + .size + .height * 0.69, + child: ListView( + children: [ + Container( + child: isFromSearch + ? Column( + children: [ - child: ListView( - children: [ - Container( - child: isFromSearch - ? Column( - children: [ - tabsBar(context, screenSize), - SizedBox( - height: 10, - ), - if (_activeTab == 0) - Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + if (_activeTab == 0) + Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: + NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, childAspectRatio: 1 / 1.0, @@ -126,286 +135,584 @@ class _PatientProfileScreenState extends Statewith SingleT children: [ PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: + VITAL_SIGN_DETAILS, isInPatient: true, - icon: 'patient/vital_signs.png'), + icon: + 'patient/vital_signs.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: LAB_RESULT, isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), + patientType: + patientType, + arrivalType: + arrivalType, + isInPatient: + isInpatient, + route: + RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: _activeTab==0, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + isSelectInpatient: + _activeTab == 0, + isInPatient: + isInpatient, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), + isDischargedPatient: + isDischargedPatient, + nameLine1: + TranslationBase + .of( + context) + .progress, + nameLine2: + TranslationBase + .of( + context) + .note, + icon: + 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", + isDischargedPatient: + isDischargedPatient, + nameLine1: + "Order", + //"Text", nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), + "Sheet", + //TranslationBase.of(context).orders, + icon: + 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), + isInPatient: + isInpatient, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: MEDICAL_FILE, nameLine1: "Health", - isInPatient: isInpatient, + isInPatient: + isInpatient, nameLine2: "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, isDisable: true, route: MEDICAL_FILE, - nameLine1: "Medical", //Health - isInPatient: isInpatient, - nameLine2: "Report", //Report + nameLine1: + "Medical", + //Health + isInPatient: + isInpatient, + nameLine2: + "Report", + //Report //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, + patientType: + patientType, + arrivalType: + arrivalType, + route: + REFER_IN_PATIENT_TO_DOCTOR, isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), + isDisable: + isDischargedPatient || + isFromSearch, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .approvals, + icon: + 'patient/vital_signs.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, isDisable: true, route: null, nameLine1: "Discharge", nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), + icon: + 'patient/patient_sick_leave.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), ], ), ), - if(_activeTab==1) + if (_activeTab == 1) Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), child: GridView.count( shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, childAspectRatio: 1 / 1.0, crossAxisCount: 3, children: [ PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: + VITAL_SIGN_DETAILS, + icon: + 'patient/vital_signs.png'), // if (selectedPatientType != 7) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: MEDICAL_FILE, nameLine1: - "Health", //TranslationBase.of(context).medicalReport, + "Health", + //TranslationBase.of(context).medicalReport, nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), + patientType: + patientType, + arrivalType: + arrivalType, + isInPatient: + isInpatient, + route: + RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/health_summary.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, + nameLine1: + TranslationBase + .of( + context) + .patient, nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), + icon: + 'patient/patient_sick_leave.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/vital_signs.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_UCAF_REQUEST, isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .ucaf, + icon: + 'patient/ucaf.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, 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) + 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( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_ADMISSION_REQUEST, + isDisable: patient + .patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .admission, + nameLine2: + TranslationBase + .of( + context) + .request, + icon: + 'patient/admission_req.png'), ], ), ), ], - ):isInpatient? - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + ) + : isInpatient + ? Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), child: GridView.count( shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, childAspectRatio: 1 / 1.0, @@ -417,69 +724,130 @@ class _PatientProfileScreenState extends Statewith SingleT arrivalType: arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, route: VITAL_SIGN_DETAILS, isInPatient: true, - icon: 'patient/vital_signs.png'), + icon: + 'patient/vital_signs.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: LAB_RESULT, isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, isInPatient: isInpatient, route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, isInPatient: isInpatient, patientType: patientType, arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient :true, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + route: + ORDER_PRESCRIPTION_NEW, + isSelectInpatient: true, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: PROGRESS_NOTE, isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), + isDischargedPatient: + isDischargedPatient, + nameLine1: + TranslationBase + .of( + context) + .progress, + nameLine2: + TranslationBase + .of( + context) + .note, + icon: + 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, isInPatient: isInpatient, patientType: patientType, arrivalType: arrivalType, route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", + isDischargedPatient: + isDischargedPatient, + nameLine1: + "Order", + //"Text", nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), + "Sheet", + //TranslationBase.of(context).orders, + icon: + 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: ORDER_PROCEDURE, isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), PatientProfileButton( patient: patient, patientType: patientType, @@ -489,36 +857,64 @@ class _PatientProfileScreenState extends Statewith SingleT isInPatient: isInpatient, nameLine2: "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, isDisable: true, route: MEDICAL_FILE, - nameLine1: "Medical", //Health + nameLine1: + "Medical", + //Health isInPatient: isInpatient, - nameLine2: "Report", //Report + nameLine2: + "Report", + //Report //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, + route: + REFER_IN_PATIENT_TO_DOCTOR, isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), + isDisable: + isDischargedPatient || + isFromSearch, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .approvals, + icon: + 'patient/vital_signs.png'), PatientProfileButton( isInPatient: isInpatient, patient: patient, @@ -528,271 +924,448 @@ class _PatientProfileScreenState extends Statewith SingleT route: null, nameLine1: "Discharge", nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), + icon: + 'patient/patient_sick_leave.png'), PatientProfileButton( isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), ], ), - ): - Column( + ) + : Column( children: [ Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + padding: const EdgeInsets + .symmetric( + vertical: 15.0, + horizontal: 15), child: GridView.count( shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, childAspectRatio: 1 / 1.0, crossAxisCount: 3, children: [ PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: + VITAL_SIGN_DETAILS, + icon: + 'patient/vital_signs.png'), // if (selectedPatientType != 7) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: MEDICAL_FILE, nameLine1: - "Health", //TranslationBase.of(context).medicalReport, + "Health", + //TranslationBase.of(context).medicalReport, nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), + patientType: + patientType, + arrivalType: + arrivalType, + isInPatient: + isInpatient, + route: + RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/health_summary.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, + nameLine1: + TranslationBase + .of( + context) + .patient, nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), + icon: + 'patient/patient_sick_leave.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: false, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + isSelectInpatient: + false, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PROCEDURE, + isInPatient: + isInpatient, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/vital_signs.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_UCAF_REQUEST, isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .ucaf, + icon: + 'patient/ucaf.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, 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) + 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( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_ADMISSION_REQUEST, isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .admission, + nameLine2: + TranslationBase + .of( + context) + .request, + icon: + 'patient/admission_req.png'), ], ), ), ], + ), + ), + ], ), ), - ], - ), - ), ], ), - if (patient.patientStatusType != null && patient.patientStatusType == 43) BaseView( onModelReady: (model) async {}, - builder: (_, model, w) => Positioned( - top: 180, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( - title: - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/create-episod.png", - color: Colors.white, - height: 30, - ), - onPressed: () async { - if (patient.patientStatusType == 43) { - PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); - GifLoaderDialogUtils.showMyDialog( - context); - await model.postEpisode( - postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog( - context); - patient.episodeNo = model.episodeID; - Navigator.of(context).pushNamed( - CREATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }, - ), - if (patient.episodeNo != 0) - AppButton( - title: - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, + builder: (_, model, w) => + Positioned( + top: 180, + left: 20, + right: 20, + child: Row( + children: [ + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase + .of(context) + .createNew}\n${TranslationBase + .of(context) + .episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + onPressed: () async { + if (patient.patientStatusType == + 43) { + PostEpisodeReqModel + postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: + patient.appointmentNo, + patientMRN: + patient.patientMRN); + GifLoaderDialogUtils.showMyDialog( + context); + await model.postEpisode( + postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog( + context); + patient.episodeNo = + model.episodeID; + Navigator.of(context).pushNamed( + CREATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }, ), - onPressed: () { - if (patient.patientStatusType == - 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }), - ], - ), - )), - + if (patient.episodeNo != 0) + AppButton( + title: + "${TranslationBase + .of(context) + .update}\n${TranslationBase + .of(context) + .episode}", + color: + patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/modilfy-episode.png", + color: Colors.white, + height: 30, + ), + onPressed: () { + if (patient.patientStatusType == + 43) { + Navigator.of(context).pushNamed( + UPDATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }), + ], + ), + )), ], ), - ], ), )); } - - Widget tabsBar( - BuildContext context, Size screenSize ) { + Widget tabsBar(BuildContext context, Size screenSize) { List _tabs = [ "Inpatient Info".toUpperCase(), "Outpatient Info".toUpperCase(), @@ -815,7 +1388,6 @@ class _PatientProfileScreenState extends Statewith SingleT setState(() { _activeTab = _tabs.indexOf(item); }); - }, child: Center( child: Container( @@ -843,7 +1415,6 @@ class _PatientProfileScreenState extends Statewith SingleT ), ); } - } class AvatarWidget extends StatelessWidget { @@ -868,5 +1439,3 @@ class AvatarWidget extends StatelessWidget { ); } } - -