|
|
|
|
@ -7,11 +7,11 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.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/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';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_history_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_medication_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
|
|
|
|
@ -24,9 +24,15 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
|
|
|
class SubjectivePage extends StatefulWidget {
|
|
|
|
|
final Function changePageViewIndex;
|
|
|
|
|
final List<MySelectedAllergy> myAllergiesList;
|
|
|
|
|
final List<MasterKeyModel> myHistoryList ;
|
|
|
|
|
final List<MasterKeyModel> myHistoryList;
|
|
|
|
|
final PatiantInformtion patientInfo;
|
|
|
|
|
|
|
|
|
|
SubjectivePage({Key key, this.changePageViewIndex, this.myAllergiesList, this.myHistoryList});
|
|
|
|
|
SubjectivePage(
|
|
|
|
|
{Key key,
|
|
|
|
|
this.changePageViewIndex,
|
|
|
|
|
this.myAllergiesList,
|
|
|
|
|
this.myHistoryList,
|
|
|
|
|
this.patientInfo});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_SubjectivePageState createState() => _SubjectivePageState();
|
|
|
|
|
@ -270,44 +276,46 @@ class _SubjectivePageState extends State<SubjectivePage> {
|
|
|
|
|
formKey.currentState.save();
|
|
|
|
|
formKey.currentState.validate();
|
|
|
|
|
|
|
|
|
|
widget.changePageViewIndex(1);
|
|
|
|
|
|
|
|
|
|
// if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) {
|
|
|
|
|
// await postChiefComplaint(model: model);
|
|
|
|
|
// if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
// helpers.showErrorToast(model.error);
|
|
|
|
|
// } else {
|
|
|
|
|
// if (myHistoryList.length != 0) {
|
|
|
|
|
// await postHistories(model: model, myHistoryList: myHistoryList);
|
|
|
|
|
// if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
// helpers.showErrorToast(model.error);
|
|
|
|
|
// } else {
|
|
|
|
|
// if (myAllergiesList.length != 0) {
|
|
|
|
|
// await postAllergy(myAllergiesList: myAllergiesList, model: model);
|
|
|
|
|
// if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
// helpers.showErrorToast(model.error);
|
|
|
|
|
// } else {
|
|
|
|
|
// widget.changePageViewIndex(1);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// if (myAllergiesList.length != 0) {
|
|
|
|
|
// await postAllergy(myAllergiesList: myAllergiesList, model: model);
|
|
|
|
|
// if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
// helpers.showErrorToast(model.error);
|
|
|
|
|
// } else {
|
|
|
|
|
// widget.changePageViewIndex(1);
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// widget.changePageViewIndex(1);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// helpers.showErrorToast('Please add required field correctly');
|
|
|
|
|
// }
|
|
|
|
|
if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) {
|
|
|
|
|
await postChiefComplaint(model: model);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
if (myHistoryList.length != 0) {
|
|
|
|
|
await postHistories(model: model, myHistoryList: myHistoryList);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
if (myAllergiesList.length != 0) {
|
|
|
|
|
await postAllergy(myAllergiesList: myAllergiesList, model: model);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
widget.changePageViewIndex(1);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
widget.changePageViewIndex(1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (myAllergiesList.length != 0) {
|
|
|
|
|
await postAllergy(myAllergiesList: myAllergiesList, model: model);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
widget.changePageViewIndex(1);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
widget.changePageViewIndex(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
helpers.showErrorToast('Please add required field correctly');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -324,9 +332,9 @@ class _SubjectivePageState extends State<SubjectivePage> {
|
|
|
|
|
.add(ListHisProgNotePatientAllergyDiseaseVM(
|
|
|
|
|
allergyDiseaseId: allergy.selectedAllergy.id,
|
|
|
|
|
allergyDiseaseType: allergy.selectedAllergy.typeId,
|
|
|
|
|
patientMRN: 3120690,
|
|
|
|
|
episodeId: 200012117,
|
|
|
|
|
appointmentNo: 2016054573,
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeId: widget.patientInfo.episodeNo,
|
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo,
|
|
|
|
|
severity: allergy.selectedAllergySeverity.id,
|
|
|
|
|
remarks: allergy.remark,
|
|
|
|
|
createdBy: 1485,
|
|
|
|
|
@ -353,9 +361,9 @@ class _SubjectivePageState extends State<SubjectivePage> {
|
|
|
|
|
postHistoriesRequestModel.listMedicalHistoryVM = [];
|
|
|
|
|
//TODO: make static value dynamic
|
|
|
|
|
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
|
|
|
|
|
patientMRN: 3120690,
|
|
|
|
|
episodeId: 200012117,
|
|
|
|
|
appointmentNo: 2016054573,
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeId: widget.patientInfo.episodeNo,
|
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo,
|
|
|
|
|
remarks: "",
|
|
|
|
|
historyId: history.id,
|
|
|
|
|
historyType: history.typeId,
|
|
|
|
|
@ -375,11 +383,11 @@ class _SubjectivePageState extends State<SubjectivePage> {
|
|
|
|
|
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
|
|
|
|
|
//TODO: make static value dynamic
|
|
|
|
|
new PostChiefComplaintRequestModel(
|
|
|
|
|
patientMRN: 3120690,
|
|
|
|
|
episodeID: 200012117,
|
|
|
|
|
appointmentNo: 2016054573,
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeID: widget.patientInfo.episodeNo,
|
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo,
|
|
|
|
|
chiefComplaint: complaintsController.text,
|
|
|
|
|
currentMedication: "currentMedication",
|
|
|
|
|
currentMedication: " currentMedication ",
|
|
|
|
|
hopi: illnessController.text,
|
|
|
|
|
isLactation: false,
|
|
|
|
|
ispregnant: false,
|
|
|
|
|
|