rawGetPatientHcPartyKeysForDelegate method

Future<Map<String, String>?> rawGetPatientHcPartyKeysForDelegate(
  1. String patientId
)

Get the patient (identified by patientId) hcparty keys. Those keys are AES keys (encrypted) used to share information between HCPs and a patient.

This endpoint is used to recover all keys that have already been created and that can be used to share information with this patient. It returns a map with the following structure: ID of the owner of the encrypted AES key -> encrypted AES key. The returned encrypted AES keys will have to be decrypted using the patient's private key.

Parameters:

  • String patientId (required): The patient Id for which information is shared

Implementation

Future<Map<String, String>?> rawGetPatientHcPartyKeysForDelegate(String patientId,) async {
  final response = await rawGetPatientHcPartyKeysForDelegateWithHttpInfo(patientId,);
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException.withRequestId(response.statusCode, await _decodeBodyBytes(response), response.headers["x-request-id"], response.request?.url.toString());
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return Map<String, String>.from(await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, String>'),);
  }
  return null;
}