first step for fix first step from fixes soap

merge-requests/773/head
Elham Rababh 3 years ago
parent d63fa42178
commit 638ae40035

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";

@ -6,6 +6,7 @@ class MySelectedAllergy {
String remark;
bool isChecked;
bool isExpanded;
bool isLocal;
int createdBy;
MySelectedAllergy(
@ -13,7 +14,8 @@ class MySelectedAllergy {
this.selectedAllergy,
this.remark,
this.isChecked,
this.isExpanded = true,
this.isExpanded = true,
this.isLocal = true,
this.createdBy});
MySelectedAllergy.fromJson(Map<String, dynamic> json) {
@ -26,6 +28,7 @@ class MySelectedAllergy {
remark = json['remark'];
isChecked = json['isChecked'];
isExpanded = json['isExpanded'];
isLocal = json['isLocal'];
createdBy = json['createdBy'];
}
@ -41,6 +44,7 @@ class MySelectedAllergy {
data['isChecked'] = this.isChecked;
data['isExpanded'] = this.isExpanded;
data['createdBy'] = this.createdBy;
data['isLocal'] = this.isLocal;
return data;
}
}

@ -8,6 +8,8 @@ class MySelectedExamination {
bool notExamined;
bool isNew;
int createdBy;
String createdOn;
String editedOn;
MySelectedExamination(
{this.selectedExamination,
@ -16,7 +18,9 @@ class MySelectedExamination {
this.isAbnormal = false,
this.notExamined = true,
this.isNew = true,
this.createdBy});
this.createdBy, this.createdOn,
this.editedOn,});
MySelectedExamination.fromJson(Map<String, dynamic> json) {
selectedExamination = json['selectedExamination'] != null
@ -28,6 +32,8 @@ class MySelectedExamination {
notExamined = json['notExamined'];
isNew = json['isNew'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
editedOn = json['editedOn'];
}
Map<String, dynamic> toJson() {
@ -42,6 +48,9 @@ class MySelectedExamination {
data['notExamined'] = this.notExamined;
data['isNew'] = this.isNew;
data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['editedOn'] = this.editedOn;
return data;
}
}

@ -4,9 +4,10 @@ class MySelectedHistory {
MasterKeyModel selectedHistory;
String remark;
bool isChecked;
bool isLocal;
MySelectedHistory(
{ this.selectedHistory, this.remark, this.isChecked});
{ this.selectedHistory, this.remark, this.isChecked, this.isLocal = true});
MySelectedHistory.fromJson(Map<String, dynamic> json) {
@ -15,6 +16,7 @@ class MySelectedHistory {
: null;
remark = json['remark'];
remark = json['isChecked'];
isLocal = json['isLocal'];
}
Map<String, dynamic> toJson() {
@ -25,6 +27,7 @@ class MySelectedHistory {
}
data['remark'] = this.remark;
data['isChecked'] = this.remark;
data['isLocal'] = this.isLocal;
return data;
}
}

@ -55,7 +55,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '',
appointmentNo: int.parse(widget.patientInfo.appointmentNo));
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()));
await model.getPatientAssessment(getAssessmentReqModel);
if (model.patientAssessmentList.isNotEmpty) {
if (model.listOfDiagnosisCondition.length == 0) {

@ -83,9 +83,11 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
remark: element.remarks,
isNormal: element.isNormal,
createdBy: element.createdBy,
createdOn:element.createdOn ,
editedOn: element.editedOn,
notExamined: element.notExamined,
isNew: element.isNew,
isAbnormal: element.isAbnormal);
isAbnormal: element.isAbnormal,);
widget.mySelectedExamination.add(tempEam);
});
}
@ -213,7 +215,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
appointmentNo: widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
createdOn: exam.createdOn??
DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id,
@ -276,21 +279,6 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
removeExamination: (masterKey) => removeExamination(masterKey)),
),
);
/*showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return AddExaminationDailog(
mySelectedExamination: widget.mySelectedExamination,
addSelectedExamination: () {
setState(() {
Navigator.of(context).pop();
});
},
removeExamination: (masterKey) => removeExamination(masterKey),
);
});*/
}
}

@ -74,7 +74,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel(
appointmentNo: int.parse(widget.patientInfo.appointmentNo),
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
@ -88,6 +88,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn;
widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn;
widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName;
widget.patientProgressNote.appointmentNo = model.patientProgressNoteList[0].appointmentNo;
setState(() {
isAddProgress = false;
});
@ -158,7 +160,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
fontSize: 12,
),
AppText(
widget.patientProgressNote.appointmentNo ?? '',
widget.patientProgressNote.appointmentNo.toString() ?? '',
fontWeight: FontWeight.w600,
),
],

