PDF lab attachment for VIDA 4 done.

CR-20974-PDF-Results-In-Lab
haroon amjad 1 month ago
parent 89fb761afc
commit 6249a16bd9

@ -460,11 +460,12 @@ class LabRepoImp implements LabRepo {
Map<String, dynamic> mapDevice = {
"ProjectID": labResult.projectID,
"SetupID": labResult.setupID,
// "SetupID": "105",
"LabAccessionNumber": labResult.accessionNo ?? "",
"FileName": labResult.fileNameWithExtension ?? "",
"Lang": Utils.appState.isArabic() ? "ar" : "en",
"Internationalization": "false",
"FileHash": Utils.isVidaPlusProject(int.parse(labResult.projectID!)) ? [labResult.uploadedDocuments?[selectedIndex]] : [],
"FileHash": Utils.isVidaPlusProject(int.parse(labResult.projectID!)) ? [(labResult.uploadedDocuments?[selectedIndex].fileData)] : [],
};
try {

@ -1018,7 +1018,7 @@ class LabViewModel extends ChangeNotifier {
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.only(right: 12),
child: "Attachment ${(index + 1)}".toText16(color: AppColors.primaryRedColor, isBold: true, isUnderLine: true),
child: "${labResult.uploadedDocuments![index].fileName}".toText16(color: AppColors.primaryRedColor, isBold: true, isUnderLine: true),
).onPress(() {
LoaderBottomSheet.showLoader();
getLabResultAttachmentPDF(

@ -52,7 +52,7 @@ class LabResult {
int? testID;
String? testShortDescription;
String? uOM;
List<dynamic>? uploadedDocuments;
List<LabResultAttachment>? uploadedDocuments;
String? verifiedOn;
dynamic verifiedOnDateTime;
@ -168,7 +168,14 @@ class LabResult {
testID = json['TestID'];
testShortDescription = json['TestShortDescription'];
uOM = json['UOM'];
uploadedDocuments = json['UploadedDocuments'] ?? [];
if (json['UploadedDocuments'] != null) {
uploadedDocuments = <LabResultAttachment>[];
json['UploadedDocuments'].forEach((v) {
uploadedDocuments!.add(LabResultAttachment.fromJson(v));
});
}
verifiedOn = json['VerifiedOn'];
verifiedOnDateTime = json['VerifiedOnDateTime'];
}
@ -255,6 +262,28 @@ class LabResult {
}
}
class LabResultAttachment {
String? fileData;
String? fileName;
String? fileType;
LabResultAttachment({this.fileData, this.fileName, this.fileType});
LabResultAttachment.fromJson(Map<String, dynamic> json) {
fileData = json['FileData'];
fileName = json['FileName'];
fileType = json['FileType'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['FileData'] = this.fileData;
data['FileName'] = this.fileName;
data['FileType'] = this.fileType;
return data;
}
}
// class LabResult {
// String? description;
// dynamic femaleInterpretativeData;

Loading…
Cancel
Save