Prescription download changes

pull/180/head
haroon amjad 2 months ago
parent 85ccf41d04
commit 66ff6ed8b6

@ -83,6 +83,7 @@ var PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async';
var GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; var GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
var GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; var GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
var SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; var SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail';
var SEND_PRESCRIPTION_EMAIL_NEW = 'Services/Notifications.svc/REST/SendPrescriptionEmail_New';
var GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; var GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
///Lab Order ///Lab Order

@ -581,7 +581,8 @@ class AuthenticationViewModel extends ChangeNotifier {
if (!_appState.getIsChildLoggedIn) { if (!_appState.getIsChildLoggedIn) {
await medicalVm.getFamilyFiles(status: 0); await medicalVm.getFamilyFiles(status: 0);
// await medicalVm.getAllPendingRecordsByResponseId(); // await medicalVm.getAllPendingRecordsByResponseId();
_navigationService.replaceAllRoutesAndNavigateToLanding(); // _navigationService.replaceAllRoutesAndNavigateToLanding();
_navigationService.popUntilNamed(AppRoutes.landingScreen);
} }
} else { } else {
if (activation.list != null && activation.list!.isNotEmpty) { if (activation.list != null && activation.list!.isNotEmpty) {

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

@ -184,9 +184,9 @@ class AppointmentCard extends StatelessWidget {
AppCustomChipWidget( AppCustomChipWidget(
labelText: isLoading labelText: isLoading
? 'Olaya' ? 'Olaya'
: patientAppointmentHistoryResponseModel.projectName!.length > 15 : (patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital").length > 15
? '${patientAppointmentHistoryResponseModel.projectName!.substring(0, 15)}...' ? '${(patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital").substring(0, 15)}...'
: patientAppointmentHistoryResponseModel.projectName!) : patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital")
.toShimmer2(isShow: isLoading), .toShimmer2(isShow: isLoading),
AppCustomChipWidget( AppCustomChipWidget(
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w),

@ -139,7 +139,7 @@ class _PrescriptionDetailPageState extends State<PrescriptionDetailPage> {
labelText: LocaleKeys.ratingValue.tr(namedArgs: {'rating': widget.prescriptionsResponseModel.decimalDoctorRate.toString()}, context: context), labelText: LocaleKeys.ratingValue.tr(namedArgs: {'rating': widget.prescriptionsResponseModel.decimalDoctorRate.toString()}, context: context),
), ),
AppCustomChipWidget( AppCustomChipWidget(
labelText: widget.prescriptionsResponseModel.name!, labelText: widget.prescriptionsResponseModel.name ?? "",
), ),
], ],
), ),

@ -165,7 +165,7 @@ class _PrescriptionsListPageState extends State<PrescriptionsListPage> {
], ],
), ),
SizedBox(height: 8.h), SizedBox(height: 8.h),
model.patientPrescriptionOrdersViewList[index].filterName!.toText16(isBold: true) (model.patientPrescriptionOrdersViewList[index].filterName ?? "").toText16(isBold: true)
], ],
), ),
), ),
@ -217,7 +217,7 @@ class _PrescriptionsListPageState extends State<PrescriptionsListPage> {
labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(prescription.appointmentDate), false), labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(prescription.appointmentDate), false),
), ),
AppCustomChipWidget( AppCustomChipWidget(
labelText: model.isSortByClinic ? prescription.name! : prescription.clinicDescription!, labelText: model.isSortByClinic ? prescription.name ?? "" : prescription.clinicDescription!,
), ),
], ],
), ),

Loading…
Cancel
Save