diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index df7cea74..456d8524 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -587,6 +587,9 @@ const Map> localizedValues = { 'en': "There is no detail for this patient", 'ar': "لا توجد تفاصيل لهذا المريض" }, + 'allergicTO': {'en': "ALLERGIC TO ", 'ar':" حساس من" }, + 'normal': {'en': "Normal", 'ar':"عادي" }, + 'abnormal': {'en': "Abnormal", 'ar':" غير عادي" }, "systolic-lng": {"en": "Systolic", "ar": "الإنقباض"}, "diastolic-lng": {"en": "Diastolic", "ar": "الإنبساط"}, "mass": {"en": "Mass", "ar": "كتلة"}, diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index e3daf6e9..03500740 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -246,10 +246,15 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - String getAllergicNames(){ - String allergiesString=''; + String getAllergicNames(isArabic) { + String allergiesString = ''; patientAllergiesList.forEach((element) { - allergiesString += element.allergyDiseaseName+' , '; + MasterKeyModel selectedAllergy = getOneMasterKey( + masterKeys: MasterKeysService.Allergies, + id: element.allergyDiseaseId, + typeId: element.allergyDiseaseType); + allergiesString += + (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn )+ ' , '; }); return allergiesString; } diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index e5b89cfa..1b3621c1 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -135,14 +135,14 @@ class PatiantInformtion { description: json["Description"]?? json["description"], clinicDescription: json["ClinicDescription"]?? json["clinicDescription"], clinicDescriptionN: json["ClinicDescriptionN"]?? json["clinicDescriptionN"], - nationalityName: json["NationalityName"]?? json["nationalityName"], - nationalityNameN: json["NationalityNameN"]?? json["nationalityNameN"], + nationalityName: json["NationalityName"]?? json["nationalityName"]??json['NationalityName'], + nationalityNameN: json["NationalityNameN"]?? json["nationalityNameN"]??json['NationalityNameN'], age: json["Age"]?? json["age"], genderDescription: json["GenderDescription"], nursingStationName: json["NursingStationName"], appointmentDate: json["AppointmentDate"]?? '', startTime: json["StartTime"], - appointmentNo :json['appointmentNo'], + appointmentNo :json['appointmentNo'] ?? json['AppointmentNo'], appointmentType :json['appointmentType'], arrivedOn :json['arrivedOn'], clinicGroupId :json['clinicGroupId'], @@ -150,12 +150,12 @@ class PatiantInformtion { dischargeStatus :json['dischargeStatus'], doctorDetails :json['doctorDetails'], endTime :json['endTime'], - episodeNo :json['episodeNo'], + episodeNo :json['episodeNo'] ?? json['EpisodeID'], fallRiskScore :json['fallRiskScore'], isSigned :json['isSigned'], medicationOrders :json['medicationOrders'], - nationality :json['nationality'], - patientMRN :json['patientMRN'], + nationality :json['nationality']??json['NationalityNameN'], + patientMRN :json['patientMRN'] ?? json['PatientMRN'], ); diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index a8da28b9..e05c6f04 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -486,6 +486,7 @@ class _PatientsScreenState extends State { mainAxisAlignment: MainAxisAlignment .spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Column( crossAxisAlignment: @@ -500,11 +501,14 @@ class _PatientsScreenState extends State { fontWeight: FontWeight.bold, backGroundcolor: Colors.white, ), + AppText( item.patientId.toString(), fontSize: 1.8 * SizeConfig.textMultiplier, fontWeight: FontWeight.w300, backGroundcolor: Colors.white, + ),SizedBox( + width: 10, ), ], ), @@ -513,8 +517,8 @@ class _PatientsScreenState extends State { 2.5, ), AppText( - 'NATIONALITY: ' + - item.nationalityName.toString(), + TranslationBase.of(context).nationality +" : "+( + item.nationalityName??item.nationality), fontSize: 1.8 * SizeConfig.textMultiplier, fontWeight: diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index c3df9d86..1f81e8a5 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -610,6 +610,10 @@ class TranslationBase { String get addExamination => localizedValues['addExamination'][locale.languageCode]; String get doc => localizedValues['doc'][locale.languageCode]; + String get allergicTO=> localizedValues['allergicTO'][locale.languageCode]; + String get normal=> localizedValues['normal'][locale.languageCode]; + String get abnormal=> localizedValues['abnormal'][locale.languageCode]; + String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; String get systolicLng => diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index a6c47a7f..fd7fd0d8 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.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/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -8,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widg 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'; +import 'package:provider/provider.dart'; class PatientPageHeaderWidget extends StatelessWidget { @@ -16,6 +18,8 @@ class PatientPageHeaderWidget extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( onModelReady: (model) async { GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( @@ -83,7 +87,7 @@ class PatientPageHeaderWidget extends StatelessWidget { NetworkBaseView( baseViewModel: model, child: model.patientAllergiesList.isNotEmpty ?AppText( - "ALLERGIC TO: "+model.getAllergicNames(), + TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), color: Color(0xFFB9382C), fontWeight: FontWeight.bold, ) : AppText(''), diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index 04e090f1..11f1572f 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -143,7 +143,7 @@ class PatientProfileWidget extends StatelessWidget { height: 4, ), AppText( - patient.nationalityName, + patient.nationalityName ??patient.nationality , fontWeight: FontWeight.normal, fontSize: 1.7 * SizeConfig.textMultiplier, ), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 6085f938..054d3c34 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -42,7 +42,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { crossAxisCount: 2, childAspectRatio: 1.5, children: [ - if (int.parse(patientType) == 7) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -61,7 +61,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { }, isLoading: model.state == ViewState.BusyLocal, icon: 'create-episod.png'), - if (int.parse(patientType) == 7) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -98,9 +98,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, icon: 'radiology-1.png'), - if (selectedPatientType != 0 && - selectedPatientType != 5 && - selectedPatientType != 7) + if (selectedPatientType != 0 && selectedPatientType != 5 && selectedPatientType != 7) PatientProfileButton( key: key, patient: patient, @@ -108,7 +106,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'heartbeat.png'), - if (selectedPatientType == 7) + if (selectedPatientType == 7|| int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -130,7 +128,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, icon: 'lab.png'), - if (selectedPatientType == 7) + if (selectedPatientType == 7|| int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -154,7 +152,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'sick_leaves_icons.png'), - if (selectedPatientType == 7) + if (selectedPatientType == 7|| int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index de5d2d68..c998f932 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -160,10 +160,18 @@ class _UpdateSubjectivePageState extends State { masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); - MasterKeyModel selectedAllergySeverity = model.getOneMasterKey( - masterKeys: MasterKeysService.AllergySeverity, - id: element.severity, - ); + MasterKeyModel selectedAllergySeverity; + if (element.severity == 0) { + selectedAllergySeverity = MasterKeyModel( + id: 0, + typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); + } else { + selectedAllergySeverity = model.getOneMasterKey( + masterKeys: MasterKeysService.AllergySeverity, + id: element.severity, + ); + } + MySelectedAllergy mySelectedAllergy = MySelectedAllergy( selectedAllergy: selectedAllergy, isChecked: element.isChecked, diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index 9bd38666..ab1abd21 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -1,9 +1,10 @@ -import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; @@ -24,6 +25,7 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; class UpdateObjectivePage extends StatefulWidget { final Function changePageViewIndex; @@ -38,7 +40,6 @@ class UpdateObjectivePage extends StatefulWidget { class _UpdateObjectivePageState extends State { bool isSysExaminationExpand = false; - TextEditingController remarksController = TextEditingController(); BoxDecoration containerBorderDecoration( Color containerColor, Color borderColor) { @@ -55,9 +56,11 @@ class _UpdateObjectivePageState extends State { @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { + widget.mySelectedExamination.clear(); GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( patientMRN: widget.patientInfo.patientMRN, @@ -165,7 +168,9 @@ class _UpdateObjectivePageState extends State { Column( children: widget.mySelectedExamination.map((examination) { - return Container( + TextEditingController remarksController= TextEditingController(text :examination.remark); + + return Container( margin: EdgeInsets.only( left: 15, right: 15, top: 15), child: Column(children: [ @@ -174,8 +179,8 @@ class _UpdateObjectivePageState extends State { MainAxisAlignment.spaceBetween, children: [ Texts( - examination - .selectedExamination.nameEn + ( examination + .selectedExamination.nameEn ) .toUpperCase(), variant: "bodyText", bold: true, @@ -212,7 +217,7 @@ class _UpdateObjectivePageState extends State { const EdgeInsets .all(8.0), child: Text( - "Normal", + TranslationBase.of(context).normal, style: TextStyle( fontSize: 12, color: @@ -262,7 +267,7 @@ class _UpdateObjectivePageState extends State { const EdgeInsets .all(8.0), child: Text( - "Abnormal", + TranslationBase.of(context).abnormal, style: TextStyle( fontSize: 12, color: @@ -315,7 +320,10 @@ class _UpdateObjectivePageState extends State { fontWeight: FontWeight.w600, maxLines: 25, minLines: 4, - // controller: remarksController, + controller: remarksController, + onChanged: (val) { + examination.remark = val; + }, validator: (value) { if (value == null) return TranslationBase.of(context)