fix get and post issue to make it works with vida

merge-requests/241/head
Elham Rababah 5 years ago
parent 7ce1d2dd55
commit a46a61c5cf

@ -44,6 +44,7 @@ class BaseAppClient {
body['DoctorID'] = doctorProfile?.doctorID; body['DoctorID'] = doctorProfile?.doctorID;
if (body['DoctorID'] == "") if (body['DoctorID'] == "")
body['DoctorID'] = null; body['DoctorID'] = null;
if( body['EditedBy'] ==null)
body['EditedBy'] = doctorProfile?.doctorID; body['EditedBy'] = doctorProfile?.doctorID;
if (body['ProjectID'] == null) { if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID; body['ProjectID'] = doctorProfile?.projectID;
@ -54,6 +55,9 @@ class BaseAppClient {
if (body['DoctorID'] == '') { if (body['DoctorID'] == '') {
body['DoctorID'] =null; body['DoctorID'] =null;
} }
if (body['EditedBy'] == '') {
body.remove("EditedBy");
}
body['TokenID'] = token ?? ''; body['TokenID'] = token ?? '';
String lang = await sharedPref.getString(APP_Language); String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar') if (lang != null && lang == 'ar')

@ -538,4 +538,7 @@ const Map<String, Map<String, String>> localizedValues = {
}, },
'addAssessment': {'en': "Add ASSESSMENT", 'ar':"أضف التقييم" }, 'addAssessment': {'en': "Add ASSESSMENT", 'ar':"أضف التقييم" },
'assessment': {'en': "ASSESSMENT", 'ar':" التقييم" }, 'assessment': {'en': "ASSESSMENT", 'ar':" التقييم" },
'physicalSystemExamination': {'en': "Physical/System Examination", 'ar':" الفحص البدني / النظام" },
'searchExamination': {'en': "Search Examination", 'ar':"فحص البحث" },
'addExamination': {'en': "Add Examination", 'ar':"اضافه" },
}; };

@ -3,16 +3,19 @@ class GetChiefComplaintReqModel {
int appointmentNo; int appointmentNo;
int episodeId; int episodeId;
int episodeID; int episodeID;
dynamic doctorID;
GetChiefComplaintReqModel( GetChiefComplaintReqModel(
{this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID}); {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID});
GetChiefComplaintReqModel.fromJson(Map<String, dynamic> json) { GetChiefComplaintReqModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN']; patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];
episodeId = json['EpisodeId']; episodeId = json['EpisodeId'];
episodeID = json['EpisodeID']; episodeID = json['EpisodeID'];
} doctorID = json['DoctorID'];
}
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
@ -20,6 +23,8 @@ class GetChiefComplaintReqModel {
data['AppointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
data['EpisodeId'] = this.episodeId; data['EpisodeId'] = this.episodeId;
data['EpisodeID'] = this.episodeID; data['EpisodeID'] = this.episodeID;
data['DoctorID'] = this.doctorID;
return data; return data;
} }
} }

