|
|
|
@ -1,23 +1,20 @@
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/view_state.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/enum/view_state.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/utils.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/bottom_sheet/bottom_sheet_container.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
|
|
|
|
|
|
|
@ -103,11 +100,9 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
|
|
|
|
builder:
|
|
|
|
builder:
|
|
|
|
(BuildContext context, ProcedureViewModel model, Widget child) =>
|
|
|
|
(BuildContext context, ProcedureViewModel model, Widget child) =>
|
|
|
|
AppScaffold(
|
|
|
|
AppScaffold(
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
|
|
|
baseViewModel: model,
|
|
|
|
baseViewModel: model,
|
|
|
|
appBar: PatientSearchHeader(
|
|
|
|
isShowAppBar: true,
|
|
|
|
title: "Update Procedure",
|
|
|
|
appBar: PatientSearchHeader(title: "Update Procedure"),
|
|
|
|
),
|
|
|
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
height: MediaQuery.of(context).size.height * 0.9,
|
|
|
|
height: MediaQuery.of(context).size.height * 0.9,
|
|
|
|
@ -181,10 +176,10 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
|
|
|
|
bottomSheet: CustomBottomSheetContainer(
|
|
|
|
bottomSheet: CustomBottomSheetContainer(
|
|
|
|
label: TranslationBase.of(context).updateProcedure.toUpperCase(),
|
|
|
|
label: TranslationBase.of(context).updateProcedure.toUpperCase(),
|
|
|
|
onTap: () => updateProcedure(
|
|
|
|
onTap: () => updateProcedure(
|
|
|
|
limetNO: widget.limetNo,
|
|
|
|
lineItemNo: widget.limetNo,
|
|
|
|
orderNo: widget.orderNo,
|
|
|
|
orderNo: widget.orderNo,
|
|
|
|
orderType: selectedType.toString(),
|
|
|
|
orderType: selectedType.toString(),
|
|
|
|
categorieId: widget.categoryId,
|
|
|
|
categoryId: widget.categoryId,
|
|
|
|
procedureId: widget.procedureId,
|
|
|
|
procedureId: widget.procedureId,
|
|
|
|
entityList: entityList,
|
|
|
|
entityList: entityList,
|
|
|
|
patient: widget.patient,
|
|
|
|
patient: widget.patient,
|
|
|
|
@ -199,15 +194,15 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
|
|
|
|
updateProcedure(
|
|
|
|
updateProcedure(
|
|
|
|
{ProcedureViewModel model,
|
|
|
|
{ProcedureViewModel model,
|
|
|
|
String remarks,
|
|
|
|
String remarks,
|
|
|
|
int limetNO,
|
|
|
|
int lineItemNo,
|
|
|
|
int orderNo,
|
|
|
|
int orderNo,
|
|
|
|
String newProcedureId,
|
|
|
|
String newProcedureId,
|
|
|
|
String newCategorieId,
|
|
|
|
String newCategoryId,
|
|
|
|
List<EntityList> entityList,
|
|
|
|
List<EntityList> entityList,
|
|
|
|
String orderType,
|
|
|
|
String orderType,
|
|
|
|
String procedureId,
|
|
|
|
String procedureId,
|
|
|
|
PatiantInformtion patient,
|
|
|
|
PatiantInformtion patient,
|
|
|
|
String categorieId}) async {
|
|
|
|
String categoryId}) async {
|
|
|
|
UpdateProcedureRequestModel updateProcedureReqModel =
|
|
|
|
UpdateProcedureRequestModel updateProcedureReqModel =
|
|
|
|
new UpdateProcedureRequestModel();
|
|
|
|
new UpdateProcedureRequestModel();
|
|
|
|
List<Controls> controls = List();
|
|
|
|
List<Controls> controls = List();
|
|
|
|
@ -217,7 +212,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
|
|
|
|
|
|
|
|
|
|
|
|
updateProcedureReqModel.episodeID = patient.episodeNo;
|
|
|
|
updateProcedureReqModel.episodeID = patient.episodeNo;
|
|
|
|
updateProcedureReqModel.patientMRN = patient.patientMRN;
|
|
|
|
updateProcedureReqModel.patientMRN = patient.patientMRN;
|
|
|
|
updateProcedureReqModel.lineItemNo = limetNO;
|
|
|
|
updateProcedureReqModel.lineItemNo = lineItemNo;
|
|
|
|
updateProcedureReqModel.orderNo = orderNo;
|
|
|
|
updateProcedureReqModel.orderNo = orderNo;
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -230,22 +225,23 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
controlsProcedure.procedure = procedureId;
|
|
|
|
controlsProcedure.procedure = procedureId;
|
|
|
|
controlsProcedure.category = '0' + categorieId;
|
|
|
|
controlsProcedure.category = '0' + categoryId;
|
|
|
|
|
|
|
|
|
|
|
|
controlsProcedure.controls = controls;
|
|
|
|
controlsProcedure.controls = controls;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
updateProcedureReqModel.procedureDetail = controlsProcedure;
|
|
|
|
updateProcedureReqModel.procedureDetail = controlsProcedure;
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
await model.updateProcedure(
|
|
|
|
await model.updateProcedure(
|
|
|
|
updateProcedureRequestModel: updateProcedureReqModel,
|
|
|
|
updateProcedureRequestModel: updateProcedureReqModel,
|
|
|
|
mrn: patient.patientMRN);
|
|
|
|
mrn: patient.patientMRN);
|
|
|
|
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
Utils.showErrorToast(model.error);
|
|
|
|
Utils.showErrorToast(model.error);
|
|
|
|
model.getProcedure(mrn: patient.patientMRN);
|
|
|
|
|
|
|
|
} else if (model.state == ViewState.Idle) {
|
|
|
|
} else if (model.state == ViewState.Idle) {
|
|
|
|
DrAppToastMsg.showSuccesToast('procedure has been updated');
|
|
|
|
DrAppToastMsg.showSuccesToast('procedure has been updated');
|
|
|
|
model.getProcedure(mrn: patient.patientMRN);
|
|
|
|
await model.getProcedure(mrn: patient.patientMRN, isLocalBusy: true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|