diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index fb79b5ac..60035ee1 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -668,7 +668,7 @@ class _AppointmentActionsState extends State { context, FadePage( page: VitalSignDetailsScreen( - appointmentNo: appoNo, projectID: projectID))); + appointmentNo: appoNo, projectID: projectID,isNotOneAppointment: false,))); } navigateToInsertComplaint() { diff --git a/lib/pages/insurance/insurance_page.dart b/lib/pages/insurance/insurance_page.dart new file mode 100644 index 00000000..f938d9e5 --- /dev/null +++ b/lib/pages/insurance/insurance_page.dart @@ -0,0 +1,261 @@ +import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../../locator.dart'; +import 'insurance_card_update_details.dart'; + +class InsurancePage extends StatelessWidget { + final InsuranceViewModel model; + InsuranceCardService _insuranceCardService = locator(); + + InsurancePage({Key key, this.model}) : super(key: key); + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + child: Column( + children: [ + SizedBox( + height: 65, + ), + Container( + margin: EdgeInsets.all(10.0), + color: Colors.white, + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + if (model.user != null) + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + model.user.firstName ?? '' + " " + model.user.lastName ?? '', + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ), + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of(context) + .fileno + + ": " + + model.user.patientID + .toString(), + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ) + ], + ), + ), + ), + Expanded( + flex: 2, + child: Container( + margin: EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase.of( + context) + .fetchData, + small: true, + textColor: Colors.white, + onTap: () { + getDetails( + setupID: '010266', + projectID: 15, + patientIdentificationID: + model.user + .patientIdentificationNo, + patientID: model + .user.patientID, + name: model.user + .firstName + + " " + + model + .user.lastName,context: context); + }, + ), + ), + ], + ), + ), + ) + ], + ), + ), + if(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false) + ...List.generate(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, (index) => + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 + ? Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: EdgeInsets.fromLTRB( + 8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Texts( + model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientName, + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ), + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of( + context) + .fileno + + ": " + + model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientID + .toString(), + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ) + ], + ), + ), + ), + Expanded( + flex: 2, + child: Container( + margin: + EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase + .of(context) + .fetchData, + small: true, + textColor: + Colors.white, + onTap: () { + getDetails( + projectID: 15, + patientIdentificationID: model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientIdenficationNumber, + setupID: + '010266', + patientID: model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .responseID, + name: model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index].patientName,context: context); + }, + ), + ), + ], + ), + ), + ) + ], + ), + ), + ), + ) + : Container() + ), + + ], + ), + ); + } + + getDetails( + {String setupID, + int projectID, + String patientIdentificationID, + int patientID, + String name,BuildContext context}) { + GifLoaderDialogUtils.showMyDialog(context); + _insuranceCardService + .getPatientInsuranceDetails( + setupID: setupID, + projectID: projectID, + patientID: patientID, + patientIdentificationID: patientIdentificationID) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) { + Navigator.push( + context, + FadePage( + page: InsuranceCardUpdateDetails( + insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetailsList, + patientID: patientID, + patientIdentificationID: patientIdentificationID, + name: name, + ))); + } else { + AppToast.showErrorToast(message: _insuranceCardService.error); + } + }); + } +} diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index d2d715cb..36b424a8 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'insurance_card_update_details.dart'; +import 'insurance_page.dart'; class InsuranceUpdate extends StatefulWidget { @override @@ -25,7 +26,6 @@ class InsuranceUpdate extends StatefulWidget { class _InsuranceUpdateState extends State with SingleTickerProviderStateMixin { TabController _tabController; - InsuranceCardService _insuranceCardService = locator(); List imagesInfo = List(); @override void initState() { @@ -111,231 +111,7 @@ class _InsuranceUpdateState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - Container( - child: model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList != - null ?? - false - ? ListView.builder( - itemCount: model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList.length, - itemBuilder: (BuildContext context, int index) { - return model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .status == - 3 - ? Container( - margin: EdgeInsets.all(10.0), - child: Card( - margin: EdgeInsets.fromLTRB( - 8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10), - ), - child: Container( - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(10.0), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 2.0, - left: 10.0, - right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Texts( - model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .patientName, - fontSize: 14, - color: Colors.black, - fontWeight: - FontWeight.w500, - ), - SizedBox( - height: 8, - ), - Texts( - TranslationBase.of( - context) - .fileno + - ": " + - model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .patientID - .toString(), - fontSize: 14, - color: Colors.black, - fontWeight: - FontWeight.w500, - ) - ], - ), - ), - ), - Expanded( - flex: 2, - child: Container( - margin: - EdgeInsets.only(top: 2.0), - child: Column( - children: [ - Container( - child: SecondaryButton( - label: TranslationBase - .of(context) - .fetchData, - small: true, - textColor: - Colors.white, - onTap: () { - getDetails( - projectID: 15, - patientIdentificationID: model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .patientIdenficationNumber, - setupID: - '010266', - patientID: model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .responseID, - name: model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .patientName); - }, - ), - ), - ], - ), - ), - ) - ], - ), - ), - ), - ) - : Container(); - }) - : Container( - height: 80, - margin: EdgeInsets.all(10.0), - child: Column( - children: [ - SizedBox( - height: 65, - ), - Container( - color: Colors.white, - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(10.0), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - if (model.user != null) - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 2.0, - left: 10.0, - right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - model.user.firstName ?? - '' + - " " + - model.user.lastName ?? - '', - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ), - SizedBox( - height: 8, - ), - Texts( - TranslationBase.of(context) - .fileno + - ": " + - model.user.patientID - .toString(), - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ) - ], - ), - ), - ), - Expanded( - flex: 2, - child: Container( - margin: EdgeInsets.only(top: 2.0), - child: Column( - children: [ - Container( - child: SecondaryButton( - label: TranslationBase.of( - context) - .fetchData, - small: true, - textColor: Colors.white, - onTap: () { - getDetails( - setupID: '010266', - projectID: 15, - patientIdentificationID: - model.user - .patientIdentificationNo, - patientID: model - .user.patientID, - name: model.user - .firstName + - " " + - model - .user.lastName); - }, - ), - ), - ], - ), - ), - ) - ], - ), - ), - ], - ), - ), - ), + InsurancePage(model:model), Container( child: ListView.builder( itemCount: model.insuranceUpdate == null @@ -452,34 +228,5 @@ class _InsuranceUpdateState extends State ); } - getDetails( - {String setupID, - int projectID, - String patientIdentificationID, - int patientID, - String name}) { - GifLoaderDialogUtils.showMyDialog(context); - _insuranceCardService - .getPatientInsuranceDetails( - setupID: setupID, - projectID: projectID, - patientID: patientID, - patientIdentificationID: patientIdentificationID) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) { - Navigator.push( - context, - FadePage( - page: InsuranceCardUpdateDetails( - insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetailsList, - patientID: patientID, - patientIdentificationID: patientIdentificationID, - name: name, - ))); - } else { - AppToast.showErrorToast(message: _insuranceCardService.error); - } - }); - } + } diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index f923c610..7eb0b5ba 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -222,16 +222,16 @@ class _MedicalProfilePageState extends State { Navigator.push( context, FadePage( - page: DoctorHomePage(), + page: HomePrescriptionsPage(), ), ); }, child: MedicalProfileItem( title: TranslationBase.of(context) - .myDoctor, - imagePath: 'doctor_icon.png', + .medicines, + imagePath: 'prescription_icon.png', subTitle: TranslationBase.of(context) - .myDoctorSubtitle, + .medicinesSubtitle, ), ), ), @@ -239,19 +239,15 @@ class _MedicalProfilePageState extends State { flex: 1, child: InkWell( onTap: () { - Navigator.push( - context, - FadePage( - page: HomePrescriptionsPage(), - ), - ); + Navigator.push(context, + FadePage(page: VitalSignDetailsScreen())); }, child: MedicalProfileItem( title: TranslationBase.of(context) - .medicines, - imagePath: 'prescription_icon.png', + .vitalSigns, + imagePath: 'vital_sign_icon.png', subTitle: TranslationBase.of(context) - .medicinesSubtitle, + .vitalSignsSubtitle, ), ), ), @@ -260,14 +256,14 @@ class _MedicalProfilePageState extends State { child: InkWell( onTap: () { Navigator.push(context, - FadePage(page: InsuranceCard())); + FadePage(page: HomeReportPage())); }, child: MedicalProfileItem( - title: TranslationBase.of(context) - .insurance, - imagePath: 'insurance_card_icon.png', + title: + TranslationBase.of(context).medical, + imagePath: 'medical_reports_icon.png', subTitle: TranslationBase.of(context) - .insuranceSubtitle, + .medicalSubtitle, ), ), ), @@ -275,6 +271,26 @@ class _MedicalProfilePageState extends State { ), Row( children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: DoctorHomePage(), + ), + ); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context) + .myDoctor, + imagePath: 'doctor_icon.png', + subTitle: TranslationBase.of(context) + .myDoctorSubtitle, + ), + ), + ), Expanded( flex: 1, child: InkWell( @@ -306,25 +322,7 @@ class _MedicalProfilePageState extends State { ), ), ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: InsuranceApproval())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context) - .insuranceApproval, - imagePath: - 'insurance_approvals_icon.png', - subTitle: TranslationBase.of(context) - .insuranceApprovalSubtitle, - ), - ), - ), + ], ), Row(children: [ @@ -333,14 +331,14 @@ class _MedicalProfilePageState extends State { child: InkWell( onTap: () { Navigator.push(context, - FadePage(page: HomeReportPage())); + FadePage(page: InsuranceCard())); }, child: MedicalProfileItem( - title: - TranslationBase.of(context).medical, - imagePath: 'medical_reports_icon.png', + title: TranslationBase.of(context) + .insurance, + imagePath: 'insurance_card_icon.png', subTitle: TranslationBase.of(context) - .medicalSubtitle, + .insuranceSubtitle, ), ), ), @@ -364,15 +362,18 @@ class _MedicalProfilePageState extends State { flex: 1, child: InkWell( onTap: () { - Navigator.push(context, - FadePage(page: VitalSignDetailsScreen())); + Navigator.push( + context, + FadePage( + page: InsuranceApproval())); }, child: MedicalProfileItem( title: TranslationBase.of(context) - .vitalSigns, - imagePath: 'vital_sign_icon.png', + .insuranceApproval, + imagePath: + 'insurance_approvals_icon.png', subTitle: TranslationBase.of(context) - .vitalSignsSubtitle, + .insuranceApprovalSubtitle, ), ), ), diff --git a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart index 416074f2..b1c6df76 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart @@ -17,7 +17,8 @@ class VitalSignDetailsScreen extends StatelessWidget { int appointmentNo; int projectID; - VitalSignDetailsScreen({this.appointmentNo, this.projectID}); + bool isNotOneAppointment; + VitalSignDetailsScreen({this.appointmentNo, this.projectID,this.isNotOneAppointment=true}); List imagesInfo = List(); @@ -43,7 +44,7 @@ class VitalSignDetailsScreen extends StatelessWidget { Row( children: [ InkWell( - onTap: () => Navigator.push( + onTap: () =>isNotOneAppointment? Navigator.push( context, FadePage( page: VitalSignItemDetailsScreen( @@ -52,7 +53,7 @@ class VitalSignDetailsScreen extends StatelessWidget { vitalList: mode.vitalSignResModelList, ), ), - ), + ):null, child: Container( child: VitalSignItem( des: TranslationBase.of(context).height, @@ -67,7 +68,7 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ), InkWell( - onTap: () => Navigator.push( + onTap: () => isNotOneAppointment ? Navigator.push( context, FadePage( page: VitalSignItemDetailsScreen( @@ -76,7 +77,7 @@ class VitalSignDetailsScreen extends StatelessWidget { vitalList: mode.vitalSignResModelList, ), ), - ), + ):null, child: VitalSignItem( des: TranslationBase.of(context).weight, icon: DQIcons.weight_scale, @@ -93,7 +94,7 @@ class VitalSignDetailsScreen extends StatelessWidget { Row( children: [ InkWell( - onTap: () => Navigator.push( + onTap: () => isNotOneAppointment ? Navigator.push( context, FadePage( page: VitalSignItemDetailsScreen( @@ -103,7 +104,7 @@ class VitalSignDetailsScreen extends StatelessWidget { vitalList: mode.vitalSignResModelList, ), ), - ), + ): null, child: VitalSignItem( des: TranslationBase.of(context).body, icon: DQIcons.bmi, @@ -114,7 +115,7 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ), InkWell( - onTap: () => Navigator.push( + onTap: () => isNotOneAppointment ? Navigator.push( context, FadePage( page: VitalSignItemDetailsScreen( @@ -124,7 +125,7 @@ class VitalSignDetailsScreen extends StatelessWidget { vitalList: mode.vitalSignResModelList, ), ), - ), + ):null, child: Container( child: VitalSignItem( des: TranslationBase.of(context).temperature, @@ -141,7 +142,7 @@ class VitalSignDetailsScreen extends StatelessWidget { Row( children: [ InkWell( - onTap: () => Navigator.push( + onTap: () => isNotOneAppointment ? Navigator.push( context, FadePage( page: VitalSignItemDetailsScreen( @@ -150,7 +151,7 @@ class VitalSignDetailsScreen extends StatelessWidget { vitalList: mode.vitalSignResModelList, ), ), - ), + ):null, child: VitalSignItem( des: TranslationBase.of(context).heart, icon: DQIcons.heart, @@ -163,7 +164,7 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ), InkWell( - onTap: () => Navigator.push( + onTap: () => isNotOneAppointment ? Navigator.push( context, FadePage( page: VitalSignItemDetailsScreen( @@ -173,7 +174,7 @@ class VitalSignDetailsScreen extends StatelessWidget { vitalList: mode.vitalSignResModelList, ), ), - ), + ):null, child: VitalSignItem( des: TranslationBase.of(context).respirationRate, icon: DQIcons.outline, @@ -191,7 +192,7 @@ class VitalSignDetailsScreen extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ InkWell( - onTap: () => Navigator.push( + onTap: () => isNotOneAppointment ? Navigator.push( context, FadePage( page: VitalSignItemDetailsScreen( @@ -200,7 +201,7 @@ class VitalSignDetailsScreen extends StatelessWidget { vitalList: mode.vitalSignResModelList, ), ), - ), + ):null, child: VitalSignItem( des: TranslationBase.of(context).bloodPressure, icon: DQIcons.blood_pressure,