fix multiple issue

merge-requests/268/head
Elham Rababah 5 years ago
parent cbf850da2f
commit 8c9ffc2e62

@ -237,13 +237,18 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async {
setState(ViewState.Busy);
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP,
{isLocalBusy = false}) async {
if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else
setState(ViewState.Busy);
await _SOAPService.getPatientAllergy(generalGetReqForSOAP);
if (_SOAPService.hasError) {
error = _SOAPService.error;
if (isLocalBusy) {
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Error);
} else
setState(ViewState.Idle);

@ -6,15 +6,17 @@ class GetPatientArrivalListRequestModel {
int pageIndex;
int pageSize;
int clinicID;
int patientMRN;
GetPatientArrivalListRequestModel(
{this.vidaAuthTokenID,
this.from,
this.to,
this.doctorID,
this.pageIndex,
this.pageSize,
this.clinicID});
this.from,
this.to,
this.doctorID,
this.pageIndex,
this.pageSize,
this.clinicID,
this.patientMRN});
GetPatientArrivalListRequestModel.fromJson(Map<String, dynamic> json) {
vidaAuthTokenID = json['VidaAuthTokenID'];
@ -24,6 +26,7 @@ class GetPatientArrivalListRequestModel {
pageIndex = json['PageIndex'];
pageSize = json['PageSize'];
clinicID = json['ClinicID'];
patientMRN = json['PatientMRN'];
}
Map<String, dynamic> toJson() {
@ -35,6 +38,8 @@ class GetPatientArrivalListRequestModel {
data['PageSize'] = this.pageSize;
data['ClinicID'] = this.clinicID;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['PatientMRN'] = this.patientMRN;
return data;
}

@ -262,7 +262,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
GetPatientArrivalListRequestModel getPatientArrivalListRequestModel;
if (val2 == 7) {
getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel(
from: patient.From, to: patient.To, pageIndex: 0, pageSize: 0);
from: patient.From, to: patient.To, pageIndex: 0, pageSize: 0,patientMRN: patient.getPatientID);
}
model

@ -91,7 +91,7 @@ class PatientPageHeaderWidget extends StatelessWidget {
),
],
),
model.patientAllergiesList.isNotEmpty ?AppText(
model.patientAllergiesList.isNotEmpty && model.getAllergicNames(projectViewModel.isArabic)!='' ?AppText(
TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic),
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,

@ -544,6 +544,14 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
await model.patchAllergy(postAllergyRequestModel);
}
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
doctorID: '',
editedBy: '');
await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy : true);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
}

@ -37,6 +37,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel();
changePageViewIndex(pageIndex) {
changeLoadingState(true);
_controller.jumpToPage(pageIndex);
}

Loading…
Cancel
Save