|
|
|
|
@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/medical_report/MedicalReportPage.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
|
|
|
|
|
@ -26,12 +27,13 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context);
|
|
|
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
|
PatientMedicalReportViewModel patientMedicalReportViewModel = routeArgs['model'];
|
|
|
|
|
PatiantInformtion patient = routeArgs['patient'];
|
|
|
|
|
MedicalReportStatus status = routeArgs['status'];
|
|
|
|
|
MedicalReportStatus status = routeArgs['status'] as MedicalReportStatus;
|
|
|
|
|
MedicalReportModel medicalReport = routeArgs.containsKey("medicalReport") ? routeArgs['medicalReport'] : null;
|
|
|
|
|
|
|
|
|
|
return BaseView<PatientMedicalReportViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getMedicalReportTemplate(),
|
|
|
|
|
onModelReady: (_) => patientMedicalReportViewModel.getMedicalReportTemplate(),
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
@ -99,6 +101,9 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
|
|
|
|
|
medicalReport != null ? medicalReport.lineItemNo : null,
|
|
|
|
|
medicalReport != null ? medicalReport.invoiceNo : null)
|
|
|
|
|
: model.addMedicalReport(patient, txtOfMedicalReport);
|
|
|
|
|
//model.getMedicalReportList(patient);
|
|
|
|
|
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
@ -123,6 +128,7 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.verifyMedicalReport(patient, medicalReport);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
|