chief complaint in in patient

merge-requests/781/head
hussam al-habibeh 5 years ago
parent ab584c792a
commit 8c3fc3a6f7

@ -280,7 +280,6 @@ var SERVICES_PATIANT_HEADER_AR = [
"المريض الواصل"
];
const PRIMARY_COLOR = 0xff515B5D;
const TRANSACTION_NO = 0;

@ -31,11 +31,7 @@ class UpdateObjectivePage extends StatefulWidget {
final PatiantInformtion patientInfo;
UpdateObjectivePage(
{Key key,
this.changePageViewIndex,
this.patientInfo,
this.changeLoadingState,
this.currentIndex});
{Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex});
@override
_UpdateObjectivePageState createState() => _UpdateObjectivePageState();
@ -45,8 +41,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
bool isSysExaminationExpand = false;
List<MySelectedExamination> mySelectedExamination = List();
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
@ -63,12 +58,10 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
mySelectedExamination.clear();
GetPhysicalExamReqModel getPhysicalExamReqModel =
GetPhysicalExamReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()));
GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()));
await model.getPatientPhysicalExam(getPhysicalExamReqModel);
if (model.patientPhysicalExamList.isNotEmpty) {
@ -108,12 +101,9 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex),
SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex),
ExpandableSOAPWidget(
headerTitle:
TranslationBase.of(context).physicalSystemExamination,
headerTitle: TranslationBase.of(context).physicalSystemExamination,
onTap: () {
setState(() {
isSysExaminationExpand = !isSysExaminationExpand;
@ -122,8 +112,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
child: Column(
children: [
SOAPOpenItems(
label:
"${TranslationBase.of(context).addExamination}",
label: "${TranslationBase.of(context).addExamination}",
onTap: () {
openExaminationList(context);
},
@ -131,8 +120,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
Column(
children: mySelectedExamination.map((examination) {
return ExaminationItemCard(examination, () {
removeExamination(
examination.selectedExamination);
removeExamination(examination.selectedExamination);
});
}).toList(),
)
@ -214,40 +202,36 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel =
new PostPhysicalExamRequestModel();
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
[];
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = [];
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
.add(ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId,
isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal,
notExamined: exam.notExamined,
examinationType: exam.isNormal
? 1
: exam.isAbnormal
? 2
: 3,
examinationTypeName: exam.isNormal
? "Normal"
: exam.isAbnormal
? 'AbNormal'
: "Not Examined",
isNew: exam.isNew));
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId,
isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal,
notExamined: exam.notExamined,
examinationType: exam.isNormal
? 1
: exam.isAbnormal
? 2
: 3,
examinationTypeName: exam.isNormal
? "Normal"
: exam.isAbnormal
? 'AbNormal'
: "Not Examined",
isNew: exam.isNew));
});
if (model.patientPhysicalExamList.isEmpty) {
@ -269,10 +253,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
}
removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = mySelectedExamination.where(
(element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
Iterable<MySelectedExamination> history = mySelectedExamination.where((element) =>
masterKey.id == element.selectedExamination.id && masterKey.typeId == element.selectedExamination.typeId);
if (history.length > 0)
setState(() {
@ -302,11 +284,7 @@ class AddExaminationDailog extends StatefulWidget {
final Function addSelectedExamination;
final Function(MasterKeyModel) removeExamination;
const AddExaminationDailog(
{Key key,
this.mySelectedExamination,
this.addSelectedExamination,
this.removeExamination})
const AddExaminationDailog({Key key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination})
: super(key: key);
@override
@ -321,8 +299,7 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) {
await model
.getMasterLookup(MasterKeysService.PhysicalExamination);
await model.getMasterLookup(MasterKeysService.PhysicalExamination);
}
},
builder: (_, model, w) => AppScaffold(
@ -332,21 +309,19 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).physicalSystemExamination,
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
]),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).physicalSystemExamination,
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
]),
))),
)),
);

@ -34,11 +34,7 @@ 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();
@ -55,8 +51,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
String medicationControllerError = '';
String illnessControllerError = '';
final formKey = GlobalKey<FormState>();
List<MySelectedAllergy> myAllergiesList=List();
List<MySelectedHistory> myHistoryList=List();
List<MySelectedAllergy> myAllergiesList = List();
List<MySelectedHistory> myHistoryList = List();
getHistory(SOAPViewModel model) async {
widget.changeLoadingState(true);
@ -67,7 +63,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,15 +80,14 @@ 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,isLocal: false);
MySelectedHistory mySelectedHistory = MySelectedHistory(
selectedHistory: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory);
}
@ -103,8 +98,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
id: element.historyId,
);
if (history != null) {
MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
MySelectedHistory mySelectedHistory = MySelectedHistory(
selectedHistory: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory);
}
@ -115,8 +110,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
id: element.historyId,
);
if (history != null) {
MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
MySelectedHistory mySelectedHistory = MySelectedHistory(
selectedHistory: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory);
}
@ -127,8 +122,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
id: element.historyId,
);
if (history != null) {
MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
MySelectedHistory mySelectedHistory = MySelectedHistory(
selectedHistory: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory);
}
@ -157,7 +152,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
selectedAllergySeverity = MasterKeyModel(
id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: '');
} else {
selectedAllergySeverity = model.getOneMasterKey(
selectedAllergySeverity = model.getOneMasterKey(
masterKeys: MasterKeysService.AllergySeverity,
id: element.severity,
);
@ -168,7 +163,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
isChecked: element.isChecked,
createdBy: element.createdBy,
remark: element.remarks,
isLocal : false,
isLocal: false,
selectedAllergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy);
});
@ -218,9 +213,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
children: [
SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex),
ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context)
.chiefComplaints
,
headerTitle: TranslationBase.of(context).chiefComplaints,
onTap: () {
setState(() {
isChiefExpand = !isChiefExpand;
@ -241,9 +234,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
height: 30,
),
ExpandableSOAPWidget(
headerTitle: TranslationBase
.of(context)
.histories,
headerTitle: TranslationBase.of(context).histories,
isRequired: false,
onTap: () {
setState(() {
@ -259,10 +250,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
height: 30,
),
ExpandableSOAPWidget(
headerTitle: TranslationBase
.of(context)
.allergiesSoap
,
headerTitle: TranslationBase.of(context).allergiesSoap,
isRequired: false,
onTap: () {
setState(() {
@ -282,7 +270,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,
),
],
),
@ -314,8 +302,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
color: Colors.red[700],
//loading: model.state == ViewState.BusyLocal,
onPressed: () async {
addSubjectiveInfo(
model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList);
addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList);
},
),
),
@ -333,8 +320,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
addSubjectiveInfo(
{SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<MySelectedHistory> myHistoryList}) async {
if(FocusScope.of(context).hasFocus)
FocusScope.of(context).unfocus();
if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus();
widget.changeLoadingState(true);
formKey.currentState.save();
formKey.currentState.validate();
@ -367,25 +353,17 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
} 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;
}
});
@ -455,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);
}

Loading…
Cancel
Save