Skip to content

Commit 1c61bf9

Browse files
authored
fix(healthcare): replace deprecated NotificationConfig with FhirNotificationConfig (#4377)
* fix(healthcare): replace deprecated NotificationConfig with FhirNotificationConfig * address review comments
1 parent 89b781a commit 1c61bf9

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

healthcare/fhir_store_patch.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,18 @@ func patchFHIRStore(w io.Writer, projectID, location, datasetID, fhirStoreID, to
3636

3737
name := fmt.Sprintf("projects/%s/locations/%s/datasets/%s/fhirStores/%s", projectID, location, datasetID, fhirStoreID)
3838

39-
if _, err := storesService.Patch(name, &healthcare.FhirStore{
40-
NotificationConfig: &healthcare.NotificationConfig{
41-
PubsubTopic: topicName, // format is "projects/*/locations/*/topics/*"
42-
},
43-
}).UpdateMask("notificationConfig").Do(); err != nil {
39+
// topicName format is "projects/*/locations/*/topics/*"
40+
notificationConfig := &healthcare.FhirNotificationConfig{
41+
PubsubTopic: topicName,
42+
}
43+
44+
fhirStore := &healthcare.FhirStore{
45+
NotificationConfigs: []*healthcare.FhirNotificationConfig{notificationConfig},
46+
}
47+
48+
patchRequest := storesService.Patch(name, fhirStore).UpdateMask("notificationConfigs")
49+
50+
if _, err := patchRequest.Do(); err != nil {
4451
return fmt.Errorf("Patch: %w", err)
4552
}
4653

0 commit comments

Comments
 (0)