getDataSampleAttachmentContent method

  1. @override
Future<MultipartFile?> getDataSampleAttachmentContent(
  1. String dataSampleId,
  2. String documentId,
  3. String attachmentId
)
override

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:

  • String dataSampleId (required):

  • String documentId (required):

  • String attachmentId (required):

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);
}