Skip to content

Commit

Permalink
Address code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
toddkazakov committed Dec 10, 2024
1 parent 6e77878 commit 1bcfad0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion patients/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (p *PatientCDCConsumer) handleCDCEvent(event PatientCDCEvent) error {
}

errs := make([]error, 0, len(providers))
for providerName, _ := range providers {
for providerName := range providers {
templatePrefix := fmt.Sprintf("request_%s_", providerName)
action := "connect"
if event.FullDocument.IsCustodial() {
Expand Down
17 changes: 5 additions & 12 deletions patients/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,12 @@ type UpdatedFields struct {

func (u UpdatedFields) GetUpdatedConnectionRequests() ConnectionRequests {
var requests ConnectionRequests
if u.ProviderConnectionRequests != nil {
for _, r := range u.ProviderConnectionRequests {
for _, v := range r {
requests = append(requests, v)
}
}
}
for _, v := range u.ProviderConnectionRequestsDexcom {
requests = append(requests, v)
}
for _, v := range u.ProviderConnectionRequestsTwiist {
requests = append(requests, v)
for _, r := range u.ProviderConnectionRequests {
requests = append(requests, r...)
}
requests = append(requests, u.ProviderConnectionRequestsDexcom...)
requests = append(requests, u.ProviderConnectionRequestsTwiist...)

return requests
}

0 comments on commit 1bcfad0

Please sign in to comment.