diff --git a/lib/config/config.dart b/lib/config/config.dart index f3038cf7..de20e677 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -15,8 +15,9 @@ const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; - // const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'http://10.50.100.198:3334/'; + const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -369,11 +370,14 @@ const HAS_DENTAL_PLAN = const LASER_BODY_PARTS = 'Services/Patients.svc/REST/Laser_GetBodyPartsByCategory'; +const INSERT_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnarie_Insert'; +const UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnarie_Update'; + //URL to get medicine and pharmacies list const CHANNEL = 3; const GENERAL_ID = 'Cs2020@2016\$2958'; const IP_ADDRESS = '10.20.10.20'; -const VERSION_ID = 8.8; +const VERSION_ID = 7.2; const SETUP_ID = '91877'; const LANGUAGE = 2; const PATIENT_OUT_SA = 0; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7fed99a8..312c2fc8 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1748,5 +1748,6 @@ const Map localizedValues = { "yourTurn": {"en": "your turn is after", "ar": "دورك بعد"}, "patients": {"en": "patients", "ar": "مرضي"}, "group": {"en": "Group", "ar": "مجموعة"}, + "covidTestTodo": {"en": "Covid-19 Test", "ar": "فحص كورونا"}, "ancillaryOrdersPaymentConfirm": {"en": "Are you sure you want to make payment for selected orders?", "ar": "هل أنت متأكد أنك تريد سداد قيمة الطلبات المختارة؟"}, }; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 723e17a0..18b7261a 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -37,3 +37,4 @@ const LIVECARE_CLINIC_DATA = 'LIVECARE_CLINIC_DATA'; const DOCTOR_SCHEDULE_DATE_SEL = 'DOCTOR_SCHEDULE_DATE_SEL'; const APPOINTMENT_HISTORY_MEDICAL = 'APPOINTMENT_HISTORY_MEDICAL'; const CLINICS_LIST = 'CLINICS_LIST'; +const COVID_QA_LIST = 'COVID_QA_LIST'; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 8d722568..663603f4 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -124,7 +124,7 @@ class BaseAppClient { // body['IdentificationNo'] = 2076117163; // body['MobileNo'] = "966503109207"; - // body['PatientID'] = 2478442; //3844083 + // body['PatientID'] = 3648586; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 2478442 diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 6571c76f..1ea29264 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -31,12 +31,13 @@ class LabsService extends BaseService { List labResultList = List(); List labOrdersResultsList = List(); - Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo}) async { + Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID}) async { hasError = false; _requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.clinicID = clinicID; _requestPatientLabSpecialResult.invoiceNo = invoiceNo; _requestPatientLabSpecialResult.orderNo = orderNo; + _requestPatientLabSpecialResult.setupID = setupID; await baseAppClient.post(GET_Patient_LAB_SPECIAL_RESULT, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 8e61e3f3..92f79436 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -71,9 +71,9 @@ class LabsViewModel extends BaseViewModel { List labResultLists = List(); - getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo}) async { + getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID}) async { setState(ViewState.Busy); - await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID); + await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, setupID: setupID); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 8d0ebabd..17ac18da 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -367,10 +367,10 @@ class _AnicllaryOrdersState extends State with SingleTic addSelectedProcedure(value[i]); }); }), - Utils.tableColumnValue('${value[i].procedureName.toString()}', isLast: true), - Utils.tableColumnValue('${value[i].patientShare.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true), - Utils.tableColumnValue('${value[i].patientTaxAmount.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true), - Utils.tableColumnValue('${value[i].patientShareWithTax.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true), + Utils.tableColumnValue('${value[i].procedureName}', isLast: true, isCapitable: false), + Utils.tableColumnValue('${value[i].patientShare.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true, isCapitable: false), + Utils.tableColumnValue('${value[i].patientTaxAmount.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true, isCapitable: false), + Utils.tableColumnValue('${value[i].patientShareWithTax.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true, isCapitable: false), ]), ); } @@ -478,17 +478,17 @@ class _AnicllaryOrdersState extends State with SingleTic addAdvancedNumberRequest(String advanceNumber, String paymentReference, dynamic appointmentID, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, AppGlobal.context).then((res) { - print(res); autoGenerateInvoice(); }).catchError((err) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); - AppToast.showErrorToast(message: err); + AppToast.showErrorToast(message: err.toString()); print(err); }); } autoGenerateInvoice() { List selectedProcListAPI = []; + Map selectedProcListAPIMap; selectedProcList.forEach((element) { selectedProcListAPI.add({ diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 6fe2be98..4c89cf81 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -73,37 +73,36 @@ class _QRCodeState extends State { height: MediaQuery.of(context).size.width / 3, child: Row( children: [ - // _supportsNFC - // ? - Expanded( - flex: 1, - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - InkWell( - child: Container( - margin: EdgeInsets.only(top: 30.0), - alignment: Alignment.center, - padding: EdgeInsets.all(8), - decoration: BoxDecoration( - border: Border.all(color: Colors.black), - borderRadius: BorderRadius.circular(10), - ), - child: Image.asset("assets/images/nfc/ic_nfc.png"), + widget.patientShareResponse.clinicID != 265 + ? Expanded( + flex: 1, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + InkWell( + child: Container( + margin: EdgeInsets.only(top: 30.0), + alignment: Alignment.center, + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + border: Border.all(color: Colors.black), + borderRadius: BorderRadius.circular(10), + ), + child: Image.asset("assets/images/nfc/ic_nfc.png"), + ), + onTap: () { + showNfcReader(context, onNcfScan: (String nfcId) { + Future.delayed(const Duration(milliseconds: 100), () { + sendNfcCheckInRequest(nfcId); + }); + }); + }, + ), + ], ), - onTap: () { - showNfcReader(context, onNcfScan: (String nfcId) { - Future.delayed(const Duration(milliseconds: 100), () { - sendNfcCheckInRequest(nfcId); - }); - }); - }, - ), - ], - ), - ), - // : Container(), + ) + : Container(), Expanded( flex: 1, child: Container( diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index 0115083f..b4db054d 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; @@ -403,7 +404,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat docObject.doctorID = widget.selectedDoctorID; docObject.clinicID = widget.selectedClinicID; docObject.projectID = widget.projectID; - insertAppointmentCovidTest(context, docObject); + insertCovidQuestionnaire(context, docObject); }, cancelFunction: () => {}); dialog.showAlertDialog(context); @@ -412,6 +413,24 @@ class _CovidTimeSlotsState extends State with TickerProviderStat } } + insertCovidQuestionnaire(context, DoctorList docObject) async { + DoctorsListService service = new DoctorsListService(); + List qa = await sharedPref.getObject(COVID_QA_LIST); + service.insertCovidQuestionnaire(qa, widget.projectID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum).then((res) { + insertAppointmentCovidTest(context, docObject); + }).catchError((err) { + print(err); + }); + } + + updateCovidQuestionnaire(context, String appoNo) async { + DoctorsListService service = new DoctorsListService(); + service.updateCovidQuestionnaire(appoNo, widget.projectID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum).then((res) { + }).catchError((err) { + print(err); + }); + } + insertAppointmentCovidTest(context, DoctorList docObject) { DoctorsListService service = new DoctorsListService(); AppoitmentAllHistoryResultList appo; @@ -490,6 +509,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat GifLoaderDialogUtils.hideDialog(context); print(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res); + updateCovidQuestionnaire(context, appointmentNo); navigateToPaymentAlert(); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart index ee6725e9..cbf3bf21 100644 --- a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart +++ b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart @@ -1,5 +1,6 @@ import 'dart:convert'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; @@ -7,6 +8,7 @@ import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCe import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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'; @@ -265,6 +267,7 @@ class CovidDirveThruQuestionsState extends State { } next() async { + var sharedPref = new AppSharedPreferences(); bool all = true; qa.forEach((element) { all = all && (element["ans"] == 1 || element["ans"] == 0); @@ -272,6 +275,7 @@ class CovidDirveThruQuestionsState extends State { if (all) if (qa[0]["ans"] == 1) { openPassportUpdatePage(); } else { + sharedPref.setObject(COVID_QA_LIST, qa); getPaymentInfo(context, widget.projectId); } else diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 4db905fc..b2635dc4 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -114,7 +114,7 @@ class _ToDoState extends State { child: widget.appoList[index].clinicID == 265 ? Container( margin: EdgeInsets.only(left: 5.0, right: 5.0), - child: SvgPicture.asset("assets/images/new/drive-thru.svg"), + child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0), ) : widget.appoList[index].isLiveCareAppointment ? SvgPicture.asset("assets/images/new/virtual.svg") @@ -129,7 +129,7 @@ class _ToDoState extends State { padding: const EdgeInsets.only(left: 8.0, right: 8.0), child: Text( widget.appoList[index].clinicID == 265 - ? TranslationBase.of(context).drivethruAppo + ? TranslationBase.of(context).covidTestTodo : widget.appoList[index].isLiveCareAppointment ? TranslationBase.of(context).liveCareAppo : TranslationBase.of(context).walkinAppo, diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index cf0ec4e2..20d09668 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -18,16 +18,18 @@ class LaboratoryResultPage extends StatefulWidget { } class _LaboratoryResultPageState extends State { - @override Widget build(BuildContext context) { - return BaseView( onModelReady: (model) => model.getLaboratoryResult( - invoiceNo: widget.patientLabOrders.invoiceNo, clinicID: widget.patientLabOrders.clinicID, projectID: widget.patientLabOrders.projectID, orderNo: widget.patientLabOrders.orderNo), + invoiceNo: widget.patientLabOrders.invoiceNo, + clinicID: widget.patientLabOrders.clinicID, + projectID: widget.patientLabOrders.projectID, + orderNo: widget.patientLabOrders.orderNo, + setupID: widget.patientLabOrders.setupID), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBarTitle: widget.patientLabOrders.doctorName, + appBarTitle: widget.patientLabOrders.doctorName, baseViewModel: model, showNewAppBar: true, showNewAppBarTitle: true, diff --git a/lib/pages/pharmacies/screens/lakum-points-month-page.dart b/lib/pages/pharmacies/screens/lakum-points-month-page.dart index 7f821f55..514804cc 100644 --- a/lib/pages/pharmacies/screens/lakum-points-month-page.dart +++ b/lib/pages/pharmacies/screens/lakum-points-month-page.dart @@ -6,7 +6,6 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class LakumPointMonthPage extends StatefulWidget { diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 83252c75..6e819f60 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -315,7 +315,8 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, BuildContext context, [String procedureID, num testTypeEnum, num testProcedureEnum]) async { + Future insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, BuildContext context, + [String procedureID, num testTypeEnum, num testProcedureEnum]) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -850,7 +851,7 @@ class DoctorsListService extends BaseService { localRes = response; }, onFailure: (String error, int statusCode) { throw error; - }, body: request); + }, body: request, isAllowAny: true); return Future.value(localRes); } @@ -906,7 +907,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future autoGenerateAncillaryOrdersInvoice(String orderNo, int projectID, dynamic appointmentID, List selectedProcListAPI, BuildContext context) async { + Future autoGenerateAncillaryOrdersInvoice(dynamic orderNo, int projectID, dynamic appointmentID, List selectedProcListAPI, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); @@ -1356,4 +1357,51 @@ class DoctorsListService extends BaseService { }, body: request); return Future.value(localRes); } + + Future insertCovidQuestionnaire(List qa, int projectID, int testTypeEnum, int testProcedureEnum) async { + Map request; + + request = { + "ProjectID": projectID, + "IsForTravel": qa[0]['ans'].toString(), + "IsComingOutSA": qa[1]['ans'].toString(), + "IsFeverCurrently": qa[2]['ans'].toString(), + "IsFeverLast2Week": qa[3]['ans'].toString(), + "IsSorethroat": qa[4]['ans'].toString(), + "IsRunnyNose": qa[5]['ans'].toString(), + "IsCough": qa[6]['ans'].toString(), + "IsShortnessBreath": qa[7]['ans'].toString(), + "IsNausea": qa[8]['ans'].toString(), + "IsVomiting": qa[9]['ans'].toString(), + "IsHeadache": qa[10]['ans'].toString(), + "IsMusclePain": qa[11]['ans'].toString(), + "IsJoinPain": qa[12]['ans'].toString(), + "IsDiarrhea": qa[13]['ans'].toString(), + "TestTypeEnum": testTypeEnum, + "TestProcedureEnum": testProcedureEnum + }; + + dynamic localRes; + await baseAppClient.post(INSERT_COVID_QUESTIONNAIRE, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future updateCovidQuestionnaire(String appoNo, int projectID, int testTypeEnum, int testProcedureEnum) async { + Map request; + + request = {"AppointmentNo": appoNo, "ProjectID": projectID, "TestTypeEnum": testTypeEnum, "TestProcedureEnum": testProcedureEnum}; + + dynamic localRes; + await baseAppClient.post(UPDATE_COVID_QUESTIONNAIRE, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + + return Future.value(localRes); + } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 49d62d79..723cfa2f 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2824,6 +2824,7 @@ class TranslationBase { String get patients => localizedValues["patients"][locale.languageCode]; String get group => localizedValues["group"][locale.languageCode]; String get ancillaryOrdersPaymentConfirm => localizedValues["ancillaryOrdersPaymentConfirm"][locale.languageCode]; + String get covidTestTodo => localizedValues["covidTestTodo"][locale.languageCode]; }