From 8f38dc607795e2fd9b46d8e0274dbba1c819d067 Mon Sep 17 00:00:00 2001 From: Mohammad Aljmma Date: Mon, 16 Nov 2020 12:32:27 +0200 Subject: [PATCH 1/5] fix issue #24 --- lib/config/localized_values.dart | 7 +++++++ .../prescriptions/perscription_pharmacy.dart | 2 +- .../service/medical/prescriptions_service.dart | 3 ++- .../medical/prescriptions_view_model.dart | 4 ++-- .../pharmacy_for_prescriptions_page.dart | 3 ++- .../prescriptions/prescription_details_page.dart | 15 ++++++++------- .../prescriptions/prescription_items_page.dart | 8 ++++---- lib/uitl/translations_delegate_base.dart | 7 +++++++ 8 files changed, 33 insertions(+), 16 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d3edb53c..3976a47b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -833,4 +833,11 @@ const Map localizedValues = { "HealthWeatherIndicators": {"en": "Health Weather Indicators", 'ar': ' مؤشرات الطقس الصحية '}, "HealthTipsBasedOnCurrentWeather": {"en": "Health Tips Based On Current Weather", 'ar': ' نصائح صحية على أساس الطقس الحالي '}, "MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "}, + "SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"}, + "ResendOrder": {"en": "Resend order & deliver", "ar": "إعادة طلب و توصيل"}, + "Ports": {"en": "Ports", "ar": "المنافذ"}, + "Way": {"en": "Way", "ar": "الطزيقة"}, + "Average": {"en": "Average", "ar": "المعدل"}, + "DailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, + "Period": {"en": "Period", "ar": "الفترة"}, }; diff --git a/lib/core/model/prescriptions/perscription_pharmacy.dart b/lib/core/model/prescriptions/perscription_pharmacy.dart index 5180689f..3adaef7e 100644 --- a/lib/core/model/prescriptions/perscription_pharmacy.dart +++ b/lib/core/model/prescriptions/perscription_pharmacy.dart @@ -1,6 +1,6 @@ class PharmacyPrescriptions { String expiryDate; - double sellingPrice; + dynamic sellingPrice; int quantity; int itemID; int locationID; diff --git a/lib/core/service/medical/prescriptions_service.dart b/lib/core/service/medical/prescriptions_service.dart index 34c5bf54..b920499c 100644 --- a/lib/core/service/medical/prescriptions_service.dart +++ b/lib/core/service/medical/prescriptions_service.dart @@ -57,12 +57,13 @@ class PrescriptionsService extends BaseService { List prescriptionReportList = List(); Future getPrescriptionReport( - {int dischargeNo, int projectId, int clinicID, String setupID}) async { + {int dischargeNo, int projectId, int clinicID, String setupID,int episodeID}) async { hasError = false; _requestPrescriptionReport.dischargeNo = dischargeNo; _requestPrescriptionReport.projectID = projectId; _requestPrescriptionReport.clinicID = clinicID; _requestPrescriptionReport.setupID = setupID; + _requestPrescriptionReport.episodeID = episodeID; await baseAppClient.post(GET_PRESCRIPTION_REPORT, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/viewModels/medical/prescriptions_view_model.dart b/lib/core/viewModels/medical/prescriptions_view_model.dart index 8f9218c9..054dc4ef 100644 --- a/lib/core/viewModels/medical/prescriptions_view_model.dart +++ b/lib/core/viewModels/medical/prescriptions_view_model.dart @@ -103,9 +103,9 @@ class PrescriptionsViewModel extends BaseViewModel { notifyListeners(); } - getPrescriptionReport({int dischargeNo,int projectId,int clinicID,String setupID}) async { + getPrescriptionReport({int dischargeNo,int projectId,int clinicID,String setupID,int episodeID}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReport(dischargeNo: dischargeNo,projectId: projectId,clinicID: clinicID,setupID: setupID); + await _prescriptionsService.getPrescriptionReport(dischargeNo: dischargeNo,projectId: projectId,clinicID: clinicID,setupID: setupID,episodeID: episodeID); if (_prescriptionsService.hasError) { error = _prescriptionsService.error; setState(ViewState.ErrorLocal); diff --git a/lib/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart b/lib/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart index 00db8f8c..1b1eaf3f 100644 --- a/lib/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart +++ b/lib/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.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'; @@ -19,7 +20,7 @@ class PharmacyForPrescriptionsPage extends StatelessWidget { onModelReady: (model) => model.getListPharmacyForPrescriptions(itemId: prescriptionReport.itemID), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Title', + appBarTitle: TranslationBase.of(context).ports, baseViewModel: model, body: ListView.builder( itemBuilder: (context, index) => Container( diff --git a/lib/pages/medical/prescriptions/prescription_details_page.dart b/lib/pages/medical/prescriptions/prescription_details_page.dart index 43dc398b..4416b9fa 100644 --- a/lib/pages/medical/prescriptions/prescription_details_page.dart +++ b/lib/pages/medical/prescriptions/prescription_details_page.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/pharmacy_for_prescriptions_page.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:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -15,7 +16,7 @@ class PrescriptionDetailsPage extends StatelessWidget { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: 'Prescription Details', + appBarTitle: TranslationBase.of(context).prescriptions, body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -86,7 +87,7 @@ class PrescriptionDetailsPage extends StatelessWidget { SizedBox( height: 5, ), - Texts('Ports') + Texts(TranslationBase.of(context).ports) ], ), )), @@ -104,22 +105,22 @@ class PrescriptionDetailsPage extends StatelessWidget { color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts('Way'))), + child: Center(child: Texts(TranslationBase.of(context).way))), Container( color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts('Average'))), + child: Center(child: Texts(TranslationBase.of(context).average))), Container( color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts('Daily doses'))), + child: Center(child: Texts(TranslationBase.of(context).dailyDoses))), Container( color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts('Period'))), + child: Center(child: Texts(TranslationBase.of(context).period))), ], ), TableRow( @@ -162,7 +163,7 @@ class PrescriptionDetailsPage extends StatelessWidget { child: Center( child: Column( children: [ - Texts('Notes'), + Texts(TranslationBase.of(context).notes), SizedBox( height: 5, ), diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index 297d8333..d2fdae0b 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -20,7 +20,7 @@ class PrescriptionItemsPage extends StatelessWidget { Widget build(BuildContext context) { return BaseView( onModelReady: (model) => - model.getPrescriptionReport(dischargeNo: prescriptions.dischargeNo,setupID:prescriptions.setupID,clinicID: prescriptions.clinicID,projectId: prescriptions.projectID), + model.getPrescriptionReport(dischargeNo: prescriptions.dischargeNo,setupID:prescriptions.setupID,clinicID: prescriptions.clinicID,projectId: prescriptions.projectID,episodeID: prescriptions.episodeID), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).prescriptions, @@ -81,7 +81,7 @@ class PrescriptionItemsPage extends StatelessWidget { ), bottomSheet: Container( width: double.infinity, - height: MediaQuery.of(context).size.height * 0.2, + height: MediaQuery.of(context).size.height * 0.23, color: Colors.grey[100], child: Column( children: [ @@ -89,7 +89,7 @@ class PrescriptionItemsPage extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( - label: 'Send Copy', + label: TranslationBase.of(context).sendCopy, onTap: () => model.sendPrescriptionEmail( appointmentDate: prescriptions.appointmentDate, patientID: prescriptions.patientID, @@ -102,7 +102,7 @@ class PrescriptionItemsPage extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( - label: 'Resend order & deliver', + label:TranslationBase.of(context).resendOrder, backgroundColor: Colors.green[200], )) ], diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 05a0a248..5543c489 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -787,6 +787,13 @@ class TranslationBase { String get healthWeatherIndicators => localizedValues['HealthWeatherIndicators'][locale.languageCode]; String get healthTipsBasedOnCurrentWeather => localizedValues['HealthTipsBasedOnCurrentWeather'][locale.languageCode]; String get moreDetails => localizedValues['MoreDetails'][locale.languageCode]; + String get sendCopy => localizedValues['SendCopy'][locale.languageCode]; + String get resendOrder => localizedValues['ResendOrder'][locale.languageCode]; + String get ports => localizedValues['Ports'][locale.languageCode]; + String get way => localizedValues['Way'][locale.languageCode]; + String get average => localizedValues['Average'][locale.languageCode]; + String get dailyDoses => localizedValues['DailyDoses'][locale.languageCode]; + String get period => localizedValues['Period'][locale.languageCode]; } From ed7b9d609fb1e540d170d34a2eb90fcf1cb934d3 Mon Sep 17 00:00:00 2001 From: Mohammad Aljmma Date: Tue, 17 Nov 2020 10:05:25 +0200 Subject: [PATCH 2/5] fix lab result --- lib/config/config.dart | 4 ++-- lib/core/service/medical/labs_service.dart | 8 +++++--- .../data_display/medical/laboratory_result_widget.dart | 7 ++++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index f37bbaea..3f68aa34 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -6,8 +6,8 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; const MAX_SMALL_SCREEN = 660; -const BASE_URL = 'https://uat.hmgwebservices.com/'; -//const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; ///Doctor diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 36503ac1..367ca4b9 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -9,11 +9,12 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; class LabsService extends BaseService { - RequestPatientLabOrders _requestPatientLabOrders = RequestPatientLabOrders(); List patientLabOrdersList = List(); Future getPatientLabOrdersList() async { hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; await baseAppClient.post(GET_Patient_LAB_ORDERS, onSuccess: (dynamic response, int statusCode) { patientLabOrdersList.clear(); @@ -23,7 +24,7 @@ class LabsService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _requestPatientLabOrders.toJson()); + }, body: body); } RequestPatientLabSpecialResult _requestPatientLabSpecialResult = @@ -60,7 +61,8 @@ class LabsService extends BaseService { Map body = Map(); body['InvoiceNo'] = patientLabOrder.invoiceNo; body['OrderNo'] = patientLabOrder.orderNo; - body['Procedure'] = "U/A"; + body['isDentalAllowedBackend'] = false; + body['SetupID'] = patientLabOrder.setupID; body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID; //TODO Check the res diff --git a/lib/widgets/data_display/medical/laboratory_result_widget.dart b/lib/widgets/data_display/medical/laboratory_result_widget.dart index ecb32c6c..8662b9b0 100644 --- a/lib/widgets/data_display/medical/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/laboratory_result_widget.dart @@ -6,6 +6,7 @@ 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:flutter_html/flutter_html.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -153,7 +154,11 @@ class _LaboratoryResultWidgetState extends State { duration: Duration(milliseconds: 7000), child: Container( width: double.infinity, - child: Text(widget.details ?? 'No Data')), + child: Html( + // data:"
BCG
HEPATITIS B
"//model.creteVaccinationTableModelList[index].vaccinesDescription + data:widget.details ?? 'No Data', + + )), ), SizedBox( height: 12, From 770d28033d7a8f702c0694b9eee1dc2b9d67df64 Mon Sep 17 00:00:00 2001 From: Mohammad Aljmma Date: Tue, 17 Nov 2020 13:53:28 +0200 Subject: [PATCH 3/5] fix issues#26 & 27 & 28 --- lib/config/localized_values.dart | 108 ++++++++++++++++++ .../feedback/feedback_view_model.dart | 33 +++++- lib/pages/feedback/feedback_home_page.dart | 7 +- lib/pages/feedback/send_feedback_page.dart | 43 +++---- lib/pages/feedback/status_feedback_page.dart | 3 +- .../vital_sign/vital_sign_details_screen.dart | 16 +-- lib/uitl/translations_delegate_base.dart | 27 +++++ 7 files changed, 198 insertions(+), 39 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 3976a47b..0ce568ba 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -840,4 +840,112 @@ const Map localizedValues = { "Average": {"en": "Average", "ar": "المعدل"}, "DailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, "Period": {"en": "Period", "ar": "الفترة"}, + "cm": { + "en": "CM", + "ar": "سم" + }, + "kg": { + "en": "kg", + "ar": "كجم" + }, + "mass": { + "en": "Mass", + "ar": "كتلة" + }, + "temp-c": { + "en": "°C", + "ar": "°س" + }, + "bpm": { + "en": "bpm", + "ar": "نبضة" + }, + "respiration-signs": { + "en": "Respiration", + "ar": "تنفس" + }, + "sys-dias": { + "en": "SBP/DBP", + "ar": "إنقباض/إنبساط" + }, + "body": { + "en": "Body \n Mass", + "ar": "كتلة\nالجسم" + }, + "feedback": { + "en": "Feedback", + "ar": "رأيك يهمنا" + }, + "send": { + "en": "Send", + "ar": "أرسل" + }, + "status": { + "en": "Status", + "ar": "الحالة" + }, + "like-to-hear": { + "en": "We would love to hear the feedback, concerns on healthcare services and eServices experience. Please use the below form", + "ar": "يسعدنا سماع ملاحظاتك حول خدمات الرعاية الصحية والخدمات الإلكترونية. يرجى تعبئة الحقول المطلوبة" + }, + "subject": { + "en": "Subject", + "ar": "الموضوع" + }, + "message": { + "en": "Message", + "ar": "رسالة" + }, + "empty-subject": { + "en": "Please enter the subject", + "ar": "يرجى ادخال الموضوع" + }, + "empty-message": { + "en": "Please enter message", + "ar": "يرجى ادخال الموضوع" + }, + "select-attachment": { + "en": "Select Attachment", + "ar": "إختر المرفق" + }, + "complain-appo": { + "en": "Complaint for appointment", + "ar": "شكوى على موعد" + }, + "complain-without-appo": { + "en": "Complaint without appointment", + "ar": "شكوى بدون موعد" + }, + "question": { + "en": "Question", + "ar": "سؤال" + }, + "message-type": { + "en": "Message Type", + "ar": "نوع الرسالة" + }, + "compliment": { + "en": "compliment", + "ar": "ثناء" + }, + "suggestion": { + "en": "Suggestion", + "ar": "إقتراح" + }, + "your-feedback": { + "en": "Your feedback was sent", + "ar": "إقتراح" + }, + "select-part": { + "en": "Please select the part that complain about", + "ar": "يرجى تحديد الجزء الذي تشكو منه" + }, + "number": { + "en": "Number", + "ar": "الرقم" + }, + "not-classified": { + "en": "Not classified", + "ar": "غير محدد" + }, }; diff --git a/lib/core/viewModels/feedback/feedback_view_model.dart b/lib/core/viewModels/feedback/feedback_view_model.dart index d5f14e2d..4956024d 100644 --- a/lib/core/viewModels/feedback/feedback_view_model.dart +++ b/lib/core/viewModels/feedback/feedback_view_model.dart @@ -3,6 +3,8 @@ import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart'; import 'package:diplomaticquarterapp/core/service/feedback/feedback_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/cupertino.dart'; import '../../../locator.dart'; @@ -22,7 +24,31 @@ class FeedbackViewModel extends BaseViewModel { MessageType messageType = MessageType.NON; MessageType messageTypeDialog = MessageType.NON; - String selected = "not selected"; + + + String getSelected(BuildContext context) { + switch (messageType) { + case MessageType.ComplaintOnAnAppointment: + return TranslationBase.of(context).complainAppo; + break; + case MessageType.ComplaintWithoutAppointment: + return TranslationBase.of(context).complainWithoutAppo; + break; + case MessageType.Question: + return TranslationBase.of(context).question; + break; + case MessageType.Compliment: + return TranslationBase.of(context).compliment; + break; + case MessageType.Suggestion: + return TranslationBase.of(context).suggestion; + break; + case MessageType.NON: + return TranslationBase.of(context).notClassified; + break; + } + return TranslationBase.of(context).notClassified; + } setMessageDialogType(MessageType messageType) { messageTypeDialog = messageType; @@ -33,19 +59,14 @@ class FeedbackViewModel extends BaseViewModel { this.messageType = messageType; switch (messageType) { case MessageType.ComplaintOnAnAppointment: - selected = "Complaint on an appointment"; break; case MessageType.ComplaintWithoutAppointment: - selected = "Complaint without appointment"; break; case MessageType.Question: - selected = "Question"; break; case MessageType.Compliment: - selected = "Compliment"; break; case MessageType.Suggestion: - selected = "Suggestion"; break; case MessageType.NON: break; diff --git a/lib/pages/feedback/feedback_home_page.dart b/lib/pages/feedback/feedback_home_page.dart index 5c7ba86d..309b5713 100644 --- a/lib/pages/feedback/feedback_home_page.dart +++ b/lib/pages/feedback/feedback_home_page.dart @@ -1,6 +1,7 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/pages/feedback/send_feedback_page.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'; @@ -35,7 +36,7 @@ class _FeedbackHomePageState extends State isShowAppBar: true, isBottomBar: false, isShowDecPage: false, - appBarTitle: 'Feedback', + appBarTitle: TranslationBase.of(context).feedbackTitle, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -82,13 +83,13 @@ class _FeedbackHomePageState extends State Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: Texts('Send'), + child: Texts(TranslationBase.of(context).send), ), ), Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: Texts('Status'), + child: Texts(TranslationBase.of(context).status), ), ), ], diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 756a421b..27d2f353 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_mode import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; @@ -52,8 +53,7 @@ class _SendFeedbackPageState extends State { Container( margin: EdgeInsets.only(left: 20, right: 20, top: 8), child: Texts( - 'We\'d love to hear your feedback about the health care services and online services. Please fill in the required fields', - //يسعدنا سماع ملاحظاتك حول خدمات الرعاية الصحية والخدمات الإلكترونية. يرجى تعبئة الحقول المطلوبة + TranslationBase.of(context).likeToHear, textAlign: TextAlign.center, variant: 'body2Link', ), @@ -75,11 +75,12 @@ class _SendFeedbackPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( + child: Texts( - model.selected, + model.getSelected(context), variant: 'bodyText', ), - margin: EdgeInsets.only(left: 10), + margin: EdgeInsets.only(left: 10,right: 10), ), Icon( Icons.arrow_drop_down, @@ -278,14 +279,14 @@ class _SendFeedbackPageState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( - hintText: 'Title', + hintText: TranslationBase.of(context).subject, controller: titleController, fontSize: 13.5, hintColor: Colors.black, fontWeight: FontWeight.w600, validator: (value) { if (value == null) - return "please Enter title"; + return TranslationBase.of(context).emptySubject; else return null; }, @@ -294,7 +295,7 @@ class _SendFeedbackPageState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( - hintText: 'message', + hintText: TranslationBase.of(context).message, fontSize: 13.5, hintColor: Colors.black, fontWeight: FontWeight.w600, @@ -303,7 +304,7 @@ class _SendFeedbackPageState extends State { controller: messageController, validator: (value) { if (value == null) - return "please Enter message"; + return TranslationBase.of(context).emptyMessage; else return null; }), @@ -332,7 +333,7 @@ class _SendFeedbackPageState extends State { children: [ Icon(Icons.attach_file), Texts( - 'selected attachment', + TranslationBase.of(context).selectAttachment, variant: 'bodyText', textAlign: TextAlign.center, ), @@ -391,7 +392,7 @@ class _SendFeedbackPageState extends State { height: MediaQuery.of(context).size.height * 0.1, width: MediaQuery.of(context).size.width * 0.8, child: Button( - label: 'Send', + label: TranslationBase.of(context).send, loading: model.state == ViewState.BusyLocal, onTap: () { final form = formKey.currentState; @@ -415,13 +416,13 @@ class _SendFeedbackPageState extends State { }); model.setMessageType(MessageType.NON); AppToast.showSuccessToast( - message: "Your feedback was send"); + message: TranslationBase.of(context).yourFeedback); } else { AppToast.showErrorToast(message: model.error); } }); else { - AppToast.showErrorToast(message: "Please select COC"); + AppToast.showErrorToast(message: TranslationBase.of(context).selectPart); } }, ), @@ -489,7 +490,7 @@ class FeedbackTypeDialogState extends State { return BaseView( builder: (_, model, widge) => SimpleDialog( title: Text( - "Message Type", + TranslationBase.of(context).messageType, textAlign: TextAlign.center, ), children: [ @@ -509,7 +510,7 @@ class FeedbackTypeDialogState extends State { onTap: () => model.setMessageDialogType( MessageType.ComplaintOnAnAppointment), child: ListTile( - title: const Text('Complaint on an appointment'), + title: Texts(TranslationBase.of(context).complainAppo), leading: Radio( value: MessageType.ComplaintOnAnAppointment, groupValue: model.messageTypeDialog, @@ -533,7 +534,7 @@ class FeedbackTypeDialogState extends State { onTap: () => model.setMessageDialogType( MessageType.ComplaintWithoutAppointment), child: ListTile( - title: const Text('Complaint without appointment'), + title: Texts(TranslationBase.of(context).complainWithoutAppo), leading: Radio( value: MessageType.ComplaintWithoutAppointment, groupValue: model.messageTypeDialog, @@ -557,7 +558,7 @@ class FeedbackTypeDialogState extends State { onTap: () => model.setMessageDialogType(MessageType.Question), child: ListTile( - title: const Text('Question'), + title: Texts(TranslationBase.of(context).question), leading: Radio( value: MessageType.Question, groupValue: model.messageTypeDialog, @@ -581,7 +582,7 @@ class FeedbackTypeDialogState extends State { onTap: () => model.setMessageDialogType(MessageType.Compliment), child: ListTile( - title: const Text('compliment'), + title: Texts(TranslationBase.of(context).compliment), leading: Radio( value: MessageType.Compliment, groupValue: model.messageTypeDialog, @@ -605,7 +606,7 @@ class FeedbackTypeDialogState extends State { onTap: () => model.setMessageDialogType(MessageType.Suggestion), child: ListTile( - title: const Text('Suggestion'), + title: Texts(TranslationBase.of(context).suggestion), leading: Radio( value: MessageType.Suggestion, groupValue: model.messageTypeDialog, @@ -638,11 +639,11 @@ class FeedbackTypeDialogState extends State { Navigator.pop(context); }, child: Padding( - padding: const EdgeInsets.all(8.0), + padding: EdgeInsets.all(8.0), child: Container( child: Center( child: Texts( - 'cancel', + TranslationBase.of(context).cancel, color: Colors.red, ), ), @@ -666,7 +667,7 @@ class FeedbackTypeDialogState extends State { padding: const EdgeInsets.all(8.0), child: Center( child: Texts( - 'ok', + TranslationBase.of(context).ok, fontWeight: FontWeight.w400, )), ), diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index b6e389cf..457ded60 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -52,7 +53,7 @@ class _StatusFeedbackPageState extends State { children: [ Texts('${model.cOCItemList[index].cOCTitle}'), Texts( - 'Number :${model.cOCItemList[index].itemID}', + TranslationBase.of(context).number + ' : ${model.cOCItemList[index].itemID}', variant: 'overline', ), ], 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 b8c4eda2..667620a2 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart @@ -55,7 +55,7 @@ class VitalSignDetailsScreen extends StatelessWidget { mode.vitalSignResModelList.length - 1] .heightCm .toString(), - unit: ' Cm', + unit: TranslationBase.of(context).cm, ), ), ), @@ -73,7 +73,7 @@ class VitalSignDetailsScreen extends StatelessWidget { child: VitalSignItem( des: TranslationBase.of(context).weight, icon: DQIcons.weight_scale, - unit: ' Kg', + unit: TranslationBase.of(context).kg, lastVal: mode .vitalSignResModelList[ mode.vitalSignResModelList.length - 1] @@ -98,12 +98,12 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ), child: VitalSignItem( - des: TranslationBase.of(context).bodyMeasurements, + des: TranslationBase.of(context).body, icon: DQIcons.bmi, lastVal: mode .vitalSignResModelList[0].pulseBeatPerMinute .toString(), - unit: 'BMI', + unit: TranslationBase.of(context).mass, ), ), InkWell( @@ -125,7 +125,7 @@ class VitalSignDetailsScreen extends StatelessWidget { lastVal: mode .vitalSignResModelList[0].temperatureCelcius .toString(), - unit: 'C', + unit: TranslationBase.of(context).tempC, ), ), ), @@ -152,7 +152,7 @@ class VitalSignDetailsScreen extends StatelessWidget { mode.vitalSignResModelList.length - 1] .pulseBeatPerMinute .toString(), - unit: ' bpm', + unit: TranslationBase.of(context).bpm, ), ), InkWell( @@ -175,7 +175,7 @@ class VitalSignDetailsScreen extends StatelessWidget { mode.vitalSignResModelList.length - 1] .respirationBeatPerMinute .toString(), - unit: ' bmp', + unit: TranslationBase.of(context).respirationSigns, ), ), ], @@ -202,7 +202,7 @@ class VitalSignDetailsScreen extends StatelessWidget { mode.vitalSignResModelList.length - 1] .bloodPressure .toString(), - unit: ' SBP/DBP', + unit: TranslationBase.of(context).sysDias, ), ), ], diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 5543c489..1a455504 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -794,6 +794,33 @@ class TranslationBase { String get average => localizedValues['Average'][locale.languageCode]; String get dailyDoses => localizedValues['DailyDoses'][locale.languageCode]; String get period => localizedValues['Period'][locale.languageCode]; + String get cm => localizedValues['cm'][locale.languageCode]; + String get kg => localizedValues['kg'][locale.languageCode]; + String get mass => localizedValues['mass'][locale.languageCode]; + String get tempC => localizedValues['temp-c'][locale.languageCode]; + String get bpm => localizedValues['bpm'][locale.languageCode]; + String get respirationSigns => localizedValues['respiration-signs'][locale.languageCode]; + String get sysDias => localizedValues['sys-dias'][locale.languageCode]; + String get body => localizedValues['body'][locale.languageCode]; + String get feedbackTitle => localizedValues['feedback'][locale.languageCode]; + String get send => localizedValues['send'][locale.languageCode]; + String get status => localizedValues['status'][locale.languageCode]; + String get likeToHear => localizedValues['like-to-hear'][locale.languageCode]; + String get subject => localizedValues['subject'][locale.languageCode]; + String get message => localizedValues['message'][locale.languageCode]; + String get emptySubject => localizedValues['empty-subject'][locale.languageCode]; + String get emptyMessage => localizedValues['empty-message'][locale.languageCode]; + String get selectAttachment => localizedValues['select-attachment'][locale.languageCode]; + String get complainAppo => localizedValues['complain-appo'][locale.languageCode]; + String get complainWithoutAppo => localizedValues['complain-without-appo'][locale.languageCode]; + String get question => localizedValues['question'][locale.languageCode]; + String get messageType => localizedValues['message-type'][locale.languageCode]; + String get compliment => localizedValues['compliment'][locale.languageCode]; + String get suggestion => localizedValues['suggestion'][locale.languageCode]; + String get yourFeedback => localizedValues['your-feedback'][locale.languageCode]; + String get selectPart => localizedValues['select-part'][locale.languageCode]; + String get number => localizedValues['number'][locale.languageCode]; + String get notClassified => localizedValues['not-classified'][locale.languageCode]; } From a9b11a6b032bc54de4aaf87e41ae8987541f5c7d Mon Sep 17 00:00:00 2001 From: Mohammad Aljmma Date: Wed, 18 Nov 2020 01:49:20 +0200 Subject: [PATCH 4/5] fix lab result --- lib/config/config.dart | 2 +- lib/core/model/labs/lab_result.dart | 11 ++ lib/core/service/medical/labs_service.dart | 1 - .../viewModels/medical/labs_view_model.dart | 20 +++ .../data_display/medical/LabResultWidget.dart | 160 ++++++++++++++++++ .../medical/laboratory_result_widget.dart | 144 ++-------------- 6 files changed, 204 insertions(+), 134 deletions(-) create mode 100644 lib/widgets/data_display/medical/LabResultWidget.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 3f68aa34..1345cc67 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -32,7 +32,7 @@ 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_RESULT = - '/Services/Patients.svc/REST/GetPatientLabResults'; + 'Services/Patients.svc/REST/GetPatientLabResults'; /// const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index 23b3363d..c9acd809 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -86,3 +86,14 @@ class LabResult { return data; } } + + +class LabResultList { + String filterName = ""; + List patientLabResultList = List(); + + LabResultList( + {this.filterName, LabResult lab}) { + patientLabResultList.add(lab); + } +} diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 367ca4b9..b9b9a16c 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -65,7 +65,6 @@ class LabsService extends BaseService { body['SetupID'] = patientLabOrder.setupID; 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(); diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 8cbf0efc..582ee745 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -82,6 +82,8 @@ class LabsViewModel extends BaseViewModel { List get labResultList => _labsService.labResultList; + List labResultLists = List(); + getLaboratoryResult( {String projectID, int clinicID, @@ -110,6 +112,24 @@ class LabsViewModel extends BaseViewModel { error = _labsService.error; setState(ViewState.Error); } else { + _labsService.labResultList.forEach((element) { + List patientLabOrdersClinic = + labResultLists + .where((elementClinic) => + elementClinic.filterName == element.testCode) + .toList(); + + if (patientLabOrdersClinic.length != 0) { + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] + .patientLabResultList + .add(element); + } else { + labResultLists.add(LabResultList( + filterName: element.testCode, + lab: element)); + } + + }); setState(ViewState.Idle); } } diff --git a/lib/widgets/data_display/medical/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResultWidget.dart new file mode 100644 index 00000000..225b4076 --- /dev/null +++ b/lib/widgets/data_display/medical/LabResultWidget.dart @@ -0,0 +1,160 @@ +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../text.dart'; + +class LabResultWidget extends StatelessWidget { + + final String filterName ; + final List patientLabResultList; + + LabResultWidget({Key key, this.filterName, this.patientLabResultList}) : super(key: key); + ProjectViewModel projectViewModel; + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + + return Container( + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts(filterName), + InkWell( + onTap: () { + //TODO 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(patientLabResultList), + ), + ], + ), + ); + } + List fullData(List labResultList) { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Color(0xff515B5D), + 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: Color(0xff515B5D), + ), + child: Center( + child: Texts('Value', color: Colors.white), + ), + height: 60), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Color(0xff515B5D), + 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/data_display/medical/laboratory_result_widget.dart b/lib/widgets/data_display/medical/laboratory_result_widget.dart index 8662b9b0..f763def1 100644 --- a/lib/widgets/data_display/medical/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/laboratory_result_widget.dart @@ -11,6 +11,7 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../text.dart'; +import 'LabResultWidget.dart'; class LaboratoryResultWidget extends StatefulWidget { final GestureTapCallback onTap; @@ -155,9 +156,7 @@ class _LaboratoryResultWidgetState extends State { child: Container( width: double.infinity, child: Html( - // data:"
BCG
HEPATITIS B
"//model.creteVaccinationTableModelList[index].vaccinesDescription - data:widget.details ?? 'No Data', - + data: widget.details ?? 'No Data', )), ), SizedBox( @@ -227,32 +226,16 @@ class _LaboratoryResultWidgetState extends State { 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]), + ...List.generate( + model.labResultLists.length, + (index) => LabResultWidget( + filterName: model + .labResultLists[index].filterName, + patientLabResultList: model + .labResultLists[index] + .patientLabResultList, ), - children: fullData(model.labResultList), - ), + ) ], ), ), @@ -269,108 +252,5 @@ class _LaboratoryResultWidgetState extends State { ); } - 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; - } + } From 501692587f3d3b25207f442fab08dd2131ca6581 Mon Sep 17 00:00:00 2001 From: Mohammad Aljmma Date: Wed, 18 Nov 2020 01:52:13 +0200 Subject: [PATCH 5/5] change the base Url --- lib/config/config.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 1345cc67..f4659076 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -6,8 +6,8 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; const MAX_SMALL_SCREEN = 660; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; ///Doctor