chef complint for in patient

merge-requests/787/head^2
hussam al-habibeh 5 years ago
parent 8147d20fc6
commit 562fd1b515

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

@ -21,10 +21,18 @@ class GetChiefComplaintReqModel {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN; data['PatientMRN'] = this.patientMRN;
if (this.appointmentNo != null) {
data['AppointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
}
if (this.episodeId != null) {
data['EpisodeId'] = this.episodeId; data['EpisodeId'] = this.episodeId;
}
if (episodeID != null) {
data['EpisodeID'] = this.episodeID; data['EpisodeID'] = this.episodeID;
}
if (doctorID != null) {
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;
}
if (this.admissionNo != null) { if (this.admissionNo != null) {
data['AdmissionNo'] = this.admissionNo; data['AdmissionNo'] = this.admissionNo;
} }

@ -43,8 +43,13 @@ class PostChiefComplaintRequestModel {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
if (appointmentNo != null) {
data['AppointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
}
if (episodeID != null) {
data['EpisodeID'] = this.episodeID; data['EpisodeID'] = this.episodeID;
}
data['PatientMRN'] = this.patientMRN; data['PatientMRN'] = this.patientMRN;
data['chiefComplaint'] = this.chiefComplaint; data['chiefComplaint'] = this.chiefComplaint;
data['Hopi'] = this.hopi; data['Hopi'] = this.hopi;
@ -53,8 +58,10 @@ class PostChiefComplaintRequestModel {
data['isLactation'] = this.isLactation; data['isLactation'] = this.isLactation;
data['numberOfWeeks'] = this.numberOfWeeks; data['numberOfWeeks'] = this.numberOfWeeks;
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;
if (editedBy != null) {
data['EditedBy'] = this.editedBy; data['EditedBy'] = this.editedBy;
if (this.admissionNo != null) { }
if (admissionNo != null) {
data['AdmissionNo'] = this.admissionNo; data['AdmissionNo'] = this.admissionNo;
} }

@ -79,7 +79,8 @@ class PatiantInformtion {
int vcId; int vcId;
String voipToken; String voipToken;
PatiantInformtion({this.patientDetails, PatiantInformtion(
{this.patientDetails,
this.projectId, this.projectId,
this.clinicId, this.clinicId,
this.doctorId, this.doctorId,
@ -155,12 +156,9 @@ class PatiantInformtion {
this.admissionDateWithDateTimeForm, this.admissionDateWithDateTimeForm,
this.appointmentDateWithDateTimeForm}); this.appointmentDateWithDateTimeForm});
PatiantInformtion.fromJson(Map<String, dynamic> json) { PatiantInformtion.fromJson(Map<String, dynamic> json) {
{ {
patientDetails = json['patientDetails'] != null patientDetails = json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) : null;
? new PatiantInformtion.fromJson(json['patientDetails'])
: null;
projectId = json["ProjectID"] ?? json["projectID"]; projectId = json["ProjectID"] ?? json["projectID"];
clinicId = json["ClinicID"] ?? json["clinicID"]; clinicId = json["ClinicID"] ?? json["clinicID"];
doctorId = json["DoctorID"] ?? json["doctorID"]; doctorId = json["DoctorID"] ?? json["doctorID"];
@ -183,14 +181,12 @@ class PatiantInformtion {
: json["Gender"] : json["Gender"]
: json["gender"]; : json["gender"];
fullName = json["fullName"] ?? json["fullName"] ?? json["PatientName"]; fullName = json["fullName"] ?? json["fullName"] ?? json["PatientName"];
fullNameN = fullNameN = json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"];
json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"];
dateofBirth = json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth']; dateofBirth = json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth'];
nationalityId = json["NationalityID"] ?? json["nationalityID"]; nationalityId = json["NationalityID"] ?? json["nationalityID"];
mobileNumber = json["MobileNumber"] ?? json["mobileNumber"]; mobileNumber = json["MobileNumber"] ?? json["mobileNumber"];
emailAddress = json["EmailAddress"] ?? json["emailAddress"]; emailAddress = json["EmailAddress"] ?? json["emailAddress"];
patientIdentificationNo = patientIdentificationNo = json["PatientIdentificationNo"] ?? json["patientIdentificationNo"];
json["PatientIdentificationNo"] ?? json["patientIdentificationNo"];
//TODO make 7 dynamic when the backend retrun it in patient arrival //TODO make 7 dynamic when the backend retrun it in patient arrival
patientType = json["PatientType"] ?? json["patientType"] ?? 1; patientType = json["PatientType"] ?? json["patientType"] ?? 1;
admissionNo = json["AdmissionNo"] ?? json["admissionNo"]; admissionNo = json["AdmissionNo"] ?? json["admissionNo"];
@ -200,16 +196,10 @@ class PatiantInformtion {
bedId = json["BedID"] ?? json["bedID"]; bedId = json["BedID"] ?? json["bedID"];
nursingStationId = json["NursingStationID"] ?? json["nursingStationID"]; nursingStationId = json["NursingStationID"] ?? json["nursingStationID"];
description = json["Description"] ?? json["description"]; description = json["Description"] ?? json["description"];
clinicDescription = clinicDescription = json["ClinicDescription"] ?? json["clinicDescription"];
json["ClinicDescription"] ?? json["clinicDescription"]; clinicDescriptionN = json["ClinicDescriptionN"] ?? json["clinicDescriptionN"];
clinicDescriptionN = nationalityName = json["NationalityName"] ?? json["nationalityName"] ?? json['NationalityName'];
json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; nationalityNameN = json["NationalityNameN"] ?? json["nationalityNameN"] ?? json['NationalityNameN'];
nationalityName = json["NationalityName"] ??
json["nationalityName"] ??
json['NationalityName'];
nationalityNameN = json["NationalityNameN"] ??
json["nationalityNameN"] ??
json['NationalityNameN'];
age = json["Age"] ?? json["age"]; age = json["Age"] ?? json["age"];
genderDescription = json["GenderDescription"]; genderDescription = json["GenderDescription"];
nursingStationName = json["NursingStationName"]; nursingStationName = json["NursingStationName"];
@ -217,8 +207,7 @@ class PatiantInformtion {
startTime = json["startTime"] ?? json['StartTime']; startTime = json["startTime"] ?? json['StartTime'];
appointmentNo = json['appointmentNo'] ?? json['AppointmentNo']; appointmentNo = json['appointmentNo'] ?? json['AppointmentNo'];
appointmentType = json['appointmentType']; appointmentType = json['appointmentType'];
appointmentTypeId = appointmentTypeId = json['appointmentTypeId'] ?? json['appointmentTypeid'];
json['appointmentTypeId'] ?? json['appointmentTypeid'];
arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn']; arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn'];
clinicGroupId = json['clinicGroupId']; clinicGroupId = json['clinicGroupId'];
companyName = json['companyName']; companyName = json['companyName'];
@ -234,16 +223,15 @@ class PatiantInformtion {
json['PatientMRN'] ?? json['PatientMRN'] ??
(json["PatientID"] != null (json["PatientID"] != null
? int?.parse(json["PatientID"].toString()) ? int?.parse(json["PatientID"].toString())
: json["patientID"] != null ? int?.parse( : json["patientID"] != null
json["patientID"].toString()) : json["patientId"] != null ? int ? int?.parse(json["patientID"].toString())
?.parse(json["patientId"].toString()) : ''); : json["patientId"] != null
? int?.parse(json["patientId"].toString())
: '');
visitType = json['visitType'] ?? json['visitType'] ?? json['visitType']; visitType = json['visitType'] ?? json['visitType'] ?? json['visitType'];
nationalityFlagURL = nationalityFlagURL = json['NationalityFlagURL'] ?? json['NationalityFlagURL'];
json['NationalityFlagURL'] ?? json['NationalityFlagURL']; patientStatusType = json['patientStatusType'] ?? json['PatientStatusType'];
patientStatusType = visitTypeId = json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'];
json['patientStatusType'] ?? json['PatientStatusType'];
visitTypeId =
json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'];
startTimes = json['StartTime'] ?? json['StartTime']; startTimes = json['StartTime'] ?? json['StartTime'];
dischargeDate = json['DischargeDate']; dischargeDate = json['DischargeDate'];
status = json['Status']; status = json['Status'];
@ -262,16 +250,15 @@ class PatiantInformtion {
voipToken = json['VoipToken']; voipToken = json['VoipToken'];
admissionDateWithDateTimeForm = json["AdmissionDate"] != null admissionDateWithDateTimeForm = json["AdmissionDate"] != null
? AppDateUtils.convertStringToDate(json["AdmissionDate"]) ? AppDateUtils.convertStringToDate(json["AdmissionDate"])
: json["admissionDate"] != null ? AppDateUtils.convertStringToDate( : json["admissionDate"] != null
json["admissionDate"]) : null; ? AppDateUtils.convertStringToDate(json["admissionDate"])
: null;
appointmentDateWithDateTimeForm = appointmentDateWithDateTimeForm =
json["AppointmentDate"] != null ? AppDateUtils.convertStringToDate( json["AppointmentDate"] != null ? AppDateUtils.convertStringToDate(json["AppointmentDate"]) : null;
json["AppointmentDate"]) : null;
} }
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
@ -315,9 +302,9 @@ class PatiantInformtion {
data["Gender"] = this.gender; data["Gender"] = this.gender;
data["gender"] = this.gender; data["gender"] = this.gender;
data['Age'] = this.age; data['Age'] = this.age;
data['AppointmentDate'] = this.appointmentDate.isNotEmpty?this.appointmentDate:null; data['AppointmentDate'] = this.appointmentDate.isNotEmpty ? this.appointmentDate : null;
data['AppointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
data['ArrivalTime'] = this.arrivalTime; data['ArrivalTime'] = this.arrivalTime;
data['ArrivalTimeD'] = this.arrivalTimeD; data['ArrivalTimeD'] = this.arrivalTimeD;

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

Loading…
Cancel
Save