diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index b0e473f9..cec5693c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -124,10 +124,10 @@ const Map> localizedValues = { 'ar': 'ليس لديك اي ملاحظة تقدم ' }, 'invoiceNo:': {'en': 'Invoice No :', 'ar': 'رقم الفاتورة'}, - 'generalResult': {'en': 'General Result :', 'ar': 'النتيجة العامة'}, + 'generalResult': {'en': 'General Result ', 'ar': 'النتيجة العامة'}, 'description': {'en': 'Description', 'ar': 'الوصف'}, 'value': {'en': 'Value', 'ar': 'القيمة'}, - 'range': {'en': 'range', 'ar': 'النطاق'}, + 'range': {'en': 'Range', 'ar': 'النطاق'}, 'enterId': {'en': 'Enter ID', 'ar': 'الهوية'}, 'pleaseEnterYourID': { 'en': 'Please enter your ID', @@ -378,7 +378,10 @@ const Map> localizedValues = { 'headCircum': {'en': "Head Circum", 'ar': 'محيط الرأس'}, 'leanBodyWeight': {'en': "Lean Body Weight", 'ar': 'وزن الجسم الهزيل'}, 'bodyMassIndex': {'en': "Body Mass Index", 'ar': 'مؤشر كتلة الجسم'}, - 'yourBodyMassIndex': {'en': "Your Body Mass Index is", 'ar': 'مؤشر كتلة جسمك هو'}, + 'yourBodyMassIndex': { + 'en': "Your Body Mass Index is", + 'ar': 'مؤشر كتلة جسمك هو' + }, 'bmiUnderWeight': {'en': "UnderWeight", 'ar': 'تحت الوزن'}, 'bmiHealthy': {'en': "Healthy", 'ar': 'صحي'}, 'bmiOverWeight': {'en': "OverWeight", 'ar': 'فوق الوزن'}, @@ -817,4 +820,8 @@ const Map> localizedValues = { "en": "Extend Sick Leave Request", "ar": "تمديد طلب الإجازة المرضية" }, + "accepted": {"en": "Accepted", "ar": "وافقت"}, + "cancelled": {"en": "Cancelled", "ar": "ألغيت"}, + "unReplied": {"en": "UnReplied", "ar": "لم يتم الرد"}, + "replied": {"en": "Replied", "ar": " تم الرد"}, }; diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 3f457956..43851649 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -88,6 +88,11 @@ class LabsViewModel extends BaseViewModel { List labResultLists = List(); + List get labResultListsCoustom { + + return labResultLists; + } + getLaboratoryResult( {String projectID, int clinicID, diff --git a/lib/core/viewModel/leave_rechdule_response.dart b/lib/core/viewModel/leave_rechdule_response.dart index d7cab8bf..abcba69e 100644 --- a/lib/core/viewModel/leave_rechdule_response.dart +++ b/lib/core/viewModel/leave_rechdule_response.dart @@ -9,7 +9,7 @@ class GetRescheduleLeavesResponse { int requisitionNo; int requisitionType; int status; - + String createdOn; GetRescheduleLeavesResponse( {this.clinicId, this.coveringDoctorId, @@ -20,7 +20,8 @@ class GetRescheduleLeavesResponse { this.reasonId, this.requisitionNo, this.requisitionType, - this.status}); + this.status, + this.createdOn}); GetRescheduleLeavesResponse.fromJson(Map json) { clinicId = json['clinicId']; @@ -33,6 +34,7 @@ class GetRescheduleLeavesResponse { requisitionNo = json['requisitionNo']; requisitionType = json['requisitionType']; status = json['status']; + createdOn = json['createdOn']; } Map toJson() { @@ -47,6 +49,7 @@ class GetRescheduleLeavesResponse { data['requisitionNo'] = this.requisitionNo; data['requisitionType'] = this.requisitionType; data['status'] = this.status; + data['createdOn'] = this.createdOn; return data; } } diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index a07ae715..548c0a68 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -1,10 +1,17 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/medical_file_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart'; +import 'package:doctor_app_flutter/core/service/prescriptions_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; @@ -12,8 +19,10 @@ import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; +import 'package:flutter/cupertino.dart'; class PrescriptionViewModel extends BaseViewModel { + FilterType filterType = FilterType.Clinic; bool hasError = false; PrescriptionService _prescriptionService = locator(); List get allMedicationList => @@ -26,6 +35,26 @@ class PrescriptionViewModel extends BaseViewModel { List get drugToDrug => _prescriptionService.drugToDrugList; List get itemMedicineList => _prescriptionService.itemMedicineList; + PrescriptionsService _prescriptionsService = locator(); + + List _prescriptionsOrderListClinic = List(); + List _prescriptionsOrderListHospital = List(); + + List get prescriptionReportList => + _prescriptionsService.prescriptionReportList; + + List get prescriptionsList => + _prescriptionsService.prescriptionsList; + + List get pharmacyPrescriptionsList => + _prescriptionsService.pharmacyPrescriptionsList; + List get prescriptionReportEnhList => + _prescriptionsService.prescriptionReportEnhList; + + List get prescriptionsOrderList => + filterType == FilterType.Clinic + ? _prescriptionsOrderListClinic + : _prescriptionsOrderListHospital; Future getItem({int itemID}) async { hasError = false; @@ -119,4 +148,113 @@ class PrescriptionViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + setFilterType(FilterType filterType) { + this.filterType = filterType; + notifyListeners(); + } + + getPrescriptionReport( + {Prescriptions prescriptions, + @required PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _prescriptionsService.getPrescriptionReport( + prescriptions: prescriptions, patient: patient); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + getListPharmacyForPrescriptions( + {int itemId, @required PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _prescriptionsService.getListPharmacyForPrescriptions( + itemId: itemId, patient: patient); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + void _filterList() { + _prescriptionsService.prescriptionsList.forEach((element) { + /// PrescriptionsList list sort clinic + List prescriptionsByClinic = + _prescriptionsOrderListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); + + if (prescriptionsByClinic.length != 0) { + _prescriptionsOrderListClinic[ + _prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] + .prescriptionsList + .add(element); + } else { + _prescriptionsOrderListClinic.add(PrescriptionsList( + filterName: element.clinicDescription, prescriptions: element)); + } + + /// PrescriptionsList list sort via hospital + List prescriptionsByHospital = + _prescriptionsOrderListHospital + .where( + (elementClinic) => elementClinic.filterName == element.name, + ) + .toList(); + + if (prescriptionsByHospital.length != 0) { + _prescriptionsOrderListHospital[_prescriptionsOrderListHospital + .indexOf(prescriptionsByHospital[0])] + .prescriptionsList + .add(element); + } else { + _prescriptionsOrderListHospital.add(PrescriptionsList( + filterName: element.name, prescriptions: element)); + } + }); + } + + getPrescriptionReportEnh( + {PrescriptionsOrder prescriptionsOrder, + @required PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _prescriptionsService.getPrescriptionReportEnh( + prescriptionsOrder: prescriptionsOrder, patient: patient); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + _getPrescriptionsOrders() async { + await _prescriptionsService.getPrescriptionsOrders(); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + getPrescriptions(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _prescriptionsService.getPrescriptions(patient); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.Error); + } else { + _filterList(); + await _getPrescriptionsOrders(); + + setState(ViewState.Idle); + } + } } diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 6af34f4d..9627353f 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -1,4 +1,9 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; +import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; +import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; +import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; @@ -6,11 +11,18 @@ import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; +import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; +import 'package:doctor_app_flutter/core/service/labs_service.dart'; import 'package:doctor_app_flutter/core/service/procedure_service.dart'; +import 'package:doctor_app_flutter/core/service/radiology_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:flutter/cupertino.dart'; class ProcedureViewModel extends BaseViewModel { + FilterType filterType = FilterType.Clinic; bool hasError = false; ProcedureService _procedureService = locator(); List get procedureList => @@ -20,6 +32,28 @@ class ProcedureViewModel extends BaseViewModel { List get categoriesList => _procedureService.categoriesList; List get categoryList => _procedureService.categoryList; + RadiologyService _radiologyService = locator(); + LabsService _labsService = locator(); + List _finalRadiologyListClinic = List(); + List _finalRadiologyListHospital = List(); + List get finalRadiologyList => + filterType == FilterType.Clinic + ? _finalRadiologyListClinic + : _finalRadiologyListHospital; + + List get radiologyList => + _radiologyService.finalRadiologyList; + + List get labOrdersResultsList => + _labsService.labOrdersResultsList; + + List _patientLabOrdersListClinic = List(); + List _patientLabOrdersListHospital = List(); + + List get patientLabOrdersList => + filterType == FilterType.Clinic + ? _patientLabOrdersListClinic + : _patientLabOrdersListHospital; Future getProcedure({int mrn}) async { hasError = false; @@ -101,4 +135,229 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); //await getProcedure(mrn: mrn); } + + void getPatientRadOrders(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _radiologyService.getPatientRadOrders(patient); + if (_radiologyService.hasError) { + error = _radiologyService.error; + setState(ViewState.Error); + } else { + _radiologyService.finalRadiologyList.forEach((element) { + List finalRadiologyListClinic = + _finalRadiologyListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); + + if (finalRadiologyListClinic.length != 0) { + _finalRadiologyListClinic[ + finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] + .finalRadiologyList + .add(element); + } else { + _finalRadiologyListClinic.add(FinalRadiologyList( + filterName: element.clinicDescription, finalRadiology: element)); + } + + // FinalRadiologyList list sort via project + List finalRadiologyListHospital = + _finalRadiologyListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (finalRadiologyListHospital.length != 0) { + _finalRadiologyListHospital[finalRadiologyListHospital + .indexOf(finalRadiologyListHospital[0])] + .finalRadiologyList + .add(element); + } else { + _finalRadiologyListHospital.add(FinalRadiologyList( + filterName: element.projectName, finalRadiology: element)); + } + }); + + setState(ViewState.Idle); + } + } + + String get radImageURL => _radiologyService.url; + + getRadImageURL( + {int invoiceNo, + int lineItem, + int projectId, + @required PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _radiologyService.getRadImageURL( + invoiceNo: invoiceNo, + lineItem: lineItem, + projectId: projectId, + patient: patient); + if (_radiologyService.hasError) { + error = _radiologyService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + setFilterType(FilterType filterType) { + this.filterType = filterType; + notifyListeners(); + } + + List get patientLabSpecialResult => + _labsService.patientLabSpecialResult; + + List get labResultList => _labsService.labResultList; + + List labResultLists = List(); + + List get labResultListsCoustom { + return labResultLists; + } + + void getLabs(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _labsService.getPatientLabOrdersList(patient); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.ErrorLocal); + } else { + _labsService.patientLabOrdersList.forEach((element) { + List patientLabOrdersClinic = + _patientLabOrdersListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); + + if (patientLabOrdersClinic.length != 0) { + _patientLabOrdersListClinic[_patientLabOrdersListClinic + .indexOf(patientLabOrdersClinic[0])] + .patientLabOrdersList + .add(element); + } else { + _patientLabOrdersListClinic.add(PatientLabOrdersList( + filterName: element.clinicDescription, + patientDoctorAppointment: element)); + } + + // doctor list sort via project + List patientLabOrdersHospital = + _patientLabOrdersListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (patientLabOrdersHospital.length != 0) { + _patientLabOrdersListHospital[_patientLabOrdersListHospital + .indexOf(patientLabOrdersHospital[0])] + .patientLabOrdersList + .add(element); + } else { + _patientLabOrdersListHospital.add(PatientLabOrdersList( + filterName: element.projectName, + patientDoctorAppointment: element)); + } + }); + + setState(ViewState.Idle); + } + } + + getLaboratoryResult( + {String projectID, + int clinicID, + String invoiceNo, + String orderNo, + PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _labsService.getLaboratoryResult( + invoiceNo: invoiceNo, + orderNo: orderNo, + projectID: projectID, + clinicID: clinicID, + patient: patient); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + getPatientLabResult( + {PatientLabOrders patientLabOrder, PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _labsService.getPatientLabResult( + patientLabOrder: patientLabOrder, patient: patient); + if (_labsService.hasError) { + 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) { + var value = + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] + .patientLabResultList + .where((e) => + e.sampleCollectedOn == element.sampleCollectedOn && + e.resultValue == element.resultValue) + .toList(); + if (value.isEmpty) + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] + .patientLabResultList + .add(element); + } else { + labResultLists + .add(LabResultList(filterName: element.testCode, lab: element)); + } + }); + setState(ViewState.Idle); + } + } + + getPatientLabOrdersResults( + {PatientLabOrders patientLabOrder, + String procedure, + PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _labsService.getPatientLabOrdersResults( + patientLabOrder: patientLabOrder, + procedure: procedure, + patient: patient); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + bool isShouldClear = false; + if (_labsService.labOrdersResultsList.length == 1) { + labOrdersResultsList.forEach((element) { + if (element.resultValue.contains('/') || + element.resultValue.contains('*') || + element.resultValue.isEmpty) isShouldClear = true; + }); + } + if (isShouldClear) _labsService.labOrdersResultsList.clear(); + setState(ViewState.Idle); + } + } + + sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { + await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); + if (_labsService.hasError) { + error = _labsService.error; + } else + DrAppToastMsg.showSuccesToast(mes); + } } diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index 3a194970..4370b47f 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -70,10 +70,17 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int invoiceNo, int lineItem, int projectId,@required PatiantInformtion patient}) async { + getRadImageURL( + {int invoiceNo, + int lineItem, + int projectId, + @required PatiantInformtion patient}) async { setState(ViewState.Busy); await _radiologyService.getRadImageURL( - invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId,patient: patient); + invoiceNo: invoiceNo, + lineItem: lineItem, + projectId: projectId, + patient: patient); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/main.dart b/lib/main.dart index e3db2e49..a7515e7b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -61,7 +61,7 @@ class MyApp extends StatelessWidget { primarySwatch: Colors.grey, primaryColor: Colors.grey, buttonColor: HexColor('#B8382C'), - fontFamily: 'WorkSans', + fontFamily: 'Poppins', dividerColor: Colors.grey[350], backgroundColor: Color.fromRGBO(255, 255, 255, 1), ), diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index ba76c031..ffb12ee1 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -1,11 +1,16 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class ECGPage extends StatelessWidget { @@ -13,7 +18,9 @@ class ECGPage extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - + String patientType = routeArgs['patient-type']; + String arrivalType = routeArgs['arrival-type']; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getECGPatient( patientType: patient.patientType, @@ -21,28 +28,97 @@ class ECGPage extends StatelessWidget { patientID: patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBarTitle: 'ECG', - body: ListView.builder( - itemCount: model.patientMuseResultsModelList.length, - itemBuilder: (context, index) => InkWell( + isShowAppBar: false, + backgroundColor: Color(0xffF8F8F8), + body: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), + SizedBox(height: 12,), + Texts('Service',style: "caption2",color: Colors.black,), + Texts('ECG',bold: true,fontSize: 22,), + SizedBox(height: 12,), + ...List.generate(model.patientMuseResultsModelList.length, (index) => InkWell( onTap: () async { await launch( model.patientMuseResultsModelList[index].imageURL); }, child: Container( width: double.infinity, - margin: EdgeInsets.all(5), + height: 110, + margin: EdgeInsets.only(top: 5,bottom: 5), padding: EdgeInsets.all(10), decoration: BoxDecoration( - border: Border.all(color: Colors.grey,width: 2) + border: Border.all(color: Colors.white,width: 2), + color: Colors.white, + borderRadius: BorderRadius.circular(8) ), - child: Center( - child: Texts( - "${model.patientMuseResultsModelList[index].createdOnDateTime}"), + child: Column( + children: [ + Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('ECG Report',fontWeight: FontWeight.w700,fontSize: 17,), + SizedBox(height:3), + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of(context).orderNo, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: '${/*model.patientMuseResultsModelList[index].orderNo?? */'3455'}', + style: TextStyle( + fontWeight: FontWeight.w600, + fontFamily: + 'Poppins', + fontSize: 14)), + ], + ), + ) + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Texts('${DateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), + Texts('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), + ], + ), + ), + ], + ), + SizedBox(height: 15,), + Align( + alignment: Alignment.topRight, + child: Icon(Icons.arrow_circle_up_rounded), + ) + ], ), ), )), + + ], + ), + ), + ), ), ); } diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 57b4614d..c20a48ae 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -13,11 +13,10 @@ import 'package:provider/provider.dart'; class LabResultWidget extends StatelessWidget { - final String filterName ; final List patientLabResultList; final PatientLabOrders patientLabOrder; final PatiantInformtion patient; - LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key); + LabResultWidget({Key key, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key); ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -29,38 +28,88 @@ class LabResultWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, children: [ - Texts(filterName), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: FlowChartPage( - filterName: filterName, - patientLabOrder: patientLabOrder, - patient: patient, - ), + Expanded( + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).description, + color: Colors.black,bold: true, ), - ); - }, - child: Texts( - TranslationBase.of(context).showMoreBtn, - textDecoration: TextDecoration.underline, - color: Colors.blue, + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: Texts(TranslationBase.of(context).value, color: Colors.black,bold: true,), + ), ), ), + Expanded( + child: Container( + child: Center( + child: Texts(TranslationBase.of(context).range, color: Colors.black,bold: true,), + ), + ), + ) ], ), - Table( - border: TableBorder.symmetric( - inside: BorderSide( - width: 2.0, color: Colors.grey[300]), - ), - children: fullData(patientLabResultList,context), - ), + SizedBox(height: 7,), + Divider(color: Colors.black,thickness: 1,), + SizedBox(height: 12,), + ...List.generate(patientLabResultList.length, (index) => Column( + children: [ + Row( + children: [ + Expanded( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${patientLabResultList[index].testCode}\n'+ + patientLabResultList[index].description, + textAlign: TextAlign.center, + ), + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + patientLabResultList[index].resultValue+" "+patientLabResultList[index].uOM, + textAlign: TextAlign.center, + ), + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + patientLabResultList[index].referanceRange, + textAlign: TextAlign.center, + ), + ), + ), + ) + ], + ), + Divider(), + ], + )) + // Table( + // border: TableBorder.symmetric( + // inside: BorderSide(width: 2.0, color: Colors.grey[300],style: BorderStyle.solid), + // ), + // children: fullData(patientLabResultList,context), + // ), ], ), ); @@ -71,54 +120,22 @@ class LabResultWidget extends StatelessWidget { TableRow( children: [ Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - 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( - TranslationBase.of(context).description, - color: Colors.white, - ), + child: Center( + child: Texts( + TranslationBase.of(context).description, + color: Colors.black,bold: true, ), - height: 60, ), ), Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - ), - child: Center( - child: Texts(TranslationBase.of(context).value, color: Colors.white), - ), - height: 60), + child: Center( + child: Texts(TranslationBase.of(context).value, color: Colors.black,bold: true,), + ), ), Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - 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(TranslationBase.of(context).range, color: Colors.white), - ), - height: 60), + child: Center( + child: Texts(TranslationBase.of(context).range, color: Colors.black,bold: true,), + ), ), ], ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index 398479c4..ddbbcd45 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -3,18 +3,21 @@ import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'laboratory_result_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; class LaboratoryResultPage extends StatefulWidget { final PatientLabOrders patientLabOrders; final PatiantInformtion patient; - - LaboratoryResultPage({Key key, this.patientLabOrders, this.patient}); + final String patientType; + final String arrivalType; + LaboratoryResultPage({Key key, this.patientLabOrders, this.patient, this.patientType, this.arrivalType}); @override _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); @@ -31,22 +34,35 @@ class _LaboratoryResultPageState extends State { orderNo: widget.patientLabOrders.orderNo, patient: widget.patient), builder: (_, model, w) => AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).labResults, + isShowAppBar: false, + // appBarTitle: TranslationBase.of(context).labResults, baseViewModel: model, body: Scaffold( - body: ListView.builder( - itemBuilder: (context, index) => LaboratoryResultWidget( - onTap: () async { + body: SingleChildScrollView( + child: Column( + children: [ + PatientProfileHeaderWhitAppointment(patient: widget.patient, + patientType: widget.patientType??"0", + arrivalType: widget.arrivalType??"0", + orderNo: widget.patientLabOrders.orderNo, + appointmentDate:widget.patientLabOrders.orderDate, + doctorName: widget.patientLabOrders.doctorName, + profileUrl: widget.patientLabOrders.doctorImageURL, + invoiceNO: widget.patientLabOrders.invoiceNo, + ), + ...List.generate(model.patientLabSpecialResult.length, (index) => LaboratoryResultWidget( + onTap: () async { + + }, + billNo: widget.patientLabOrders.invoiceNo, + details: model.patientLabSpecialResult[index].resultDataHTML, + orderNo: widget.patientLabOrders.orderNo, + patientLabOrder: widget.patientLabOrders, + patient: widget.patient, + )), - }, - billNo: widget.patientLabOrders.invoiceNo, - details: model.patientLabSpecialResult[index].resultDataHTML, - orderNo: widget.patientLabOrders.orderNo, - patientLabOrder: widget.patientLabOrders, - patient: widget.patient, + ], ), - itemCount: model.patientLabSpecialResult.length, ), ), ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 25663fa6..a2c8411d 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -34,7 +34,6 @@ class LaboratoryResultWidget extends StatefulWidget { } class _LaboratoryResultWidgetState extends State { - bool _isShowMore = true; bool _isShowMoreGeneral = true; ProjectViewModel projectViewModel; @@ -42,8 +41,7 @@ class _LaboratoryResultWidgetState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => - model.getPatientLabResult(patientLabOrder: widget.patientLabOrder,patient: widget.patient), + onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrder,patient: widget.patient), builder: (_, model, w) => NetworkBaseView( baseViewModel: model, child: Container( @@ -53,33 +51,6 @@ class _LaboratoryResultWidgetState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - margin: EdgeInsets.all(8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(5.0), - )), - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(TranslationBase.of(context).invoiceNo), - Texts(widget.billNo), - ], - ), - ), - ), - ], - ), - ), SizedBox( height: 12, ), @@ -106,20 +77,17 @@ class _LaboratoryResultWidgetState extends State { )), child: Row( children: [ - Expanded( - child: Texts(TranslationBase.of(context) - .generalResult)), + Expanded(child: Container( + margin: EdgeInsets.only(left: 10, right: 10), + child: Texts(TranslationBase.of(context).generalResult,bold: true,))), Container( width: 25, height: 25, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).primaryColor), child: Icon( _isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, - color: Colors.white, + color: Colors.grey[800], size: 22, ), ) @@ -142,22 +110,10 @@ class _LaboratoryResultWidgetState extends State { duration: Duration(milliseconds: 7000), child: Container( width: double.infinity, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ...List.generate( - model.labResultLists.length, - (index) => LabResultWidget( - patientLabOrder: widget.patientLabOrder, - filterName: model - .labResultLists[index].filterName, - patientLabResultList: model - .labResultLists[index] - .patientLabResultList, - patient:widget.patient, - ), - ) - ], + child: LabResultWidget( + patientLabOrder: widget.patientLabOrder, + patientLabResultList: model.labResultList, + patient:widget.patient, ), ), ), @@ -167,63 +123,7 @@ class _LaboratoryResultWidgetState extends State { SizedBox( height: 10, ), - InkWell( - onTap: () { - setState(() { - _isShowMore = !_isShowMore; - }); - }, - 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( - TranslationBase.of(context).specialResult)), - Container( - width: 25, - height: 25, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).primaryColor), - child: Icon( - _isShowMore - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, - color: Colors.white, - size: 22, - ), - ) - ], - ), - ), - ), - if (_isShowMore) - 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: Html( - data: widget.details ?? - TranslationBase.of(context).noDataAvailable, - )), - ), + ], ), ], diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index c0118e5f..bbf60821 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -1,10 +1,14 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart'; +import 'package:doctor_app_flutter/screens/procedures/add_lab_orders.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; @@ -16,98 +20,129 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class LabsHomePage extends StatelessWidget { + String patientType; + String arrivalType; @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; - ProjectViewModel projectViewModel = Provider.of(context); - return BaseView( + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + print(arrivalType); + return BaseView( onModelReady: (model) => model.getLabs(patient), - builder: (context, LabsViewModel model, widget) => AppScaffold( + builder: (context, ProcedureViewModel model, widget) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).labOrders, + isShowAppBar: false, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( widthFactor: 1.0, - child: Center( - child: Column( - children: [ - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Clinic), - child: ListTile( - title: Text(TranslationBase.of(context).clinic), - leading: Radio( - value: FilterType.Clinic, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, - ), - ), - ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientProfileHeaderNewDesign(patient, + patient.patientType.toString() ?? '0', patientType), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Lab', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + Texts( + 'Result', + bold: true, + fontSize: 22, ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Hospital), - child: ListTile( - title: Text(TranslationBase.of(context).hospital), - leading: Radio( - value: FilterType.Hospital, - groupValue: model.filterType, - onChanged: (FilterType value) => - model.setFilterType(value), - ), - ), - ), - ) ], ), - ...List.generate( - model.patientLabOrdersList.length, - (index) => AppExpandableNotifier( - title: model.patientLabOrdersList[index].filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: model - .patientLabOrdersList[index].patientLabOrdersList - .map((labOrder) { - return DoctorCard( - onTap: () => Navigator.push( - context, - FadePage( - page: LaboratoryResultPage( - patientLabOrders: labOrder, - patient: patient, + ), + if (patientType != null && patientType == '7') + InkWell( + onTap: () { + addSelectedLabOrder(context, model, patient); + }, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), ), ), - ), - isInOutPatient: labOrder.isInOutPatient, - name: labOrder.doctorName, - billNo: ' ${labOrder.invoiceNo}', - profileUrl: labOrder.doctorImageURL, - subName: labOrder.projectName, - isLiveCareAppointment: - labOrder.isLiveCareAppointment, - date: projectViewModel.isArabic - ? DateUtils.getMonthDayYearDateFormattedAr( - labOrder.orderDate) - : DateUtils.getMonthDayYearDateFormatted( - labOrder.orderDate), - ); - }).toList(), + SizedBox( + height: 10, + ), + Texts( + 'Apply for New Lab Order', + color: Colors.grey[600], + fontWeight: FontWeight.w600, + ) + ], + ), + ), ), ), - ) - ], - ), + ), + ...List.generate( + model.patientLabOrdersList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model + .patientLabOrdersList[index].patientLabOrdersList + .map((labOrder) { + return DoctorCard( + onTap: () => Navigator.push( + context, + FadePage( + page: LaboratoryResultPage( + patientLabOrders: labOrder, + patient: patient, + arrivalType: arrivalType, + patientType: patientType, + ), + ), + ), + doctorName: labOrder.doctorName, + invoiceNO: ' ${labOrder.invoiceNo}', + profileUrl: labOrder.doctorImageURL, + branch: labOrder.projectName, + appointmentDate: labOrder.orderDate, + orderNo: labOrder.orderNo, + ); + }).toList(), + ), + ) + ], ), ), ), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index dedb5bd5..ac94b3d3 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -15,8 +16,9 @@ import 'package:url_launcher/url_launcher.dart'; class RadiologyDetailsPage extends StatelessWidget { final FinalRadiology finalRadiology; final PatiantInformtion patient; - - RadiologyDetailsPage({Key key, this.finalRadiology, this.patient}); + final String patientType; + final String arrivalType; + RadiologyDetailsPage({Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType}); @override Widget build(BuildContext context) { @@ -27,54 +29,66 @@ class RadiologyDetailsPage extends StatelessWidget { lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( - appBarTitle: TranslationBase.of(context).radiologyReport, - isShowAppBar: true, + + isShowAppBar: false, baseViewModel: model, body: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Texts( - '${finalRadiology.reportData}', - textAlign: TextAlign.center, + + PatientProfileHeaderWhitAppointment(patient: patient, + patientType: patientType??"0", + arrivalType: arrivalType??"0", + orderNo: finalRadiology.orderNo.toString(), + appointmentDate:finalRadiology.orderDate, + doctorName: finalRadiology.doctorName, + profileUrl: finalRadiology.doctorImageURL, + invoiceNO: finalRadiology.invoiceNo.toString(), ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - '${finalRadiology.reportData}', - textAlign: TextAlign.start, - fontSize: 17, + + Container( + + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 5,), + Texts(TranslationBase.of(context).generalResult), + SizedBox(height: 5,), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + '${finalRadiology.reportData}', + textAlign: TextAlign.start, + fontSize: 17, + color: Colors.grey, + ), + ), + SizedBox(height: 25,), + Center( + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + color: Colors.red, + onTap: () { + launch(model.radImageURL); + }, + title: TranslationBase.of(context).openRad, + ), + ), + ), + ], ), ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.2, - ) ], ), ), - bottomSheet: Container( - width: double.infinity, - height: MediaQuery.of(context).size.height * 0.14, - // color: Colors.grey[100], - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Divider(), - if (model.radImageURL.isNotEmpty) - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - - onTap: () { - launch(model.radImageURL); - }, - title: TranslationBase.of(context).openRad, - ), - ), - ], - ), - )), + ), ); } } diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index cce155d2..f083f779 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -1,11 +1,15 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; +import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; @@ -20,91 +24,110 @@ class RadiologyHomePage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - return BaseView( + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; + + return BaseView( onModelReady: (model) => model.getPatientRadOrders(patient), builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).radiology, + isShowAppBar: false, + // appBarTitle: TranslationBase.of(context).radiology, baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, child: ListView( physics: BouncingScrollPhysics(), children: [ - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Clinic), - child: ListTile( - title: Text(TranslationBase.of(context).clinic), - leading: Radio( - value: FilterType.Clinic, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, - ), - ), + PatientProfileHeaderNewDesign( + patient, patient.patientType.toString() ?? '0', arrivalType), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Radiology', + style: "caption2", + color: Colors.black, + fontSize: 13, ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Hospital), - child: ListTile( - title: Text(TranslationBase.of(context).hospital), - leading: Radio( - value: FilterType.Hospital, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, - ), - ), + Texts( + 'Result', + bold: true, + fontSize: 22, ), - ) - ], + ], + ), ), - ...List.generate( - model.finalRadiologyList.length, - (index) => AppExpandableNotifier( - title: model.finalRadiologyList[index].filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: model - .finalRadiologyList[index].finalRadiologyList - .map((radiology) { - return InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: RadiologyDetailsPage( - finalRadiology: radiology, - patient: patient, + if (patientType != null && patientType == '7') + InkWell( + onTap: () { + addSelectedRadiologyOrder(context, model, patient); + }, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), ), ), - ), - child: DoctorCard( - isInOutPatient: radiology.isInOutPatient, - isLiveCareAppointment: - radiology.isLiveCareAppointment, - name: radiology.doctorName, - profileUrl: radiology.doctorImageURL, - billNo: '${radiology.invoiceNo}', - subName: '${radiology.projectName}', - date: projectViewModel.isArabic - ? DateUtils.getMonthDayYearDateFormattedAr( - radiology.orderDate) - : DateUtils.getMonthDayYearDateFormatted( - radiology.orderDate), - ), - ); - }).toList(), - )), - ) + SizedBox( + height: 10, + ), + Texts( + 'Apply for Radiology Order', + color: Colors.grey[600], + fontWeight: FontWeight.w600, + ) + ], + ), + ), + ), + ), + ), + ...List.generate(model.radiologyList.length, (index) => InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: RadiologyDetailsPage( + finalRadiology: model.radiologyList[index], + patient: patient, + ), + ), + ), + child: DoctorCard( + doctorName: model.radiologyList[index].doctorName, + profileUrl: model.radiologyList[index].doctorImageURL, + invoiceNO: '${model.radiologyList[index].invoiceNo}', + branch: '${model.radiologyList[index].projectName}', + appointmentDate: model.radiologyList[index].orderDate, + orderNo: model.radiologyList[index].orderNo.toString(), + ), + )), + ], ), ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index a7e10f25..5dc04221 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -80,6 +80,7 @@ postProcedure( if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { + model.getPrescriptions(patient); DrAppToastMsg.showSuccesToast('Medication has been added'); } } diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index 67e957a2..af5bbb3f 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -5,7 +5,9 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_details_page.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; @@ -15,7 +17,9 @@ import 'package:flutter/material.dart'; class PrescriptionItemsPage extends StatelessWidget { final Prescriptions prescriptions; final PatiantInformtion patient; - PrescriptionItemsPage({Key key, this.prescriptions, this.patient}); + final String patientType; + final String arrivalType; + PrescriptionItemsPage({Key key, this.prescriptions, this.patient, this.patientType, this.arrivalType}); @override Widget build(BuildContext context) { @@ -23,155 +27,159 @@ class PrescriptionItemsPage extends StatelessWidget { onModelReady: (model) => model.getPrescriptionReport(prescriptions: prescriptions,patient: patient), builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescriptions, + isShowAppBar: false, baseViewModel: model, body: SingleChildScrollView( child: Container( child: Column( children: [ + PatientProfileHeaderWhitAppointment(patient: patient, + patientType: patientType??"0", + arrivalType: arrivalType??"0", + branch: '', + clinic: prescriptions.clinicDescription, + isPrescriptions: true, + appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), + doctorName: prescriptions.doctorName, + profileUrl: prescriptions.doctorImageURL, + // invoiceNO: widget.patientLabOrders.invoiceNo, + ), + if (!prescriptions.isInOutPatient) ...List.generate( model.prescriptionReportList.length, - (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionDetailsPage( - prescriptionReport: - model.prescriptionReportList[index], - ), - ), + (index) => Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, ), - child: Container( - width: double.infinity, - margin: - EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all( - color: Colors.grey[200], width: 0.5), - ), - child: Row( - children: [ - ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(5)), - child: Image.network( - model.prescriptionReportList[index] - .imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts(model - .prescriptionReportList[index] - .itemDescription - .isNotEmpty - ? model.prescriptionReportList[index] - .itemDescription - : model.prescriptionReportList[index] - .itemDescriptionN)), - )), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 18,right: 18), + child: Texts(model.prescriptionReportList[index].itemDescription.isNotEmpty ? model.prescriptionReportList[index].itemDescription : model.prescriptionReportList[index].itemDescriptionN,bold: true,)), + SizedBox(height: 12,), + Row( + children: [ + SizedBox(width: 18,), + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(width: 0.5,color: Colors.grey) + ), + height: 55, + width: 55, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Image.network( + model.prescriptionReportList[index].imageSRCUrl, + fit: BoxFit.cover, + ), + ), + ), + SizedBox(width: 10,), + Expanded(child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Texts(TranslationBase.of(context).route,color: Colors.grey,), + Expanded(child: Texts(model.prescriptionReportList[index].routeN)), + ], + ), + Row( + children: [ + Texts(TranslationBase.of(context).frequency,color: Colors.grey,), + Texts(model.prescriptionReportList[index].frequencyN ?? ''), + ], + ), + SizedBox(height: 12,), + Texts(model.prescriptionReportList[index].remarks ?? ''), + ], + ),) + + + ], ) ], ), ), )) + else - ...List.generate( - model.prescriptionReportEnhList.length, - (index) => InkWell( - onTap: () { - PrescriptionReport prescriptionReport = - PrescriptionReport( - imageSRCUrl: model - .prescriptionReportEnhList[index].imageSRCUrl, - itemDescription: model - .prescriptionReportEnhList[index] - .itemDescription, - itemDescriptionN: model - .prescriptionReportEnhList[index] - .itemDescription, - routeN: - model.prescriptionReportEnhList[index].route, - frequency: model - .prescriptionReportEnhList[index].frequency, - frequencyN: model - .prescriptionReportEnhList[index].frequency, - doseDailyQuantity: model - .prescriptionReportEnhList[index] - .doseDailyQuantity, - days: model.prescriptionReportEnhList[index].days, - itemID: - model.prescriptionReportEnhList[index].itemID, - remarks: model - .prescriptionReportEnhList[index].remarks); - Navigator.push( - context, - FadePage( - page: PrescriptionDetailsPage( - prescriptionReport: prescriptionReport, - ), + ...List.generate( + model.prescriptionReportEnhList.length, + (index) => Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 18,right: 18), + child: Texts(model.prescriptionReportEnhList[index].itemDescription,bold: true,),), + SizedBox(height: 12,), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(width: 18,), + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(width: 0.5,color: Colors.grey) + ), + height: 55, + width: 55, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Image.network( + model.prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + + ), + ), + ), + SizedBox(width: 10,), + Expanded(child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Texts(TranslationBase.of(context).route,color: Colors.grey,), + Expanded(child: Texts(model.prescriptionReportEnhList[index].route??'')), + ], + ), + Row( + children: [ + Texts(TranslationBase.of(context).frequency,color: Colors.grey,), + Texts(model.prescriptionReportEnhList[index].frequency ?? ''), + ], + ), + SizedBox(height: 12,), + Texts(model.prescriptionReportEnhList[index].remarks?? ''), + ], + ),) + + + ], + ) + ], ), - ); - }, - child: Container( - margin: EdgeInsets.all(8.0), - color: Colors.white, - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - model - .prescriptionReportEnhList[index].imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(model.prescriptionReportEnhList[index] - .itemDescription), - ], - ), - ), - ), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], - ) - ], ), ), - ), - ), + ), + + ], ), diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index d595ff0b..aca973da 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -1,11 +1,15 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescriptions_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; @@ -15,106 +19,123 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PrescriptionsPage extends StatelessWidget { - @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; ProjectViewModel projectViewModel = Provider.of(context); - return BaseView( + return BaseView( onModelReady: (model) => model.getPrescriptions(patient), builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescriptions, + isShowAppBar: false, body: FractionallySizedBox( widthFactor: 1.0, child: ListView( physics: BouncingScrollPhysics(), children: [ - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => model - .setFilterType(FilterType.Clinic), - child: ListTile( - title: Text(TranslationBase.of(context).clinic), - leading: Radio( - value: FilterType.Clinic, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, - ), - ), + PatientProfileHeaderNewDesign( + patient, arrivalType ?? '0', patientType), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Order', + style: "caption2", + color: Colors.black, + fontSize: 13, ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => model - .setFilterType(FilterType.Hospital), - child: ListTile( - title: Text(TranslationBase.of(context).hospital), - leading: Radio( - value: FilterType.Hospital, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, + Texts( + 'Prescriptions', + bold: true, + fontSize: 22, + ), + ], + ), + ), + if (patientType != null && patientType == '7') + InkWell( + onTap: () { + addPrescriptionForm( + context, model, patient, model.prescriptionList); + }, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ), + SizedBox( + height: 10, + ), + Texts( + 'Apply for New Prescriptions Order', + color: Colors.grey[600], + fontWeight: FontWeight.w600, + ) + ], ), ), ), - ) - ], - ), + ), + ), ...List.generate( - model.prescriptionsOrderList.length, - (index) => AppExpandableNotifier( - title: model - .prescriptionsOrderList[index].filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: model - .prescriptionsOrderList[index].prescriptionsList - .map((prescriptions) { - return InkWell( - onTap: () => Navigator.push( + model.prescriptionsList.length, + (index) => InkWell( + onTap: () => Navigator.push( context, FadePage( page: PrescriptionItemsPage( - prescriptions: prescriptions, + prescriptions: + model.prescriptionsList[index], patient: patient, + patientType: patientType, + arrivalType: arrivalType, ), ), ), - child: DoctorCard( - name: prescriptions.doctorName, - profileUrl: prescriptions.doctorImageURL, - rat: - prescriptions.actualDoctorRate.toDouble(), - subName: prescriptions.name, - isInOutPatient: prescriptions.isInOutPatient, - isLiveCareAppointment: - prescriptions.isLiveCareAppointment, - date: projectViewModel.isArabic - ? DateUtils - .getMonthDayYearDateFormattedAr( - DateUtils.convertStringToDate( - prescriptions - .appointmentDate)) - : DateUtils.getMonthDayYearDateFormatted( - DateUtils.convertStringToDate( - prescriptions.appointmentDate)), - ), - ); - }).toList(), - )), - ) + child: DoctorCard( + doctorName: + model.prescriptionsList[index].doctorName, + profileUrl: + model.prescriptionsList[index].doctorImageURL, + branch: model.prescriptionsList[index].name, + clinic: model + .prescriptionsList[index].clinicDescription, + isPrescriptions: true, + appointmentDate: + DateUtils.getDateTimeFromServerFormat( + model.prescriptionsList[index].appointmentDate, + ), + ))) ], ), ), diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart new file mode 100644 index 00000000..d023dbc2 --- /dev/null +++ b/lib/screens/procedures/ProcedureCard.dart @@ -0,0 +1,142 @@ +import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class ProcedureCard extends StatelessWidget { + final Function onTap; + final EntityList entityList; + + const ProcedureCard({Key key, this.onTap, this.entityList}) : super(key: key); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + width: double.maxFinite, + height: MediaQuery.of(context).size.height * .22, + margin: EdgeInsets.all(10), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + height: MediaQuery.of(context).size.height * .20, + width: 5, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10), + ), + color: entityList.orderType == 1 + ? Colors.red[500] + : Colors.black, + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.only( + left: projectViewModel.isArabic ? 0 : 15, + right: projectViewModel.isArabic ? 15 : 0), + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + entityList.orderType == 0 + ? 'Routine' + : 'Urgent', + color: entityList.orderType == 0 + ? Colors.black + : Colors.red[800], + fontWeight: FontWeight.w600, + ), + SizedBox( + height: 5, + ), + Texts( + entityList.procedureName, + bold: true, + fontSize: 14, + ), + ], + ), + ), + SizedBox( + width: 5, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Texts( + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + Texts( + '${DateUtils.getHour(DateUtils.convertISOStringToDateTime(entityList.orderDate))}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], + ), + ], + ), + Row( + children: [ + Texts( + TranslationBase.of(context).orderNo, + color: Colors.grey, + fontSize: 12, + ), + Texts( + entityList.orderNo.toString(), + color: Colors.grey, + fontSize: 12, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + entityList.remarks ?? '', + fontSize: 12, + ), + Icon(Icons.edit) + ], + ) + ], + ), + onTap: onTap, + ), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index ada0641b..d72ffa65 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -75,14 +75,14 @@ postProcedure( if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); - model.getProcedure(mrn: patient.patientMRN); + model.getLabs(patient); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been added'); } } else { if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); - model.getProcedure(mrn: patient.patientMRN); + model.getLabs(patient); } else if (model.state == ViewState.Idle) { helpers.showErrorToast( model.valadteProcedureList[0].entityList[0].warringMessages); diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index c523c2b0..d3ae723d 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -75,14 +75,14 @@ postProcedure( if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); - model.getProcedure(mrn: patient.patientMRN); + model.getPatientRadOrders(patient); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been added'); } } else { if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); - model.getProcedure(mrn: patient.patientMRN); + model.getPatientRadOrders(patient); } else if (model.state == ViewState.Idle) { helpers.showErrorToast( model.valadteProcedureList[0].entityList[0].warringMessages); diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index a03e1348..4f47da43 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -7,601 +7,122 @@ import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; -class ProcedureScreen extends StatefulWidget { - @override - _ProcedureScreenState createState() => _ProcedureScreenState(); -} - -class _ProcedureScreenState extends State { - int selectedType = 0; - int testNum = 1; - PatiantInformtion patient; - setSelectedType(int val) { - setState(() { - selectedType = val; - }); - } - - TextEditingController procedureController = TextEditingController(); +import 'ProcedureCard.dart'; +class ProcedureScreen extends StatelessWidget { @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; - patient = routeArgs['patient']; + PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; return BaseView( - onModelReady: (model) => model.getProcedure(mrn: 0), + onModelReady: (model) => model.getProcedure(mrn: patient.patientId), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).orderProcedure, - body: NetworkBaseView( - baseViewModel: model, - child: SingleChildScrollView( - child: Container( - color: Colors.white, + isShowAppBar: false, + appBarTitle: TranslationBase.of(context).orderProcedure, + body: NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Container( + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientProfileHeaderNewDesign( + patient, arrivalType ?? '0', patientType), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientPageHeaderWidget(patient), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, + Texts( + 'Order Test or', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + Texts( + 'Procedure', + bold: true, + fontSize: 22, ), - (model.procedureList.length != 0) - ? SizedBox( - height: model.procedureList[0].rowcount == 0 - ? 200.0 - : 10.0) - : SizedBox(height: 200.0), - //model.prescriptionList == null - (model.procedureList.length != 0) - ? model.procedureList[0].rowcount == 0 - ? Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - InkWell( - onTap: () { - model - .getProcedureCategory() - .then((value) { - addSelectedProcedure( - context, model, patient); - }); - - //model.postPrescription(); - }, - child: CircleAvatar( - radius: 65, - backgroundColor: Color(0XFFB8382C), - child: CircleAvatar( - radius: 60, - backgroundColor: Colors.white, - child: Icon( - Icons.add, - color: Colors.black, - size: 45.0, - ), - ), - ), - ), - SizedBox( - height: 15.0, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - 'NO ORDER FOR PROCEDURE LISTED', - color: Colors.black, - fontWeight: FontWeight.w900, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).addNow, - color: Color(0XFFB8382C), - fontWeight: FontWeight.w700, - ), - ], - ), - ], - ) - : Padding( - padding: EdgeInsets.all(16.0), - child: NetworkBaseView( - baseViewModel: model, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - InkWell( - child: Container( - height: 50.0, - width: 450.0, - decoration: BoxDecoration( - color: Colors.white, - border: Border.all( - color: Colors.grey), - borderRadius: - BorderRadius.circular(10.0), - ), - child: Padding( - padding: EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - AppText( - TranslationBase.of( - context) - .addMoreProcedure, - fontWeight: - FontWeight.w100, - fontSize: 12.5, - ), - Icon( - Icons.add, - color: Color(0XFFB8382C), - ) - ], - ), - ), - ), - onTap: () { - model - .getProcedureCategory() - .then((value) { - addSelectedProcedure( - context, model, patient); - }); - - //model.postPrescription(); - }, - ), - // Container( - // decoration: BoxDecoration( - // borderRadius: BorderRadius.all( - // Radius.circular(6.0)), - // border: Border.all( - // width: 1.0, - // color: HexColor("#CCCCCC"))), - // child: AppTextFormField( - // labelText: 'Add more procedure', - // borderColor: Colors.white, - // //suffixIcon: Icons.search, - // - // //textInputType: TextInputType.number, - // inputFormatter: ONLY_NUMBERS, - // onTap: () { - // addSelectedProcedure(context); - // }, - // ), - // ), - SizedBox( - height: 10.0, - ), - ...List.generate( - model.procedureList[0].rowcount, - (index) => Container( - color: Colors.white, - child: Column( - children: [ - SizedBox( - height: - MediaQuery.of(context) - .size - .height * - 0.022, - ), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Container( - height: MediaQuery.of( - context) - .size - .height * - 0.18, - width: MediaQuery.of( - context) - .size - .width * - 0.135, - child: Column( - children: [ - AppText( - DateTime.parse(model - .procedureList[ - 0] - .entityList[ - index] - .orderDate) - .year - .toString(), - color: model - .procedureList[ - 0] - .entityList[ - index] - .orderType == - 1 - ? Color( - 0xFFB9382C) - : Colors - .green), - AppText( - Helpers.getMonth(model.procedureList[0].entityList[index].orderDate != - null - ? (DateTime.parse(model.procedureList[0].entityList[index].orderDate) - .month) - : DateTime.now() - .month) - .toUpperCase(), - color: model - .procedureList[ - 0] - .entityList[ - index] - .orderType == - 1 - ? Color( - 0xFFB9382C) - : Colors - .green), - AppText( - DateTime.parse(model - .procedureList[ - 0] - .entityList[ - index] - .orderDate) - .day - .toString(), - color: model - .procedureList[ - 0] - .entityList[ - index] - .orderType == - 1 - ? Color( - 0xFFB9382C) - : Colors - .green), - ], - ), - ), - Expanded( - child: Container( - width: MediaQuery.of( - context) - .size - .width * - 0.05, - child: Column( - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context) - .codeNo + - " : ", - fontWeight: - FontWeight - .w700, - fontSize: - 13.0, - ), - AppText( - model - .procedureList[ - 0] - .entityList[ - index] - .procedureId - .toString(), - fontSize: - 12.0, - ), - SizedBox( - width: 12.0, - ), - AppText( - TranslationBase.of(context) - .orderType + - " : ", - fontWeight: - FontWeight - .w700, - fontSize: - 13.0, - ), - Expanded( - child: AppText( - model.procedureList[0].entityList[index].orderType == - 0 - ? 'Routine' - : 'Urgent', - fontSize: - 13.5, - color: model.procedureList[0].entityList[index].orderType == - 1 - ? Color(0xFFB9382C) - : Colors.green), - ), - ], - ), - Row( - children: [ - AppText( - 'Order.NO' + - " : ", - fontWeight: - FontWeight - .w700, - fontSize: - 15.0, - ), - AppText( - model - .procedureList[ - 0] - .entityList[ - index] - .orderNo - .toString(), - fontSize: - 13.0, - ), - ], - ), - Row( - children: [ - Container( - child: - Expanded( - child: - AppText( - model - .procedureList[0] - .entityList[index] - .procedureName, - fontWeight: - FontWeight.w800, - ), - ), - ) - ], - ), - - Row( - children: [ - // AppText( - // TranslationBase.of(context) - // .price + - // " : ", - // fontWeight: - // FontWeight - // .w700, - // ), - // Expanded( - // child: AppText( - // model - // .procedureList[ - // 0] - // .entityList[ - // index] - // .price - // .toString(), - // fontSize: - // 13.0), - // ) - ], - ), - SizedBox( - height: 10.0, - ), - - Row( - children: [ - Expanded( - child: - Container( - height: MediaQuery.of(context) - .size - .height * - 0.047, - width: MediaQuery.of(context) - .size - .width * - 0.10, - child: - AppText( - model.procedureList[0].entityList[index].remarks != - null - ? model.procedureList[0].entityList[index].remarks.toString() - : "", - fontSize: - 11.5, - ), - ), - ), - ], - ), - SizedBox( - height: 20.0, - ), - - // SizedBox( - // height: 40, - // ), - ], - ), - ), - ), - Container( - child: Column( - children: [ - InkWell( - child: Icon( - Icons.edit), - onTap: () { - // model - // .updateProcedure(); - if (model.procedureList[0].entityList[index].categoryID == 02 || - model - .procedureList[ - 0] - .entityList[ - index] - .categoryID == - 03 || - model - .procedureList[0] - .entityList[index] - .categoryID == - 55) { - updateProcedureForm( - context, - limetNo: model - .procedureList[ - 0] - .entityList[ - index] - .lineItemNo, - model: - model, - orderNo: model - .procedureList[ - 0] - .entityList[ - index] - .orderNo, - remarks: model - .procedureList[ - 0] - .entityList[ - index] - .remarks, - procedureName: model - .procedureList[ - 0] - .entityList[ - index] - .procedureName, - patient: - patient, - procedureId: model - .procedureList[ - 0] - .entityList[ - index] - .procedureId, - categoreId: model - .procedureList[ - 0] - .entityList[ - index] - .categoryID - .toString()); - } else { - helpers.showErrorToast( - 'You cant Update this Procedure'); - } - }, - ) - ], - ), - ), - ], - ), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), - ], - ), - ), - ), - ], - ), - ), - ) - : Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - InkWell( - onTap: () { - model - .getProcedureCategory() - .then((value) { - addSelectedProcedure( - context, model, patient); - }); - - //model.postPrescription(); - }, - child: CircleAvatar( - radius: 65, - backgroundColor: Color(0XFFB8382C), - child: CircleAvatar( - radius: 60, - backgroundColor: Colors.white, - child: Icon( - Icons.add, - color: Colors.black, - size: 45.0, - ), - ), - ), - ), - SizedBox( - height: 15.0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - 'NO ORDER FOR PROCEDURE LISTED', - color: Colors.black, - fontWeight: FontWeight.w900, - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).addNow, - color: Color(0XFFB8382C), - fontWeight: FontWeight.w700, - ), - ], - ), - ], - ) ], ), ), - ), - )), + if (patientType != null && patientType == '7') + InkWell( + onTap: () { + //TODO Hussam call the add page here + }, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ), + SizedBox( + height: 10, + ), + Texts( + 'Add More Procedure', + color: Colors.grey[600], + fontWeight: FontWeight.w600, + ) + ], + ), + ), + ), + ), + ), + if (model.procedureList.isNotEmpty) + ...List.generate( + model.procedureList[0].rowcount, + (index) => ProcedureCard( + entityList: model.procedureList[0].entityList[index], + onTap: (){ + //TODO Hussam call the edit page here + }, + ), + ), + ], + ), + ), + ), + ), + ), ); } } diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index aaafa380..8981f374 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -79,11 +79,13 @@ class AddRescheduleLeavScreen extends StatelessWidget { decoration: BoxDecoration( border: Border( left: BorderSide( - color: item.status == 1 + color: item.status == 10 ? Colors.green : item.status == 2 ? HexColor('#CC9B14') - : Colors.red[800], + : item.status == 9 + ? Colors.red[800] + : Colors.red, width: 5.0, ))), padding: EdgeInsets.only(left: 10, right: 10), @@ -107,23 +109,30 @@ class AddRescheduleLeavScreen extends StatelessWidget { margin: EdgeInsets.only(top: 10), child: AppText( - item.status == 1 + item.status == 10 ? TranslationBase.of( context) - .approved + .accepted : item.status == 2 ? TranslationBase.of( context) .pending - : TranslationBase.of( - context) - .rejected, + : item.status == 9 + ? TranslationBase + .of( + context) + .rejected + : TranslationBase + .of(context) + .cancelled, fontWeight: FontWeight.bold, - color: item.status == 1 + color: item.status == 10 ? Colors.green : item.status == 2 ? HexColor('#CC9B14') - : Colors.red[800], + : item.status == 9 + ? Colors.red[800] + : Colors.red, fontSize: 14, ), ), @@ -133,7 +142,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { child: AppText( DateUtils .convertStringToDateFormat( - item.dateTimeTo, + item.createdOn, 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, )) diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 9396c2f0..d55675c3 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -7,6 +7,14 @@ class DateUtils { return DateFormat(dateFormat).format(dateTime); } + static DateTime convertISOStringToDateTime(String date){ + DateTime newDate; + + newDate = DateTime.parse(date); + + return newDate; + } + static String convertStringToDateFormat(String date, String dateFormat) { DateTime dateTime = DateTime.parse(date); return convertDateToFormat(dateTime, dateFormat); @@ -256,9 +264,9 @@ class DateUtils { /// get data formatted like Apr 26,2020 /// [dateTime] convert DateTime to data formatted - static String getMonthDayYearDateFormatted(DateTime dateTime) { + static String getMonthDayYearDateFormatted(DateTime dateTime,{bool isArabic = false}) { if (dateTime != null) - return getMonth(dateTime.month) + + return isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) + " " + dateTime.day.toString() + ", " + @@ -267,6 +275,24 @@ class DateUtils { return ""; } + /// get data formatted like 26 Apr 2020 + /// [dateTime] convert DateTime to data formatted + static String getDayMonthYearDateFormatted(DateTime dateTime,{bool isArabic = false}) { + if (dateTime != null) + return dateTime.day.toString()+" "+ "${isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) }"+ + " " + + + dateTime.year.toString(); + else + return ""; + } + + /// get data formatted like 10:45 PM + /// [dateTime] convert DateTime to data formatted + static String getHour(DateTime dateTime) { + return DateFormat('hh:mm a').format(dateTime); + } + static String getAgeByBirthday(dynamic birthday, BuildContext context) { // https://leechy.dev/calculate-dates-diff-in-dart DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index d499636b..09bc7e06 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -650,12 +650,16 @@ class TranslationBase { String get leanBodyWeight => localizedValues['leanBodyWeight'][locale.languageCode]; - String get bodyMassIndex => localizedValues['bodyMassIndex'][locale.languageCode]; + String get bodyMassIndex => + localizedValues['bodyMassIndex'][locale.languageCode]; - String get yourBodyMassIndex => localizedValues['yourBodyMassIndex'][locale.languageCode]; - String get bmiUnderWeight => localizedValues['bmiUnderWeight'][locale.languageCode]; + String get yourBodyMassIndex => + localizedValues['yourBodyMassIndex'][locale.languageCode]; + String get bmiUnderWeight => + localizedValues['bmiUnderWeight'][locale.languageCode]; String get bmiHealthy => localizedValues['bmiHealthy'][locale.languageCode]; - String get bmiOverWeight => localizedValues['bmiOverWeight'][locale.languageCode]; + String get bmiOverWeight => + localizedValues['bmiOverWeight'][locale.languageCode]; String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; String get method => localizedValues['method'][locale.languageCode]; @@ -1195,6 +1199,10 @@ class TranslationBase { String get updateReschedule => localizedValues['update-reschedule'][locale.languageCode]; String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; + String get accepted => localizedValues['accepetd'][locale.languageCode]; + String get cancelled => localizedValues['cancelled'][locale.languageCode]; + String get unReplied => localizedValues['unReplied'][locale.languageCode]; + String get replied => localizedValues['replied'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index f3882e23..d0d8c3ca 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -1,13 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; class DoctorReplyWidget extends StatefulWidget { final ListGtMyPatientsQuestions reply; @@ -22,224 +22,431 @@ class DoctorReplyWidget extends StatefulWidget { class _DoctorReplyWidgetState extends State { @override Widget build(BuildContext context) { - return Stack( - children: [ - Container( - margin: EdgeInsets.symmetric(vertical: 10.0), - width: double.infinity, - decoration: BoxDecoration( - color: HexColor('#FFFFFF'), - borderRadius: BorderRadius.all( - Radius.circular(20.0), - ), - ), - child: Container( - margin: EdgeInsets.all(5), - child: Column( - children: [ - SizedBox(height: 18,), - Container( - margin: EdgeInsets.only(right: 15), - child: Row( + return Container( + child: CardWithBgWidget( + bgColor: + widget.reply.status == 2 + ? Color(0xFF2E303A) + : Color(0xFFD02127), + hasBorder: false, + widget: Container( + // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: widget.reply.status==2 ? TranslationBase.of(context).replied :TranslationBase.of(context).unReplied , + style: TextStyle( + color: widget.reply.status == 2 + ? Color(0xFF2E303A) + : Color(0xFFD02127), + + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 2.0 * SizeConfig.textMultiplier)), + ], + ), + ), + AppText( + DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .day + .toString() + + " " + + DateUtils.getMonth( + DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .month) + .toString() + .substring(0, 3) + + ' ' + + DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .year + .toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + ], + ), + Row( + children: [ + Expanded( + child: AppText( + Helpers.capitalize( widget.reply.patientName), + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + ), + SizedBox( + width: 4, + ), + widget.reply.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ], + ), + SizedBox( + height: 20, + ), + + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, children: [ - SizedBox(width: 5,), - //LargeAvatar(icon: widget.reply.gender == 0 ? DoctorApp.male : DoctorApp.femaleicon ,), Container( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment(-1, -1), - end: Alignment(1, 1), - colors: [ - Colors.grey[100], - Colors.grey[200], - ]), - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], - borderRadius: BorderRadius.all(Radius.circular(50.0)), - ), - width: 80, - height: 80, - child: Icon(widget.reply.gender == 1 ? DoctorApp.male : DoctorApp.female_icon,size: 80,)), + margin: EdgeInsets.only(top: 5), + width: 60, + height: 60, + child: Image.asset( + widget.reply.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), - SizedBox(width: 15,), - Expanded( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - widget.reply.patientName, - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 5, - ), + ], + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // SizedBox(height: 10,), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, - Row( - children: [ - AppText( - TranslationBase.of(context).fileNo, - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - Container( - margin: EdgeInsets.only(left: 5), - child: AppText( - '${widget.reply.patientID}', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - ), - ], - ), - SizedBox( - height: 5, - ), - Row( - children: [ - AppText( - TranslationBase.of(context).mobileNo, - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - Container( - margin: EdgeInsets.only(left: 5), - child: AppText( - widget.reply.mobileNumber, - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - ), + children: [ + + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNumber, + style: TextStyle( + fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold, fontFamily: 'Poppins')), + new TextSpan( + text: widget.reply.patientID.toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), ], ), - SizedBox( - height: 5, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 70, - height: 20, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(60.0)), - color: Colors.green[600] - ), - child: Center( - child: AppText( - widget.reply.requestTime, - fontSize: 1.5 * SizeConfig.textMultiplier, - color: Colors.white, - ), - ), - ), - Container( - - child: AppText( - '${Helpers.getDate(widget.reply.requestDate)}', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - color: Colors.black, - ), + ), + Container( + width: MediaQuery.of(context).size.width*0.45, + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', ), - ], + children: [ + new TextSpan( + text: TranslationBase.of(context).age + + " : ", + style: TextStyle(fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ], + ), ), - - ], - ), + ) + ], ), - ) - ], - ), - ), - !widget.isShowMore ? SizedBox(height: 18,) : - AnimatedContainer( - duration: Duration(milliseconds: 200), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Divider(color: Colors.grey), - SizedBox(height: 5,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).remarks + " : ", - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ),Expanded( - child: AppText( - widget.reply.remarks, - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ), - ), ], ), - SizedBox(height: 10,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).doctorResponse + " : ", - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ),Expanded( - child: AppText( - widget.reply.doctorResponse, - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ), + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).doctorResponse + " : ", + style: + TextStyle(fontSize: 14, fontFamily: 'Poppins', color: Color(0xFF575757),fontWeight: FontWeight.bold)), + new TextSpan( + text: widget.reply.remarks, + style: TextStyle( + fontFamily: 'Poppins', + color: Color(0xFF575757), + fontSize: 15)), + ], ), - ], - ),SizedBox(height: 10,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).infoStatus + " : ", - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ),Expanded( - child: AppText( - widget.reply.infoStatus, - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ), - ), - ], - ) - ], - ), + ), + ), + ],) + ], ), - ], - ), + SizedBox( + height: 20, + ), + ], ), - ), - Positioned( - right: 5, - top: 20, - child: InkWell( - onTap: (){ - setState(() { - widget.isShowMore = !widget.isShowMore; - }); - }, - child: Icon(widget.isShowMore? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), - ) - ], - + // onTap: onTap, + )), + ), ); + // Stack( + // children: [ + // Container( + // margin: EdgeInsets.symmetric(vertical: 10.0), + // width: double.infinity, + // decoration: BoxDecoration( + // color: HexColor('#FFFFFF'), + // borderRadius: BorderRadius.all( + // Radius.circular(20.0), + // ), + // ), + // child: Container( + // margin: EdgeInsets.all(5), + // child: Column( + // children: [ + // SizedBox(height: 18,), + // Container( + // margin: EdgeInsets.only(right: 15), + // child: Row( + // children: [ + // SizedBox(width: 5,), + // //LargeAvatar(icon: widget.reply.gender == 0 ? DoctorApp.male : DoctorApp.femaleicon ,), + // Container( + // decoration: BoxDecoration( + // gradient: LinearGradient( + // begin: Alignment(-1, -1), + // end: Alignment(1, 1), + // colors: [ + // Colors.grey[100], + // Colors.grey[200], + // ]), + // boxShadow: [ + // BoxShadow( + // color: Color.fromRGBO(0, 0, 0, 0.08), + // offset: Offset(0.0, 5.0), + // blurRadius: 16.0) + // ], + // borderRadius: BorderRadius.all(Radius.circular(50.0)), + // ), + // width: 80, + // height: 80, + // child: Icon(widget.reply.gender == 1 ? DoctorApp.male : DoctorApp.female_icon,size: 80,)), + // + // SizedBox(width: 15,), + // Expanded( + // child: Container( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // widget.reply.patientName, + // fontSize: 1.5 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // SizedBox( + // height: 5, + // ), + // + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).fileNo, + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // Container( + // margin: EdgeInsets.only(left: 5), + // child: AppText( + // '${widget.reply.patientID}', + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ), + // SizedBox( + // height: 5, + // ), + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).mobileNo, + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // Container( + // margin: EdgeInsets.only(left: 5), + // child: AppText( + // widget.reply.mobileNumber, + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ), + // SizedBox( + // height: 5, + // ), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Container( + // width: 70, + // height: 20, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all(Radius.circular(60.0)), + // color: Colors.green[600] + // ), + // child: Center( + // child: AppText( + // widget.reply.requestTime, + // fontSize: 1.5 * SizeConfig.textMultiplier, + // color: Colors.white, + // ), + // ), + // ), + // Container( + // + // child: AppText( + // '${Helpers.getDate(widget.reply.requestDate)}', + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // color: Colors.black, + // ), + // ), + // ], + // ), + // + // ], + // ), + // ), + // ) + // + // ], + // ), + // ), + // + // !widget.isShowMore ? SizedBox(height: 18,) : + // AnimatedContainer( + // duration: Duration(milliseconds: 200), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Divider(color: Colors.grey), + // SizedBox(height: 5,), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).remarks + " : ", + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ),Expanded( + // child: AppText( + // widget.reply.remarks, + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ), + // SizedBox(height: 10,), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).doctorResponse + " : ", + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ),Expanded( + // child: AppText( + // widget.reply.doctorResponse, + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ),SizedBox(height: 10,), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).infoStatus + " : ", + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ),Expanded( + // child: AppText( + // widget.reply.infoStatus, + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ) + // ], + // ), + // ), + // + // ], + // ), + // ), + // ), + // Positioned( + // right: 5, + // top: 20, + // child: InkWell( + // onTap: (){ + // setState(() { + // widget.isShowMore = !widget.isShowMore; + // }); + // }, + // child: Icon(widget.isShowMore? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), + // ) + // ], + // + // ); } } diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index b50a191b..848bda41 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -22,7 +22,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { Widget build(BuildContext context) { return Container( padding: EdgeInsets.only( - left: 0, right: 5, bottom: 5, top: 5), + left: 0, right: 5, bottom: 5,), decoration: BoxDecoration( color: Colors.white, ), @@ -188,9 +188,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { ), Container( child: AppText( - convertDateFormat2(patient - .appointmentDate - .toString()), + convertDateFormat2(patient.appointmentDate.toString()?? ''), fontSize: 1.5 * SizeConfig .textMultiplier, @@ -314,20 +312,22 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { } convertDateFormat2(String str) { - String timeConvert; + String newDate; const start = "/Date("; - const end = "+0300)"; + if (str.isNotEmpty) { + const end = "+0300)"; - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0'); + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + newDate = date.year.toString() + + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0'); + } return newDate.toString(); } diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart new file mode 100644 index 00000000..57f79f7a --- /dev/null +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart @@ -0,0 +1,487 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; +import 'package:provider/provider.dart'; + +import 'large_avatar.dart'; + +class PatientProfileHeaderWhitAppointment extends StatelessWidget { + + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final String doctorName; + final String branch; + final DateTime appointmentDate; + final String profileUrl; + final String invoiceNO; + final String orderNo; + final bool isPrescriptions; + final String clinic; + PatientProfileHeaderWhitAppointment( + {this.patient, + this.patientType, + this.arrivalType, + this.doctorName, + this.branch, + this.appointmentDate, + this.profileUrl, + this.invoiceNO, + this.orderNo, this.isPrescriptions = false, this.clinic}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + //height: 300, + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + AppText( + (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize( + patient.lastName)), + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + patient.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + ), + Row(children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + patient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SERVICES_PATIANT2[ + int.parse(patientType)] == + "patientArrivalList" + ? Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + patient.patientStatusType == + 43 + ? AppText( + TranslationBase.of( + context) + .arrivedP, + color: Colors.green, + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of( + context) + .notArrived, + color: + Colors.red[800], + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ), + arrivalType == '1' + ? AppText( + patient.startTime != + null + ? patient + .startTime + : '', + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + : AppText( + DateUtils.convertStringToDateFormat( + patient + .arrivedOn, + 'MM-dd-yyyy HH:mm'), + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + ], + )) + : SizedBox(), + if (SERVICES_PATIANT2[ + int.parse(patientType)] == + "List_MyOutPatient") + Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .appointmentDate + + " : ", + fontSize: 14, + ), + patient.startTime != null + ? Container( + height: 15, + width: 60, + decoration: + BoxDecoration( + borderRadius: + BorderRadius + .circular( + 25), + color: HexColor( + "#20A169"), + ), + child: AppText( + patient.startTime, + color: Colors.white, + fontSize: 1.5 * + SizeConfig + .textMultiplier, + textAlign: TextAlign + .center, + fontWeight: + FontWeight.bold, + ), + ) + : SizedBox(), + SizedBox( + width: 3.5, + ), + Container( + child: AppText( + convertDateFormat2(patient.appointmentDate??''), + fontSize: 1.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold, + ), + ), + SizedBox( + height: 0.5, + ) + ], + ), + margin: EdgeInsets.only( + top: 8, + ), + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig + .textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of( + context) + .fileNumber, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: patient.patientId + .toString(), + style: TextStyle( + fontWeight: + FontWeight.w700, + fontFamily: + 'Poppins', + fontSize: 14)), + ], + ), + ), + Row( + children: [ + AppText( + patient.nationalityName ?? + patient.nationality, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + patient.nationality != null + ? ClipRRect( + borderRadius: + BorderRadius + .circular( + 20.0), + child: Image.network( + patient + .nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: + (BuildContext + context, + Object + exception, + StackTrace + stackTrace) { + return Text( + 'No Image'); + }, + )) + : SizedBox() + ], + ) + ], + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .age + + " : ", + style: TextStyle( + fontSize: 14)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", + style: TextStyle( + fontWeight: + FontWeight.w700, + fontSize: 14)), + ], + ), + ), + ), + ], + ), + ), + ]), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 30, + height: 30, + margin: EdgeInsets.only(left: projectViewModel.isArabic?10:85, right: projectViewModel.isArabic?85:10,top: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border( + bottom:BorderSide(color: Colors.grey[400],width: 2.5), + left: BorderSide(color: Colors.grey[400],width: 2.5), + ) + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 10), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: LargeAvatar( + name: doctorName, + url: profileUrl, + ), + width: 25, + height: 25, + margin: EdgeInsets.only(top: 10), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + '${TranslationBase.of(context).dr}.$doctorName', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + if (orderNo != null && !isPrescriptions) + Row( + children: [ + Texts( + 'Order No:', + color: Colors.grey[800], + ), + Texts( + orderNo ?? '', + ) + ], + ), + if (invoiceNO != null && !isPrescriptions) + Row( + children: [ + Texts( + 'Invoice:', + color: Colors.grey[800], + ), + Texts( + invoiceNO, + ) + ], + ), + if(isPrescriptions) + Row( + children: [ + Texts( + 'Branch:', + color: Colors.grey[800], + ), + Texts( + branch?? '', + ) + ], + ), + if(isPrescriptions) + Row( + children: [ + Texts( + 'Clinic:', + color: Colors.grey[800], + ), + Texts( + clinic?? '', + ) + ], + ), + Row( + children: [ + Texts( + !isPrescriptions? 'Result Date:': 'Prescriptions Date', + color: Colors.grey[800], + ), + Expanded( + child: Texts( + '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + ), + ) + ], + ) + ]), + ), + ), + + ], + ), + ), + ), + ], + ) + ], + ), + ), + ); + } + + convertDateFormat2(String str) { + String newDate =""; + const start = "/Date("; + const end = "+0300)"; + + if (str.isNotEmpty) { + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + newDate = date.year.toString() + + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0'); + } + + return newDate.toString(); + } + + isToday(date) { + DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); + return DateFormat("yyyy-MM-dd").format(tempDate) == + DateFormat("yyyy-MM-dd").format(DateTime.now()); + } + + myBoxDecoration() { + return BoxDecoration( + border: Border( + top: BorderSide( + color: Colors.green, + width: 5, + ), + ), + borderRadius: BorderRadius.circular(10)); + } +} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index b5afa0af..712648cc 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -124,25 +124,25 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'patient/admission_req.png'), - (int.parse(patientType) == 7 || int.parse(patientType) == 6) - ? PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png') - : PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_HISTORY, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + // (int.parse(patientType) == 7 || int.parse(patientType) == 6) + // ? PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: ORDER_PRESCRIPTION, + // nameLine1: TranslationBase.of(context).orders, + // nameLine2: TranslationBase.of(context).prescription, + // icon: 'patient/order_prescription.png') + // : PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: ORDER_PRESCRIPTION_HISTORY, + // nameLine1: TranslationBase.of(context).orders, + // nameLine2: TranslationBase.of(context).prescription, + // icon: 'patient/order_prescription.png'), PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/shared/Text.dart b/lib/widgets/shared/Text.dart index 4f2c4271..d3fa3cb9 100644 --- a/lib/widgets/shared/Text.dart +++ b/lib/widgets/shared/Text.dart @@ -216,7 +216,8 @@ class _TextsState extends State { fontSize:widget.fontSize?? _getFontSize(), letterSpacing: widget.variant == "overline" ? 1.5 : null, - fontWeight: _getFontWeight(), + fontWeight: widget.fontWeight ?? _getFontWeight(), + fontFamily: 'Poppins', decoration: widget.textDecoration //TextDecoration.lineThrough )), @@ -251,7 +252,7 @@ class _TextsState extends State { style: _getFontStyle().copyWith( color: HexColor('#FF0000'), fontWeight: FontWeight.w800, - fontFamily: "WorkSans", + fontFamily: "Poppins", )), ), ), diff --git a/lib/widgets/shared/app_button.dart b/lib/widgets/shared/app_button.dart index 984d4350..3f9c4549 100644 --- a/lib/widgets/shared/app_button.dart +++ b/lib/widgets/shared/app_button.dart @@ -2,18 +2,22 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class Button extends StatefulWidget { + final String title; + final Widget icon; + final VoidCallback onTap; + final bool loading; + final Color color; + Button({ Key key, - this.title: "", + this.title = "", this.icon, this.onTap, - this.loading: false, + this.loading= false, + this.color, }) : super(key: key); - final String title; - final Widget icon; - final VoidCallback onTap; - final bool loading; + @override _ButtonState createState() => _ButtonState(); @@ -86,7 +90,8 @@ class _ButtonState extends State