@ -2,16 +2,23 @@ class GeneralGetReqForSOAP {
int patientMRN; int patientMRN;
int appointmentNo; int appointmentNo;
int episodeId; int episodeId;
String doctorID; dynamic editedBy;
dynamic doctorID;
GeneralGetReqForSOAP( GeneralGetReqForSOAP({
{this.patientMRN, this.appointmentNo, this.episodeId, this.doctorID}); this.patientMRN,
this.appointmentNo,
this.episodeId,
this.doctorID,
this.editedBy,
});
GeneralGetReqForSOAP.fromJson(Map<String, dynamic> json) { GeneralGetReqForSOAP.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN']; patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];
episodeId = json['EpisodeId']; episodeId = json['EpisodeId'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
editedBy = json['EditedBy'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -20,6 +27,8 @@ class GeneralGetReqForSOAP {
data['AppointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
data['EpisodeId'] = this.episodeId; data['EpisodeId'] = this.episodeId;
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;
data['EditedBy'] = this.editedBy;
return data; return data;
} }
} }

@ -5,8 +5,9 @@ class GetHistoryReqModel {
String from; String from;
String to; String to;
int clinicID; int clinicID;
int doctorID;
int appointmentNo; int appointmentNo;
dynamic editedBy;
dynamic doctorID;
GetHistoryReqModel( GetHistoryReqModel(
{this.patientMRN, {this.patientMRN,
@ -16,6 +17,7 @@ class GetHistoryReqModel {
this.to, this.to,
this.clinicID, this.clinicID,
this.doctorID, this.doctorID,
this.editedBy,
this.appointmentNo}); this.appointmentNo});
GetHistoryReqModel.fromJson(Map<String, dynamic> json) { GetHistoryReqModel.fromJson(Map<String, dynamic> json) {
@ -27,6 +29,7 @@ class GetHistoryReqModel {
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];
editedBy = json['EditedBy'];
} }
@ -40,6 +43,8 @@ class GetHistoryReqModel {
data['To'] = this.to; data['To'] = this.to;
data['ClinicID'] = this.clinicID; data['ClinicID'] = this.clinicID;
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;
data['EditedBy'] = this.editedBy;
return data; return data;
} }
} }

@ -4,13 +4,18 @@ class GetPhysicalExamReqModel {
String episodeID; String episodeID;
String from; String from;
String to; String to;
dynamic editedBy;
dynamic doctorID;
GetPhysicalExamReqModel( GetPhysicalExamReqModel({
{this.patientMRN, this.patientMRN,
this.appointmentNo, this.appointmentNo,
this.episodeID, this.episodeID,
this.from, this.from,
this.to}); this.to,
this.doctorID,
this.editedBy,
});
GetPhysicalExamReqModel.fromJson(Map<String, dynamic> json) { GetPhysicalExamReqModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN']; patientMRN = json['PatientMRN'];
@ -18,6 +23,8 @@ class GetPhysicalExamReqModel {
episodeID = json['EpisodeID']; episodeID = json['EpisodeID'];
from = json['From']; from = json['From'];
to = json['To']; to = json['To'];
doctorID = json['DoctorID'];
editedBy = json['EditedBy'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -27,6 +34,8 @@ class GetPhysicalExamReqModel {
data['EpisodeID'] = this.episodeID; data['EpisodeID'] = this.episodeID;
data['From'] = this.from; data['From'] = this.from;
data['To'] = this.to; data['To'] = this.to;
data['DoctorID'] = this.doctorID;
data['EditedBy'] = this.editedBy;
return data; return data;
} }
} }

@ -5,9 +5,14 @@ class MySelectedAllergy {
MasterKeyModel selectedAllergy; MasterKeyModel selectedAllergy;
String remark; String remark;
bool isChecked; bool isChecked;
int createdBy;
MySelectedAllergy( MySelectedAllergy(
{this.selectedAllergySeverity, this.selectedAllergy, this.remark, this.isChecked}); {this.selectedAllergySeverity,
this.selectedAllergy,
this.remark,
this.isChecked,
this.createdBy});
MySelectedAllergy.fromJson(Map<String, dynamic> json) { MySelectedAllergy.fromJson(Map<String, dynamic> json) {
selectedAllergySeverity = json['selectedAllergySeverity'] != null selectedAllergySeverity = json['selectedAllergySeverity'] != null
@ -18,6 +23,7 @@ class MySelectedAllergy {
: null; : null;
remark = json['remark']; remark = json['remark'];
remark = json['isChecked']; remark = json['isChecked'];
createdBy = json['createdBy'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -30,6 +36,7 @@ class MySelectedAllergy {
} }
data['remark'] = this.remark; data['remark'] = this.remark;
data['isChecked'] = this.remark; data['isChecked'] = this.remark;
data['createdBy'] = this.createdBy;
return data; return data;
} }
} }

@ -5,18 +5,23 @@ class MySelectedExamination {
String remark; String remark;
bool isNormal; bool isNormal;
bool isAbnormal; bool isAbnormal;
int createdBy;
MySelectedExamination( 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<String, dynamic> json) { MySelectedExamination.fromJson(Map<String, dynamic> json) {
selectedExamination = json['selectedExamination'] != null selectedExamination = json['selectedExamination'] != null
? new MasterKeyModel.fromJson(json['selectedExamination']) ? new MasterKeyModel.fromJson(json['selectedExamination'])
: null; : null;
remark = json['remark']; remark = json['remark'];
remark = json['isNormal']; remark = json['isNormal'];
remark = json['isAbnormal']; remark = json['isAbnormal'];
createdBy = json['createdBy'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -28,6 +33,7 @@ class MySelectedExamination {
data['remark'] = this.remark; data['remark'] = this.remark;
data['isNormal'] = this.isNormal; data['isNormal'] = this.isNormal;
data['isAbnormal'] = this.isAbnormal; data['isAbnormal'] = this.isAbnormal;
data['createdBy'] = this.createdBy;
return data; return data;
} }
} }

@ -1,7 +1,8 @@
class PostHistoriesRequestModel { class PostHistoriesRequestModel {
List<ListMedicalHistoryVM> listMedicalHistoryVM; List<ListMedicalHistoryVM> listMedicalHistoryVM;
dynamic doctorID;
PostHistoriesRequestModel({this.listMedicalHistoryVM}); PostHistoriesRequestModel({this.listMedicalHistoryVM, this.doctorID});
PostHistoriesRequestModel.fromJson(Map<String, dynamic> json) { PostHistoriesRequestModel.fromJson(Map<String, dynamic> json) {
if (json['listMedicalHistoryVM'] != null) { if (json['listMedicalHistoryVM'] != null) {
@ -10,6 +11,7 @@ class PostHistoriesRequestModel {
listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v)); listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v));
}); });
} }
doctorID = json['DoctorID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -18,6 +20,7 @@ class PostHistoriesRequestModel {
data['listMedicalHistoryVM'] = data['listMedicalHistoryVM'] =
this.listMedicalHistoryVM.map((v) => v.toJson()).toList(); this.listMedicalHistoryVM.map((v) => v.toJson()).toList();
} }
data['DoctorID'] = this.doctorID;
return data; return data;
} }
} }

