createFHIRDatastore method
Create a FHIR-enabled data store.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ThrottlingException.
May throw ValidationException.
Parameter datastoreTypeVersion :
The FHIR release version supported by the data store. Current support is
for version R4.
Parameter clientToken :
An optional user-provided token to ensure API idempotency.
Parameter datastoreName :
The data store name (user-generated).
Parameter identityProviderConfiguration :
The identity provider configuration to use for the data store.
Parameter preloadDataConfig :
An optional parameter to preload (import) open source Synthea FHIR data
upon creation of the data store.
Parameter sseConfiguration :
The server-side encryption key configuration for a customer-provided
encryption key specified for creating a data store.
Parameter tags :
The resource tags applied to a data store when it is created.
Implementation
Future<CreateFHIRDatastoreResponse> createFHIRDatastore({
required FHIRVersion datastoreTypeVersion,
String? clientToken,
String? datastoreName,
IdentityProviderConfiguration? identityProviderConfiguration,
PreloadDataConfig? preloadDataConfig,
SseConfiguration? sseConfiguration,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'HealthLake.CreateFHIRDatastore'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DatastoreTypeVersion': datastoreTypeVersion.value,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (datastoreName != null) 'DatastoreName': datastoreName,
if (identityProviderConfiguration != null)
'IdentityProviderConfiguration': identityProviderConfiguration,
if (preloadDataConfig != null) 'PreloadDataConfig': preloadDataConfig,
if (sseConfiguration != null) 'SseConfiguration': sseConfiguration,
if (tags != null) 'Tags': tags,
},
);
return CreateFHIRDatastoreResponse.fromJson(jsonResponse.body);
}