diff --git a/lib/config/config.dart b/lib/config/config.dart index e69f0510..5013e201 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,12 +20,9 @@ var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; -// var BASE_URL = 'http://10.50.100.198:2018/'; -// var BASE_URL = 'http://10.50.100.198:4422/'; -var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; -// var BASE_URL = 'http://10.20.200.111:1010/'; -// var BASE_URL = 'https://hmgwebservices.com/'; + // var BASE_URL = 'http://10.50.100.198:2018/'; + // var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 5912d123..741800a5 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1986,6 +1986,7 @@ const Map localizedValues = { "ar": "يرجى ملاحظة أن هذا هو المبلغ النقدي، إذا كنت ترغب في تحديث التأمين الخاص بك، يرجى النقر أدناه:" }, "validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"}, + "resultStatus": {"en": "Result Status: ", "ar": "حالة النتيجة: "}, "contactRRT": {"en": "Contact RRT", "ar": "تواصل مع فريق الاستجابة السريعة"}, "checkInViaLocation": {"en": "Check-In Via Location", "ar": "تسجيل الوصول عبر الموقع"}, "locationCheckInError": {"en": "Please ensure you're within the hospital location to perform online check-in.", "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."}, diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index 20dcda5a..2f3b1629 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -37,6 +37,8 @@ class PatientLabOrders { String? setupID; List? speciality; bool? isLiveCareAppointment; + int? status; + String? statusDesc; PatientLabOrders( {this.actualDoctorRate, this.clinicDescription, @@ -73,7 +75,9 @@ class PatientLabOrders { this.invoiceNo_VP, this.invoiceType, this.speciality, - this.isLiveCareAppointment}); + this.isLiveCareAppointment, + this.status, + this.statusDesc,}); PatientLabOrders.fromJson(Map json) { actualDoctorRate = json['ActualDoctorRate']; @@ -111,6 +115,8 @@ class PatientLabOrders { invoiceNo_VP = json['invoiceNo_VP']; invoiceType = json['InvoiceType']; isLiveCareAppointment = json['IsLiveCareAppointment']; + status = json['Status']; + statusDesc = json['StatusDesc']; // speciality = json['Speciality'].cast(); } @@ -151,6 +157,8 @@ class PatientLabOrders { data['Speciality'] = this.speciality; data['IsLiveCareAppointment'] = this.isLiveCareAppointment; data['invoiceNo_VP'] = this.invoiceNo_VP; + data['Status'] = this.status; + data['StatusDesc'] = this.statusDesc; return data; } } diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 69f4b10e..855836e3 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -76,6 +76,7 @@ class _LaboratoryResultPageState extends State { details: model.patientLabSpecialResult.isEmpty ? null : getSpecialResults(model), orderNo: widget.patientLabOrders!.orderNo, patientLabOrder: widget.patientLabOrders, + projectName: widget.patientLabOrders!.projectName, ), itemCount: 1, ), diff --git a/lib/pages/medical/labs/labs_home_page.dart b/lib/pages/medical/labs/labs_home_page.dart index 7998b558..5a163c10 100644 --- a/lib/pages/medical/labs/labs_home_page.dart +++ b/lib/pages/medical/labs/labs_home_page.dart @@ -87,6 +87,9 @@ class LabsHomePage extends StatelessWidget { isLiveCareAppointment: labOrder.isLiveCareAppointment, date: labOrder.orderDate, isSortByClinic: _isSortByClinic, + isLabOrderResult: true, + resultStatus: labOrder.status!, + resultStatusDesc: labOrder.statusDesc!, //projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(labOrder.orderDate) : DateUtil.getMonthDayYearDateFormatted(labOrder.orderDate), ); }, diff --git a/lib/pages/medical/my_invoices/invoice_detail_page.dart b/lib/pages/medical/my_invoices/invoice_detail_page.dart index e676aefe..c4cfe3e2 100644 --- a/lib/pages/medical/my_invoices/invoice_detail_page.dart +++ b/lib/pages/medical/my_invoices/invoice_detail_page.dart @@ -39,9 +39,11 @@ class _InvoiceDetailState extends State { dynamic grandTotal = 0; + late ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); generateInvoiceDetails(); return AppScaffold( appBarTitle: widget.doctor.doctorTitle != null ? widget.doctor.doctorTitle.toString() : TranslationBase.of(context).dr + " " + widget.doctor.name.toString(), @@ -278,13 +280,13 @@ class _InvoiceDetailState extends State { tableRow.add( TableRow(children: [ Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation![i].procedureName}', - isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation!.length - 1)), + isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation!.length - 1), mProjectViewModel: projectViewModel), Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation![i].quantity}', - isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation!.length - 1)), + isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation!.length - 1), mProjectViewModel: projectViewModel), Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation![i].price.toString() + " " + TranslationBase.of(context).sar}', - isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation!.length - 1)), + isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation!.length - 1), mProjectViewModel: projectViewModel), Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation![i].total.toString() + " " + TranslationBase.of(context).sar}', - isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation!.length - 1)), + isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation!.length - 1), mProjectViewModel: projectViewModel), ]), ); } diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart index 56ea5cf6..06df5e90 100644 --- a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart @@ -117,8 +117,8 @@ class _VitalSingChartAndDetialsState extends State { children: [ Utils.tableColumnValue( "${projectViewModel.isArabic ? DateUtil.getWeekDayArabic(labResultList[i].vitalSignDate!.weekday) : DateUtil.getWeekDay(labResultList[i].vitalSignDate!.weekday)}, ${labResultList[i].vitalSignDate!.day} ${projectViewModel.isArabic ? DateUtil.getMonthArabic(labResultList[i].vitalSignDate!.month) : DateUtil.getMonth(labResultList[i].vitalSignDate!.month)}, ${labResultList[i].vitalSignDate!.year}", - isLast: i == (labResultList.length - 1)), - Utils.tableColumnValue('${labResultList[i].toJson()[widget.viewKey]}', isLast: i == (labResultList.length - 1)), + isLast: i == (labResultList.length - 1), mProjectViewModel: projectViewModel), + Utils.tableColumnValue('${labResultList[i].toJson()[widget.viewKey]}', isLast: i == (labResultList.length - 1), mProjectViewModel: projectViewModel), ], ), ); diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart index 4b29c9ec..195afb0c 100644 --- a/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart @@ -113,9 +113,9 @@ class VitalSingChartBloodPressure extends StatelessWidget { children: [ Utils.tableColumnValue( "${projectViewModel.isArabic ? DateUtil.getWeekDayArabic(labResultList[i].vitalSignDate!.weekday) : DateUtil.getWeekDay(labResultList[i].vitalSignDate!.weekday)}, ${labResultList[i].vitalSignDate!.day} ${projectViewModel.isArabic ? DateUtil.getMonthArabic(labResultList[i].vitalSignDate!.month) : DateUtil.getMonth(labResultList[i].vitalSignDate!.month)}, ${labResultList[i].vitalSignDate!.year}", - isLast: i == (labResultList.length - 1)), - Utils.tableColumnValue('${labResultList[i].toJson()[viewKey1]}', isLast: i == (labResultList.length - 1)), - Utils.tableColumnValue('${labResultList[i].toJson()[viewKey2]}', isLast: i == (labResultList.length - 1)), + isLast: i == (labResultList.length - 1), mProjectViewModel: projectViewModel), + Utils.tableColumnValue('${labResultList[i].toJson()[viewKey1]}', isLast: i == (labResultList.length - 1), mProjectViewModel: projectViewModel), + Utils.tableColumnValue('${labResultList[i].toJson()[viewKey2]}', isLast: i == (labResultList.length - 1), mProjectViewModel: projectViewModel), ], ), ); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 0f30731b..d9fec44b 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -3021,6 +3021,7 @@ class TranslationBase { String get generalConsentTitle => localizedValues["generalConsentTitle"][locale.languageCode]; String get generalConsentSubTitle => localizedValues["generalConsentSubTitle"][locale.languageCode]; String get incorrectNationalId => localizedValues["incorrectNationalId"][locale.languageCode]; + String get resultStatus => localizedValues["resultStatus"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 1529d605..ebe33ac9 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -39,6 +39,7 @@ import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; @@ -823,7 +824,31 @@ class Utils { ); } - static Widget tableColumnValue(String text, {bool isLast = false, bool isCapitable = true, ProjectViewModel? mProjectViewModel}) { + static Widget tableColumnValue(String text, {bool isLast = false, bool isCapitable = true, bool isHighLow = false, required ProjectViewModel mProjectViewModel}) { + ProjectViewModel projectViewModel = mProjectViewModel ?? Provider.of(AppGlobal.context); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox(height: 12), + Text( + isCapitable && !projectViewModel.isArabic ? text.toLowerCase().capitalizeFirstofEach : text, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: isHighLow ? CustomColors.accentColor : Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), + ), + SizedBox(height: 12), + if (!isLast) + Divider( + height: 1, + color: Color(0xffEFEFEF), + thickness: 1, + ) + ], + ); + } + + static Widget tableColumnValueWithFlowChart(String text, String flowChartText, {bool isLast = false, bool isCapitable = true, ProjectViewModel? mProjectViewModel}) { ProjectViewModel projectViewModel = mProjectViewModel ?? Provider.of(AppGlobal.context); return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -837,6 +862,13 @@ class Utils { overflow: TextOverflow.ellipsis, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), + SizedBox(height: 8), + AutoSizeText( + flowChartText, + maxLines: 1, + minFontSize: 6, + style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.48, height: 18 / 12), + ), SizedBox(height: 12), if (!isLast) Divider( diff --git a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart index 1e11d402..1bf7f045 100644 --- a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart +++ b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart @@ -160,8 +160,8 @@ class LabResultWidget extends StatelessWidget { children: [ Utils.tableColumnTitle(TranslationBase.of(context).description, showDivider: false), Utils.tableColumnTitle(TranslationBase.of(context).value, showDivider: false), + Utils.tableColumnTitle(TranslationBase.of(context).unit, showDivider: false), Utils.tableColumnTitle(TranslationBase.of(context).range, showDivider: false), - Utils.tableColumnTitle("", showDivider: false), ], ), ); @@ -185,8 +185,9 @@ class LabResultWidget extends StatelessWidget { padding: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 12, right: projectViewModel.isArabic ? 12 : 0), child: Utils.tableColumnValue(labResultList[i].description ?? "", isLast: true, mProjectViewModel: projectViewModel), ), - Utils.tableColumnValue(labResultList[i].resultValue! + " " + labResultList![i].uOM!, isLast: true, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(labResultList[i]!.referanceRange!, isLast: true, isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(labResultList[i].resultValue! + " " + labResultList[i].uOM!, + isHighLow: (labResultList[i].resultValueFlag!.toLowerCase() == "h" || labResultList[i].resultValueFlag!.toLowerCase() == "l"), isLast: true, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(labResultList[i].uOM!, isLast: true, isCapitable: false, mProjectViewModel: projectViewModel), !checkIfCovidLab(patientLabResultList!) ? InkWell( onTap: () { @@ -202,7 +203,7 @@ class LabResultWidget extends StatelessWidget { }, child: Padding( padding: EdgeInsets.only(left: !projectViewModel.isArabic ? 0 : 12, right: !projectViewModel.isArabic ? 12 : 0), - child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false), + child: Utils.tableColumnValueWithFlowChart(labResultList[i].referanceRange!, TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false), ), ) : Container(), diff --git a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart index e52ca036..d0deb1b4 100644 --- a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart +++ b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart @@ -19,9 +19,12 @@ class LabResultDetailsWidget extends StatefulWidget { } class _VitalSignDetailsWidgetState extends State { + + late ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return Table( columnWidths: { 0: FlexColumnWidth(2), @@ -46,8 +49,8 @@ class _VitalSignDetailsWidgetState extends State { tableRow.add( TableRow( children: [ - Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(labOrderResultList![i].verifiedOnDateTime!)), isLast: i == (labOrderResultList.length - 1)), - Utils.tableColumnValue(labOrderResultList[i].resultValue!, isLast: i == (labOrderResultList.length - 1)), + Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(labOrderResultList![i].verifiedOnDateTime!)), isLast: i == (labOrderResultList.length - 1), mProjectViewModel: projectViewModel), + Utils.tableColumnValue(labOrderResultList[i].resultValue!, isLast: i == (labOrderResultList.length - 1), mProjectViewModel: projectViewModel), ], ), ); diff --git a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart index 148cf935..1ceca02f 100644 --- a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -19,9 +19,10 @@ class LaboratoryResultWidget extends StatefulWidget { final String? billNo; final String? details; final String? orderNo; + final String? projectName; final PatientLabOrders? patientLabOrder; - const LaboratoryResultWidget({Key? key, this.onTap, this.billNo, this.details, this.orderNo, this.patientLabOrder}) : super(key: key); + const LaboratoryResultWidget({Key? key, this.onTap, this.billNo, this.details, this.orderNo, this.projectName, this.patientLabOrder}) : super(key: key); @override _LaboratoryResultWidgetState createState() => _LaboratoryResultWidgetState(); diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 90a93a12..05cc66c6 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -34,6 +34,9 @@ class DoctorCard extends StatelessWidget { final bool isSickLeave; final int sickLeaveStatus; final int projectID; + final bool isLabOrderResult; + final int? resultStatus; + final String? resultStatusDesc; DoctorCard( {this.name, @@ -54,7 +57,10 @@ class DoctorCard extends StatelessWidget { this.isParentAppointment = false, this.isSickLeave = false, this.sickLeaveStatus = 0, - this.projectID = 0}); + this.projectID = 0, + this.isLabOrderResult = false, + this.resultStatus = 0, + this.resultStatusDesc = ""}); late ProjectViewModel projectViewModel; @@ -239,6 +245,8 @@ class DoctorCard extends StatelessWidget { ), ], ), + if (isLabOrderResult) + MyRichText(TranslationBase.of(context).resultStatus, resultStatusDesc ?? "", projectViewModel.isArabic, valueColor: getResultStatusColor(resultStatus!)), ], ), ), @@ -274,6 +282,22 @@ class DoctorCard extends StatelessWidget { ); } + Color getResultStatusColor(int resultStatus) { + Color statusColor = Color(0xff2B353E); + + if (resultStatus == 17 || resultStatus == 16) { + statusColor = CustomColors.green; + } + if (resultStatus == 45) { + statusColor = CustomColors.orange; + } + if (resultStatus == 44) { + statusColor = CustomColors.accentColor; + } + + return statusColor; + } + String getStatusText(BuildContext context) { String statusText = ""; if (sickLeaveStatus == 1) { diff --git a/lib/widgets/my_rich_text.dart b/lib/widgets/my_rich_text.dart index 6d183d3b..c5324cff 100644 --- a/lib/widgets/my_rich_text.dart +++ b/lib/widgets/my_rich_text.dart @@ -4,19 +4,22 @@ class MyRichText extends StatelessWidget { final String title; final String value; final bool isArabic; - MyRichText(this.title,this.value,this.isArabic,{Key? key}) : super(key: key); + final Color? valueColor; + + // MyRichText(this.title, this.value, this.isArabic, {this.valueColor}); + MyRichText(this.title, this.value, this.isArabic, {this.valueColor, Key? key}) : super(key: key); @override Widget build(BuildContext context) { return RichText( - maxLines: 1, + maxLines: 2, text: TextSpan( text: title, style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff575757), letterSpacing: -0.4, height: 18 / 10), children: [ TextSpan( text: " $value", - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: valueColor ?? Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ) ]), );