Skip to content

Commit

Permalink
fix(healthcare): replace deprecated NotificationConfig with FhirNotif…
Browse files Browse the repository at this point in the history
…icationConfig (#4377)

* fix(healthcare): replace deprecated NotificationConfig with FhirNotificationConfig

* address review comments
  • Loading branch information
noerog authored Sep 17, 2024
1 parent 89b781a commit 1c61bf9
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions healthcare/fhir_store_patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,18 @@ func patchFHIRStore(w io.Writer, projectID, location, datasetID, fhirStoreID, to

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

if _, err := storesService.Patch(name, &healthcare.FhirStore{
NotificationConfig: &healthcare.NotificationConfig{
PubsubTopic: topicName, // format is "projects/*/locations/*/topics/*"
},
}).UpdateMask("notificationConfig").Do(); err != nil {
// topicName format is "projects/*/locations/*/topics/*"
notificationConfig := &healthcare.FhirNotificationConfig{
PubsubTopic: topicName,
}

fhirStore := &healthcare.FhirStore{
NotificationConfigs: []*healthcare.FhirNotificationConfig{notificationConfig},
}

patchRequest := storesService.Patch(name, fhirStore).UpdateMask("notificationConfigs")

if _, err := patchRequest.Do(); err != nil {
return fmt.Errorf("Patch: %w", err)
}

Expand Down

0 comments on commit 1c61bf9

Please sign in to comment.