some fixes to go flutter 2

merge-requests/888/head
Elham Rababh 3 years ago
parent 47437c8637
commit 7f9969b6cf

@ -252,7 +252,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
setState(ViewState.BusyLocal);
await _liveCarePatientServices.addPatientToDoctorList(vcID: vcID);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
error = _liveCarePatientServices.error!;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
@ -264,7 +264,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
setState(ViewState.BusyLocal);
await _liveCarePatientServices.removePatientFromDoctorList(vcID: vcID);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
error = _liveCarePatientServices.error!;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);

@ -59,7 +59,7 @@ class PatientMedicalReportViewModel extends BaseViewModel {
setState(ViewState.Busy);
await _service.addMedicalReport(patient, htmlText);
if (_service.hasError) {
error = _service.error;
error = _service.error!;
await getMedicalReportList(patient);
setState(ViewState.ErrorLocal);
} else
@ -72,7 +72,7 @@ class PatientMedicalReportViewModel extends BaseViewModel {
setState(ViewState.Busy);
await _service.updateMedicalReport(patient, htmlText, limitNumber, invoiceNumber);
if (_service.hasError) {
error = _service.error;
error = _service.error!;
await getMedicalReportList(patient);
setState(ViewState.ErrorLocal);
} else

@ -30,7 +30,7 @@ class PatientRegistrationViewModel extends BaseViewModel {
await _patientRegistrationService
.checkPatientForRegistration(registrationModel);
if (_patientRegistrationService.hasError) {
error = _patientRegistrationService.error;
error = _patientRegistrationService.error!;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
@ -135,7 +135,7 @@ class PatientRegistrationViewModel extends BaseViewModel {
// await _patientRegistrationService.
// getPatientInfo(getPatientInfoRequestModel);
// if (_patientRegistrationService.hasError) {
// error = _patientRegistrationService.error;
// error = _patientRegistrationService.error!;
// setState(ViewState.ErrorLocal);
// } else
setState(ViewState.Idle);
@ -155,7 +155,7 @@ class PatientRegistrationViewModel extends BaseViewModel {
model: this,
checkPatientForRegistrationModel: checkPatientForRegistrationModel);
if (_patientRegistrationService.hasError) {
error = _patientRegistrationService.error;
error = _patientRegistrationService.error!;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
@ -191,7 +191,7 @@ class PatientRegistrationViewModel extends BaseViewModel {
setState(ViewState.BusyLocal);
await _patientRegistrationService.checkActivationCode(model);
if (_patientRegistrationService.hasError) {
error = _patientRegistrationService.error;
error = _patientRegistrationService.error!;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
@ -201,7 +201,7 @@ class PatientRegistrationViewModel extends BaseViewModel {
setState(ViewState.BusyLocal);
await _patientRegistrationService.registrationPatient(registrationModel);
if (_patientRegistrationService.hasError) {
error = _patientRegistrationService.error;
error = _patientRegistrationService.error!;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);

@ -354,7 +354,7 @@ class SOAPViewModel extends BaseViewModel {
patientTypeID: 1);
await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
error = _SOAPService.error!;
setState(ViewState.ErrorLocal);
} else {
patient.episodeNo = _SOAPService.episodeID;
@ -584,7 +584,7 @@ class SOAPViewModel extends BaseViewModel {
final results = await Future.wait(services ?? []);
if (_SOAPService.hasError) {
error = _SOAPService.error;
error = _SOAPService.error!;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
@ -644,7 +644,7 @@ class SOAPViewModel extends BaseViewModel {
final results = await Future.wait(services ?? []);
if (_SOAPService.hasError || _prescriptionService.hasError) {
error = _SOAPService.error + _prescriptionService.error;
error = _SOAPService.error + _prescriptionService.error!;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
@ -684,7 +684,7 @@ class SOAPViewModel extends BaseViewModel {
final results = await Future.wait(services ?? []);
if (allowSetState) {
if (_SOAPService.hasError) {
error = _SOAPService.error;
error = _SOAPService.error!;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
@ -708,7 +708,7 @@ class SOAPViewModel extends BaseViewModel {
}
if (_SOAPService.hasError) {
error = _SOAPService.error;
error = _SOAPService.error!;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
@ -766,7 +766,7 @@ class SOAPViewModel extends BaseViewModel {
final results = await Future.wait(services);
if (_SOAPService.hasError) {
error = _SOAPService.error;
error = _SOAPService.error!;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);

@ -332,7 +332,7 @@ class AuthenticationViewModel extends BaseViewModel {
await _authService.selectDeviceImei(localToken);
if (_authService.hasError) {
error = _authService.error;
error = _authService.error!;
setState(ViewState.ErrorLocal);
} else {
if (_authService.dashboardItemsList.length > 0) {

@ -42,7 +42,7 @@ List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList =>
]);
if (_dashboardService.hasError) {
error = _dashboardService.error;
error = _dashboardService.error!;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
@ -91,7 +91,7 @@ List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList =>
);
await authProvider.getDoctorProfileBasedOnClinic(clinicModel);
if (authProvider.state == ViewState.ErrorLocal) {
error = authProvider.error;
error = authProvider.error!;
}
}
@ -118,7 +118,7 @@ List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList =>
await getDoctorProfile();
await _doctorReplyService.getNotRepliedCount();
if (_doctorReplyService.hasError) {
error = _doctorReplyService.error;
error = _doctorReplyService.error!;
setState(ViewState.ErrorLocal);
} else {
notifyListeners();

@ -163,7 +163,7 @@ class LabsViewModel extends BaseViewModel {
await _labsService.getPatientLabOrdersResultHistoryByDescription(
patientLabOrder: patientLabOrder, procedureDescription: procedureDescription, patient: patient);
if (_labsService.hasError) {
error = _labsService.error;
error = _labsService.error!;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
@ -182,7 +182,7 @@ class LabsViewModel extends BaseViewModel {
setState(ViewState.Busy);
await _labsService.getAllSpecialLabResult(mrn: patientId);
if (_labsService.hasError) {
error = _labsService.error;
error = _labsService.error!;
setState(ViewState.Error);
} else
setState(ViewState.Idle);

@ -323,7 +323,7 @@ class PatientViewModel extends BaseViewModel {
await _patientService.getNursingProgressNote(requestModel);
if (_patientService.hasError) {
error = _patientService.error;
error = _patientService.error!;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
@ -337,7 +337,7 @@ class PatientViewModel extends BaseViewModel {
await _patientService.getDiagnosisForInPatient(requestModel);
if (_patientService.hasError) {
error = _patientService.error;
error = _patientService.error!;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
@ -362,7 +362,7 @@ class PatientViewModel extends BaseViewModel {
setupID: "010266");
await _patientService.getDiabeticChartValues(requestModel);
if (_patientService.hasError) {
error = _patientService.error;
error = _patientService.error!;
if (isLocalBusy)
setState(ViewState.ErrorLocal);
else

@ -21,7 +21,7 @@ class PendingOrdersViewModel extends BaseViewModel {
await _pendingOrderService.getPendingOrders(
patientId: patientId, admissionNo: admissionNo);
if (_pendingOrderService.hasError) {
error = _pendingOrderService.error;
error = _pendingOrderService.error!;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
@ -34,7 +34,7 @@ class PendingOrdersViewModel extends BaseViewModel {
await _pendingOrderService.getAdmissionOrders(
patientId: patientId, admissionNo: admissionNo);
if (_pendingOrderService.hasError) {
error = _pendingOrderService.error;
error = _pendingOrderService.error!;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);

@ -256,7 +256,7 @@ class PrescriptionViewModel extends BaseViewModel {
setState(ViewState.Busy);
await _prescriptionsService.getMedicationForInPatient(patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
error = _prescriptionsService.error!;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);

@ -132,7 +132,7 @@ class PrescriptionsViewModel extends BaseViewModel {
getMedicationForInPatient(PatiantInformtion patient) async {
await _prescriptionsService.getMedicationForInPatient(patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
error = _prescriptionsService.error!;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);

@ -21,7 +21,7 @@ class DischargeSummaryViewModel extends BaseViewModel {
setState(ViewState.Busy);
await _dischargeSummaryService.getPendingDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel);
if (_dischargeSummaryService.hasError) {
error = _dischargeSummaryService.error;
error = _dischargeSummaryService.error!;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);

@ -23,7 +23,7 @@ class OperationReportViewModel extends BaseViewModel {
setState(ViewState.Busy);
await _operationReportService.getReservations(patientId: patientId);
if (_operationReportService.hasError) {
error = _operationReportService.error;
error = _operationReportService.error!;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
@ -36,7 +36,7 @@ class OperationReportViewModel extends BaseViewModel {
GetOperationDetailsRequestModel getOperationReportRequestModel = GetOperationDetailsRequestModel(reservationNo:reservation.oTReservationID, patientID: reservation.patientID, setupID: "010266" );
await _operationReportService.getOperationReportDetails(getOperationReportRequestModel:getOperationReportRequestModel);
if (_operationReportService.hasError) {
error = _operationReportService.error;
error = _operationReportService.error!;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
@ -51,7 +51,7 @@ class OperationReportViewModel extends BaseViewModel {
setState(ViewState.BusyLocal);
await _operationReportService.updateOperationReport(createUpdateOperationReport);
if (_operationReportService.hasError) {
error = _operationReportService.error;
error = _operationReportService.error!;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);

@ -98,7 +98,7 @@ class SickLeaveViewModel extends BaseViewModel {
final results = await Future.wait(services);
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
error = _sickLeaveService.error!;
// if (isLocalBusy)
setState(ViewState.ErrorLocal);
// else
@ -112,7 +112,7 @@ class SickLeaveViewModel extends BaseViewModel {
setState(ViewState.Busy);
await _sickLeaveService.getSickLeaveDoctor(patientMRN);
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
error = _sickLeaveService.error!;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);

@ -13,7 +13,7 @@ class ProfileMedicalInfoWidgetSearch extends StatefulWidget {
final PatiantInformtion patient;
final String patientType;
final String? arrivalType;
final bool? isInpatient;
final bool isInpatient;
final bool? isDischargedPatient;
ProfileMedicalInfoWidgetSearch(
@ -23,7 +23,7 @@ class ProfileMedicalInfoWidgetSearch extends StatefulWidget {
this.arrivalType,
required this.from,
required this.to,
this.isInpatient,
this.isInpatient = false,
this.isDischargedPatient});
@override
@ -62,22 +62,21 @@ class _ProfileMedicalInfoWidgetSearchState extends State<ProfileMedicalInfoWidge
crossAxisCount: 3,
children: [
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs,
patient: widget.patient,
patientType: widget.patientType,
arrivalType: widget.arrivalType??"",
from: widget.from,
to: widget.to,
nameLine1: TranslationBase.of(context).vital??'',
nameLine2: TranslationBase.of(context).signs??'',
route: VITAL_SIGN_DETAILS,
icon: 'patient/vital_signs.png'),
// if (selectedPatientType != 7)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
patient: widget.patient,
patientType: widget.patientType,
arrivalType: widget.arrivalType??"",
route: HEALTH_SUMMARY,
nameLine1:
"Health", //TranslationBase.of(context).medicalReport,
@ -85,128 +84,128 @@ class _ProfileMedicalInfoWidgetSearchState extends State<ProfileMedicalInfoWidge
"Summary", //TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
patient: widget.patient,
patientType: widget.patientType,
arrivalType: widget.arrivalType??"",
route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
nameLine1: TranslationBase.of(context).lab??'',
nameLine2: TranslationBase.of(context).result??'',
icon: 'patient/lab_results.png'),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInPatient: isInpatient,
patient: widget.patient,
patientType: widget.patientType,
arrivalType: widget.arrivalType??"",
isInPatient: widget.isInpatient,
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
nameLine1: TranslationBase.of(context).radiology??'',
nameLine2: TranslationBase.of(context).service??'',
icon: 'patient/health_summary.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
patient: widget.patient,
patientType: widget.patientType,
arrivalType: widget.arrivalType??"",
route: PATIENT_ECG,
nameLine1: TranslationBase.of(context).patient,
nameLine1: TranslationBase.of(context).patient??'',
nameLine2: "ECG",
icon: 'patient/patient_sick_leave.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
patient: widget.patient,
patientType: widget.patientType,
arrivalType: widget.arrivalType??"",
route: ORDER_PRESCRIPTION_NEW,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription,
nameLine1: TranslationBase.of(context).orders??'',
nameLine2: TranslationBase.of(context).prescription??'',
icon: 'patient/order_prescription.png'),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
patient: widget.patient,
patientType: widget.patientType,
arrivalType: widget.arrivalType??"",
route: ORDER_PROCEDURE,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).procedures,
nameLine1: TranslationBase.of(context).orders??'',
nameLine2: TranslationBase.of(context).procedures??'',
icon: 'patient/Order_Procedures.png'),
//if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
patient: widget.patient,
patientType: widget.patientType,
arrivalType: widget.arrivalType??"",
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service,
nameLine1: TranslationBase.of(context).insurance??'',
nameLine2: TranslationBase.of(context).service??'',
icon: 'patient/vital_signs.png'),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
patient: widget.patient,
patientType: widget.patientType,
arrivalType: widget.arrivalType??"",
route: ADD_SICKLEAVE,
nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave,
nameLine1: TranslationBase.of(context).patientSick??'',
nameLine2: TranslationBase.of(context).leave??'',
icon: 'patient/patient_sick_leave.png'),
if (patient.appointmentNo != null &&
patient.appointmentNo != 0)
if (widget.patient.appointmentNo != null &&
widget.patient.appointmentNo != 0)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
patient: widget.patient,
patientType: widget.patientType,
arrivalType: widget.arrivalType??"",
route: PATIENT_UCAF_REQUEST,
isDisable:
patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf,
widget.patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).patient??'',
nameLine2: TranslationBase.of(context).ucaf??'',
icon: 'patient/ucaf.png'),
if (patient.appointmentNo != null &&
patient.appointmentNo != 0)
if (widget.patient.appointmentNo != null &&
widget.patient.appointmentNo != 0)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
patient: widget.patient,
patientType: widget.patientType,
arrivalType: widget.arrivalType??"",
route: REFER_PATIENT_TO_DOCTOR,
isDisable:
patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient,
widget.patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).referral??'',
nameLine2: TranslationBase.of(context).patient??'',
icon: 'patient/refer_patient.png'),
if (patient.appointmentNo != null &&
patient.appointmentNo != 0)
if (widget.patient.appointmentNo != null &&
widget.patient.appointmentNo != 0)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
patient: widget.patient,
patientType: widget.patientType,
arrivalType: widget.arrivalType??"",
route: PATIENT_ADMISSION_REQUEST,
isDisable:
patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request,
widget.patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).admission??'',
nameLine2: TranslationBase.of(context).request??'',
icon: 'patient/admission_req.png'),
if (isInpatient)
if (widget.isInpatient)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
patient: widget.patient,
patientType: widget.patientType,
arrivalType: widget.arrivalType??"",
route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
nameLine1: TranslationBase.of(context).progress??'',
nameLine2: TranslationBase.of(context).note??'',
icon: 'patient/Progress_notes.png'),
if (isInpatient)
if (widget.isInpatient)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
patient: widget.patient,
patientType: widget.patientType,
arrivalType: widget.arrivalType??"",
route: ORDER_NOTE,
nameLine1: "Order", //"Text",
nameLine2: "Sheet",

Loading…
Cancel
Save