Meal Plan API integration in progress

merge-update-with-lab-changes
haroon amjad 3 years ago
parent 60d5ba4a9e
commit 9f44b25353

@ -606,6 +606,9 @@ var GET_BIRTH_NOTIFICATION = 'Services/INPs.svc/REST/getBirthNotification_bymoth
var SAVE_BIRTH_NOTIFICATION = 'Services/INPs.svc/REST/SaveBirthNotification';
//Meal Plan APIs
var GET_ADMITTED_PATIENTS = 'Services/MOP.svc/REST/GetAdmittedPatients';
class AppGlobal {
static var context;

@ -1,8 +1,12 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class MealPlanPage extends StatefulWidget {
const MealPlanPage({Key key}) : super(key: key);
@ -12,8 +16,16 @@ class MealPlanPage extends StatefulWidget {
}
class _MealPlanPageState extends State<MealPlanPage> {
ProjectViewModel projectViewModel;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
@ -92,4 +104,16 @@ class _MealPlanPageState extends State<MealPlanPage> {
),
);
}
void getAdmittedPatientDetails() {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getAdmittedPatientDetails(projectViewModel.user.patientID, projectViewModel.inPatientProjectID, projectViewModel.getAdmissionInfoResponseModel.admissionNo, 0, 0, 0, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
// AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
Navigator.of(context).pop();
}).catchError((err) {
print(err);
});
}
}

@ -274,4 +274,26 @@ class ClinicListService extends BaseService {
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getAdmittedPatientDetails(int patientID, int projectID, int admissionNo, int buildingID, int floorID, int nursingStationID, context) async {
Map<String, dynamic> request;
request = {
"ProjectID": projectID,
"PatientID" : patientID,
"AdmissionNo": admissionNo,
"BuildingID" : buildingID,
"FloorID" : floorID,
"NursingStationID": nursingStationID
};
dynamic localRes;
await baseAppClient.post(GET_ADMITTED_PATIENTS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
}

Loading…
Cancel
Save