|
|
|
|
@ -2,9 +2,11 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/note/note_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/note/update_note_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/service/patient/patient_service.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart';
|
|
|
|
|
@ -17,51 +19,43 @@ import 'base_view_model.dart';
|
|
|
|
|
class PatientViewModel extends BaseViewModel {
|
|
|
|
|
PatientService _patientService = locator<PatientService>();
|
|
|
|
|
|
|
|
|
|
List<VitalSignResModel> get patientVitalSignList =>
|
|
|
|
|
_patientService.patientVitalSignList;
|
|
|
|
|
List<PatiantInformtion> get inPatientList => _patientService.inPatientList;
|
|
|
|
|
|
|
|
|
|
List<VitalSignResModel> get patientVitalSignOrderdSubList =>
|
|
|
|
|
_patientService.patientVitalSignOrderdSubList;
|
|
|
|
|
List<VitalSignResModel> get patientVitalSignList => _patientService.patientVitalSignList;
|
|
|
|
|
|
|
|
|
|
List<LabOrdersResModel> get patientLabResultOrdersList =>
|
|
|
|
|
_patientService.patientLabResultOrdersList;
|
|
|
|
|
List<VitalSignResModel> get patientVitalSignOrderdSubList => _patientService.patientVitalSignOrderdSubList;
|
|
|
|
|
|
|
|
|
|
List<PrescriptionResModel> get patientPrescriptionsList =>
|
|
|
|
|
_patientService.patientPrescriptionsList;
|
|
|
|
|
List<LabOrdersResModel> get patientLabResultOrdersList => _patientService.patientLabResultOrdersList;
|
|
|
|
|
|
|
|
|
|
List<PrescriptionResModel> get patientPrescriptionsList => _patientService.patientPrescriptionsList;
|
|
|
|
|
|
|
|
|
|
List<PrescriptionReportForInPatient> get prescriptionReportForInPatientList =>
|
|
|
|
|
_patientService.prescriptionReportForInPatientList;
|
|
|
|
|
|
|
|
|
|
List<PrescriptionReport> get prescriptionReport =>
|
|
|
|
|
_patientService.prescriptionReport;
|
|
|
|
|
List<PrescriptionReport> get prescriptionReport => _patientService.prescriptionReport;
|
|
|
|
|
|
|
|
|
|
List<RadiologyResModel> get patientRadiologyList =>
|
|
|
|
|
_patientService.patientRadiologyList;
|
|
|
|
|
List<RadiologyResModel> get patientRadiologyList => _patientService.patientRadiologyList;
|
|
|
|
|
|
|
|
|
|
List<LabResult> get labResultList => _patientService.labResultList;
|
|
|
|
|
|
|
|
|
|
get insuranceApporvalsList => _patientService.insuranceApporvalsList;
|
|
|
|
|
|
|
|
|
|
List<NoteModel> get patientProgressNoteList =>
|
|
|
|
|
_patientService.patientProgressNoteList;
|
|
|
|
|
List<NoteModel> get patientProgressNoteList => _patientService.patientProgressNoteList;
|
|
|
|
|
|
|
|
|
|
List<dynamic> get clinicsList => _patientService.clinicsList;
|
|
|
|
|
|
|
|
|
|
List<dynamic> get doctorsList => _patientService.doctorsList;
|
|
|
|
|
|
|
|
|
|
List<dynamic> get referralFrequencyList =>
|
|
|
|
|
_patientService.referalFrequancyList;
|
|
|
|
|
List<dynamic> get referralFrequencyList => _patientService.referalFrequancyList;
|
|
|
|
|
|
|
|
|
|
Future getPatientList(patient, patientType,
|
|
|
|
|
{bool isBusyLocal = false, isView}) async {
|
|
|
|
|
Future getPatientList(patient, patientType, {bool isBusyLocal = false, isView}) async {
|
|
|
|
|
var localRes;
|
|
|
|
|
if (isBusyLocal) {
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
} else {
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
}
|
|
|
|
|
localRes = await _patientService.getPatientList(patient, patientType,
|
|
|
|
|
isView: isView);
|
|
|
|
|
localRes = await _patientService.getPatientList(patient, patientType, isView: isView);
|
|
|
|
|
|
|
|
|
|
if (_patientService.hasError) {
|
|
|
|
|
error = _patientService.error;
|
|
|
|
|
@ -210,16 +204,12 @@ class PatientViewModel extends BaseViewModel {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List getDoctorNameList() {
|
|
|
|
|
var doctorNamelist = _patientService.doctorsList
|
|
|
|
|
.map((value) => value['DoctorName'].toString())
|
|
|
|
|
.toList();
|
|
|
|
|
var doctorNamelist = _patientService.doctorsList.map((value) => value['DoctorName'].toString()).toList();
|
|
|
|
|
return doctorNamelist;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List getClinicNameList() {
|
|
|
|
|
var clinicsNameslist = _patientService.clinicsList
|
|
|
|
|
.map((value) => value['ClinicDescription'].toString())
|
|
|
|
|
.toList();
|
|
|
|
|
var clinicsNameslist = _patientService.clinicsList.map((value) => value['ClinicDescription'].toString()).toList();
|
|
|
|
|
return clinicsNameslist;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -234,9 +224,8 @@ class PatientViewModel extends BaseViewModel {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List getReferralNamesList() {
|
|
|
|
|
var referralNamesList = _patientService.referalFrequancyList
|
|
|
|
|
.map((value) => value['Description'].toString())
|
|
|
|
|
.toList();
|
|
|
|
|
var referralNamesList =
|
|
|
|
|
_patientService.referalFrequancyList.map((value) => value['Description'].toString()).toList();
|
|
|
|
|
return referralNamesList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -281,4 +270,18 @@ class PatientViewModel extends BaseViewModel {
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false}) async {
|
|
|
|
|
await getDoctorProfile();
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
|
|
|
|
|
await _patientService.getInPatient(requestModel, false);
|
|
|
|
|
if (_patientService.hasError) {
|
|
|
|
|
error = _patientService.error;
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else {
|
|
|
|
|
// setDefaultInPatientList();
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|