getDataSampleAttachmentContent method
Get attachment content of a DataSample
Data Samples may contain attachments such as prescriptions, reports, ... Use this method to get the content of an attachment
Parameters:
Implementation
@override
Future<MultipartFile?> getDataSampleAttachmentContent(String dataSampleId, String documentId, String attachmentId) async {
final localCrypto = api.crypto;
final currentUser = (await api.baseUserApi.getCurrentUser())
?? (throw StateError("There is no user currently logged in. You must call this method from an authenticated MedTechApi"));
final documentOfAttachment = await _getDataSampleAttachmentDocumentFromICure(localCrypto, currentUser, dataSampleId, documentId);
return api.baseDocumentApi.rawGetDocumentAttachment(documentId, attachmentId,
enckeys: (await _getDocumentEncryptionKeys(localCrypto, currentUser, documentOfAttachment)).join(","), fileName: null);
}