From f9b8191a5ee480c681e58eeaf576dff683d8bc3e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 16 Mar 2021 15:21:21 +0200 Subject: [PATCH] jira bugs --- lib/config/config.dart | 20 +- lib/core/service/client/base_app_client.dart | 46 ++- lib/pages/insurance/insurance_page.dart | 291 +++++++++--------- .../insurance/insurance_update_screen.dart | 10 +- 4 files changed, 176 insertions(+), 191 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0f8df420..c8ad92ef 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -95,9 +95,12 @@ const GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; ///ED Online -const ER_GET_VISUAL_TRIAGE_QUESTIONS = "services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; -const ER_SAVE_TRIAGE_INFORMATION = "services/Doctors.svc/REST/ER_SaveTriageInformation"; -const ER_GetPatientPaymentInformationForERClinic = "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic"; +const ER_GET_VISUAL_TRIAGE_QUESTIONS = + "services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; +const ER_SAVE_TRIAGE_INFORMATION = + "services/Doctors.svc/REST/ER_SaveTriageInformation"; +const ER_GetPatientPaymentInformationForERClinic = + "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic"; ///Er Nearest const GET_AMBULANCE_REQUEST = @@ -312,7 +315,7 @@ var DEVICE_TOKEN = ""; var IS_VOICE_COMMAND_CLOSED = false; var IS_TEXT_COMPLETED = false; var DeviceTypeID = Platform.isIOS ? 1 : 2; -const LANGUAGE_ID = 1; +const LANGUAGE_ID = 2; const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; const GET_PAtIENTS_INSURANCE = @@ -534,12 +537,9 @@ const GET_SPECIFICATION = "productspecification/"; const GET_BRAND_ITEMS = "products"; // External API -const ADD_ADDRESS_INFO = - "addcustomeraddress"; -const GET_CUSTOMER_ADDRESSES = - "Customers/"; -const GET_CUSTOMER_INFO = - "VerifyCustomer"; +const ADD_ADDRESS_INFO = "addcustomeraddress"; +const GET_CUSTOMER_ADDRESSES = "Customers/"; +const GET_CUSTOMER_INFO = "VerifyCustomer"; //Pharmacy diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 1d5b55aa..a647c1c0 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -216,11 +216,10 @@ class BaseAppClient { postPharmacy(String endPoint, {Map body, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - bool isAllowAny = false, - bool isExternal = false}) async { - + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + bool isAllowAny = false, + bool isExternal = false}) async { var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); var user = await sharedPref.getObject(USER_PROFILE); String url; @@ -246,12 +245,12 @@ class BaseAppClient { if (!isExternal) { String token = await sharedPref.getString(TOKEN); var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); if (body.containsKey('SetupID')) { body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null - ? body['SetupID'] - : SETUP_ID + ? body['SetupID'] + : SETUP_ID : SETUP_ID; } @@ -263,17 +262,17 @@ class BaseAppClient { body['generalid'] = GENERAL_ID; body['PatientOutSA'] = body.containsKey('PatientOutSA') ? body['PatientOutSA'] != null - ? body['PatientOutSA'] - : PATIENT_OUT_SA + ? body['PatientOutSA'] + : PATIENT_OUT_SA : PATIENT_OUT_SA; if (body.containsKey('isDentalAllowedBackend')) { body['isDentalAllowedBackend'] = - body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null - ? body['isDentalAllowedBackend'] - : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; + body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; } body['DeviceTypeID'] = DeviceTypeID; @@ -281,18 +280,18 @@ class BaseAppClient { if (!body.containsKey('IsPublicRequest')) { body['PatientType'] = body.containsKey('PatientType') ? body['PatientType'] != null - ? body['PatientType'] - : user['PatientType'] != null - ? user['PatientType'] - : PATIENT_TYPE + ? body['PatientType'] + : user['PatientType'] != null + ? user['PatientType'] + : PATIENT_TYPE : PATIENT_TYPE; body['PatientTypeID'] = body.containsKey('PatientTypeID') ? body['PatientTypeID'] != null - ? body['PatientTypeID'] - : user['PatientType'] != null - ? user['PatientType'] - : PATIENT_TYPE_ID + ? body['PatientTypeID'] + : user['PatientType'] != null + ? user['PatientType'] + : PATIENT_TYPE_ID : PATIENT_TYPE_ID; if (user != null) { body['TokenID'] = token; @@ -587,7 +586,6 @@ class BaseAppClient { return params; } - pharmacyPost(String endPoint, {Map body, Function(dynamic response, int statusCode) onSuccess, diff --git a/lib/pages/insurance/insurance_page.dart b/lib/pages/insurance/insurance_page.dart index f938d9e5..a391f554 100644 --- a/lib/pages/insurance/insurance_page.dart +++ b/lib/pages/insurance/insurance_page.dart @@ -16,7 +16,7 @@ class InsurancePage extends StatelessWidget { final InsuranceViewModel model; InsuranceCardService _insuranceCardService = locator(); - InsurancePage({Key key, this.model}) : super(key: key); + InsurancePage({Key key, this.model}) : super(key: key); @override Widget build(BuildContext context) { return SingleChildScrollView( @@ -31,24 +31,20 @@ class InsurancePage extends StatelessWidget { width: MediaQuery.of(context).size.width, padding: EdgeInsets.all(10.0), child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, + 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), + margin: + EdgeInsets.only(top: 2.0, left: 10.0, right: 20.0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - model.user.firstName ?? '' + " " + model.user.lastName ?? '', + model.user.firstName + " " + model.user.lastName, fontSize: 14, color: Colors.black, fontWeight: FontWeight.w500, @@ -57,11 +53,9 @@ class InsurancePage extends StatelessWidget { height: 8, ), Texts( - TranslationBase.of(context) - .fileno + + TranslationBase.of(context).fileno + ": " + - model.user.patientID - .toString(), + model.user.patientID.toString(), fontSize: 14, color: Colors.black, fontWeight: FontWeight.w500, @@ -78,9 +72,7 @@ class InsurancePage extends StatelessWidget { children: [ Container( child: SecondaryButton( - label: TranslationBase.of( - context) - .fetchData, + label: TranslationBase.of(context).fetchData, small: true, textColor: Colors.white, onTap: () { @@ -88,15 +80,12 @@ class InsurancePage extends StatelessWidget { setupID: '010266', projectID: 15, patientIdentificationID: - model.user - .patientIdentificationNo, - patientID: model - .user.patientID, - name: model.user - .firstName + + model.user.patientIdentificationNo, + patientID: model.user.patientID, + name: model.user.firstName + " " + - model - .user.lastName,context: context); + model.user.lastName, + context: context); }, ), ), @@ -107,122 +96,115 @@ class InsurancePage extends StatelessWidget { ], ), ), - 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); - }, - ), + 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() - ), - + ) + : Container()), ], ), ); @@ -230,29 +212,32 @@ class InsurancePage extends StatelessWidget { getDetails( {String setupID, - int projectID, - String patientIdentificationID, - int patientID, - String name,BuildContext context}) { + int projectID, + String patientIdentificationID, + int patientID, + String name, + BuildContext context}) { GifLoaderDialogUtils.showMyDialog(context); _insuranceCardService .getPatientInsuranceDetails( - setupID: setupID, - projectID: projectID, - patientID: patientID, - patientIdentificationID: patientIdentificationID) + setupID: setupID, + projectID: projectID, + patientID: patientID, + patientIdentificationID: patientIdentificationID) .then((value) { GifLoaderDialogUtils.hideDialog(context); - if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) { + if (!_insuranceCardService.hasError && + _insuranceCardService.isHaveInsuranceCard) { Navigator.push( context, FadePage( page: InsuranceCardUpdateDetails( - insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetailsList, - patientID: patientID, - patientIdentificationID: patientIdentificationID, - name: name, - ))); + 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 36b424a8..6c3ee61c 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -32,7 +32,11 @@ class _InsuranceUpdateState extends State super.initState(); _tabController = TabController(length: 2, vsync: this); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); } void dispose() { @@ -111,7 +115,7 @@ class _InsuranceUpdateState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - InsurancePage(model:model), + InsurancePage(model: model), Container( child: ListView.builder( itemCount: model.insuranceUpdate == null @@ -227,6 +231,4 @@ class _InsuranceUpdateState extends State ), ); } - - }