getDataSampleAttachmentDocument method

  1. @override
Future<Document?> getDataSampleAttachmentDocument(
  1. String dataSampleId,
  2. String documentId
)
override

Get document metadata of a DataSample attachment

Data Samples may contain attachments such as prescriptions, reports, ... Use this method to get the document metadata information of an attachment

Parameters:

  • String dataSampleId (required):

  • String documentId (required):

Implementation

@override
Future<Document?> getDataSampleAttachmentDocument(String dataSampleId, String documentId) 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"));

  return DocumentDtoMapper((await _getDataSampleAttachmentDocumentFromICure(localCrypto, currentUser, dataSampleId, documentId))).toDocument();
}