diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index cfad087a..ee4181e3 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -782,7 +782,7 @@ const Map> localizedValues = { }, "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, - "open-rad": {"en": "Open Image", "ar": "فتح صور الاشعة"}, + "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"}, 'fileNumber': {'en': "File Number: ", 'ar': " :رقم الملف"}, 'searchPatient-name': { diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index 1d406b81..fdccf5f5 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -125,7 +125,7 @@ class FinalRadiology { orderNo = json['OrderNo']; projectName = json['ProjectName']; qR = json['QR']; - isLiveCareAppodynamicment = json['IsLiveCareAppodynamicment']; + isLiveCareAppodynamicment = json['IsLiveCareAppointment']; reportDataHTML = json['ReportDataHTML']; reportDataTextdynamic = json['ReportDataTextdynamic']; // speciality = json['Speciality'].cast(); diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index 71307ddc..4dd16859 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -71,14 +71,19 @@ class VitalSignsService extends BaseService { hasError = false; Map body = Map(); body['PatientID'] = patient.patientId; - body['PatientTypeID'] = 1; - if(isInPatient){ - body['InOutPatientType'] = 1; - }else { - body['InOutPatientType'] = 2; + body['PatientTypeID'] = patient.patientType; + // if(isInPatient){ + body['InOutPatientType'] = 0; + // }else { + // body['InOutPatientType'] = 2; + // } + + if (patient.appointmentNo != null && patient.projectId != null) { + body['TransNo'] = patient.appointmentNo; + body['ProjectID'] = patient.projectId; } - await baseAppClient.post( + await baseAppClient.postPatient( GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { patientVitalSignsHistory.clear(); @@ -93,6 +98,7 @@ class VitalSignsService extends BaseService { super.error = error.toString(); }, body: body, + patient: patient ); } } diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 6786ad92..f9cbfc8d 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -52,12 +52,13 @@ class VitalSignsViewModel extends BaseViewModel { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } - await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); - // if (isInPatient) { - // await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); - // } else { - // await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); - // } + + if (isInPatient) { + await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); + } else { + await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); + + } if (_vitalSignService.hasError) { error = _vitalSignService.error; diff --git a/lib/models/patient/my_referral/my_referred_patient_model.dart b/lib/models/patient/my_referral/my_referred_patient_model.dart index cc0381d8..44a427f7 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/models/patient/my_referral/my_referred_patient_model.dart @@ -64,6 +64,7 @@ class MyReferredPatientModel { String referralClinicDescription; String referringDoctorName; bool isReferralDoctorSameBranch; + String referralStatusDesc; MyReferredPatientModel({ this.rowID, @@ -128,7 +129,7 @@ class MyReferredPatientModel { this.referringDoctorName, this.isReferralDoctorSameBranch, this.referralDoctorName, - this.referralClinicDescription, + this.referralClinicDescription,this.referralStatusDesc }); MyReferredPatientModel.fromJson(Map json) { @@ -194,6 +195,7 @@ class MyReferredPatientModel { referringDoctorName = json['ReferringDoctorName']; referralDoctorName = json['ReferralDoctorName']; referralClinicDescription = json['ReferralClinicDescription']; + referralStatusDesc = json['ReferralStatusDesc']; } Map toJson() { 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 1cdc5987..dd3e0995 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -3,6 +3,7 @@ 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/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -37,7 +38,7 @@ class _LabsHomePageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getLabs(patient, isInpatient: isInpatient), + onModelReady: (model) => model.getLabs(patient, isInpatient: false), builder: (context, ProcedureViewModel model, widget) => AppScaffold( baseViewModel: model, backgroundColor: Colors.grey[100], @@ -105,42 +106,7 @@ class _LabsHomePageState extends State { )), ); },label: 'Apply for New Lab Order',), - if(!isInpatient) - Container( - margin: EdgeInsets.only(right: 8), - width: double.maxFinite, - child: InkWell( - onTap: (){ - setState(() { - isInpatient= true; - }); - model.getLabs(patient, isInpatient: true); - }, - child: Align( - alignment: Alignment.centerRight, - child: AppText('View Inpatient Lab Result', - textDecoration:TextDecoration.underline,color: Colors.red,), - ), - ), - ), - if(isInpatient) - Container( - width: double.maxFinite, - margin: EdgeInsets.only(right: 8), - child: InkWell( - onTap: (){ - setState(() { - isInpatient= false; - }); - model.getLabs(patient, isInpatient: false); - }, - child: Align( - alignment: Alignment.centerRight, - child: AppText('View Outpatient Lab Result', - textDecoration:TextDecoration.underline,color: Colors.red,), - ), - ), - ), + ...List.generate( model.patientLabOrdersList.length, (index) => Column( @@ -149,26 +115,80 @@ class _LabsHomePageState extends State { children: model .patientLabOrdersList[index].patientLabOrdersList .map((labOrder) { - return DoctorCard( - onTap: () => Navigator.push( - context, - FadePage( - page: LaboratoryResultPage( - patientLabOrders: labOrder, - patient: patient, - arrivalType: arrivalType, - patientType: patientType, + return Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), + child: Row( + children: [ + Container( + width: 20, + height: 160, + decoration: BoxDecoration( + //Colors.red[900] Color(0xff404545) + color: labOrder.isLiveCareAppointment + ? Colors.red[900] + : !labOrder.isInOutPatient + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomLeft: Radius.circular(8), + + ), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + labOrder.isLiveCareAppointment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !labOrder.isInOutPatient + ? TranslationBase.of(context) + .inPatient + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), + ), + Expanded( + child: DoctorCard( + isNoMargin: true, + 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, + clinic: labOrder.clinicDescription, + appointmentDate: labOrder.orderDate, + orderNo: labOrder.orderNo, + isShowTime: false, + ), ), - ), + ], ), - doctorName: labOrder.doctorName, - invoiceNO: ' ${labOrder.invoiceNo}', - profileUrl: labOrder.doctorImageURL, - branch: labOrder.projectName, - clinic: labOrder.clinicDescription, - appointmentDate: labOrder.orderDate, - orderNo: labOrder.orderNo, - isShowTime: false, ); }).toList(), ), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 4f3b5be2..acc79d19 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -64,17 +64,18 @@ class RadiologyDetailsPage extends StatelessWidget { SizedBox( height: 5, ), - AppText(TranslationBase.of(context).generalResult), - SizedBox( - height: 5, + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText(TranslationBase.of(context).generalResult,color: Color(0xff2E303A),), ), + Padding( padding: const EdgeInsets.all(8.0), child: AppText( '${finalRadiology.reportData.trim()}', textAlign: TextAlign.start, fontSize: 17, - color: Colors.grey, + color: Color(0xff575757), ), ), SizedBox( @@ -94,8 +95,9 @@ class RadiologyDetailsPage extends StatelessWidget { margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), child: SecondaryButton( - color: Colors.red[600], + color: Color(0xffD02127), disabled: finalRadiology.dIAPACSURL == "", + textColor: Color(0xffFFFFFF), onTap: () { launch(model.radImageURL); }, diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index ec34bcd1..6c709e83 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -4,6 +4,7 @@ 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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -24,6 +25,7 @@ class _RadiologyHomePageState extends State { PatiantInformtion patient; String arrivalType; bool isInpatient; + @override void didChangeDependencies() { super.didChangeDependencies(); @@ -38,8 +40,8 @@ class _RadiologyHomePageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => - model.getPatientRadOrders(patient, patientType: patientType, isInPatient: isInpatient), + onModelReady: (model) => model.getPatientRadOrders(patient, + patientType: patientType, isInPatient: false), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], @@ -112,63 +114,81 @@ class _RadiologyHomePageState extends State { }, label: 'Apply for Radiology Order', ), - if(!isInpatient) - Container( - width: double.maxFinite, - margin: EdgeInsets.only(right: 8), - child: InkWell( - onTap: (){ - setState(() { - isInpatient = true; - }); - model.getPatientRadOrders(patient, patientType: patientType, isInPatient: true); - }, - child: Align( - alignment: Alignment.centerRight, - child: AppText('View Inpatient Lab Result', - textDecoration:TextDecoration.underline,color: Colors.red,), - ), - ), - ), - if(isInpatient) - Container( - margin: EdgeInsets.only(right: 8), - width: double.maxFinite, - child: InkWell( - onTap: (){ - setState(() { - isInpatient = false; - }); - model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false); - }, - child: Align( - alignment: Alignment.centerRight, - child: AppText('View Outpatient Lab Result', - textDecoration:TextDecoration.underline,color: Colors.red,), - ), - ), - ), ...List.generate( model.radiologyList.length, - (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: RadiologyDetailsPage( - finalRadiology: model.radiologyList[index], - patient: patient, + (index) => Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, ), - ), - ), - child: DoctorCard( - doctorName: model.radiologyList[index].doctorName, - profileUrl: model.radiologyList[index].doctorImageURL, - invoiceNO: '${model.radiologyList[index].invoiceNo}', - branch: '${model.radiologyList[index].projectName}', - clinic: model.radiologyList[index].clinicDescription, - appointmentDate: - !isInpatient?model.radiologyList[index].orderDate : - model.radiologyList[index].reportDate, + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), + child: Row( + children: [ + Container( + width: 20, + height: 160, + decoration: BoxDecoration( + //Colors.red[900] Color(0xff404545) + color: model.radiologyList[index].isLiveCareAppodynamicment + ? Colors.red[900] + : !model.radiologyList[index].isInOutPatient + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomLeft: Radius.circular(8), + + ), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + model.radiologyList[index].isLiveCareAppodynamicment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !model.radiologyList[index].isInOutPatient + ? TranslationBase.of(context) + .inPatient + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), + ), + Expanded( + child: DoctorCard( + isNoMargin: true, + doctorName: model.radiologyList[index].doctorName, + profileUrl: model.radiologyList[index].doctorImageURL, + invoiceNO: '${model.radiologyList[index].invoiceNo}', + branch: '${model.radiologyList[index].projectName}', + clinic: model.radiologyList[index].clinicDescription, + appointmentDate: !isInpatient + ? model.radiologyList[index].orderDate + : model.radiologyList[index].reportDate, + onTap: () { + Navigator.push( + context, + FadePage( + page: RadiologyDetailsPage( + finalRadiology: model.radiologyList[index], + patient: patient, + ), + ), + ); + }, + ), + ), + ], ), )), if (model.radiologyList.isEmpty && diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index ceb35929..23bbb2b9 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -66,8 +66,7 @@ class ReferredPatientScreen extends StatelessWidget { ); }, child: PatientReferralItemWidget( - referralStatus: - "${model.getReferralStatusNameByCode(model.getReferredPatientItem(index).referralStatus, context)}", + referralStatus:model.getReferredPatientItem(index).referralStatusDesc, referralStatusCode: model .getReferredPatientItem(index) .referralStatus, diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart index 07c4b38e..a9ca6c27 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -146,7 +146,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { MainAxisAlignment.spaceBetween, children: [ AppText( - "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", + referredPatient.referralStatusDesc, fontFamily: 'Poppins', fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 2352ae32..c99bb063 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -284,118 +284,7 @@ class _PrescriptionFormWidgetState extends State { child: Column( //mainAxisAlignment: MainAxisAlignment.end, children: [ - // Container( - // height: MediaQuery.of(context).size.height * - // 0.070, - // color: Colors.white, - // child: InkWell( - // onTap: model.allMedicationList != null - // ? () { - // Helpers.hideKeyboard(context); - // setState(() { - // _selectedMedication = null; - // model.getItem( - // itemID: _selectedMedication - // .itemId); - // }); - // } - // : null, - // child: _selectedMedication == null - // ? AutoCompleteTextField< - // GetMedicationResponseModel>( - // onFocusChanged: (__) { - // if (_selectedMedication != - // null) { - // model.getItem( - // itemID: - // _selectedMedication - // .itemId); - // uom = _selectedMedication.uom; - // } else { - // null; - // } - // if (_selectedMedication != - // null && - // duration != null && - // frequency != null && - // strengthController.text != - // null) { - // model.getBoxQuantity( - // freq: frequency[ - // 'parameterCode'], - // duration: duration['id'], - // itemCode: - // _selectedMedication - // .itemId, - // strength: double.parse( - // strengthController - // .text)); - // box = model.boxQuintity; - // - // return; - // } - // }, - // decoration: - // textFieldSelectorDecoration( - // TranslationBase.of(context) - // .searchMedicineNameHere, - // _selectedMedication != null - // ? _selectedMedication - // .genericName - // : null, - // true, - // ), - // itemSubmitted: (item) => setState( - // () => _selectedMedication = - // item), - // key: key, - // suggestions: - // model.allMedicationList, - // itemBuilder: (context, - // suggestion) => - // new Padding( - // child: AppText(suggestion - // .description + - // '/' + - // suggestion - // .genericName), - // padding: - // EdgeInsets.all(15.0)), - // itemSorter: (a, b) => 1, - // suggestionsAmount: 7, - // itemFilter: (suggestion, input) => - // suggestion.genericName.toLowerCase().startsWith( - // input.toLowerCase()) || - // suggestion.description - // .toLowerCase() - // .startsWith(input - // .toLowerCase()) || - // suggestion.keywords - // .toLowerCase() - // .startsWith( - // input.toLowerCase()), - // ) - // : TextField( - // onEditingComplete: () { - // model.getItem( - // itemID: _selectedMedication - // .itemId); - // }, - // decoration: textFieldSelectorDecoration( - // TranslationBase.of(context) - // .searchMedicineNameHere, - // _selectedMedication != null - // ? _selectedMedication - // .description + - // ('${_selectedMedication.genericName}') - // : null, - // false, - // suffixIcon: - // Icon(Icons.search)), - // enabled: false, - // ), - // ), - // ), + FractionallySizedBox( widthFactor: 0.9, child: Container( diff --git a/lib/widgets/shared/buttons/secondary_button.dart b/lib/widgets/shared/buttons/secondary_button.dart index acd99c99..48c65baf 100644 --- a/lib/widgets/shared/buttons/secondary_button.dart +++ b/lib/widgets/shared/buttons/secondary_button.dart @@ -238,11 +238,9 @@ class _SecondaryButtonState extends State widget.label, style: TextStyle( color: widget.textColor, - fontSize: widget.small ? 12.0 : 15.0, - // fontWeight: FontWeight.w800, - fontFamily: projectViewModel.isArabic - ? 'Cairo' - : 'Poppins'), + fontSize: 16, + fontWeight: FontWeight.w700, + fontFamily: 'Poppins'), ), ) ], diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 1c889d9d..778ce3c8 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -20,6 +20,7 @@ class DoctorCard extends StatelessWidget { final String clinic; final bool isShowEye; final bool isShowTime; + final bool isNoMargin; DoctorCard( {this.doctorName, @@ -31,13 +32,13 @@ class DoctorCard extends StatelessWidget { this.orderNo, this.isPrescriptions = false, this.clinic, - this.isShowEye = true, this.isShowTime= true}); + this.isShowEye = true, this.isShowTime= true, this.isNoMargin =false}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - margin: EdgeInsets.all(10), + margin: EdgeInsets.all(!isNoMargin? 10:0), decoration: BoxDecoration( border: Border.all( width: 0.5,