You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
|
|
|
|
|
|
|
|
|
|
import '../../locator.dart';
|
|
|
|
|
|
|
|
|
|
class UcafViewModel extends BaseViewModel {
|
|
|
|
|
|
|
|
|
|
UcafService _ucafService = locator<UcafService>();
|
|
|
|
|
|
|
|
|
|
List<GetChiefComplaintResModel> get patientChiefComplaintList => _ucafService.patientChiefComplaintList;
|
|
|
|
|
VitalSignData get patientVitalSigns => _ucafService.patientVitalSigns;
|
|
|
|
|
|
|
|
|
|
Future getUCAFData(PatiantInformtion patient) async {
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
await _ucafService.getPatientVitalSign(patient);
|
|
|
|
|
await _ucafService.getPatientChiefComplaint(patient);
|
|
|
|
|
|
|
|
|
|
if (_ucafService.hasError) {
|
|
|
|
|
error = _ucafService.error;
|
|
|
|
|
setState(ViewState.Error);
|
|
|
|
|
} else {
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|