@ -555,6 +555,9 @@ class TranslationBase {
String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; String get addAssessment => localizedValues['addAssessment'][locale.languageCode];
String get assessment => localizedValues['assessment'][locale.languageCode]; String get assessment => localizedValues['assessment'][locale.languageCode];
String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][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<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -170,31 +170,40 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
builder: (context) { builder: (context) {
return AddAllergies( return AddAllergies(
addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { addAllergiesFun: (MySelectedAllergy mySelectedAllergy) {
setState(() { if (mySelectedAllergy.selectedAllergySeverity == null ||
List<MySelectedAllergy> allergy = mySelectedAllergy.selectedAllergy == null) {
// ignore: missing_return helpers.showErrorToast(TranslationBase
widget.myAllergiesList.where((element) => .of(context)
mySelectedAllergy.selectedAllergy.id == .requiredMsg);
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 } else {
// .of(context) setState(() {
// .itemExist); List<MySelectedAllergy> 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);
}
});
}
},); },);
}); });
} }

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.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/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.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/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_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_chief_complaint_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_histories_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/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.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/util/translations_delegate_base.dart';
@ -54,20 +56,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo: widget.patientInfo.appointmentNo); appointmentNo: widget.patientInfo.appointmentNo,
doctorID: '',
getHistoryReqModel.historyType = editedBy: '');
MasterKeysService.HistoryFamily.getMasterKeyService();
await model.getPatientHistories(getHistoryReqModel, isFirst: true); 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);
if (model.patientHistoryList.isNotEmpty) { if (model.patientHistoryList.isNotEmpty) {
if (model.historyFamilyList.isEmpty) { if (model.historyFamilyList.isEmpty) {
@ -147,58 +140,64 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
}); });
} }
} }
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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
widget.myAllergiesList.clear(); widget.myAllergiesList.clear();
widget.myHistoryList.clear(); widget.myHistoryList.clear();
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo);
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel getChiefComplaintReqModel =
GetChiefComplaintReqModel( GetChiefComplaintReqModel(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
episodeID: widget.patientInfo.episodeNo); episodeID: widget.patientInfo.episodeNo,
doctorID: '');
await model.getPatientChiefComplaint(getChiefComplaintReqModel); await model.getPatientChiefComplaint(getChiefComplaintReqModel);
if (model.patientChiefComplaintList.isNotEmpty) { 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; 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 getHistory(model);
await getAllergies(model);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
@ -472,29 +471,30 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
{List<MySelectedAllergy> myAllergiesList, SOAPViewModel model}) async { {List<MySelectedAllergy> myAllergiesList, SOAPViewModel model}) async {
PostAllergyRequestModel postAllergyRequestModel = PostAllergyRequestModel postAllergyRequestModel =
new PostAllergyRequestModel(); new PostAllergyRequestModel();
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
widget.myAllergiesList.forEach((allergy) { widget.myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
null) null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
//TODO: make static value dynamic //TODO: make static value dynamic
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(
.add(ListHisProgNotePatientAllergyDiseaseVM( ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId, allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id, severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark, remarks: allergy.remark,
createdBy: 4709, createdBy: allergy.createdBy??doctorProfile.doctorID,
// createdOn: DateTime.now().toIso8601String(),
createdOn: DateTime.now().toIso8601String(), editedBy: doctorProfile.doctorID,
//"2020-08-14T20:37:22.780Z", editedOn: DateTime.now().toIso8601String(),
editedBy: 4709, isChecked: allergy.isChecked,
editedOn: DateTime.now().toIso8601String(), isUpdatedByNurse: false));
//"2020-08-14T20:37:22.780Z",
isChecked: false,
isUpdatedByNurse: false));
}); });
if (model.patientAllergiesList.isEmpty) { if (model.patientAllergiesList.isEmpty) {
await model.postAllergy(postAllergyRequestModel); await model.postAllergy(postAllergyRequestModel);
@ -510,7 +510,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
postHistories( postHistories(
{List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async { {List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async {
PostHistoriesRequestModel postHistoriesRequestModel = PostHistoriesRequestModel postHistoriesRequestModel =
new PostHistoriesRequestModel(); new PostHistoriesRequestModel(doctorID: '');
widget.myHistoryList.forEach((history) { widget.myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null) if (postHistoriesRequestModel.listMedicalHistoryVM == null)
postHistoriesRequestModel.listMedicalHistoryVM = []; postHistoriesRequestModel.listMedicalHistoryVM = [];

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.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/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.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/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/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.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/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/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.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/util/translations_delegate_base.dart';
@ -77,6 +79,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
selectedExamination: examMaster, selectedExamination: examMaster,
remark: element.remarks, remark: element.remarks,
isNormal: element.isNormal, isNormal: element.isNormal,
createdBy: element.createdBy,
isAbnormal: element.isAbnormal); isAbnormal: element.isAbnormal);
widget.mySelectedExamination.add(tempEam); widget.mySelectedExamination.add(tempEam);
}); });
@ -102,7 +105,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
children: [ children: [
Row( Row(
children: [ children: [
Texts('Physical/System Examination', Texts(TranslationBase.of(context).physicalSystemExamination,
variant: isSysExaminationExpand variant: isSysExaminationExpand
? "bodyText" ? "bodyText"
: '', : '',
@ -137,7 +140,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
margin: margin:
EdgeInsets.only(left: 10, right: 10, top: 15), EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: "Add Examination", hintText: TranslationBase.of(context).physicalSystemExamination,
fontSize: 13.5, fontSize: 13.5,
onTapTextFields: () { onTapTextFields: () {
openExaminationList(context); openExaminationList(context);
@ -351,7 +354,11 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
} }
submitUpdateObjectivePage(SOAPViewModel model) async { submitUpdateObjectivePage(SOAPViewModel model) async {
if(widget.mySelectedExamination.isNotEmpty){ if(widget.mySelectedExamination.isNotEmpty){
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
widget.mySelectedExamination.forEach((exam) { widget.mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
@ -364,9 +371,9 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '', remarks: exam.remark ?? '',
createdBy: 4709, createdBy: exam.createdBy??doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(), createdOn: DateTime.now().toIso8601String(),
editedBy: 4709, editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(), editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id, examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId, examType: exam.selectedExamination.typeId,
@ -505,8 +512,8 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
baseViewModel: model, baseViewModel: model,
child: MasterKeyCheckboxSearchWidget( child: MasterKeyCheckboxSearchWidget(
model: model, model: model,
hintSearchText: 'Search Examination', hintSearchText: TranslationBase.of(context).searchExamination,
buttonName: 'Add Examination', buttonName: TranslationBase.of(context).addExamination,
masterList: model.physicalExaminationList, masterList: model.physicalExaminationList,
removeHistory: (history){ removeHistory: (history){
setState(() { setState(() {

@ -33,7 +33,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
List<MySelectedAllergy> myAllergiesList= List(); List<MySelectedAllergy> myAllergiesList= List();
List<MySelectedHistory> myHistoryList = List(); List<MySelectedHistory> myHistoryList = List();
List<MySelectedExamination> mySelectedExamination = List(); List<MySelectedExamination> mySelectedExamination = List();
MySelectedAssessment mySelectedAssessment = new MySelectedAssessment(); MySelectedAssessment mySelectedAssessment = MySelectedAssessment();
changePageViewIndex(pageIndex) { changePageViewIndex(pageIndex) {
_controller.jumpToPage(pageIndex); _controller.jumpToPage(pageIndex);
} }

Loading…
Cancel
Save