@ -153,13 +153,15 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
).toList();
if (allergy.length > 0) {
if(allergy.first.isLocal) {
setState(() {
widget.myAllergiesList.remove(allergy.first);
});
}
setState(() {
allergy[0].isChecked = false;
});
}
print(allergy);
}
openAllergiesList(BuildContext context, Function changeParentState) {
@ -180,7 +182,8 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
});
if (isAllDataFilled) {
mySelectedAllergy.forEach((element) {
if (!widget.myAllergiesList.contains(element.selectedAllergySeverity.id)) {
if ((widget.myAllergiesList.singleWhere((it) => it.selectedAllergy.id == element.selectedAllergy.id,
orElse: () => null)) == null) {
widget.myAllergiesList.add(element);
}
});

@ -123,10 +123,19 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
).toList();
if (history.length > 0)
setState(() {
history[0].isChecked = false;
});
if (history.length > 0) {
if(history.first.isLocal) {
setState(() {
widget.myHistoryList.remove(history.first);
});
} else {
setState(() {
history[0].isChecked = false;
});
}
}
}
openHistoryList(BuildContext context) {

@ -30,16 +30,12 @@ import 'history/update_history_widget.dart';
class UpdateSubjectivePage extends StatefulWidget {
final Function changePageViewIndex;
final Function changeLoadingState;
final List<MySelectedAllergy> myAllergiesList;
final List<MySelectedHistory> myHistoryList;
final PatiantInformtion patientInfo;
final int currentIndex;
UpdateSubjectivePage(
{Key key,
this.changePageViewIndex,
this.myAllergiesList,
this.myHistoryList,
this.patientInfo,
this.changeLoadingState,
this.currentIndex});
@ -59,6 +55,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
String medicationControllerError = '';
String illnessControllerError = '';
final formKey = GlobalKey<FormState>();
List<MySelectedAllergy> myAllergiesList=List();
List<MySelectedHistory> myHistoryList=List();
getHistory(SOAPViewModel model) async {
widget.changeLoadingState(true);
@ -93,9 +91,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
);
if (history != null) {
MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks);
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
widget.myHistoryList.add(mySelectedHistory);
myHistoryList.add(mySelectedHistory);
}
}
if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) {
@ -105,9 +103,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
);
if (history != null) {
MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks);
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
widget.myHistoryList.add(mySelectedHistory);
myHistoryList.add(mySelectedHistory);
}
}
if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) {
@ -117,9 +115,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
);
if (history != null) {
MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks);
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
widget.myHistoryList.add(mySelectedHistory);
myHistoryList.add(mySelectedHistory);
}
}
if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) {
@ -129,9 +127,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
);
if (history != null) {
MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks);
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
widget.myHistoryList.add(mySelectedHistory);
myHistoryList.add(mySelectedHistory);
}
}
});
@ -169,8 +167,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
isChecked: element.isChecked,
createdBy: element.createdBy,
remark: element.remarks,
isLocal : false,
selectedAllergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null) widget.myAllergiesList.add(mySelectedAllergy);
if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy);
});
}
}
@ -179,8 +178,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
widget.myAllergiesList.clear();
widget.myHistoryList.clear();
myAllergiesList.clear();
myHistoryList.clear();
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
patientMRN: widget.patientInfo.patientMRN,
@ -246,7 +245,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
});
},
child: Column(
children: [UpdateHistoryWidget(myHistoryList: widget.myHistoryList)],
children: [UpdateHistoryWidget(myHistoryList: myHistoryList)],
),
isExpanded: isHistoryExpand,
),
@ -264,7 +263,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
child: Column(
children: [
UpdateAllergiesWidget(
myAllergiesList: widget.myAllergiesList,
myAllergiesList: myAllergiesList,
),
SizedBox(
height: 30,
@ -304,10 +303,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
title: TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
color: Colors.red[700],
loading: model.state == ViewState.BusyLocal,
// loading: model.state == ViewState.BusyLocal,
onPressed: () async {
addSubjectiveInfo(
model: model, myAllergiesList: widget.myAllergiesList, myHistoryList: widget.myHistoryList);
model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList);
},
),
),
@ -325,6 +324,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
addSubjectiveInfo(
{SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<MySelectedHistory> myHistoryList}) async {
widget.changeLoadingState(true);
formKey.currentState.save();
formKey.currentState.validate();
@ -370,6 +370,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
medicationControllerError = TranslationBase.of(context).emptyMessage;
}
});
widget.changeLoadingState(false);
Helpers.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg);
}
}
@ -380,7 +382,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
widget.myAllergiesList.forEach((allergy) {
myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM(
@ -419,7 +421,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
postHistories({List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async {
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: '');
widget.myHistoryList.forEach((history) {
myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = [];
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
patientMRN: widget.patientInfo.patientMRN,

@ -105,8 +105,6 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
UpdateSubjectivePage(
changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex,
myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateObjectivePage(

Loading…
Cancel
Save