|
|
|
|
@ -167,29 +167,44 @@ class PrescriptionsRepoImp implements PrescriptionsRepo {
|
|
|
|
|
@override
|
|
|
|
|
Future<Either<Failure, GenericApiModel>> getPrescriptionPDF(
|
|
|
|
|
{required PatientPrescriptionsResponseModel prescriptionsResponseModel, required List<PrescriptionDetailResponseModel> prescriptionDetailsList}) async {
|
|
|
|
|
// Map<String, dynamic> mapDevice = {
|
|
|
|
|
// "AppointmentDate": prescriptionsResponseModel.appointmentDate,
|
|
|
|
|
// "ClinicName": prescriptionsResponseModel.clinicDescription,
|
|
|
|
|
// "DoctorName": prescriptionsResponseModel.doctorName,
|
|
|
|
|
// "ProjectID": prescriptionsResponseModel.projectID,
|
|
|
|
|
// "DoctorID": prescriptionsResponseModel.doctorID,
|
|
|
|
|
// "ClinicID": prescriptionsResponseModel.clinicID,
|
|
|
|
|
// "DateofBirth": Utils.appState.getAuthenticatedUser()!.dateofBirth,
|
|
|
|
|
// "ListPrescriptions": prescriptionDetailsList,
|
|
|
|
|
// "PatientIditificationNum": Utils.appState.getAuthenticatedUser()!.patientIdentificationNo,
|
|
|
|
|
// "PatientMobileNumber": Utils.appState.getAuthenticatedUser()!.mobileNumber,
|
|
|
|
|
// "PatientName": "${Utils.appState.getAuthenticatedUser()!.firstName!} ${Utils.appState.getAuthenticatedUser()!.lastName!}",
|
|
|
|
|
// "To": Utils.appState.getAuthenticatedUser()!.emailAddress,
|
|
|
|
|
// "SetupID": prescriptionsResponseModel.setupID,
|
|
|
|
|
// "IsDownload": true,
|
|
|
|
|
// "isDentalAllowedBackend": false,
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> mapDevice = {
|
|
|
|
|
"AppointmentDate": prescriptionsResponseModel.appointmentDate,
|
|
|
|
|
"ClinicName": prescriptionsResponseModel.clinicDescription,
|
|
|
|
|
"DoctorName": prescriptionsResponseModel.doctorName,
|
|
|
|
|
"ProjectID": prescriptionsResponseModel.projectID,
|
|
|
|
|
"DoctorID": prescriptionsResponseModel.doctorID,
|
|
|
|
|
"ClinicID": prescriptionsResponseModel.clinicID,
|
|
|
|
|
"DateofBirth": Utils.appState.getAuthenticatedUser()!.dateofBirth,
|
|
|
|
|
"ListPrescriptions": prescriptionDetailsList,
|
|
|
|
|
"PatientIditificationNum": Utils.appState.getAuthenticatedUser()!.patientIdentificationNo,
|
|
|
|
|
"PatientMobileNumber": Utils.appState.getAuthenticatedUser()!.mobileNumber,
|
|
|
|
|
"PatientName": "${Utils.appState.getAuthenticatedUser()!.firstName!} ${Utils.appState.getAuthenticatedUser()!.lastName!}",
|
|
|
|
|
"To": Utils.appState.getAuthenticatedUser()!.emailAddress,
|
|
|
|
|
"AppointmentNo": prescriptionsResponseModel.appointmentNo,
|
|
|
|
|
"SetupID": prescriptionsResponseModel.setupID,
|
|
|
|
|
"EpisodeID": prescriptionsResponseModel.episodeID,
|
|
|
|
|
"ClinicID": prescriptionsResponseModel.clinicID,
|
|
|
|
|
"ProjectID": prescriptionsResponseModel.projectID,
|
|
|
|
|
"DischargeNo": prescriptionsResponseModel.dischargeNo,
|
|
|
|
|
"IsDownload": true,
|
|
|
|
|
"isDentalAllowedBackend": false,
|
|
|
|
|
// "To": Utils.appState.getAuthenticatedUser()!.emailAddress,
|
|
|
|
|
"To": "amjad.haroon@cloudsolutions.com.sa",
|
|
|
|
|
"ClinicName": prescriptionsResponseModel.clinicDescription,
|
|
|
|
|
"DoctorName": prescriptionsResponseModel.doctorName,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
GenericApiModel<dynamic>? apiResponse;
|
|
|
|
|
Failure? failure;
|
|
|
|
|
await apiClient.post(
|
|
|
|
|
SEND_PRESCRIPTION_EMAIL,
|
|
|
|
|
// SEND_PRESCRIPTION_EMAIL,
|
|
|
|
|
SEND_PRESCRIPTION_EMAIL_NEW,
|
|
|
|
|
body: mapDevice,
|
|
|
|
|
onFailure: (error, statusCode, {messageStatus, failureType}) {
|
|
|
|
|
failure = failureType;
|
|
|
|
|
|