|
|
|
@ -37,18 +37,13 @@ class UpdateSubjectivePage extends StatefulWidget {
|
|
|
|
|
final int currentIndex;
|
|
|
|
|
|
|
|
|
|
UpdateSubjectivePage(
|
|
|
|
|
{Key key,
|
|
|
|
|
this.changePageViewIndex,
|
|
|
|
|
this.patientInfo,
|
|
|
|
|
this.changeLoadingState,
|
|
|
|
|
this.currentIndex});
|
|
|
|
|
{Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_UpdateSubjectivePageState createState() => _UpdateSubjectivePageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
|
|
|
|
|
implements SubjectiveCallBack {
|
|
|
|
|
class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements SubjectiveCallBack {
|
|
|
|
|
bool isChiefExpand = false;
|
|
|
|
|
bool isHistoryExpand = false;
|
|
|
|
|
bool isAllergiesExpand = false;
|
|
|
|
@ -88,63 +83,47 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model.patientHistoryList.forEach((element) {
|
|
|
|
|
if (element.historyType ==
|
|
|
|
|
MasterKeysService.HistoryFamily.getMasterKeyService()) {
|
|
|
|
|
if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) {
|
|
|
|
|
MasterKeyModel history = model.getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.HistoryFamily,
|
|
|
|
|
id: element.historyId,
|
|
|
|
|
);
|
|
|
|
|
if (history != null) {
|
|
|
|
|
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(
|
|
|
|
|
history: history,
|
|
|
|
|
isChecked: element.isChecked,
|
|
|
|
|
remark: element.remarks,
|
|
|
|
|
isLocal: false);
|
|
|
|
|
history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
|
|
|
|
|
myHistoryList.add(mySelectedHistory);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (element.historyType ==
|
|
|
|
|
MasterKeysService.HistoryMedical.getMasterKeyService()) {
|
|
|
|
|
if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) {
|
|
|
|
|
MasterKeyModel history = model.getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.HistoryMedical,
|
|
|
|
|
id: element.historyId,
|
|
|
|
|
);
|
|
|
|
|
if (history != null) {
|
|
|
|
|
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(
|
|
|
|
|
history: history,
|
|
|
|
|
isChecked: element.isChecked,
|
|
|
|
|
remark: element.remarks,
|
|
|
|
|
isLocal: false);
|
|
|
|
|
history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
|
|
|
|
|
myHistoryList.add(mySelectedHistory);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (element.historyType ==
|
|
|
|
|
MasterKeysService.HistorySports.getMasterKeyService()) {
|
|
|
|
|
if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) {
|
|
|
|
|
MasterKeyModel history = model.getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.HistorySports,
|
|
|
|
|
id: element.historyId,
|
|
|
|
|
);
|
|
|
|
|
if (history != null) {
|
|
|
|
|
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(
|
|
|
|
|
history: history,
|
|
|
|
|
isChecked: element.isChecked,
|
|
|
|
|
remark: element.remarks,
|
|
|
|
|
isLocal: false);
|
|
|
|
|
history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
|
|
|
|
|
myHistoryList.add(mySelectedHistory);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (element.historyType ==
|
|
|
|
|
MasterKeysService.HistorySurgical.getMasterKeyService()) {
|
|
|
|
|
if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) {
|
|
|
|
|
MasterKeyModel history = model.getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.HistorySurgical,
|
|
|
|
|
id: element.historyId,
|
|
|
|
|
);
|
|
|
|
|
if (history != null) {
|
|
|
|
|
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(
|
|
|
|
|
history: history,
|
|
|
|
|
isChecked: element.isChecked,
|
|
|
|
|
remark: element.remarks,
|
|
|
|
|
isLocal: false);
|
|
|
|
|
history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
|
|
|
|
|
myHistoryList.add(mySelectedHistory);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -161,23 +140,16 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
|
|
|
|
|
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);
|
|
|
|
|
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);
|
|
|
|
|
masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType);
|
|
|
|
|
MasterKeyModel selectedAllergySeverity;
|
|
|
|
|
if (element.severity == 0) {
|
|
|
|
|
selectedAllergySeverity = MasterKeyModel(
|
|
|
|
|
id: 0,
|
|
|
|
|
typeId: MasterKeysService.AllergySeverity.getMasterKeyService(),
|
|
|
|
|
nameAr: '',
|
|
|
|
|
nameEn: '');
|
|
|
|
|
id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: '');
|
|
|
|
|
} else {
|
|
|
|
|
selectedAllergySeverity = model.getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.AllergySeverity,
|
|
|
|
@ -185,17 +157,15 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MySelectedAllergy mySelectedAllergy =
|
|
|
|
|
SoapUtils.generateMySelectedAllergy(
|
|
|
|
|
allergy: selectedAllergy,
|
|
|
|
|
isChecked: element.isChecked,
|
|
|
|
|
createdBy: element.createdBy,
|
|
|
|
|
remark: element.remarks,
|
|
|
|
|
isLocal: false,
|
|
|
|
|
allergySeverity: selectedAllergySeverity);
|
|
|
|
|
|
|
|
|
|
if (selectedAllergy != null && selectedAllergySeverity != null)
|
|
|
|
|
myAllergiesList.add(mySelectedAllergy);
|
|
|
|
|
MySelectedAllergy mySelectedAllergy = SoapUtils.generateMySelectedAllergy(
|
|
|
|
|
allergy: selectedAllergy,
|
|
|
|
|
isChecked: element.isChecked,
|
|
|
|
|
createdBy: element.createdBy,
|
|
|
|
|
remark: element.remarks,
|
|
|
|
|
isLocal: false,
|
|
|
|
|
allergySeverity: selectedAllergySeverity);
|
|
|
|
|
|
|
|
|
|
if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -207,29 +177,29 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
|
|
|
|
|
myAllergiesList.clear();
|
|
|
|
|
myHistoryList.clear();
|
|
|
|
|
model.setSubjectiveCallBack(this);
|
|
|
|
|
GetChiefComplaintReqModel getChiefComplaintReqModel =
|
|
|
|
|
GetChiefComplaintReqModel(
|
|
|
|
|
admissionNo: int.parse(widget.patientInfo.admissionNo),patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
appointmentNo:
|
|
|
|
|
int.parse(widget.patientInfo.appointmentNo.toString()),
|
|
|
|
|
episodeId: widget.patientInfo.episodeNo,
|
|
|
|
|
episodeID: widget.patientInfo.episodeNo,
|
|
|
|
|
doctorID: '');
|
|
|
|
|
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
|
|
|
|
|
admissionNo: widget.patientInfo.admissionNo != null ? int.parse(widget.patientInfo.admissionNo) : null,
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo != null
|
|
|
|
|
? int.parse(widget.patientInfo.appointmentNo.toString())
|
|
|
|
|
: null,
|
|
|
|
|
episodeId: widget.patientInfo.episodeNo,
|
|
|
|
|
episodeID: widget.patientInfo.episodeNo,
|
|
|
|
|
doctorID: '');
|
|
|
|
|
await model.getPatientChiefComplaint(getChiefComplaintReqModel);
|
|
|
|
|
if (model.patientChiefComplaintList.isNotEmpty) {
|
|
|
|
|
isChiefExpand = true;
|
|
|
|
|
complaintsController.text = Helpers.parseHtmlString(
|
|
|
|
|
model.patientChiefComplaintList[0].chiefComplaint);
|
|
|
|
|
complaintsController.text = Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint);
|
|
|
|
|
illnessController.text = model.patientChiefComplaintList[0].hopi;
|
|
|
|
|
medicationController.text =
|
|
|
|
|
!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty
|
|
|
|
|
? model.patientChiefComplaintList[0].currentMedication +
|
|
|
|
|
'\n \n'
|
|
|
|
|
: model.patientChiefComplaintList[0].currentMedication;
|
|
|
|
|
medicationController.text = !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty
|
|
|
|
|
? model.patientChiefComplaintList[0].currentMedication + '\n \n'
|
|
|
|
|
: model.patientChiefComplaintList[0].currentMedication;
|
|
|
|
|
}
|
|
|
|
|
if (widget.patientInfo.admissionNo == null) {
|
|
|
|
|
await getHistory(model);
|
|
|
|
|
|
|
|
|
|
await getHistory(model);
|
|
|
|
|
await getAllergies(model);
|
|
|
|
|
await getAllergies(model);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
widget.changeLoadingState(false);
|
|
|
|
|
},
|
|
|
|
@ -245,9 +215,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SOAPStepHeader(
|
|
|
|
|
currentIndex: widget.currentIndex,
|
|
|
|
|
changePageViewIndex: widget.changePageViewIndex),
|
|
|
|
|
SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex),
|
|
|
|
|
ExpandableSOAPWidget(
|
|
|
|
|
headerTitle: TranslationBase.of(context).chiefComplaints,
|
|
|
|
|
onTap: () {
|
|
|
|
@ -267,51 +235,48 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
|
|
|
|
|
isExpanded: isChiefExpand,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: SizeConfig.heightMultiplier *
|
|
|
|
|
(SizeConfig.isHeightVeryShort ? 4 : 2),
|
|
|
|
|
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2),
|
|
|
|
|
),
|
|
|
|
|
ExpandableSOAPWidget(
|
|
|
|
|
headerTitle: TranslationBase.of(context).histories,
|
|
|
|
|
isRequired: false,
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isHistoryExpand = !isHistoryExpand;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
UpdateHistoryWidget(myHistoryList: myHistoryList)
|
|
|
|
|
],
|
|
|
|
|
if (widget.patientInfo.admissionNo == null)
|
|
|
|
|
ExpandableSOAPWidget(
|
|
|
|
|
headerTitle: TranslationBase.of(context).histories,
|
|
|
|
|
isRequired: false,
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isHistoryExpand = !isHistoryExpand;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [UpdateHistoryWidget(myHistoryList: myHistoryList)],
|
|
|
|
|
),
|
|
|
|
|
isExpanded: isHistoryExpand,
|
|
|
|
|
),
|
|
|
|
|
isExpanded: isHistoryExpand,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: SizeConfig.heightMultiplier *
|
|
|
|
|
(SizeConfig.isHeightVeryShort ? 4 : 2),
|
|
|
|
|
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2),
|
|
|
|
|
),
|
|
|
|
|
ExpandableSOAPWidget(
|
|
|
|
|
headerTitle: TranslationBase.of(context).allergiesSoap,
|
|
|
|
|
isRequired: false,
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isAllergiesExpand = !isAllergiesExpand;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
UpdateAllergiesWidget(
|
|
|
|
|
myAllergiesList: myAllergiesList,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
if (widget.patientInfo.admissionNo == null)
|
|
|
|
|
ExpandableSOAPWidget(
|
|
|
|
|
headerTitle: TranslationBase.of(context).allergiesSoap,
|
|
|
|
|
isRequired: false,
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isAllergiesExpand = !isAllergiesExpand;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
UpdateAllergiesWidget(
|
|
|
|
|
myAllergiesList: myAllergiesList,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
isExpanded: isAllergiesExpand,
|
|
|
|
|
),
|
|
|
|
|
isExpanded: isAllergiesExpand,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: SizeConfig.heightMultiplier *
|
|
|
|
|
(SizeConfig.isHeightVeryShort ? 20 : 10),
|
|
|
|
|
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
@ -323,9 +288,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addSubjectiveInfo(
|
|
|
|
|
{SOAPViewModel model,
|
|
|
|
|
List<MySelectedAllergy> myAllergiesList,
|
|
|
|
|
List<MySelectedHistory> myHistoryList}) async {
|
|
|
|
|
{SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<MySelectedHistory> myHistoryList}) async {
|
|
|
|
|
if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus();
|
|
|
|
|
widget.changeLoadingState(true);
|
|
|
|
|
formKey.currentState.save();
|
|
|
|
@ -338,79 +301,73 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
|
|
|
|
|
///TODO Elham*
|
|
|
|
|
///
|
|
|
|
|
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);
|
|
|
|
|
// }
|
|
|
|
|
// if (myHistoryList.length != 0) {
|
|
|
|
|
// await postHistories(model: model, myHistoryList: myHistoryList);
|
|
|
|
|
// if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
// Helpers.showErrorToast(model.error);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (myAllergiesList.length != 0) {
|
|
|
|
|
// await postAllergy(myAllergiesList: myAllergiesList, model: model);
|
|
|
|
|
// if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
// Helpers.showErrorToast(model.error);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// widget.changeLoadingState(true);
|
|
|
|
|
//
|
|
|
|
|
// widget.changePageViewIndex(1);
|
|
|
|
|
// } else {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// if (complaintsController.text.isEmpty) {
|
|
|
|
|
// complaintsControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
|
// } else if (complaintsController.text.length < 25) {
|
|
|
|
|
// complaintsControllerError =
|
|
|
|
|
// TranslationBase.of(context).chiefComplaintLength;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (illnessController.text.isEmpty) {
|
|
|
|
|
// illnessControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (medicationController.text.isEmpty) {
|
|
|
|
|
// medicationControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
//
|
|
|
|
|
// widget.changeLoadingState(false);
|
|
|
|
|
// Helpers.showErrorToast(
|
|
|
|
|
// TranslationBase.of(context).chiefComplaintErrorMsg);
|
|
|
|
|
// }
|
|
|
|
|
if (complaintsController.text.isNotEmpty &&
|
|
|
|
|
illnessController.text.isNotEmpty &&
|
|
|
|
|
complaintsController.text.length > 25) {
|
|
|
|
|
await postChiefComplaint(model: model);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
if (myHistoryList.length != 0 && widget.patientInfo.admissionNo == null) {
|
|
|
|
|
await postHistories(model: model, myHistoryList: myHistoryList);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (myAllergiesList.length != 0 && widget.patientInfo.admissionNo == null) {
|
|
|
|
|
await postAllergy(myAllergiesList: myAllergiesList, model: model);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
widget.changeLoadingState(true);
|
|
|
|
|
|
|
|
|
|
widget.changePageViewIndex(1);
|
|
|
|
|
} else {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (complaintsController.text.isEmpty) {
|
|
|
|
|
complaintsControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
|
} else if (complaintsController.text.length < 25) {
|
|
|
|
|
complaintsControllerError = TranslationBase.of(context).chiefComplaintLength;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (illnessController.text.isEmpty) {
|
|
|
|
|
illnessControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (medicationController.text.isEmpty) {
|
|
|
|
|
medicationControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
widget.changeLoadingState(false);
|
|
|
|
|
Helpers.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
postAllergy(
|
|
|
|
|
{List<MySelectedAllergy> myAllergiesList, SOAPViewModel model}) async {
|
|
|
|
|
PostAllergyRequestModel postAllergyRequestModel =
|
|
|
|
|
new PostAllergyRequestModel();
|
|
|
|
|
postAllergy({List<MySelectedAllergy> myAllergiesList, SOAPViewModel model}) async {
|
|
|
|
|
PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel();
|
|
|
|
|
|
|
|
|
|
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
|
|
|
|
|
|
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
|
|
|
|
|
myAllergiesList.forEach((allergy) {
|
|
|
|
|
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
|
|
|
|
|
null)
|
|
|
|
|
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null)
|
|
|
|
|
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
|
|
|
|
|
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));
|
|
|
|
|
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);
|
|
|
|
@ -434,13 +391,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
postHistories(
|
|
|
|
|
{List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async {
|
|
|
|
|
PostHistoriesRequestModel postHistoriesRequestModel =
|
|
|
|
|
new PostHistoriesRequestModel(doctorID: '');
|
|
|
|
|
postHistories({List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async {
|
|
|
|
|
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: '');
|
|
|
|
|
myHistoryList.forEach((history) {
|
|
|
|
|
if (postHistoriesRequestModel.listMedicalHistoryVM == null)
|
|
|
|
|
postHistoriesRequestModel.listMedicalHistoryVM = [];
|
|
|
|
|
if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = [];
|
|
|
|
|
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeId: widget.patientInfo.episodeNo,
|
|
|
|
@ -466,18 +420,18 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
|
|
|
|
|
postChiefComplaint({SOAPViewModel model}) async {
|
|
|
|
|
formKey.currentState.save();
|
|
|
|
|
if (formKey.currentState.validate()) {
|
|
|
|
|
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
|
|
|
|
|
new PostChiefComplaintRequestModel(
|
|
|
|
|
admissionNo: int.parse(widget.patientInfo.admissionNo),patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeID: widget.patientInfo.episodeNo,
|
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo,
|
|
|
|
|
chiefComplaint: complaintsController.text,
|
|
|
|
|
currentMedication: medicationController.text,
|
|
|
|
|
hopi: illnessController.text,
|
|
|
|
|
isLactation: false,
|
|
|
|
|
ispregnant: false,
|
|
|
|
|
doctorID: '',
|
|
|
|
|
numberOfWeeks: 0);
|
|
|
|
|
PostChiefComplaintRequestModel postChiefComplaintRequestModel = new PostChiefComplaintRequestModel(
|
|
|
|
|
admissionNo: widget.patientInfo.admissionNo != null ? int.parse(widget.patientInfo.admissionNo) : null,
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeID: widget.patientInfo.episodeNo,
|
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo,
|
|
|
|
|
chiefComplaint: complaintsController.text,
|
|
|
|
|
currentMedication: medicationController.text,
|
|
|
|
|
hopi: illnessController.text,
|
|
|
|
|
isLactation: false,
|
|
|
|
|
ispregnant: false,
|
|
|
|
|
doctorID: '',
|
|
|
|
|
numberOfWeeks: 0);
|
|
|
|
|
if (model.patientChiefComplaintList.isEmpty) {
|
|
|
|
|
postChiefComplaintRequestModel.editedBy = '';
|
|
|
|
|
await model.postChiefComplaint(postChiefComplaintRequestModel);
|
|
|
|
@ -489,9 +443,6 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Function nextFunction(model) {
|
|
|
|
|
addSubjectiveInfo(
|
|
|
|
|
model: model,
|
|
|
|
|
myAllergiesList: myAllergiesList,
|
|
|
|
|
myHistoryList: myHistoryList);
|
|
|
|
|
addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|