From 70665ca0dbddb27143346dafb6217f91cba41c44 Mon Sep 17 00:00:00 2001 From: maxwellgithinji Date: Tue, 6 Jun 2023 10:26:55 +0300 Subject: [PATCH] fix: update fhir patient id Signed-off-by: maxwellgithinji --- pkg/clinical/presentation/rest/handlers.go | 3 ++- pkg/clinical/usecases/clinical/pubsub.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/clinical/presentation/rest/handlers.go b/pkg/clinical/presentation/rest/handlers.go index 6e7f9513..d4003bb8 100644 --- a/pkg/clinical/presentation/rest/handlers.go +++ b/pkg/clinical/presentation/rest/handlers.go @@ -1,6 +1,7 @@ package rest import ( + "context" "encoding/json" "fmt" "net/http" @@ -34,7 +35,7 @@ func NewPresentationHandlers(usecases usecases.Interactor, extension BaseExtensi // ReceivePubSubPushMessage receives and processes a pubsub message func (p PresentationHandlersImpl) ReceivePubSubPushMessage(c *gin.Context) { - ctx := c.Request.Context() + ctx := context.Background() message, err := p.baseExt.VerifyPubSubJWTAndDecodePayload(c.Writer, c.Request) if err != nil { diff --git a/pkg/clinical/usecases/clinical/pubsub.go b/pkg/clinical/usecases/clinical/pubsub.go index 87b7ce15..ea11efc7 100644 --- a/pkg/clinical/usecases/clinical/pubsub.go +++ b/pkg/clinical/usecases/clinical/pubsub.go @@ -105,7 +105,7 @@ func (c *UseCasesClinicalImpl) CreatePubsubPatient(ctx context.Context, payload return err } - err = c.infrastructure.MyCareHub.AddFHIRIDToPatientProfile(context.Background(), *patient.PatientRecord.ID, payload.ClientID) + err = c.infrastructure.MyCareHub.AddFHIRIDToPatientProfile(ctx, *patient.PatientRecord.ID, payload.ClientID) if err != nil { return err }