Prescription download changes

pull/180/head
haroon amjad 1 week 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_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
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';
///Lab Order

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

@ -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;

@ -184,9 +184,9 @@ class AppointmentCard extends StatelessWidget {
AppCustomChipWidget(
labelText: isLoading
? 'Olaya'
: patientAppointmentHistoryResponseModel.projectName!.length > 15
? '${patientAppointmentHistoryResponseModel.projectName!.substring(0, 15)}...'
: patientAppointmentHistoryResponseModel.projectName!)
: (patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital").length > 15
? '${(patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital").substring(0, 15)}...'
: patientAppointmentHistoryResponseModel.projectName ?? "Habib Hospital")
.toShimmer2(isShow: isLoading),
AppCustomChipWidget(
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),
),
AppCustomChipWidget(
labelText: widget.prescriptionsResponseModel.name!,
labelText: widget.prescriptionsResponseModel.name ?? "",
),
],
),

@ -165,7 +165,7 @@ class _PrescriptionsListPageState extends State<PrescriptionsListPage> {
],
),
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),
),
AppCustomChipWidget(
labelText: model.isSortByClinic ? prescription.name! : prescription.clinicDescription!,
labelText: model.isSortByClinic ? prescription.name ?? "" : prescription.clinicDescription!,
),
],
),

Loading…
Cancel
Save