Creating a FHIR resource
The FHIR create interaction creates a new FHIR resource in a HealthLake data
store. For additional information, see create
To create a FHIR resource
-
Collect HealthLake
regionanddatastoreIdvalues. For more information, see Getting data store properties. -
Determine the type of FHIR
Resourceto create. For more information, see Resource types. -
Construct a URL for the request using the collected values for HealthLake
regionanddatastoreId. Also include the FHIRResourcetype to create. To view the entire URL path in the following example, scroll over the Copy button.POST https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/Resource -
Construct a JSON body for the request, specifying the FHIR data for the new resource. For the purpose of this procedure, we are using a FHIR
Patientresource, so save the file ascreate-patient.json.{ "resourceType": "Patient", "identifier": [ { "system": "urn:oid:1.2.36.146.595.217.0.1", "value": "12345" } ], "name": [ { "family": "Silva", "given": [ "Ana", "Carolina" ] } ], "gender": "female", "birthDate": "1992-02-10" } -
Send the request. The FHIR
createinteraction uses aPOSTrequest with either AWS Signature Version 4 or SMART on FHIR authorization. The following examples create a FHIRPatientresource in HealthLake using either curl or the HealthLake Console. To view an entire example, scroll over the Copy button.
Configuring validation level for resource creation
When creating a FHIR resource, you can optionally specify an x-amzn-healthlake-fhir-validation-level
HTTP header to configure a validation level for the resource. AWS HealthLake currently supports the following validation levels:
-
strict: Resources are validated according to the profile element of the resource, or the R4 specification if no profile is present. This is the default validation level for AWS HealthLake. -
structure-only: Resources are validated against R4, ignoring any referenced profiles. -
minimal: Resources are validated minimally, ignoring certain R4 rules. Resources that fail structure checks required for search/analytics will be updated to include a warning for audit.
Resources created with the minimal validation level may be ingested into a Datastore despite failing validation required for search indexing. In this case, resources will be updated to include a Healthlake specific extension to document said failures:
{ "url": "http://healthlake.amazonaws.com/fhir/StructureDefinition/validation-issue", "valueString": "{\"resourceType\":\"OperationOutcome\",\"issue\":[{\"severity\":\"error\",\"code\":\"processing\",\"details\":{\"text\":\"FHIR resource in payload failed FHIR validation rules.\"},\"diagnostics\":\"FHIR resource in payload failed FHIR validation rules.\"}]}" }
Additionally, the following HTTP response header will be included with a value of "true":
x-amzn-healthlake-validation-issues : true
Note
The data ingested that is malformed according the R4 specification may not be searchable as expected if these errors are present.