How do I set defaultSearchHandlingStrict via the Google Healthcare API?

39 Views Asked by At

I'm able to fetch a fhirStore object with the JS api, but I don't see any decent examples of how to update the fhirStore to use defaultSearchHandlingStrict = true. Thanks

1

There are 1 best solutions below

2
On

The Cloud Healthcare API docs have a guide for how to update a FHIR store config, link. Updating the strict handling behaviour can be done in the same way as other properties of the FHIR store config. If you're using JS this might look something like

const updateStrictHandling = async () => {
  // TODO(developer): uncomment these lines before running the sample
  // const cloudRegion = 'us-central1';
  // const projectId = 'adjective-noun-123';
  // const datasetId = 'my-dataset';
  // const fhirStoreId = 'my-fhir-store';
  const name = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}/fhirStores/${fhirStoreId}`;
  const request = {
    name,
    updateMask: 'defaultSearchHandlingStrict',
    resource: {
      defaultSearchHandlingStrict: true,
    },
  };

  return healthcare.projects.locations.datasets.fhirStores.patch(request);
};

await updateStrictHandling();

(example adapted from the linked page)