createFHIRDatastore method

Future<CreateFHIRDatastoreResponse> createFHIRDatastore({
  1. required FHIRVersion datastoreTypeVersion,
  2. AnalyticsConfiguration? analyticsConfiguration,
  3. String? clientToken,
  4. String? datastoreName,
  5. IdentityProviderConfiguration? identityProviderConfiguration,
  6. NlpConfiguration? nlpConfiguration,
  7. PreloadDataConfig? preloadDataConfig,
  8. ProfileConfiguration? profileConfiguration,
  9. SseConfiguration? sseConfiguration,
  10. List<Tag>? tags,
})

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 analyticsConfiguration : The analytics configuration for the data store.

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 nlpConfiguration : The natural language processing (NLP) configuration for the data store.

Parameter preloadDataConfig : An optional parameter to preload (import) open source Synthea FHIR data upon creation of the data store.

Parameter profileConfiguration : The profile configuration for 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,
  AnalyticsConfiguration? analyticsConfiguration,
  String? clientToken,
  String? datastoreName,
  IdentityProviderConfiguration? identityProviderConfiguration,
  NlpConfiguration? nlpConfiguration,
  PreloadDataConfig? preloadDataConfig,
  ProfileConfiguration? profileConfiguration,
  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,
      if (analyticsConfiguration != null)
        'AnalyticsConfiguration': analyticsConfiguration,
      'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (datastoreName != null) 'DatastoreName': datastoreName,
      if (identityProviderConfiguration != null)
        'IdentityProviderConfiguration': identityProviderConfiguration,
      if (nlpConfiguration != null) 'NlpConfiguration': nlpConfiguration,
      if (preloadDataConfig != null) 'PreloadDataConfig': preloadDataConfig,
      if (profileConfiguration != null)
        'ProfileConfiguration': profileConfiguration,
      if (sseConfiguration != null) 'SseConfiguration': sseConfiguration,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateFHIRDatastoreResponse.fromJson(jsonResponse.body);
}