Creating a FHIR resource - AWS HealthLake

Creating a FHIR resource

The FHIR create interaction creates a new FHIR resource in a HealthLake data store. For additional information, see create in the FHIR R4 RESTful API documentation.

To create a FHIR resource

  1. Collect HealthLake region and datastoreId values. For more information, see Getting data store properties.

  2. Determine the type of FHIR Resource to create. For more information, see Resource types.

  3. Construct a URL for the request using the collected values for HealthLake region and datastoreId. Also include the FHIR Resource type 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
  4. 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 Patient resource, so save the file as create-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" }
  5. Send the request. The FHIR create interaction uses a POST request with either AWS Signature Version 4 or SMART on FHIR authorization. The following examples create a FHIR Patient resource in HealthLake using either curl or the HealthLake Console. To view an entire example, scroll over the Copy button.

    curl

    SigV4 authorization

    curl --request POST \ 'https://healthlake.region.amazonaws.com/datastore/datastore-id/r4/Patient \ --aws-sigv4 'aws:amz:region:healthlake' \ --user "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" \ --header "x-amz-security-token:$AWS_SESSION_TOKEN" \ --header 'Accept: application/json' \ --data @create-patient.json
    AWS Console
    Note

    The HealthLake Console supports only AWS SigV4 authorization.

    1. Sign in to the Run query page on the HealthLake Console.

    2. Under the Query settings section, make the following selections.

    • Data Store ID — choose a data store ID to generate a query string.

    • Query type — choose Create.

    • Resource type — choose the FHIR resource type to create.

    • Request body — construct a JSON body for the request, specifying the FHIR data for the new resource.

    3. Choose Run query.