| 32 | }); |
| 33 | |
| 34 | const patchFhirStore = async () => { |
| 35 | // TODO(developer): uncomment these lines before running the sample |
| 36 | // const cloudRegion = 'us-central1'; |
| 37 | // const projectId = 'adjective-noun-123'; |
| 38 | // const datasetId = 'my-dataset'; |
| 39 | // const fhirStoreId = 'my-fhir-store'; |
| 40 | // const pubsubTopic = 'my-topic' |
| 41 | const name = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}/fhirStores/${fhirStoreId}`; |
| 42 | const request = { |
| 43 | name, |
| 44 | updateMask: 'notificationConfigs', |
| 45 | resource: { |
| 46 | notificationConfigs: [ |
| 47 | { |
| 48 | pubsubTopic: `projects/${projectId}/topics/${pubsubTopic}`, |
| 49 | }, |
| 50 | ], |
| 51 | }, |
| 52 | }; |
| 53 | |
| 54 | try { |
| 55 | const response = |
| 56 | await healthcare.projects.locations.datasets.fhirStores.patch(request); |
| 57 | console.log( |
| 58 | `Patched FHIR store ${fhirStoreId} with Cloud Pub/Sub topic ${pubsubTopic}` |
| 59 | ); |
| 60 | console.log(JSON.stringify(response.data, null, 2)); |
| 61 | } catch (error) { |
| 62 | console.error('Error patching FHIR store:', error.message || error); |
| 63 | } |
| 64 | }; |
| 65 | |
| 66 | patchFhirStore(); |
| 67 | // [END healthcare_patch_fhir_store] |