'FHIR works on AWS server not allowing to keep customized id as primary key

We are working for FHIR(Fast Healthcare Interoperability Resources).

We have followed “FHIR works on AWS” and deployed the CloudFormation template given by AWS in our AWS environment.Following is the template that we have deployed

https://docs.aws.amazon.com/solutions/latest/fhir-works-on-aws/aws-cloudformation-template.html

Requirement : we want to maintain client specific/customized ids as primary key in the server.

Problem : server not allowing us to override or mainain client specific (customized ) ids as primary key .Infact , in the runtime, it is generating its own ids and ignoring the id given by us.



Solution 1:[1]

The FHIR spec allows for you to define your own IDs when using "update as create". This is when you create a new resource in the server, but use a PUT (update) request to the ID you want to create, such as Patient/1, instead of a POST (create) request to the resource URL. The server should return a 201 Created status instead of 200 OK. For more information see https://hl7.org/fhir/http.html#upsert

Not every FHIR server supports this, but if AWS does this is likely how it would work. The field in the CapabilityStatement for this feature is CapabilityStatement.rest.resource.updateCreate

EDIT:

This is possible by modifying the parameters passed to the DynamoDbDataService constructor in the deployment repo's src/config.ts

By default supportUpdateCreate, the second parameter, is set to false

const dynamoDbDataService = new DynamoDbDataService(DynamoDb, false, { enableMultiTenancy });

but you can set it to true to enable this functionality

const dynamoDbDataService = new DynamoDbDataService(DynamoDb, true, { enableMultiTenancy });

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1