|
|
|
|
@ -125,32 +125,50 @@ class PrescriptionsService extends BaseService {
|
|
|
|
|
isDentalAllowedBackend: false,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Future sendPrescriptionEmail(String appointmentDate, int patientID, String clinicName, String doctorName, int doctorID, int projectID, bool isInOutPatient, bool isDownload) async {
|
|
|
|
|
_requestSendPrescriptionEmail.listPrescriptions = prescriptionReportList;
|
|
|
|
|
_requestSendPrescriptionEmail.listPrescriptionsINP = prescriptionReportListINP;
|
|
|
|
|
_requestSendPrescriptionEmail.appointmentDate = appointmentDate;
|
|
|
|
|
_requestSendPrescriptionEmail.patientID = patientID;
|
|
|
|
|
_requestSendPrescriptionEmail.clinicName = clinicName;
|
|
|
|
|
_requestSendPrescriptionEmail.doctorName = doctorName;
|
|
|
|
|
_requestSendPrescriptionEmail.projectID = projectID;
|
|
|
|
|
_requestSendPrescriptionEmail.to = user.emailAddress;
|
|
|
|
|
_requestSendPrescriptionEmail.dateofBirth = user.dateofBirth;
|
|
|
|
|
_requestSendPrescriptionEmail.patientIditificationNum = user.patientIdentificationNo;
|
|
|
|
|
_requestSendPrescriptionEmail.patientMobileNumber = user.mobileNumber;
|
|
|
|
|
_requestSendPrescriptionEmail.doctorID = doctorID;
|
|
|
|
|
_requestSendPrescriptionEmail.patientName = user.firstName! + " " + user.lastName!;
|
|
|
|
|
_requestSendPrescriptionEmail.setupID = user.setupID;
|
|
|
|
|
_requestSendPrescriptionEmail.to = user.emailAddress;
|
|
|
|
|
_requestSendPrescriptionEmail.isDownload = isDownload;
|
|
|
|
|
// Future sendPrescriptionEmail(String appointmentNo, String setupID, String appointmentDate, int episodeId, int patientID, String clinicName, String doctorName, int doctorID, int projectID, bool isInOutPatient, bool isDownload) async {
|
|
|
|
|
Future sendPrescriptionEmail(Prescriptions prescriptions, bool isDownload) async {
|
|
|
|
|
// _requestSendPrescriptionEmail.listPrescriptions = prescriptionReportList;
|
|
|
|
|
// _requestSendPrescriptionEmail.listPrescriptionsINP = prescriptionReportListINP;
|
|
|
|
|
// _requestSendPrescriptionEmail.appointmentDate = appointmentDate;
|
|
|
|
|
// _requestSendPrescriptionEmail.patientID = patientID;
|
|
|
|
|
// _requestSendPrescriptionEmail.clinicName = clinicName;
|
|
|
|
|
// _requestSendPrescriptionEmail.doctorName = doctorName;
|
|
|
|
|
// _requestSendPrescriptionEmail.projectID = projectID;
|
|
|
|
|
// _requestSendPrescriptionEmail.to = user.emailAddress;
|
|
|
|
|
// _requestSendPrescriptionEmail.dateofBirth = user.dateofBirth;
|
|
|
|
|
// _requestSendPrescriptionEmail.patientIditificationNum = user.patientIdentificationNo;
|
|
|
|
|
// _requestSendPrescriptionEmail.patientMobileNumber = user.mobileNumber;
|
|
|
|
|
// _requestSendPrescriptionEmail.doctorID = doctorID;
|
|
|
|
|
// _requestSendPrescriptionEmail.patientName = user.firstName! + " " + user.lastName!;
|
|
|
|
|
// _requestSendPrescriptionEmail.setupID = user.setupID;
|
|
|
|
|
// _requestSendPrescriptionEmail.to = user.emailAddress;
|
|
|
|
|
// _requestSendPrescriptionEmail.isDownload = isDownload;
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> mapDevice = {
|
|
|
|
|
"AppointmentNo": prescriptions.appointmentNo,
|
|
|
|
|
"SetupID": prescriptions.setupID,
|
|
|
|
|
"EpisodeNo": prescriptions.episodeID,
|
|
|
|
|
"ClinicID": prescriptions.clinicID,
|
|
|
|
|
"ProjectID": prescriptions.projectID,
|
|
|
|
|
"DischargeNo": prescriptions.dischargeNo,
|
|
|
|
|
"IsDownload": true,
|
|
|
|
|
"To": user.emailAddress,
|
|
|
|
|
// "To": "amjad.haroon@cloudsolutions.com.sa",
|
|
|
|
|
"ClinicName": prescriptions.clinicDescription,
|
|
|
|
|
"DoctorName": prescriptions.doctorName,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
hasError = false;
|
|
|
|
|
await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) {
|
|
|
|
|
// await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) {
|
|
|
|
|
await baseAppClient.post(SEND_PRESCRIPTION_EMAIL_NEW, onSuccess: (response, statusCode) {
|
|
|
|
|
if (isDownload) {
|
|
|
|
|
prescriptionReportPDF = response["Base64Data"];
|
|
|
|
|
}
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
hasError = true;
|
|
|
|
|
super.error = error;
|
|
|
|
|
}, body: _requestSendPrescriptionEmail.toJson());
|
|
|
|
|
// }, body: _requestSendPrescriptionEmail.toJson());
|
|
|
|
|
}, body: mapDevice);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RequestGetListPharmacyForPrescriptions requestGetListPharmacyForPrescriptions = RequestGetListPharmacyForPrescriptions(
|
|
|
|
|
|