|
|
|
|
@ -2,13 +2,14 @@ import 'package:diplomaticquarterapp/config/config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/InPatientServices/get_admission_info_response_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Request.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
import '../../models/InPatientServices/get_admission_info_response_model.dart';
|
|
|
|
|
import '../../uitl/date_uitl.dart';
|
|
|
|
|
|
|
|
|
|
class ClinicListService extends BaseService {
|
|
|
|
|
AppSharedPreferences sharedPref = AppSharedPreferences();
|
|
|
|
|
AppGlobal appGlobal = new AppGlobal();
|
|
|
|
|
@ -16,8 +17,8 @@ class ClinicListService extends BaseService {
|
|
|
|
|
AuthenticatedUser authUser = new AuthenticatedUser();
|
|
|
|
|
AuthProvider authProvider = new AuthProvider();
|
|
|
|
|
|
|
|
|
|
late double lat;
|
|
|
|
|
late double long;
|
|
|
|
|
double? lat;
|
|
|
|
|
double? long;
|
|
|
|
|
|
|
|
|
|
Future<Map> getClinicsList(context) async {
|
|
|
|
|
Map<String, dynamic> request = {};
|
|
|
|
|
@ -63,7 +64,7 @@ class ClinicListService extends BaseService {
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> getChiefComplaintsList(int clinicID, int projectID, int languageID, bool isContinueDentalPlan, BuildContext context, {doctorId}) async {
|
|
|
|
|
Future<Map> getChiefComplaintsList(int clinicID, int projectID, int languageID, BuildContext context, {doctorId}) async {
|
|
|
|
|
//Utils.showProgressDialog(context);
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
|
|
|
|
|
@ -88,8 +89,8 @@ class ClinicListService extends BaseService {
|
|
|
|
|
"SessionID": null,
|
|
|
|
|
"isDentalAllowedBackend": true,
|
|
|
|
|
"DeviceTypeID": 1,
|
|
|
|
|
// "PatientID": 1,
|
|
|
|
|
"ContinueDentalPlan": isContinueDentalPlan,
|
|
|
|
|
"PatientID": 1,
|
|
|
|
|
"ContinueDentalPlan": true,
|
|
|
|
|
"IsSearchAppointmnetByClinicID": false,
|
|
|
|
|
"DateofBirth": authUser.dateofBirth
|
|
|
|
|
};
|
|
|
|
|
@ -155,10 +156,75 @@ class ClinicListService extends BaseService {
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
Future<Map> getInPatientAdvancePaymentHistory(int projectID, int admissionNo, int admissionReqNo, context) async {
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
request = {"ProjectID": projectID, "AdmissionNo": admissionNo, "AdmissionReqNo": admissionReqNo};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(GET_INPATIENT_PAID_ADVANCE_PAYMENT, onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request, isAllowAny: true);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> insertInPatientOrder(
|
|
|
|
|
GetAdmissionInfoResponseModel getAdmissionInfoResponseModel, int typeID, String patientName, String patientNameAR, String patientMobileNo, String comments, context) async {
|
|
|
|
|
Future<Map> getInPatientPaymentLink(int projectID, int admissionNo, int orderID, String name, String email, num amount, String nationalID, int clinicID, context) async {
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
// request = {"ProjectID": projectID, "AdmissionReqNo": admissionReqNo, "AdmissionNo": admissionNo};
|
|
|
|
|
|
|
|
|
|
request = {
|
|
|
|
|
"ProjectID": projectID,
|
|
|
|
|
"ClientOrderID": orderID,
|
|
|
|
|
"OrderDescription": "InPatient Advance Payment",
|
|
|
|
|
"CustomerName": name,
|
|
|
|
|
"CustomerEmail": email,
|
|
|
|
|
"Amount": amount,
|
|
|
|
|
"IsPaid": 0,
|
|
|
|
|
"AppointmentID": admissionNo.toString(),
|
|
|
|
|
"PaymentOption": "0",
|
|
|
|
|
"PaymentReferenceNumber": admissionNo,
|
|
|
|
|
"SourceType": "1",
|
|
|
|
|
"NationalID": nationalID,
|
|
|
|
|
"ClinicID": clinicID,
|
|
|
|
|
"createdBy": 102
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(GET_INPATIENT_ADVANCE_PAYMENT_LINK, onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request, isAllowAny: true);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
Future<Map> submitBirthNotification(num motherMRN, int projectID, String fatherNameAR, String fatherNameEN, String babyNameAR, String babyNameEN, String contactNum, String idImage, context) async {
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
request = {
|
|
|
|
|
"ProjectID": projectID,
|
|
|
|
|
"mothermrn": motherMRN,
|
|
|
|
|
"fatherName": fatherNameEN,
|
|
|
|
|
"fatherNameAr": fatherNameAR,
|
|
|
|
|
"babyName": babyNameEN,
|
|
|
|
|
"babyNameAr": babyNameEN,
|
|
|
|
|
"contactNumber": contactNum,
|
|
|
|
|
"iDImage": idImage,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(SAVE_BIRTH_NOTIFICATION, onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request, isAllowAny: true);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> insertInPatientOrder(GetAdmissionInfoResponseModel getAdmissionInfoResponseModel, int typeID, String patientName, String patientNameAR, String patientMobileNo, String comments,
|
|
|
|
|
context) async {
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
request = {
|
|
|
|
|
"ProjectID": getAdmissionInfoResponseModel.projectID,
|
|
|
|
|
@ -183,38 +249,26 @@ class ClinicListService extends BaseService {
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> getBirthNotification(num motherMRN, context) async {
|
|
|
|
|
Future<Map> getGeneralInstructions(int projectID, context) async {
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
request = {
|
|
|
|
|
"mothermrn": motherMRN,
|
|
|
|
|
};
|
|
|
|
|
request = {"ProjectID": projectID};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(GET_BIRTH_NOTIFICATION, onSuccess: (response, statusCode) async {
|
|
|
|
|
await baseAppClient.post(GET_GENERAL_INSTRUCTIONS, onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request, isAllowAny: true);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> submitBirthNotification(num motherMRN, int projectID, String fatherNameAR, String fatherNameEN, String babyNameAR, String babyNameEN, String contactNum, String idImage, context) async {
|
|
|
|
|
Future<Map> getMedicalInstructions(int projectID, context) async {
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
request = {
|
|
|
|
|
"ProjectID": projectID,
|
|
|
|
|
"mothermrn": motherMRN,
|
|
|
|
|
"fatherName": fatherNameEN,
|
|
|
|
|
"fatherNameAr": fatherNameAR,
|
|
|
|
|
"babyName": babyNameEN,
|
|
|
|
|
"babyNameAr": babyNameAR,
|
|
|
|
|
"contactNumber": contactNum,
|
|
|
|
|
"iDImage": idImage,
|
|
|
|
|
};
|
|
|
|
|
request = {"ProjectID": projectID};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(SAVE_BIRTH_NOTIFICATION, onSuccess: (response, statusCode) async {
|
|
|
|
|
await baseAppClient.post(GET_MEDICAL_INSTRUCTIONS, onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
throw error;
|
|
|
|
|
@ -222,13 +276,13 @@ class ClinicListService extends BaseService {
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> getAdmittedPatientDetails(int patientID, int projectID, int admissionNo, int buildingID, int floorID, int nursingStationID, context) async {
|
|
|
|
|
Future<Map> getInPatientAdvancePaymentRequests(int projectID, int admissionNo, int admissionReqNo, context) async {
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
request = {"ProjectID": projectID, "PatientID": patientID, "AdmissionNo": admissionNo, "BuildingID": buildingID, "FloorID": floorID, "NursingStationID": nursingStationID};
|
|
|
|
|
request = {"ProjectID": projectID, "AdmissionReqNo": admissionReqNo, "AdmissionNo": admissionNo};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(GET_ADMITTED_PATIENTS, onSuccess: (response, statusCode) async {
|
|
|
|
|
await baseAppClient.post(GET_INPATIENT_ADVANCE_PAYMENT_REQUESTS, onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
throw error;
|
|
|
|
|
@ -236,13 +290,15 @@ class ClinicListService extends BaseService {
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> getInPatientAdvancePaymentHistory(int projectID, int admissionNo, int admissionReqNo, context) async {
|
|
|
|
|
Future<Map> getBirthNotification(num motherMRN, context) async {
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
request = {"ProjectID": projectID, "AdmissionNo": admissionNo, "AdmissionReqNo": admissionReqNo};
|
|
|
|
|
request = {
|
|
|
|
|
"mothermrn": motherMRN,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(GET_INPATIENT_PAID_ADVANCE_PAYMENT, onSuccess: (response, statusCode) async {
|
|
|
|
|
await baseAppClient.post(GET_BIRTH_NOTIFICATION, onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
throw error;
|
|
|
|
|
@ -250,6 +306,19 @@ class ClinicListService extends BaseService {
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
Future<Map> getCurrentWeekIDAndDay(BuildContext context) async {
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
await baseAppClient.get(GET_CURRENT_WEEKID_WEEKDAY, isExternal: false, isRCService: false, onSuccess: (response, statusCode) async {
|
|
|
|
|
@ -331,42 +400,20 @@ class ClinicListService extends BaseService {
|
|
|
|
|
}, body: request, isAllowAny: true);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> getDischargeMedicationOrder(GetAdmissionInfoResponseModel getAdmissionInfoResponseModel) async {
|
|
|
|
|
Future<Map> checkIfInPatientAPI(context) async {
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
request = {
|
|
|
|
|
"ProjectID": getAdmissionInfoResponseModel.projectID,
|
|
|
|
|
"ClinicID": getAdmissionInfoResponseModel.clinicID,
|
|
|
|
|
"DoctorID": getAdmissionInfoResponseModel.doctorID,
|
|
|
|
|
"AdmissionNo": getAdmissionInfoResponseModel.admissionNo
|
|
|
|
|
"IsActiveAppointment": false,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// request = {
|
|
|
|
|
// "ProjectID": 12,
|
|
|
|
|
// "VersionID": 10.8,
|
|
|
|
|
// "Channel": 3,
|
|
|
|
|
// "LanguageID": 2,
|
|
|
|
|
// "IPAdress": "10.20.10.20",
|
|
|
|
|
// "generalid": "Cs2020@2016\$2958",
|
|
|
|
|
// "DeviceTypeID": 2,
|
|
|
|
|
// "PatientType": 1,
|
|
|
|
|
// "PatientTypeID": 1,
|
|
|
|
|
// "TokenID": "@dm!n",
|
|
|
|
|
// "PatientID": 869588,
|
|
|
|
|
// "PatientOutSA": 0,
|
|
|
|
|
// "SessionID": "rVuK3nzN4UKN0SW95un0jQ==",
|
|
|
|
|
// "ClinicID": 2,
|
|
|
|
|
// "DoctorID": "7600",
|
|
|
|
|
// "AdmissionNo": 2011001258
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(INPATIENT_DISCHARGE_MEDICATIONS, onSuccess: (response, statusCode) async {
|
|
|
|
|
await baseAppClient.post(CHECK_IF_PATIENT_ADMITTED, onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request, isAllowAny: true);
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|