Merge branch 'in_patient_soap' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into episode_fixes_dev_merge

 Conflicts:
	lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart
merge-requests/787/head
Elham Rababh 5 years ago
commit 539d8500f1

@ -15,16 +15,24 @@ class GetChiefComplaintReqModel {
episodeId = json['EpisodeId']; episodeId = json['EpisodeId'];
episodeID = json['EpisodeID']; episodeID = json['EpisodeID'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
admissionNo = json['AdmissionNo']; admissionNo = json['admissionNo'];
} }
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;
@ -90,8 +85,7 @@ 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,
@ -99,15 +93,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory( 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,
@ -115,15 +105,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory( 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,
@ -131,15 +117,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory( 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,
@ -147,10 +129,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory( 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);
} }
} }
@ -167,23 +146,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,
@ -191,8 +163,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,
@ -200,8 +171,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);
}); });
} }
} }
@ -213,32 +183,27 @@ 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: widget.patientInfo.admissionNo == null
? 0
: int.parse(widget.patientInfo.admissionNo),
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
appointmentNo: widget.patientInfo.appointmentNo == null appointmentNo: widget.patientInfo.appointmentNo != null
? 0 ? 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.appointmentNo != null) { if (widget.patientInfo.admissionNo == null) {
await getHistory(model); await getHistory(model);
await getAllergies(model); await getAllergies(model);
} }
@ -282,9 +247,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,
@ -294,16 +259,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,
@ -325,8 +288,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),
), ),
], ],
), ),
@ -338,9 +300,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();
@ -480,14 +440,11 @@ 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: widget.patientInfo.admissionNo == null
? 0
: int.parse(widget.patientInfo.admissionNo),
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo, episodeID: widget.patientInfo.episodeNo ?? 0,
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo ?? 0,
chiefComplaint: complaintsController.text, chiefComplaint: complaintsController.text,
currentMedication: medicationController.text, currentMedication: medicationController.text,
hopi: illnessController.text, hopi: illnessController.text,
@ -499,6 +456,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
postChiefComplaintRequestModel.editedBy = ''; postChiefComplaintRequestModel.editedBy = '';
await model.postChiefComplaint(postChiefComplaintRequestModel); await model.postChiefComplaint(postChiefComplaintRequestModel);
} else { } else {
postChiefComplaintRequestModel.editedBy = '';
await model.patchChiefComplaint(postChiefComplaintRequestModel); await model.patchChiefComplaint(postChiefComplaintRequestModel);
} }
} }
@ -506,9 +464,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