diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 8e253151..f04fd8d4 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -15,16 +15,24 @@ class GetChiefComplaintReqModel { episodeId = json['EpisodeId']; episodeID = json['EpisodeID']; doctorID = json['DoctorID']; - admissionNo = json['AdmissionNo']; + admissionNo = json['admissionNo']; } Map toJson() { final Map data = new Map(); data['PatientMRN'] = this.patientMRN; - data['AppointmentNo'] = this.appointmentNo; - data['EpisodeId'] = this.episodeId; - data['EpisodeID'] = this.episodeID; - data['DoctorID'] = this.doctorID; + if (this.appointmentNo != null) { + data['AppointmentNo'] = this.appointmentNo; + } + if (this.episodeId != null) { + data['EpisodeId'] = this.episodeId; + } + if (episodeID != null) { + data['EpisodeID'] = this.episodeID; + } + if (doctorID != null) { + data['DoctorID'] = this.doctorID; + } if (this.admissionNo != null) { data['AdmissionNo'] = this.admissionNo; } diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index 5f5fe721..682342df 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -43,8 +43,13 @@ class PostChiefComplaintRequestModel { Map toJson() { final Map data = new Map(); - data['AppointmentNo'] = this.appointmentNo; - data['EpisodeID'] = this.episodeID; + if (appointmentNo != null) { + data['AppointmentNo'] = this.appointmentNo; + } + + if (episodeID != null) { + data['EpisodeID'] = this.episodeID; + } data['PatientMRN'] = this.patientMRN; data['chiefComplaint'] = this.chiefComplaint; data['Hopi'] = this.hopi; @@ -53,8 +58,10 @@ class PostChiefComplaintRequestModel { data['isLactation'] = this.isLactation; data['numberOfWeeks'] = this.numberOfWeeks; data['DoctorID'] = this.doctorID; - data['EditedBy'] = this.editedBy; - if (this.admissionNo != null) { + if (editedBy != null) { + data['EditedBy'] = this.editedBy; + } + if (admissionNo != null) { data['AdmissionNo'] = this.admissionNo; } diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 83a70b01..df966f03 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -79,95 +79,93 @@ class PatiantInformtion { int vcId; String voipToken; - PatiantInformtion({this.patientDetails, - this.projectId, - this.clinicId, - this.doctorId, - this.patientId, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.nationalityId, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.createdOn, - this.roomId, - this.bedId, - this.nursingStationId, - this.description, - this.clinicDescription, - this.clinicDescriptionN, - this.nationalityName, - this.nationalityNameN, - this.age, - this.genderDescription, - this.nursingStationName, - this.appointmentDate, - this.startTime, - this.appointmentNo, - this.arrivalTime, - this.arrivalTimeD, - this.callStatus, - this.callStatusDisc, - this.callTypeID, - this.clientRequestID, - this.clinicName, - this.consoltationEnd, - this.consultationNotes, - this.appointmentType, - this.appointmentTypeId, - this.arrivedOn, - this.clinicGroupId, - this.companyName, - this.dischargeStatus, - this.doctorDetails, - this.endTime, - this.episodeNo, - this.fallRiskScore, - this.genderInt, - this.isSigned, - this.medicationOrders, - this.nationality, - this.patientMRN, - this.visitType, - this.fullName, - this.fullNameN, - this.nationalityFlagURL, - this.patientStatusType, - this.patientStatus, - this.visitTypeId, - this.startTimes, - this.dischargeDate, - this.status, - this.vcId, - this.voipToken, - this.admissionDateWithDateTimeForm, + PatiantInformtion( + {this.patientDetails, + this.projectId, + this.clinicId, + this.doctorId, + this.patientId, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.nationalityId, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.createdOn, + this.roomId, + this.bedId, + this.nursingStationId, + this.description, + this.clinicDescription, + this.clinicDescriptionN, + this.nationalityName, + this.nationalityNameN, + this.age, + this.genderDescription, + this.nursingStationName, + this.appointmentDate, + this.startTime, + this.appointmentNo, + this.arrivalTime, + this.arrivalTimeD, + this.callStatus, + this.callStatusDisc, + this.callTypeID, + this.clientRequestID, + this.clinicName, + this.consoltationEnd, + this.consultationNotes, + this.appointmentType, + this.appointmentTypeId, + this.arrivedOn, + this.clinicGroupId, + this.companyName, + this.dischargeStatus, + this.doctorDetails, + this.endTime, + this.episodeNo, + this.fallRiskScore, + this.genderInt, + this.isSigned, + this.medicationOrders, + this.nationality, + this.patientMRN, + this.visitType, + this.fullName, + this.fullNameN, + this.nationalityFlagURL, + this.patientStatusType, + this.patientStatus, + this.visitTypeId, + this.startTimes, + this.dischargeDate, + this.status, + this.vcId, + this.voipToken, + this.admissionDateWithDateTimeForm, this.appointmentDateWithDateTimeForm}); - PatiantInformtion.fromJson(Map json) { { - patientDetails = json['patientDetails'] != null - ? new PatiantInformtion.fromJson(json['patientDetails']) - : null; + patientDetails = json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) : null; projectId = json["ProjectID"] ?? json["projectID"]; clinicId = json["ClinicID"] ?? json["clinicID"]; doctorId = json["DoctorID"] ?? json["doctorID"]; patientId = json["PatientID"] != null ? json["PatientID"] is String - ? int.parse(json["PatientID"]) - : json["PatientID"] + ? int.parse(json["PatientID"]) + : json["PatientID"] : json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN']; doctorName = json["DoctorName"] ?? json["doctorName"]; doctorNameN = json["DoctorNameN"] ?? json["doctorNameN"]; @@ -179,18 +177,16 @@ class PatiantInformtion { lastNameN = json["LastNameN"] ?? json["lastNameN"]; gender = json["Gender"] != null ? json["Gender"] is String - ? int.parse(json["Gender"]) - : json["Gender"] + ? int.parse(json["Gender"]) + : json["Gender"] : json["gender"]; fullName = json["fullName"] ?? json["fullName"] ?? json["PatientName"]; - fullNameN = - json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"]; + fullNameN = json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"]; dateofBirth = json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth']; nationalityId = json["NationalityID"] ?? json["nationalityID"]; mobileNumber = json["MobileNumber"] ?? json["mobileNumber"]; emailAddress = json["EmailAddress"] ?? json["emailAddress"]; - patientIdentificationNo = - json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; + patientIdentificationNo = json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; //TODO make 7 dynamic when the backend retrun it in patient arrival patientType = json["PatientType"] ?? json["patientType"] ?? 1; admissionNo = json["AdmissionNo"] ?? json["admissionNo"]; @@ -200,16 +196,10 @@ class PatiantInformtion { bedId = json["BedID"] ?? json["bedID"]; nursingStationId = json["NursingStationID"] ?? json["nursingStationID"]; description = json["Description"] ?? json["description"]; - clinicDescription = - json["ClinicDescription"] ?? json["clinicDescription"]; - clinicDescriptionN = - json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; - nationalityName = json["NationalityName"] ?? - json["nationalityName"] ?? - json['NationalityName']; - nationalityNameN = json["NationalityNameN"] ?? - json["nationalityNameN"] ?? - json['NationalityNameN']; + clinicDescription = json["ClinicDescription"] ?? json["clinicDescription"]; + clinicDescriptionN = json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; + nationalityName = json["NationalityName"] ?? json["nationalityName"] ?? json['NationalityName']; + nationalityNameN = json["NationalityNameN"] ?? json["nationalityNameN"] ?? json['NationalityNameN']; age = json["Age"] ?? json["age"]; genderDescription = json["GenderDescription"]; nursingStationName = json["NursingStationName"]; @@ -217,8 +207,7 @@ class PatiantInformtion { startTime = json["startTime"] ?? json['StartTime']; appointmentNo = json['appointmentNo'] ?? json['AppointmentNo']; appointmentType = json['appointmentType']; - appointmentTypeId = - json['appointmentTypeId'] ?? json['appointmentTypeid']; + appointmentTypeId = json['appointmentTypeId'] ?? json['appointmentTypeid']; arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn']; clinicGroupId = json['clinicGroupId']; companyName = json['companyName']; @@ -234,16 +223,15 @@ class PatiantInformtion { json['PatientMRN'] ?? (json["PatientID"] != null ? int?.parse(json["PatientID"].toString()) - : json["patientID"] != null ? int?.parse( - json["patientID"].toString()) : json["patientId"] != null ? int - ?.parse(json["patientId"].toString()) : ''); + : json["patientID"] != null + ? int?.parse(json["patientID"].toString()) + : json["patientId"] != null + ? int?.parse(json["patientId"].toString()) + : ''); visitType = json['visitType'] ?? json['visitType'] ?? json['visitType']; - nationalityFlagURL = - json['NationalityFlagURL'] ?? json['NationalityFlagURL']; - patientStatusType = - json['patientStatusType'] ?? json['PatientStatusType']; - visitTypeId = - json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; + nationalityFlagURL = json['NationalityFlagURL'] ?? json['NationalityFlagURL']; + patientStatusType = json['patientStatusType'] ?? json['PatientStatusType']; + visitTypeId = json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; startTimes = json['StartTime'] ?? json['StartTime']; dischargeDate = json['DischargeDate']; status = json['Status']; @@ -262,16 +250,15 @@ class PatiantInformtion { voipToken = json['VoipToken']; admissionDateWithDateTimeForm = json["AdmissionDate"] != null ? AppDateUtils.convertStringToDate(json["AdmissionDate"]) - : json["admissionDate"] != null ? AppDateUtils.convertStringToDate( - json["admissionDate"]) : null; + : json["admissionDate"] != null + ? AppDateUtils.convertStringToDate(json["admissionDate"]) + : null; appointmentDateWithDateTimeForm = - json["AppointmentDate"] != null ? AppDateUtils.convertStringToDate( - json["AppointmentDate"]) : null; + json["AppointmentDate"] != null ? AppDateUtils.convertStringToDate(json["AppointmentDate"]) : null; } } - Map toJson() { final Map data = new Map(); @@ -315,9 +302,9 @@ class PatiantInformtion { data["Gender"] = this.gender; data["gender"] = this.gender; - 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['ArrivalTime'] = this.arrivalTime; data['ArrivalTimeD'] = this.arrivalTimeD; @@ -343,4 +330,4 @@ class PatiantInformtion { data['DateOfBirth'] = this.dateofBirth; return data; } -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index fb126a69..bf3e0988 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -37,18 +37,13 @@ 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(); } -class _UpdateSubjectivePageState extends State - implements SubjectiveCallBack { +class _UpdateSubjectivePageState extends State implements SubjectiveCallBack { bool isChiefExpand = false; bool isHistoryExpand = false; bool isAllergiesExpand = false; @@ -90,8 +85,7 @@ class _UpdateSubjectivePageState extends State } 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, @@ -99,15 +93,11 @@ class _UpdateSubjectivePageState extends State if (history != null) { MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); 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, @@ -115,15 +105,11 @@ class _UpdateSubjectivePageState extends State if (history != null) { MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); 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, @@ -131,15 +117,11 @@ class _UpdateSubjectivePageState extends State if (history != null) { MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); 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, @@ -147,10 +129,7 @@ class _UpdateSubjectivePageState extends State if (history != null) { MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); myHistoryList.add(mySelectedHistory); } } @@ -167,23 +146,16 @@ class _UpdateSubjectivePageState extends State 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( masterKeys: MasterKeysService.AllergySeverity, @@ -191,17 +163,15 @@ class _UpdateSubjectivePageState extends State ); } - MySelectedAllergy mySelectedAllergy = - SoapUtils.generateMySelectedAllergy( - allergy: selectedAllergy, - isChecked: element.isChecked, - createdBy: element.createdBy, - remark: element.remarks, - isLocal: false, - allergySeverity: selectedAllergySeverity); - - if (selectedAllergy != null && selectedAllergySeverity != null) - myAllergiesList.add(mySelectedAllergy); + MySelectedAllergy mySelectedAllergy = SoapUtils.generateMySelectedAllergy( + allergy: selectedAllergy, + isChecked: element.isChecked, + createdBy: element.createdBy, + remark: element.remarks, + isLocal: false, + allergySeverity: selectedAllergySeverity); + + if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy); }); } } @@ -213,32 +183,27 @@ class _UpdateSubjectivePageState extends State myAllergiesList.clear(); myHistoryList.clear(); model.setSubjectiveCallBack(this); - GetChiefComplaintReqModel getChiefComplaintReqModel = - GetChiefComplaintReqModel( - admissionNo: widget.patientInfo.admissionNo == null - ? 0 - : int.parse(widget.patientInfo.admissionNo), - patientMRN: widget.patientInfo.patientMRN, - appointmentNo: widget.patientInfo.appointmentNo == null - ? 0 - : int.parse(widget.patientInfo.appointmentNo.toString()), - episodeId: widget.patientInfo.episodeNo, - episodeID: widget.patientInfo.episodeNo, - doctorID: ''); + GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( + admissionNo: widget.patientInfo.admissionNo != null ? int.parse(widget.patientInfo.admissionNo) : null, + patientMRN: widget.patientInfo.patientMRN, + appointmentNo: widget.patientInfo.appointmentNo != null + ? int.parse(widget.patientInfo.appointmentNo.toString()) + : null, + 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; } - if (widget.patientInfo.appointmentNo != null) { + if (widget.patientInfo.admissionNo == null) { await getHistory(model); + await getAllergies(model); } @@ -282,51 +247,48 @@ class _UpdateSubjectivePageState extends State isExpanded: isChiefExpand, ), SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 4 : 2), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), ), - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).histories, - isRequired: false, - onTap: () { - setState(() { - isHistoryExpand = !isHistoryExpand; - }); - }, - child: Column( - children: [ - UpdateHistoryWidget(myHistoryList: myHistoryList) - ], + if (widget.patientInfo.admissionNo == null) + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).histories, + isRequired: false, + onTap: () { + setState(() { + isHistoryExpand = !isHistoryExpand; + }); + }, + child: Column( + children: [UpdateHistoryWidget(myHistoryList: myHistoryList)], + ), + isExpanded: isHistoryExpand, ), - isExpanded: isHistoryExpand, - ), SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 4 : 2), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), ), - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).allergiesSoap, - isRequired: false, - onTap: () { - setState(() { - isAllergiesExpand = !isAllergiesExpand; - }); - }, - child: Column( - children: [ - UpdateAllergiesWidget( - myAllergiesList: myAllergiesList, - ), - SizedBox( - height: 30, - ), - ], + if (widget.patientInfo.admissionNo == null) + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).allergiesSoap, + isRequired: false, + onTap: () { + setState(() { + isAllergiesExpand = !isAllergiesExpand; + }); + }, + child: Column( + children: [ + UpdateAllergiesWidget( + myAllergiesList: myAllergiesList, + ), + SizedBox( + height: 30, + ), + ], + ), + isExpanded: isAllergiesExpand, ), - isExpanded: isAllergiesExpand, - ), SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 20 : 10), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10), ), ], ), @@ -338,9 +300,7 @@ class _UpdateSubjectivePageState extends State } addSubjectiveInfo( - {SOAPViewModel model, - List myAllergiesList, - List myHistoryList}) async { + {SOAPViewModel model, List myAllergiesList, List myHistoryList}) async { if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus(); widget.changeLoadingState(true); formKey.currentState.save(); @@ -480,25 +440,23 @@ class _UpdateSubjectivePageState extends State postChiefComplaint({SOAPViewModel model}) async { formKey.currentState.save(); if (formKey.currentState.validate()) { - PostChiefComplaintRequestModel postChiefComplaintRequestModel = - new PostChiefComplaintRequestModel( - admissionNo: widget.patientInfo.admissionNo == null - ? 0 - : 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); + PostChiefComplaintRequestModel postChiefComplaintRequestModel = new PostChiefComplaintRequestModel( + admissionNo: widget.patientInfo.admissionNo != null ? int.parse(widget.patientInfo.admissionNo) : null, + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo ?? 0, + appointmentNo: widget.patientInfo.appointmentNo ?? 0, + 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); } else { + postChiefComplaintRequestModel.editedBy = ''; await model.patchChiefComplaint(postChiefComplaintRequestModel); } } @@ -506,9 +464,6 @@ class _UpdateSubjectivePageState extends State @override Function nextFunction(model) { - addSubjectiveInfo( - model: model, - myAllergiesList: myAllergiesList, - myHistoryList: myHistoryList); + addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList); } }