findByDocTypeHCPartyAndMessage method
Future<List<DecryptedDocumentDto> >
findByDocTypeHCPartyAndMessage(
- UserDto user,
- String documentType,
- String hcpId,
- DecryptedMessageDto message,
- CryptoConfig<
DecryptedDocumentDto, DocumentDto> config,
Implementation
Future<List<DecryptedDocumentDto>> findByDocTypeHCPartyAndMessage(UserDto user, String documentType, String hcpId, DecryptedMessageDto message, CryptoConfig<DecryptedDocumentDto, DocumentDto> config) async {
var keys = await config.crypto.decryptEncryptionKeys(user.dataOwnerId()!, message.delegations);
if (keys.isEmpty) {
throw FormatException("No delegations for user");
}
return this.findByDocTypeHCPartyAndMessageForeignKeys(user, documentType, hcpId, keys.join(","), config);
}