|
|
|
@ -33,14 +33,16 @@ class UpdateSubjectivePage extends StatefulWidget {
|
|
|
|
|
final List<MySelectedAllergy> myAllergiesList;
|
|
|
|
|
final List<MySelectedHistory> myHistoryList;
|
|
|
|
|
final PatiantInformtion patientInfo;
|
|
|
|
|
final int currentIndex;
|
|
|
|
|
final int currentIndex;
|
|
|
|
|
|
|
|
|
|
UpdateSubjectivePage(
|
|
|
|
|
{Key key,
|
|
|
|
|
this.changePageViewIndex,
|
|
|
|
|
this.myAllergiesList,
|
|
|
|
|
this.myHistoryList,
|
|
|
|
|
this.patientInfo, this.changeLoadingState, this.currentIndex});
|
|
|
|
|
this.patientInfo,
|
|
|
|
|
this.changeLoadingState,
|
|
|
|
|
this.currentIndex});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_UpdateSubjectivePageState createState() => _UpdateSubjectivePageState();
|
|
|
|
@ -67,7 +69,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
doctorID: '',
|
|
|
|
|
editedBy: '');
|
|
|
|
|
|
|
|
|
|
await model.getPatientHistories(getHistoryReqModel,isFirst: true);
|
|
|
|
|
await model.getPatientHistories(getHistoryReqModel, isFirst: true);
|
|
|
|
|
|
|
|
|
|
if (model.patientHistoryList.isNotEmpty) {
|
|
|
|
|
if (model.historyFamilyList.isEmpty) {
|
|
|
|
@ -84,62 +86,50 @@ 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 = MySelectedHistory(
|
|
|
|
|
selectedHistory: history,
|
|
|
|
|
isChecked: element.isChecked,
|
|
|
|
|
remark: element.remarks);
|
|
|
|
|
MySelectedHistory mySelectedHistory =
|
|
|
|
|
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks);
|
|
|
|
|
|
|
|
|
|
widget.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 = MySelectedHistory(
|
|
|
|
|
selectedHistory: history,
|
|
|
|
|
isChecked: element.isChecked,
|
|
|
|
|
remark: element.remarks);
|
|
|
|
|
MySelectedHistory mySelectedHistory =
|
|
|
|
|
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks);
|
|
|
|
|
|
|
|
|
|
widget.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 = MySelectedHistory(
|
|
|
|
|
selectedHistory: history,
|
|
|
|
|
isChecked: element.isChecked,
|
|
|
|
|
remark: element.remarks);
|
|
|
|
|
MySelectedHistory mySelectedHistory =
|
|
|
|
|
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks);
|
|
|
|
|
|
|
|
|
|
widget.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 = MySelectedHistory(
|
|
|
|
|
selectedHistory: history,
|
|
|
|
|
isChecked: element.isChecked,
|
|
|
|
|
remark: element.remarks);
|
|
|
|
|
MySelectedHistory mySelectedHistory =
|
|
|
|
|
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks);
|
|
|
|
|
|
|
|
|
|
widget.myHistoryList.add(mySelectedHistory);
|
|
|
|
|
}
|
|
|
|
@ -157,23 +147,18 @@ 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(
|
|
|
|
|
selectedAllergySeverity = model.getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.AllergySeverity,
|
|
|
|
|
id: element.severity,
|
|
|
|
|
);
|
|
|
|
@ -185,8 +170,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
createdBy: element.createdBy,
|
|
|
|
|
remark: element.remarks,
|
|
|
|
|
selectedAllergySeverity: selectedAllergySeverity);
|
|
|
|
|
if (selectedAllergy != null && selectedAllergySeverity != null)
|
|
|
|
|
widget.myAllergiesList.add(mySelectedAllergy);
|
|
|
|
|
if (selectedAllergy != null && selectedAllergySeverity != null) widget.myAllergiesList.add(mySelectedAllergy);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -198,33 +182,31 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
widget.myAllergiesList.clear();
|
|
|
|
|
widget.myHistoryList.clear();
|
|
|
|
|
|
|
|
|
|
GetChiefComplaintReqModel getChiefComplaintReqModel =
|
|
|
|
|
GetChiefComplaintReqModel(
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo,
|
|
|
|
|
episodeId: widget.patientInfo.episodeNo,
|
|
|
|
|
episodeID: widget.patientInfo.episodeNo,
|
|
|
|
|
doctorID: '');
|
|
|
|
|
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
|
|
|
|
|
admissionNo: int.parse(widget.patientInfo.admissionNo),
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo,
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await getHistory(model);
|
|
|
|
|
await getAllergies(model);
|
|
|
|
|
|
|
|
|
|
widget.changeLoadingState(false);
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
backgroundColor: Theme
|
|
|
|
|
.of(context)
|
|
|
|
|
.scaffoldBackgroundColor,
|
|
|
|
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
child: Center(
|
|
|
|
@ -234,12 +216,9 @@ 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
|
|
|
|
|
,
|
|
|
|
|
headerTitle: TranslationBase.of(context).chiefComplaints,
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isChiefExpand = !isChiefExpand;
|
|
|
|
@ -259,12 +238,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExpandableSOAPWidget(
|
|
|
|
|
headerTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.histories,
|
|
|
|
|
headerTitle: TranslationBase.of(context).histories,
|
|
|
|
|
isRequired: false,
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
@ -272,22 +247,15 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
UpdateHistoryWidget(myHistoryList: widget.myHistoryList)
|
|
|
|
|
],
|
|
|
|
|
children: [UpdateHistoryWidget(myHistoryList: widget.myHistoryList)],
|
|
|
|
|
),
|
|
|
|
|
isExpanded: isHistoryExpand,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExpandableSOAPWidget(
|
|
|
|
|
headerTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.allergiesSoap
|
|
|
|
|
,
|
|
|
|
|
headerTitle: TranslationBase.of(context).allergiesSoap,
|
|
|
|
|
isRequired: false,
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
@ -296,8 +264,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
UpdateAllergiesWidget(myAllergiesList: widget
|
|
|
|
|
.myAllergiesList,),
|
|
|
|
|
UpdateAllergiesWidget(
|
|
|
|
|
myAllergiesList: widget.myAllergiesList,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
@ -306,7 +275,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
isExpanded: isAllergiesExpand,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height:MediaQuery.of(context).size.height * 0.16,
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.16,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
@ -319,9 +288,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(0.0),
|
|
|
|
|
),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: HexColor('#707070'),
|
|
|
|
|
width: 0),
|
|
|
|
|
border: Border.all(color: HexColor('#707070'), width: 0),
|
|
|
|
|
),
|
|
|
|
|
height: 80,
|
|
|
|
|
width: double.infinity,
|
|
|
|
@ -330,38 +297,35 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(child:
|
|
|
|
|
FractionallySizedBox(
|
|
|
|
|
widthFactor: .80,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.next,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color:Colors.red[700],
|
|
|
|
|
loading: model.state == ViewState.BusyLocal,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
addSubjectiveInfo(
|
|
|
|
|
model: model,
|
|
|
|
|
myAllergiesList: widget.myAllergiesList,
|
|
|
|
|
myHistoryList: widget.myHistoryList);
|
|
|
|
|
},
|
|
|
|
|
Container(
|
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
|
widthFactor: .80,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: TranslationBase.of(context).next,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: Colors.red[700],
|
|
|
|
|
loading: model.state == ViewState.BusyLocal,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
addSubjectiveInfo(
|
|
|
|
|
model: model, myAllergiesList: widget.myAllergiesList, myHistoryList: widget.myHistoryList);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addSubjectiveInfo({SOAPViewModel model,
|
|
|
|
|
List<MySelectedAllergy> myAllergiesList,
|
|
|
|
|
List<MySelectedHistory> myHistoryList}) async {
|
|
|
|
|
addSubjectiveInfo(
|
|
|
|
|
{SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<MySelectedHistory> myHistoryList}) async {
|
|
|
|
|
formKey.currentState.save();
|
|
|
|
|
formKey.currentState.validate();
|
|
|
|
|
|
|
|
|
@ -391,66 +355,49 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
widget.changeLoadingState(true);
|
|
|
|
|
|
|
|
|
|
widget.changePageViewIndex(1);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (complaintsController.text.isEmpty) {
|
|
|
|
|
complaintsControllerError = TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
complaintsControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
|
} else if (complaintsController.text.length < 25) {
|
|
|
|
|
complaintsControllerError = TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.chiefComplaintLength;
|
|
|
|
|
complaintsControllerError = TranslationBase.of(context).chiefComplaintLength;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (illnessController.text.isEmpty) {
|
|
|
|
|
illnessControllerError = TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
illnessControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (medicationController.text.isEmpty) {
|
|
|
|
|
medicationControllerError = TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
medicationControllerError = TranslationBase.of(context).emptyMessage;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
Helpers.showErrorToast(TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.chiefComplaintErrorMsg);
|
|
|
|
|
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);
|
|
|
|
|
widget.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);
|
|
|
|
@ -464,20 +411,17 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo,
|
|
|
|
|
doctorID: '',
|
|
|
|
|
editedBy: '');
|
|
|
|
|
await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy : true);
|
|
|
|
|
await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy: true);
|
|
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
postHistories(
|
|
|
|
|
{List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async {
|
|
|
|
|
PostHistoriesRequestModel postHistoriesRequestModel =
|
|
|
|
|
new PostHistoriesRequestModel(doctorID: '');
|
|
|
|
|
postHistories({List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async {
|
|
|
|
|
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: '');
|
|
|
|
|
widget.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,
|
|
|
|
@ -489,14 +433,12 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (model.patientHistoryList.isEmpty) {
|
|
|
|
|
await model.postHistories(postHistoriesRequestModel);
|
|
|
|
|
} else {
|
|
|
|
|
await model.patchHistories(postHistoriesRequestModel);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
@ -504,20 +446,19 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
|
|
|
|
|
postChiefComplaint({SOAPViewModel model}) async {
|
|
|
|
|
formKey.currentState.save();
|
|
|
|
|
if(formKey.currentState.validate()){
|
|
|
|
|
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
|
|
|
|
|
new PostChiefComplaintRequestModel(
|
|
|
|
|
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 (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);
|
|
|
|
|
if (model.patientChiefComplaintList.isEmpty) {
|
|
|
|
|
postChiefComplaintRequestModel.editedBy = '';
|
|
|
|
|
await model.postChiefComplaint(postChiefComplaintRequestModel);
|
|
|
|
@ -527,8 +468,3 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|