|
|
|
|
@ -151,6 +151,8 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
|
|
|
|
|
{required int projectID, required int clinicID, required String appointmentNo, required bool isLiveCareAppointment}) async {
|
|
|
|
|
Map<String, dynamic> mapRequest = {"ProjectID": projectID, "ClinicID": clinicID, "AppointmentNo": appointmentNo, "IsActiveAppointment": true, "IsForLiveCare": isLiveCareAppointment};
|
|
|
|
|
|
|
|
|
|
late PatientAppointmentShareResponseModel patientShareObj;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
GenericApiModel<PatientAppointmentShareResponseModel>? apiResponse;
|
|
|
|
|
Failure? failure;
|
|
|
|
|
@ -163,15 +165,20 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
|
|
|
|
|
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
|
|
|
|
|
try {
|
|
|
|
|
final list = response['OnlineCheckInAppointments'];
|
|
|
|
|
if (list == null || list.isEmpty) {
|
|
|
|
|
throw Exception("patient share list is empty");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final patientShareObj = PatientAppointmentShareResponseModel.fromJson(list[0]);
|
|
|
|
|
patientShareObj = (list == null || list.isEmpty) ? PatientAppointmentShareResponseModel() : PatientAppointmentShareResponseModel.fromJson(list[0]);
|
|
|
|
|
patientShareObj.isCash = response["IsCash"];
|
|
|
|
|
patientShareObj.isEligible = response["IsEligible"];
|
|
|
|
|
patientShareObj.isInsured = response["IsInsured"];
|
|
|
|
|
|
|
|
|
|
// if (list == null || list.isEmpty) {
|
|
|
|
|
// throw Exception("patient share list is empty");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// final patientShareObj = PatientAppointmentShareResponseModel.fromJson(list[0]);
|
|
|
|
|
// patientShareObj.isCash = response["IsCash"];
|
|
|
|
|
// patientShareObj.isEligible = response["IsEligible"];
|
|
|
|
|
// patientShareObj.isInsured = response["IsInsured"];
|
|
|
|
|
|
|
|
|
|
apiResponse = GenericApiModel<PatientAppointmentShareResponseModel>(
|
|
|
|
|
messageStatus: messageStatus,
|
|
|
|
|
statusCode: statusCode,
|
|
|
|
|
|