CR 6204 Lab reports enhancements in progress

merge-update-with-lab-changes
haroon amjad 3 years ago
parent df610690d5
commit 34d3cf2945

@ -25,6 +25,7 @@ class RequestSendLabReportEmail {
String invoiceNo; String invoiceNo;
String orderDate; String orderDate;
String orderNo; String orderNo;
bool isDownload;
RequestSendLabReportEmail( RequestSendLabReportEmail(
{this.versionID, {this.versionID,
@ -52,7 +53,8 @@ class RequestSendLabReportEmail {
this.projectID, this.projectID,
this.invoiceNo, this.invoiceNo,
this.orderDate, this.orderDate,
this.orderNo}); this.orderNo,
this.isDownload});
RequestSendLabReportEmail.fromJson(Map<String, dynamic> json) { RequestSendLabReportEmail.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID']; versionID = json['VersionID'];
@ -81,6 +83,7 @@ class RequestSendLabReportEmail {
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
orderDate = json['OrderDate']; orderDate = json['OrderDate'];
orderNo = json['OrderNo']; orderNo = json['OrderNo'];
isDownload = json['IsDownload'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -111,6 +114,7 @@ class RequestSendLabReportEmail {
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['OrderDate'] = this.orderDate; data['OrderDate'] = this.orderDate;
data['OrderNo'] = this.orderNo; data['OrderNo'] = this.orderNo;
data['IsDownload'] = this.isDownload;
return data; return data;
} }
} }

@ -194,7 +194,7 @@ class LabsService extends BaseService {
RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail();
Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj}) async { Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj, bool isDownload = false}) async {
_requestSendLabReportEmail.projectID = patientLabOrder.projectID; _requestSendLabReportEmail.projectID = patientLabOrder.projectID;
_requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo;
_requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName;
@ -208,6 +208,7 @@ class LabsService extends BaseService {
_requestSendLabReportEmail.projectName = patientLabOrder.projectName; _requestSendLabReportEmail.projectName = patientLabOrder.projectName;
_requestSendLabReportEmail.setupID = patientLabOrder.setupID; _requestSendLabReportEmail.setupID = patientLabOrder.setupID;
_requestSendLabReportEmail.orderNo = patientLabOrder.orderNo; _requestSendLabReportEmail.orderNo = patientLabOrder.orderNo;
_requestSendLabReportEmail.isDownload = isDownload;
await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -135,7 +135,7 @@ class LabsViewModel extends BaseViewModel {
} }
} }
sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj}) async { sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj, bool isDownload = false}) async {
await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj); await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;

@ -73,7 +73,11 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
width: MediaQuery.of(context).size.width * 0.9, width: MediaQuery.of(context).size.width * 0.9,
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).downloadReport, TranslationBase.of(context).downloadReport,
() => {}, () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isDownload: true);
GifLoaderDialogUtils.hideDialog(context);
},
textColor: Colors.white, textColor: Colors.white,
), ),
), ),

Loading…
Cancel
Save