1

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.

  • Perhaps a question for https://github.com/awslabs/fhir-works-on-aws-deployment/issues if you don't get an authoritative answer. – jarmod May 06 '22 at 15:49

2 Answers2

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 });
Nik Klassen
  • 681
  • 8
  • 16
  • thanks @Nik Klassen, but in FHIR server in AWS by default "CapabilityStatement.rest.resource.updateCreate" is false , and we are not able to update that flag by any chance because only "get" call is there for it. Any idea about how to change that flag to "True". – venkatesh19 May 09 '22 at 05:49
  • I have updated my comment with the code required to enable this in AWS – Nik Klassen May 09 '22 at 13:28
  • thanks again @Nik Klassen, we have tried the solution that you have suggested . Infact , as AWS lambda code editor saying 'code is too big to enable code editor', we have downoaded the lambda function code, modified in our local system and re-deployed the same to the function . But we are not seeing any reflections,and we are getting same error again. After this also , when we try to do PUT call , we are getting same error as before like "404 not found error for the id which we are passing" Does AWS FHIR support PUT operation to create a new resource ? – venkatesh19 May 10 '22 at 13:44
  • Unfortunately I don't think I can help with how to get the modified code deployed. But I do think the is the correct way to change the configuration. – Nik Klassen May 11 '22 at 15:45
  • Where do we find the configuration file and can we modified it ?..if yes, any idea about how to change the configuration ..there is no option for changing the updateCreate flag while launching AWS CloudFormation template – venkatesh19 May 12 '22 at 07:04
  • Actually we are not seeing the 'src/config.ts' file anywhere in the lambda function when we download it from lambda function ...We are seeing 'src/index.js' and 'src/index.js.map'... can you please let us know where do we find the 'src/config.ts' file as you mentioned earlier. – venkatesh19 May 12 '22 at 08:04
0

Take a look at this comment:

https://github.com/awslabs/fhir-works-on-aws-deployment/issues/629#issuecomment-1448755536

After set supportUpdateCreate to true on DynamoDbDataService constructor, you must know that you should use PUT instead of POST!