diff --git a/android/build.gradle b/android/build.gradle index e2e8a05f..8e56476b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' + classpath 'com.android.tools.build:gradle:4.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.2' } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 296b146b..5660070d 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 23 08:50:38 CEST 2017 +#Thu Sep 03 16:26:30 EEST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/assets/images/report.jpg b/assets/images/report.jpg new file mode 100644 index 00000000..5846cd53 Binary files /dev/null and b/assets/images/report.jpg differ diff --git a/lib/config/config.dart b/lib/config/config.dart index 956a2315..fc636ceb 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -28,8 +28,8 @@ const GET_PRESCRIPTION_REPORT_ENH = ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = - 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const GET_Patient_LAB_RESULT = '/Services/Patients.svc/REST/GetPatientLabResults'; /// const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 903943ef..ddd98917 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -448,4 +448,5 @@ const Map> localizedValues = { "OrderNo": {"en": "Order No", "ar": "رقم الطلب"}, "OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"}, "VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"}, + "MonthlyReports": {"en": "Monthly Reports", "ar": "تقارير شهرية"}, }; diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart new file mode 100644 index 00000000..23b3363d --- /dev/null +++ b/lib/core/model/labs/lab_result.dart @@ -0,0 +1,88 @@ +class LabResult { + String description; + Null femaleInterpretativeData; + int gender; + int lineItemNo; + Null maleInterpretativeData; + String notes; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; + Null superVerifiedOn; + String testCode; + String uOM; + String verifiedOn; + Null verifiedOnDateTime; + + LabResult( + {this.description, + this.femaleInterpretativeData, + this.gender, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); + + LabResult.fromJson(Map json) { + description = json['Description']; + femaleInterpretativeData = json['FemaleInterpretativeData']; + gender = json['Gender']; + lineItemNo = json['LineItemNo']; + maleInterpretativeData = json['MaleInterpretativeData']; + notes = json['Notes']; + packageID = json['PackageID']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + referanceRange = json['ReferanceRange']; + resultValue = json['ResultValue']; + sampleCollectedOn = json['SampleCollectedOn']; + sampleReceivedOn = json['SampleReceivedOn']; + setupID = json['SetupID']; + superVerifiedOn = json['SuperVerifiedOn']; + testCode = json['TestCode']; + uOM = json['UOM']; + verifiedOn = json['VerifiedOn']; + verifiedOnDateTime = json['VerifiedOnDateTime']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['Gender'] = this.gender; + data['LineItemNo'] = this.lineItemNo; + data['MaleInterpretativeData'] = this.maleInterpretativeData; + data['Notes'] = this.notes; + data['PackageID'] = this.packageID; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ReferanceRange'] = this.referanceRange; + data['ResultValue'] = this.resultValue; + data['SampleCollectedOn'] = this.sampleCollectedOn; + data['SampleReceivedOn'] = this.sampleReceivedOn; + data['SetupID'] = this.setupID; + data['SuperVerifiedOn'] = this.superVerifiedOn; + data['TestCode'] = this.testCode; + data['UOM'] = this.uOM; + data['VerifiedOn'] = this.verifiedOn; + data['VerifiedOnDateTime'] = this.verifiedOnDateTime; + return data; + } +} diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index efb168c8..aa48c49d 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -31,7 +31,7 @@ class BaseAppClient { //Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en'); var user = await sharedPref.getObject(USER_PROFILE); body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID diff --git a/lib/core/service/insurance_service.dart b/lib/core/service/insurance_service.dart index 8850e953..7fee6615 100644 --- a/lib/core/service/insurance_service.dart +++ b/lib/core/service/insurance_service.dart @@ -1,8 +1,13 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart'; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; class InsuranceCardService extends BaseService { List _cardList = List(); @@ -15,6 +20,9 @@ class InsuranceCardService extends BaseService { List get insuranceApproval => _insuranceApproval; + GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse(); + clearInsuranceCard() { _cardList.clear(); } @@ -101,7 +109,7 @@ class InsuranceCardService extends BaseService { Future getInsuranceApproval({int appointmentNo}) async { hasError = false; // _cardList.clear(); - if(appointmentNo != null) { + if (appointmentNo != null) { _insuranceApprovalModel.appointmentNo = appointmentNo; _insuranceApprovalModel.eXuldAPPNO = null; _insuranceApprovalModel.projectID = null; @@ -124,4 +132,35 @@ class InsuranceCardService extends BaseService { super.error = error; }, body: _insuranceApprovalModel.toJson()); } + + Future getFamilyFiles() async { + var myFamily = await sharedPref.getObject(FAMILY_FILE); + if (myFamily != null) { + getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson(myFamily); + } else { + getSharedRecordByStatus(); + } + } + + Future getSharedRecordByStatus() async { + try { + dynamic localRes; + var request = GetAllSharedRecordsByStatusReq(); + request.status = 0; + await baseAppClient.post(GET_SHARED_RECORD_BY_STATUS, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request.toJson()); + sharedPref.setObject(FAMILY_FILE, localRes); + getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson(localRes); + } catch (error) { + print(error); + throw error; + } + } } diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 98f8110e..c1ad65f3 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_orders.dart'; @@ -28,6 +29,7 @@ class LabsService extends BaseService { RequestPatientLabSpecialResult(); List patientLabSpecialResult = List(); + List labResultList = List(); Future getLaboratoryResult( {String projectID, @@ -52,6 +54,27 @@ class LabsService extends BaseService { }, body: _requestPatientLabSpecialResult.toJson()); } + Future getPatientLabResult({PatientLabOrders patientLabOrder}) async { + hasError = false; + Map body = Map(); + body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['OrderNo'] = patientLabOrder.orderNo; + body['Procedure'] = "U/A"; + body['ProjectID'] = patientLabOrder.projectID; + body['ClinicID'] = patientLabOrder.clinicID; + //TODO Check the res + await baseAppClient.post(GET_Patient_LAB_RESULT, + onSuccess: (dynamic response, int statusCode) { + patientLabSpecialResult.clear(); + response['ListPLR'].forEach((lab) { + labResultList.add(LabResult.fromJson(lab)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); diff --git a/lib/core/service/medical/reports_monthly_service.dart b/lib/core/service/medical/reports_monthly_service.dart new file mode 100644 index 00000000..5e643669 --- /dev/null +++ b/lib/core/service/medical/reports_monthly_service.dart @@ -0,0 +1,83 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; +import 'package:diplomaticquarterapp/core/model/reports/request_reports.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; + +class ReportsMonthlyService extends BaseService { + List reportsList = List(); + List appointHistoryList = List(); + + RequestReports _requestReports = RequestReports( + isReport: true, + encounterType: 1, + requestType: 1, + versionID: 5.5, + channel: 3, + languageID: 2, + iPAdress: "10.20.10.20", + generalid: 'Cs2020@2016\$2958', + patientOutSA: 0, + sessionID: 'KIbLoqkytuKJEWECHQ', + isDentalAllowedBackend: false, + deviceTypeID: 2, + patientID: 1231755, + tokenID: '@dm!n', + patientTypeID: 1, + patientType: 1); + + Future getReports() async { + hasError = false; + await baseAppClient.post(REPORTS, + onSuccess: (dynamic response, int statusCode) { + reportsList.clear(); + response['GetPatientMedicalStatus'].forEach((reports) { + reportsList.add(Reports.fromJson(reports)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestReports.toJson()); + } + + Future getPatentAppointmentHistory() async { + hasError = false; + Map body = new Map(); + body['IsForMedicalReport'] = true; + await baseAppClient.post(GET_PATIENT_AppointmentHistory, + onSuccess: (dynamic response, int statusCode) { + appointHistoryList = []; + response['AppoimentAllHistoryResultList'].forEach((appoint) { + appointHistoryList.add(AppointmentHistory.fromJson(appoint)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future insertRequestForMedicalReport( + AppointmentHistory appointmentHistory) async { + Map body = new Map(); + body['ClinicID'] = appointmentHistory.clinicID; + body['DoctorID'] = appointmentHistory.doctorID; + body['SetupID'] = appointmentHistory.setupID; + body['EncounterNo'] = appointmentHistory.appointmentNo; + body['EncounterType'] = 1;// appointmentHistory.appointmentType; + body['IsActive'] = appointmentHistory.isActiveDoctor; + body['ProjectID'] = appointmentHistory.projectID; + body['Remarks'] = ""; + body['ProcedureId'] = ""; + body['RequestType'] = 1; + body['Source'] = 2; + body['Status'] = 1; + body['CreatedBy'] = 102; + hasError = false; + await baseAppClient.post(INSERT_REQUEST_FOR_MEDICAL_REPORT, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/viewModels/insurance_card_View_model.dart b/lib/core/viewModels/insurance_card_View_model.dart index a6975360..e99a53f6 100644 --- a/lib/core/viewModels/insurance_card_View_model.dart +++ b/lib/core/viewModels/insurance_card_View_model.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dar import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart'; import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -20,6 +21,9 @@ class InsuranceViewModel extends BaseViewModel { List get insuranceApproval => _insuranceCardService.insuranceApproval; + GetAllSharedRecordsByStatusResponse get getAllSharedRecordsByStatusResponse => + _insuranceCardService.getAllSharedRecordsByStatusResponse; + Future getInsurance() async { hasError = false; _insuranceCardService.clearInsuranceCard(); @@ -41,7 +45,7 @@ class InsuranceViewModel extends BaseViewModel { error = _insuranceCardService.error; setState(ViewState.ErrorLocal); } else - setState(ViewState.Idle); + getFamilyFiles(); } Future getInsuranceApproval({int appointmentNo}) async { @@ -59,4 +63,13 @@ class InsuranceViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future getFamilyFiles() async { + await _insuranceCardService.getFamilyFiles(); + if (_insuranceCardService.hasError) { + error = _insuranceCardService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } } diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 1efdfb7c..032aeb1e 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -1,6 +1,6 @@ - import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; @@ -78,13 +78,32 @@ class LabsViewModel extends BaseViewModel { List get patientLabSpecialResult => _labsService.patientLabSpecialResult; + List get labResultList => _labsService.labResultList; + getLaboratoryResult( {String projectID, int clinicID, String invoiceNo, String orderNo}) 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); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + getPatientLabResult({PatientLabOrders patientLabOrder}) async { + setState(ViewState.Busy); + await _labsService.getPatientLabResult( + patientLabOrder: patientLabOrder + ); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); diff --git a/lib/core/viewModels/medical/reports_monthly_view_model.dart b/lib/core/viewModels/medical/reports_monthly_view_model.dart new file mode 100644 index 00000000..2e5952ae --- /dev/null +++ b/lib/core/viewModels/medical/reports_monthly_view_model.dart @@ -0,0 +1,84 @@ +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +import '../../../core/enum/reportfilter_type.dart'; +import '../../../core/enum/viewstate.dart'; +import '../../../core/model/reports/Reports.dart'; +import '../../../core/service/medical/reports_service.dart'; +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class ReportsMonthlyViewModel extends BaseViewModel { + ReportFilterType filterType = ReportFilterType.Requested; + + ReportsService _reportsService = locator(); + + List reportsOrderRequestList = List(); + List reportsOrderReadyList = List(); + List reportsOrderCompletedList = List(); + List reportsOrderCanceledList = List(); + + List get appointHistoryList => + _reportsService.appointHistoryList; + + getReports() async { + setState(ViewState.Busy); + reportsOrderRequestList.clear(); + reportsOrderReadyList.clear(); + reportsOrderCompletedList.clear(); + reportsOrderCanceledList.clear(); + await _reportsService.getReports(); + if (_reportsService.hasError) { + error = _reportsService.error; + setState(ViewState.Error); + } else { + _filterList(); + setState(ViewState.Idle); + } + } + + getPatentAppointmentHistory() async { + setState(ViewState.Busy); + await _reportsService.getPatentAppointmentHistory(); + if (_reportsService.hasError) { + error = _reportsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + void _filterList() { + _reportsService.reportsList.forEach((report) { + switch (report.status) { + case 1: + reportsOrderRequestList.add(report); + break; + case 2: + reportsOrderReadyList.add(report); + break; + case 3: + reportsOrderCompletedList.add(report); + break; + case 4: + reportsOrderCanceledList.add(report); + break; + default: + } + }); + } + + + insertRequestForMedicalReport(AppointmentHistory appointmentHistory)async{ + setState(ViewState.Busy); + await _reportsService.insertRequestForMedicalReport(appointmentHistory); + if (_reportsService.hasError) { + error = _reportsService.error; + AppToast.showErrorToast(message: error); + setState(ViewState.ErrorLocal); + } else { + AppToast.showSuccessToast(message: 'The order was send '); + setState(ViewState.Idle); + } + } +} diff --git a/lib/locator.dart b/lib/locator.dart index b2e974a8..6839fbc2 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -12,6 +12,7 @@ import 'core/service/medical/medical_service.dart'; import 'core/service/medical/my_doctor_service.dart'; import 'core/service/medical/prescriptions_service.dart'; import 'core/service/medical/radiology_service.dart'; +import 'core/service/medical/reports_monthly_service.dart'; import 'core/service/medical/vital_sign_service.dart'; import 'core/viewModels/appointment_rate_view_model.dart'; import 'core/viewModels/feedback/feedback_view_model.dart'; @@ -22,6 +23,7 @@ import 'core/viewModels/medical/medical_view_model.dart'; import 'core/viewModels/medical/my_doctor_view_model.dart'; import 'core/viewModels/medical/prescriptions_view_model.dart'; import 'core/viewModels/medical/radiology_view_model.dart'; +import 'core/viewModels/medical/reports_monthly_view_model.dart'; import 'core/viewModels/medical/vital_sign_view_model.dart'; import 'core/viewModels/medical/reports_view_model.dart'; import 'core/viewModels/pharmacies_view_model.dart'; @@ -53,6 +55,7 @@ void setupLocator() { locator.registerLazySingleton(() => AppointmentRateService()); locator.registerLazySingleton(() => QrService()); locator.registerFactory(() => VaccineService()); + locator.registerLazySingleton(() => ReportsMonthlyService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -70,5 +73,6 @@ void setupLocator() { locator.registerFactory(() => DashboardViewModel()); locator.registerFactory(() => AppointmentRateViewModel()); locator.registerFactory(() => QrViewModel()); + locator.registerFactory(() => ReportsMonthlyViewModel()); } diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 9cfa41a9..2fa291df 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; @@ -97,9 +98,12 @@ class _InsuranceUpdateState extends State children: [ Container( child: ListView.builder( - itemCount: model.insuranceUpdate == null + itemCount: model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList == + null ? 0 - : model.insuranceUpdate.length, + : model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList.length, itemBuilder: (BuildContext context, int index) { return Container( margin: EdgeInsets.all(10.0), @@ -112,81 +116,63 @@ class _InsuranceUpdateState extends State child: Container( width: MediaQuery.of(context).size.width, padding: EdgeInsets.all(10.0), - child: Column( + child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ - Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 2.0, - left: 10.0, - right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text("TAMER FANASHEH ", - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - Text( - 'File No.' + - model - .insuranceUpdate[ - index] - .patientID - .toString(), - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - Text( - model.insuranceUpdate[index] - .createdOn, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - ], - ), - ), + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, left: 10.0, right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index].patientName, + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.w500, + letterSpacing: 1.0)), + Text( + 'File No.' + + model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index].patientID.toString(), + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.w500, + letterSpacing: 1.0)), + ], ), - Expanded( - flex: 1, - child: Container( -// height: MediaQuery.of(context).size.height * 0.12, - margin: EdgeInsets.only(top: 20.0), - child: Column( - children: [ - Container( - child: Button( - label: 'Fetch', - ), - height: SizeConfig - .heightMultiplier * - 3.8, - width: - SizeConfig.screenWidth * - 4.2, - ), - ], - ), - ), - ) - ], + ), ), + Expanded( + flex: 2, + child: Container( + // height: MediaQuery.of(context).size.height * 0.12, + margin: EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: 'Update', + small: true, + textColor: Colors.white, + // color: Colors.grey, + ), + //height: 45, + // width:90 + ), + ], + ), + ), + ) ], ), ), diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 8eea389f..073a1d52 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -235,16 +235,21 @@ class _LandingPageState extends State with WidgetsBindingObserver { physics: NeverScrollableScrollPhysics(), controller: pageController, children: [ - HomePage(goToMyProfile: (){ - _changeCurrentTab(1); - },), + HomePage( + goToMyProfile: () { + _changeCurrentTab(1); + }, + ), MedicalProfilePage(), MyAdmissionsPage(), ToDo(), BookingOptions() ], // Please do not remove the BookingOptions from this array ), - bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab,index: currentTab,), + bottomNavigationBar: BottomNavBar( + changeIndex: _changeCurrentTab, + index: currentTab, + ), ); } @@ -307,6 +312,4 @@ class _LandingPageState extends State with WidgetsBindingObserver { _changeCurrentTab(2); } } - - } diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 216b8adb..01cb6725 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -27,8 +27,10 @@ class LaboratoryResultPage extends StatelessWidget { body: ListView.builder( itemBuilder: (context, index) => LaboratoryResultWidget( onTap: () => model.sendLabReportEmail(patientLabOrder: patientLabOrders), - billNo: model.patientLabSpecialResult[index].invoiceNo, + billNo: patientLabOrders.invoiceNo, details: model.patientLabSpecialResult[index].resultDataHTML, + orderNo: patientLabOrders.orderNo, + patientLabOrder: patientLabOrders, ), itemCount: model.patientLabSpecialResult.length, ), diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 83628076..5dccb514 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -73,7 +73,7 @@ class _MedicalProfilePageState extends State { itemCount: model.appoitmentAllHistoryResultList.length, scrollDirection: Axis.horizontal, - reverse: true, + reverse: !projectViewModel.isArabic, ), ], ), diff --git a/lib/pages/medical/reports/monthly_reports.dart b/lib/pages/medical/reports/monthly_reports.dart new file mode 100644 index 00000000..9c913705 --- /dev/null +++ b/lib/pages/medical/reports/monthly_reports.dart @@ -0,0 +1,18 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; + +class MonthlyReportsPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).monthlyReports, + body: Container(), + ), + ); + } +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 114f3a1b..22e39c39 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -508,6 +508,7 @@ class TranslationBase { String get orderNo => localizedValues['OrderNo'][locale.languageCode]; String get orderDetails => localizedValues['OrderDetails'][locale.languageCode]; String get vitalSign => localizedValues['VitalSign'][locale.languageCode]; + String get monthlyReports => localizedValues['MonthlyReports'][locale.languageCode]; } diff --git a/lib/widgets/data_display/medical/laboratory_result_widget.dart b/lib/widgets/data_display/medical/laboratory_result_widget.dart index b84b1076..53356095 100644 --- a/lib/widgets/data_display/medical/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/laboratory_result_widget.dart @@ -1,5 +1,13 @@ +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; import '../text.dart'; @@ -7,8 +15,16 @@ class LaboratoryResultWidget extends StatefulWidget { final GestureTapCallback onTap; final String billNo; final String details; + final String orderNo; + final PatientLabOrders patientLabOrder; - const LaboratoryResultWidget({Key key, this.onTap, this.billNo, this.details}) + const LaboratoryResultWidget( + {Key key, + this.onTap, + this.billNo, + this.details, + this.orderNo, + this.patientLabOrder}) : super(key: key); @override @@ -17,9 +33,12 @@ class LaboratoryResultWidget extends StatefulWidget { class _LaboratoryResultWidgetState extends State { bool _isShowMore = false; + bool _isShowMoreGeneral = false; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return Container( margin: EdgeInsets.all(15), child: Column( @@ -45,7 +64,7 @@ class _LaboratoryResultWidgetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Bill No'), + Texts('Invoice No'), Texts(widget.billNo), ], ), @@ -102,7 +121,7 @@ class _LaboratoryResultWidgetState extends State { )), child: Row( children: [ - Expanded(child: Texts('Result')), + Expanded(child: Texts('Special Result')), Container( width: 25, height: 25, @@ -132,12 +151,211 @@ class _LaboratoryResultWidgetState extends State { bottomRight: Radius.circular(5.0), )), duration: Duration(milliseconds: 7000), - child: Text(widget.details?? 'No Data'), - ) + child: Container( + width: double.infinity, + child: Text(widget.details ?? 'No Data')), + ), + SizedBox(height: 12,), + BaseView( + onModelReady: (model) => model.getPatientLabResult( + patientLabOrder: widget.patientLabOrder), + builder: (_, model, w) => NetworkBaseView( + baseViewModel: model, + child: Container( + child: Column( + children: [ + InkWell( + onTap: () { + setState(() { + _isShowMoreGeneral = !_isShowMoreGeneral; + }, + ); + }, + child: Container( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(5.0), + )), + child: Row( + children: [ + Expanded(child: Texts('General Result')), + Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.red[900]), + child: Icon( + _isShowMoreGeneral + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white, + size: 22, + ), + ) + ], + ), + ), + ), + if (_isShowMoreGeneral) + AnimatedContainer( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(5.0), + bottomRight: Radius.circular(5.0), + ), + ), + duration: Duration(milliseconds: 7000), + child: Container( + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts('U/A'), + InkWell( + onTap: () { + model.getPatientLabResult( + patientLabOrder: + widget.patientLabOrder); + }, + child: Texts( + 'Flow Chart', + decoration: TextDecoration.underline, + color: Colors.blue, + ), + ), + ], + ), + Table( + border: TableBorder.symmetric( + inside: BorderSide( + width: 2.0, color: Colors.grey[300]), + ), + children: fullData(model.labResultList), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ) ], ), ], ), ); } + + List fullData(List labResultList) { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.circular(0.0): Radius.circular(10.0), + topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), + ), + ), + child: Center( + child: Texts( + 'Description', + color: Colors.white, + ), + ), + height: 60, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + + ), + child: Center( + child: Texts('Value', color: Colors.white), + ), + height: 60), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.circular(10.0):Radius.circular(0.0), + topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), + ), + ), + child: Center( + child: Texts('Range', color: Colors.white), + ), + height: 60), + ), + ], + ), + ); + labResultList.forEach((lab) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + lab.description, + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + lab.resultValue, + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + lab.referanceRange, + textAlign: TextAlign.center, + ), + ), + ), + ), + ], + ), + ); + }); + return tableRow; + } } diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index b18a5fd9..56e06939 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -74,7 +74,7 @@ class AppScaffold extends StatelessWidget { ) : buildBodyWidget(), bottomSheet: bottomSheet, - bottomNavigationBar: BottomBarSearch() + // bottomNavigationBar: BottomBarSearch() //floatingActionButton: FloatingSearchButton(), ); } diff --git a/pubspec.yaml b/pubspec.yaml index b5b359a9..4a87b43a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,7 +38,7 @@ dependencies: url_launcher: ^5.5.0 shared_preferences: ^0.5.8 flutter_flexible_toast: ^0.1.4 - firebase_messaging: 6.0.12 + firebase_messaging: ^7.0.0 # Progress bar progress_hud_v2: ^2.0.0