Skip to content

Commit

Permalink
chore: rename and provide a descriptive comment when creating initial…
Browse files Browse the repository at this point in the history
… composition (#403)

Signed-off-by: Kathurima Kimathi <kathurimakimathi415@gmail.com>
  • Loading branch information
KathurimaKimathi committed Mar 27, 2024
1 parent 737ebd8 commit b582437
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/clinical/usecases/clinical/encounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,21 @@ func (c *UseCasesClinicalImpl) StartEncounter(ctx context.Context, episodeID str
}

// Create a blank composition
_, err = c.RecordFHIRComposition(ctx, encounter, tags, episodeOfCare)
_, err = c.CreateInitialComposition(ctx, encounter, tags, episodeOfCare)
if err != nil {
return "", err
}

return *encounter.Resource.ID, nil
}

func (c *UseCasesClinicalImpl) RecordFHIRComposition(ctx context.Context,
// CreateInitialComposition this method is to be specifically used when a new encounter is created.
// We create the initial(blank) composition so that we can use the composition to create a patients 'clinical document'
// that can be used for various purposes such as referral.
// This resource is to be updated on need basis such as (but not limited to) when a new diagnostic resource, observation etc. is created
// We want to consolidate the patients information into a single source for ease of retrieval and usage across
// depending on the current business case.
func (c *UseCasesClinicalImpl) CreateInitialComposition(ctx context.Context,
encounter *domain.FHIREncounterRelayPayload,
tags []domain.FHIRCodingInput, episodeOfCare *domain.FHIREpisodeOfCareRelayPayload) (*domain.FHIRCompositionRelayPayload, error) {
encounterRef := fmt.Sprintf("Encounter/%s", *encounter.Resource.ID)
Expand Down

0 comments on commit b582437

Please sign in to comment.