From a46a61c5cf4e52f03c1d0fb31c51c768c2d6b8c8 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 5 Jan 2021 18:59:32 +0200 Subject: [PATCH] fix get and post issue to make it works with vida --- lib/client/base_app_client.dart | 4 + lib/config/localized_values.dart | 3 + .../GetChiefComplaintReqModel.dart | 9 +- lib/models/SOAP/GeneralGetReqForSOAP.dart | 15 +- lib/models/SOAP/GetHistoryReqModel.dart | 7 +- lib/models/SOAP/GetPhysicalExamReqModel.dart | 21 ++- lib/models/SOAP/my_selected_allergy.dart | 9 +- lib/models/SOAP/my_selected_examination.dart | 10 +- .../SOAP/post_histories_request_model.dart | 5 +- lib/util/translations_delegate_base.dart | 3 + .../subjective/update_allergies_widget.dart | 55 ++++--- .../subjective/update_subjective_page.dart | 136 +++++++++--------- .../soap_update/update_objective_page.dart | 19 ++- .../soap_update/update_soap_index.dart | 2 +- 14 files changed, 184 insertions(+), 114 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index ea5580ca..6ab902de 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -44,6 +44,7 @@ class BaseAppClient { body['DoctorID'] = doctorProfile?.doctorID; if (body['DoctorID'] == "") body['DoctorID'] = null; + if( body['EditedBy'] ==null) body['EditedBy'] = doctorProfile?.doctorID; if (body['ProjectID'] == null) { body['ProjectID'] = doctorProfile?.projectID; @@ -54,6 +55,9 @@ class BaseAppClient { if (body['DoctorID'] == '') { body['DoctorID'] =null; } + if (body['EditedBy'] == '') { + body.remove("EditedBy"); + } body['TokenID'] = token ?? ''; String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index adca1232..4ad53ebe 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -538,4 +538,7 @@ const Map> localizedValues = { }, 'addAssessment': {'en': "Add ASSESSMENT", 'ar':"أضف التقييم" }, 'assessment': {'en': "ASSESSMENT", 'ar':" التقييم" }, + 'physicalSystemExamination': {'en': "Physical/System Examination", 'ar':" الفحص البدني / النظام" }, + 'searchExamination': {'en': "Search Examination", 'ar':"فحص البحث" }, + 'addExamination': {'en': "Add Examination", 'ar':"اضافه" }, }; diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 68ab6c40..80188dfe 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -3,16 +3,19 @@ class GetChiefComplaintReqModel { int appointmentNo; int episodeId; int episodeID; + dynamic doctorID; GetChiefComplaintReqModel( - {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID}); + {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID}); GetChiefComplaintReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeId']; episodeID = json['EpisodeID']; - } + doctorID = json['DoctorID']; + +} Map toJson() { final Map data = new Map(); @@ -20,6 +23,8 @@ class GetChiefComplaintReqModel { data['AppointmentNo'] = this.appointmentNo; data['EpisodeId'] = this.episodeId; data['EpisodeID'] = this.episodeID; + data['DoctorID'] = this.doctorID; + return data; } } diff --git a/lib/models/SOAP/GeneralGetReqForSOAP.dart b/lib/models/SOAP/GeneralGetReqForSOAP.dart index 488a06d4..70e76313 100644 --- a/lib/models/SOAP/GeneralGetReqForSOAP.dart +++ b/lib/models/SOAP/GeneralGetReqForSOAP.dart @@ -2,16 +2,23 @@ class GeneralGetReqForSOAP { int patientMRN; int appointmentNo; int episodeId; - String doctorID; + dynamic editedBy; + dynamic doctorID; - GeneralGetReqForSOAP( - {this.patientMRN, this.appointmentNo, this.episodeId, this.doctorID}); + GeneralGetReqForSOAP({ + this.patientMRN, + this.appointmentNo, + this.episodeId, + this.doctorID, + this.editedBy, + }); GeneralGetReqForSOAP.fromJson(Map json) { patientMRN = json['PatientMRN']; appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeId']; doctorID = json['DoctorID']; + editedBy = json['EditedBy']; } Map toJson() { @@ -20,6 +27,8 @@ class GeneralGetReqForSOAP { data['AppointmentNo'] = this.appointmentNo; data['EpisodeId'] = this.episodeId; data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; + return data; } } diff --git a/lib/models/SOAP/GetHistoryReqModel.dart b/lib/models/SOAP/GetHistoryReqModel.dart index 1df26690..720b6342 100644 --- a/lib/models/SOAP/GetHistoryReqModel.dart +++ b/lib/models/SOAP/GetHistoryReqModel.dart @@ -5,8 +5,9 @@ class GetHistoryReqModel { String from; String to; int clinicID; - int doctorID; int appointmentNo; + dynamic editedBy; + dynamic doctorID; GetHistoryReqModel( {this.patientMRN, @@ -16,6 +17,7 @@ class GetHistoryReqModel { this.to, this.clinicID, this.doctorID, + this.editedBy, this.appointmentNo}); GetHistoryReqModel.fromJson(Map json) { @@ -27,6 +29,7 @@ class GetHistoryReqModel { clinicID = json['ClinicID']; doctorID = json['DoctorID']; appointmentNo = json['AppointmentNo']; + editedBy = json['EditedBy']; } @@ -40,6 +43,8 @@ class GetHistoryReqModel { data['To'] = this.to; data['ClinicID'] = this.clinicID; data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; + return data; } } diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/models/SOAP/GetPhysicalExamReqModel.dart index ce045c22..5145c419 100644 --- a/lib/models/SOAP/GetPhysicalExamReqModel.dart +++ b/lib/models/SOAP/GetPhysicalExamReqModel.dart @@ -4,13 +4,18 @@ class GetPhysicalExamReqModel { String episodeID; String from; String to; + dynamic editedBy; + dynamic doctorID; - GetPhysicalExamReqModel( - {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.from, - this.to}); + GetPhysicalExamReqModel({ + this.patientMRN, + this.appointmentNo, + this.episodeID, + this.from, + this.to, + this.doctorID, + this.editedBy, + }); GetPhysicalExamReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -18,6 +23,8 @@ class GetPhysicalExamReqModel { episodeID = json['EpisodeID']; from = json['From']; to = json['To']; + doctorID = json['DoctorID']; + editedBy = json['EditedBy']; } Map toJson() { @@ -27,6 +34,8 @@ class GetPhysicalExamReqModel { data['EpisodeID'] = this.episodeID; data['From'] = this.from; data['To'] = this.to; + data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; return data; } } diff --git a/lib/models/SOAP/my_selected_allergy.dart b/lib/models/SOAP/my_selected_allergy.dart index e5b45502..5a6bd749 100644 --- a/lib/models/SOAP/my_selected_allergy.dart +++ b/lib/models/SOAP/my_selected_allergy.dart @@ -5,9 +5,14 @@ class MySelectedAllergy { MasterKeyModel selectedAllergy; String remark; bool isChecked; + int createdBy; MySelectedAllergy( - {this.selectedAllergySeverity, this.selectedAllergy, this.remark, this.isChecked}); + {this.selectedAllergySeverity, + this.selectedAllergy, + this.remark, + this.isChecked, + this.createdBy}); MySelectedAllergy.fromJson(Map json) { selectedAllergySeverity = json['selectedAllergySeverity'] != null @@ -18,6 +23,7 @@ class MySelectedAllergy { : null; remark = json['remark']; remark = json['isChecked']; + createdBy = json['createdBy']; } Map toJson() { @@ -30,6 +36,7 @@ class MySelectedAllergy { } data['remark'] = this.remark; data['isChecked'] = this.remark; + data['createdBy'] = this.createdBy; return data; } } diff --git a/lib/models/SOAP/my_selected_examination.dart b/lib/models/SOAP/my_selected_examination.dart index 3b6685c8..5a717a4e 100644 --- a/lib/models/SOAP/my_selected_examination.dart +++ b/lib/models/SOAP/my_selected_examination.dart @@ -5,18 +5,23 @@ class MySelectedExamination { String remark; bool isNormal; bool isAbnormal; + int createdBy; MySelectedExamination( - {this.selectedExamination, this.remark, this.isNormal = true, this.isAbnormal = false}); + {this.selectedExamination, + this.remark, + this.isNormal = true, + this.isAbnormal = false, + this.createdBy}); MySelectedExamination.fromJson(Map json) { - selectedExamination = json['selectedExamination'] != null ? new MasterKeyModel.fromJson(json['selectedExamination']) : null; remark = json['remark']; remark = json['isNormal']; remark = json['isAbnormal']; + createdBy = json['createdBy']; } Map toJson() { @@ -28,6 +33,7 @@ class MySelectedExamination { data['remark'] = this.remark; data['isNormal'] = this.isNormal; data['isAbnormal'] = this.isAbnormal; + data['createdBy'] = this.createdBy; return data; } } diff --git a/lib/models/SOAP/post_histories_request_model.dart b/lib/models/SOAP/post_histories_request_model.dart index baa428fd..d8be3fb2 100644 --- a/lib/models/SOAP/post_histories_request_model.dart +++ b/lib/models/SOAP/post_histories_request_model.dart @@ -1,7 +1,8 @@ class PostHistoriesRequestModel { List listMedicalHistoryVM; + dynamic doctorID; - PostHistoriesRequestModel({this.listMedicalHistoryVM}); + PostHistoriesRequestModel({this.listMedicalHistoryVM, this.doctorID}); PostHistoriesRequestModel.fromJson(Map json) { if (json['listMedicalHistoryVM'] != null) { @@ -10,6 +11,7 @@ class PostHistoriesRequestModel { listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v)); }); } + doctorID = json['DoctorID']; } Map toJson() { @@ -18,6 +20,7 @@ class PostHistoriesRequestModel { data['listMedicalHistoryVM'] = this.listMedicalHistoryVM.map((v) => v.toJson()).toList(); } + data['DoctorID'] = this.doctorID; return data; } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index e295266f..e6b5dbd5 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -555,6 +555,9 @@ class TranslationBase { String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; String get assessment => localizedValues['assessment'][locale.languageCode]; String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String get physicalSystemExamination => localizedValues['physicalSystemExamination'][locale.languageCode]; + String get searchExamination => localizedValues['searchExamination'][locale.languageCode]; + String get addExamination => localizedValues['addExamination'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index a9839a2c..6de9e031 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -170,31 +170,40 @@ class _UpdateAllergiesWidgetState extends State { builder: (context) { return AddAllergies( addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { - setState(() { - List allergy = - // ignore: missing_return - widget.myAllergiesList.where((element) => - mySelectedAllergy.selectedAllergy.id == - element.selectedAllergy.id - ).toList(); - if (allergy.isEmpty) { - widget.myAllergiesList.add(mySelectedAllergy); - Navigator.of(context).pop(); - } else { - allergy.first.selectedAllergy = - mySelectedAllergy.selectedAllergy; - allergy.first.selectedAllergySeverity = - mySelectedAllergy.selectedAllergySeverity; - allergy.first.remark = mySelectedAllergy.remark; - allergy.first.isChecked = mySelectedAllergy.isChecked; - Navigator.of(context).pop(); + if (mySelectedAllergy.selectedAllergySeverity == null || + mySelectedAllergy.selectedAllergy == null) { + helpers.showErrorToast(TranslationBase + .of(context) + .requiredMsg); - // helpers.showErrorToast(TranslationBase - // .of(context) - // .itemExist); - } + } else { + setState(() { + List allergy = + // ignore: missing_return + widget.myAllergiesList + .where((element) => + mySelectedAllergy.selectedAllergy.id == + element.selectedAllergy.id) + .toList(); - }); + if (allergy.isEmpty) { + widget.myAllergiesList.add(mySelectedAllergy); + Navigator.of(context).pop(); + } else { + allergy.first.selectedAllergy = + mySelectedAllergy.selectedAllergy; + allergy.first.selectedAllergySeverity = + mySelectedAllergy.selectedAllergySeverity; + allergy.first.remark = mySelectedAllergy.remark; + allergy.first.isChecked = mySelectedAllergy.isChecked; + Navigator.of(context).pop(); + + // helpers.showErrorToast(TranslationBase + // .of(context) + // .itemExist); + } + }); + } },); }); } 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 e0d92788..4370df4f 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 @@ -1,5 +1,6 @@ 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'; @@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_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'; @@ -54,20 +56,11 @@ class _UpdateSubjectivePageState extends State { GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo); - - getHistoryReqModel.historyType = - MasterKeysService.HistoryFamily.getMasterKeyService(); - await model.getPatientHistories(getHistoryReqModel, isFirst: true); - getHistoryReqModel.historyType = - MasterKeysService.HistoryMedical.getMasterKeyService(); - await model.getPatientHistories(getHistoryReqModel); - getHistoryReqModel.historyType = - MasterKeysService.HistorySurgical.getMasterKeyService(); - await model.getPatientHistories(getHistoryReqModel); - getHistoryReqModel.historyType = - MasterKeysService.HistorySports.getMasterKeyService(); - await model.getPatientHistories(getHistoryReqModel); + appointmentNo: widget.patientInfo.appointmentNo, + doctorID: '', + editedBy: ''); + + await model.getPatientHistories(getHistoryReqModel,isFirst: true); if (model.patientHistoryList.isNotEmpty) { if (model.historyFamilyList.isEmpty) { @@ -147,58 +140,64 @@ class _UpdateSubjectivePageState extends State { }); } } + + getAllergies(SOAPViewModel model) async { + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + doctorID: '', + editedBy: ''); + await model.getPatientAllergy(generalGetReqForSOAP); + if (model.patientAllergiesList.isNotEmpty) { + if (model.allergiesList.isEmpty) + await model.getMasterLookup(MasterKeysService.Allergies); + if (model.allergySeverityList.isEmpty) + await model.getMasterLookup(MasterKeysService.AllergySeverity); + + model.patientAllergiesList.forEach((element) { + MasterKeyModel selectedAllergy = model.getOneMasterKey( + masterKeys: MasterKeysService.Allergies, + id: element.allergyDiseaseId, + typeId: element.allergyDiseaseType); + MasterKeyModel selectedAllergySeverity = model.getOneMasterKey( + masterKeys: MasterKeysService.AllergySeverity, + id: element.severity, + ); + MySelectedAllergy mySelectedAllergy = MySelectedAllergy( + selectedAllergy: selectedAllergy, + isChecked: element.isChecked, + createdBy: element.createdBy, + selectedAllergySeverity: selectedAllergySeverity); + if (selectedAllergy != null && selectedAllergySeverity != null) + widget.myAllergiesList.add(mySelectedAllergy); + }); + } + } + @override Widget build(BuildContext context) { - - return BaseView( + return BaseView( onModelReady: (model) async { widget.myAllergiesList.clear(); widget.myHistoryList.clear(); - - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo); GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( patientMRN: widget.patientInfo.patientMRN, appointmentNo: widget.patientInfo.appointmentNo, episodeId: widget.patientInfo.episodeNo, - episodeID: widget.patientInfo.episodeNo); + episodeID: widget.patientInfo.episodeNo, + doctorID: ''); await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { - complaintsController.text = helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint) - ; + complaintsController.text = helpers.parseHtmlString( + model.patientChiefComplaintList[0].chiefComplaint); illnessController.text = model.patientChiefComplaintList[0].hopi; } - await model.getPatientAllergy(generalGetReqForSOAP); - if (model.patientAllergiesList.isNotEmpty) { - if (model.allergiesList.isEmpty) - await model.getMasterLookup(MasterKeysService.Allergies); - if (model.allergySeverityList.isEmpty) - await model.getMasterLookup(MasterKeysService.AllergySeverity); - - model.patientAllergiesList.forEach((element) { - MasterKeyModel selectedAllergy = model.getOneMasterKey( - masterKeys: MasterKeysService.Allergies, - id: element.allergyDiseaseId, - typeId: element.allergyDiseaseType); - MasterKeyModel selectedAllergySeverity = model.getOneMasterKey( - masterKeys: MasterKeysService.AllergySeverity, - id: element.severity, - ); - MySelectedAllergy mySelectedAllergy = MySelectedAllergy( - selectedAllergy: selectedAllergy, - isChecked: element.isChecked, - selectedAllergySeverity: selectedAllergySeverity); - if (selectedAllergy != null && selectedAllergySeverity != null) - widget.myAllergiesList.add(mySelectedAllergy); - }); - } await getHistory(model); - + await getAllergies(model); }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, @@ -472,29 +471,30 @@ class _UpdateSubjectivePageState extends State { {List myAllergiesList, SOAPViewModel model}) async { PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); + + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); widget.myAllergiesList.forEach((allergy) { if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; //TODO: make static value dynamic - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM - .add(ListHisProgNotePatientAllergyDiseaseVM( - allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - severity: allergy.selectedAllergySeverity.id, - remarks: allergy.remark, - createdBy: 4709, - // - createdOn: DateTime.now().toIso8601String(), - //"2020-08-14T20:37:22.780Z", - editedBy: 4709, - editedOn: DateTime.now().toIso8601String(), - //"2020-08-14T20:37:22.780Z", - isChecked: false, - isUpdatedByNurse: false)); + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( + ListHisProgNotePatientAllergyDiseaseVM( + allergyDiseaseId: allergy.selectedAllergy.id, + allergyDiseaseType: allergy.selectedAllergy.typeId, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + severity: allergy.selectedAllergySeverity.id, + remarks: allergy.remark, + createdBy: allergy.createdBy??doctorProfile.doctorID, + createdOn: DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + isChecked: allergy.isChecked, + isUpdatedByNurse: false)); }); if (model.patientAllergiesList.isEmpty) { await model.postAllergy(postAllergyRequestModel); @@ -510,7 +510,7 @@ class _UpdateSubjectivePageState extends State { postHistories( {List myHistoryList, SOAPViewModel model}) async { PostHistoriesRequestModel postHistoriesRequestModel = - new PostHistoriesRequestModel(); + new PostHistoriesRequestModel(doctorID: ''); widget.myHistoryList.forEach((history) { if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; 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 37a5d72f..0c8bece6 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -1,5 +1,6 @@ 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'; @@ -7,6 +8,7 @@ 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'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_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'; @@ -77,6 +79,7 @@ class _UpdateObjectivePageState extends State { selectedExamination: examMaster, remark: element.remarks, isNormal: element.isNormal, + createdBy: element.createdBy, isAbnormal: element.isAbnormal); widget.mySelectedExamination.add(tempEam); }); @@ -102,7 +105,7 @@ class _UpdateObjectivePageState extends State { children: [ Row( children: [ - Texts('Physical/System Examination', + Texts(TranslationBase.of(context).physicalSystemExamination, variant: isSysExaminationExpand ? "bodyText" : '', @@ -137,7 +140,7 @@ class _UpdateObjectivePageState extends State { margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( - hintText: "Add Examination", + hintText: TranslationBase.of(context).physicalSystemExamination, fontSize: 13.5, onTapTextFields: () { openExaminationList(context); @@ -351,7 +354,11 @@ class _UpdateObjectivePageState extends State { } submitUpdateObjectivePage(SOAPViewModel model) async { + if(widget.mySelectedExamination.isNotEmpty){ + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); widget.mySelectedExamination.forEach((exam) { if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == @@ -364,9 +371,9 @@ class _UpdateObjectivePageState extends State { episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, remarks: exam.remark ?? '', - createdBy: 4709, + createdBy: exam.createdBy??doctorProfile.doctorID, createdOn: DateTime.now().toIso8601String(), - editedBy: 4709, + editedBy: doctorProfile.doctorID, editedOn: DateTime.now().toIso8601String(), examId: exam.selectedExamination.id, examType: exam.selectedExamination.typeId, @@ -505,8 +512,8 @@ class _AddExaminationDailogState extends State { baseViewModel: model, child: MasterKeyCheckboxSearchWidget( model: model, - hintSearchText: 'Search Examination', - buttonName: 'Add Examination', + hintSearchText: TranslationBase.of(context).searchExamination, + buttonName: TranslationBase.of(context).addExamination, masterList: model.physicalExaminationList, removeHistory: (history){ setState(() { diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 0edaaaf9..3b793d6a 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -33,7 +33,7 @@ class _UpdateSoapIndexState extends State List myAllergiesList= List(); List myHistoryList = List(); List mySelectedExamination = List(); - MySelectedAssessment mySelectedAssessment = new MySelectedAssessment(); + MySelectedAssessment mySelectedAssessment = MySelectedAssessment(); changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); }