diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 23ff3cfb..65b82025 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -383,8 +383,8 @@ const Map> localizedValues = { 'leanBodyWeight': {'en': "Lean Body Weight", 'ar': 'وزن الجسم الهزيل'}, 'bodyMassIndex': {'en': "Body Mass Index", 'ar': 'مؤشر كتلة الجسم'}, 'yourBodyMassIndex': { - 'en': "Your Body Mass Index is", - 'ar': 'مؤشر كتلة جسمك هو' + 'en': "Body Mass Index is", + 'ar': 'مؤشر كتلة الجسم هو' }, 'bmiUnderWeight': {'en': "UnderWeight", 'ar': 'تحت الوزن'}, 'bmiHealthy': {'en': "Healthy", 'ar': 'صحي'}, @@ -867,4 +867,5 @@ const Map> localizedValues = { "ar": "لم يتم التقاط ذلك. حاول التحدث مرة أخرى" }, "showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"}, + "viewProfile": {"en": "View Profile", "ar": "إعرض الملف"}, }; diff --git a/lib/core/service/labs_service.dart b/lib/core/service/labs_service.dart index f38294b5..f2336735 100644 --- a/lib/core/service/labs_service.dart +++ b/lib/core/service/labs_service.dart @@ -132,7 +132,7 @@ class LabsService extends BaseService { body['OrderNo'] = patientLabOrder.orderNo; body['SetupID'] = patientLabOrder.setupID; body['ProjectID'] = patientLabOrder.projectID; - body['ClinicID'] = patientLabOrder.clinicID; + body['ClinicID'] = patientLabOrder.clinicID ?? 0; } body['isDentalAllowedBackend'] = false; body['Procedure'] = procedure; diff --git a/lib/core/service/patient-ucaf-service.dart b/lib/core/service/patient-ucaf-service.dart index ec2885f5..e53df1d0 100644 --- a/lib/core/service/patient-ucaf-service.dart +++ b/lib/core/service/patient-ucaf-service.dart @@ -36,6 +36,35 @@ class UcafService extends LookupService { }, body: body); } + Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) async { + hasError = false; + Map body = Map(); + body['PatientID'] = patient.patientId; + body['PatientTypeID'] = 1; + if(isInPatient){ + body['InOutPatientType'] = 1; + }else { + body['InOutPatientType'] = 2; + } + + await baseAppClient.post( + GET_PATIENT_VITAL_SIGN, + onSuccess: (dynamic response, int statusCode) { + patientVitalSignsHistory.clear(); + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, + body: body, + ); + } + Future getPatientVitalSignsHistory( PatiantInformtion patient, String fromDate, String toDate) async { hasError = false; diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index c302dbbd..71307ddc 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -67,12 +67,16 @@ class VitalSignsService extends BaseService { ); } - Future getInPatientVitalSignHistory(PatiantInformtion patient) async { + Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) async { hasError = false; Map body = Map(); body['PatientID'] = patient.patientId; - body['InOutPatientType'] = 1; body['PatientTypeID'] = 1; + if(isInPatient){ + body['InOutPatientType'] = 1; + }else { + body['InOutPatientType'] = 2; + } await baseAppClient.post( GET_PATIENT_VITAL_SIGN, diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index 530d92f4..dc76884d 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -67,7 +67,8 @@ class UcafViewModel extends BaseViewModel { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } - await _ucafService.getPatientVitalSignsHistory(patient, from, to); + // await _ucafService.getPatientVitalSignsHistory(patient, from, to); + await _ucafService.getInPatientVitalSignHistory(patient, false); await _ucafService.getPatientChiefComplaint(patient); if (_ucafService.hasError) { diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 06e5371a..6786ad92 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -52,11 +52,12 @@ class VitalSignsViewModel extends BaseViewModel { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } - if (isInPatient) { - await _vitalSignService.getInPatientVitalSignHistory(patient); - } else { - await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); - } + await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); + // if (isInPatient) { + // await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); + // } else { + // await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); + // } if (_vitalSignService.hasError) { error = _vitalSignService.error; diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index 2f760d1f..fcc9746a 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -16,8 +16,9 @@ class FlowChartPage extends StatelessWidget { final PatientLabOrders patientLabOrder; final String filterName; final PatiantInformtion patient; + final bool isInpatient; - FlowChartPage({this.patientLabOrder, this.filterName, this.patient}); + FlowChartPage({this.patientLabOrder, this.filterName, this.patient, this.isInpatient}); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 6c3e7fe4..0d059000 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -36,7 +36,7 @@ class LabResultWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (!isInpatient) + // if (!isInpatient) Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -50,6 +50,7 @@ class LabResultWidget extends StatelessWidget { filterName: filterName, patientLabOrder: patientLabOrder, patient: patient, + isInpatient: isInpatient, ), ), ); diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index 32d60f79..cc2c7136 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -90,15 +90,46 @@ class ReferralPatientDetailScreen extends StatelessWidget { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.network( - referredPatient.doctorImageURL + Column( + children: [ + InkWell( + onTap: () { + PatiantInformtion patient = + model.getPatientFromReferralO(referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patient, + "patientType": "1", + "isInpatient": true, + "arrivalType": "1", + "from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + }); + }, + child: Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + referredPatient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), ), - ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).viewProfile, + fontWeight: FontWeight.w700, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Colors.red[700], + ) + ], ), SizedBox( width: 10, @@ -321,7 +352,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { margin: EdgeInsets.only(left: 10, right: 0), child: Image.asset( - 'assets/images/patient/ic_ref_arrow_left.png', + 'assets/images/patient/ic_ref_arrow_up.png', height: 50, width: 30, ), 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 b68eeac1..07c4b38e 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 @@ -127,10 +127,10 @@ class ReferredPatientDetailScreen extends StatelessWidget { height: 20, ), AppText( - TranslationBase.of(context).showDetail, + TranslationBase.of(context).viewProfile, fontWeight: FontWeight.w700, fontSize: 1.7 * SizeConfig.textMultiplier, - color: Colors.blue, + color: Colors.red[700], ) ], ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index a991c2aa..4645a5e0 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1175,6 +1175,7 @@ class TranslationBase { localizedValues['noDataAvailable'][locale.languageCode]; String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; String get showDetail => localizedValues['showDetail'][locale.languageCode]; + String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; String get reschedule => localizedValues['reschedule'][locale.languageCode]; diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index 4ec76475..0adfac4d 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -328,7 +328,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget margin: EdgeInsets.only(top: 10), ), Expanded( - flex: 4, + flex: 5, child: Container( margin: EdgeInsets.all(10), child: Column( @@ -467,5 +467,5 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget } @override - Size get preferredSize => Size(double.maxFinite, 290); + Size get preferredSize => Size(double.maxFinite, 310); }