careplanservice

package
v0.0.0-...-528b95b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2026 License: GPL-3.0 Imports: 44 Imported by: 0

Documentation

Overview

Package careplanservice is a generated GoMock package.

Index

Constants

View Source
const (
	EmailRequired   = "E0001"
	PhoneRequired   = "E0002"
	InvalidEmail    = "E0003"
	InvalidPhone    = "E0004"
	PatientRequired = "E9999"
)
View Source
const CreatorExtensionURL = "http://santeonnl.github.io/shared-care-planning/StructureDefinition/resource-creator"

Variables

This section is empty.

Functions

func FHIRBaseURL

func FHIRBaseURL(tenantID string, orcaBaseURL *url.URL) *url.URL

func SetCreatorExtensionOnResource

func SetCreatorExtensionOnResource[T fhir.HasExtension](resource T, identifier *fhir.Identifier)

Types

type AnyMatchPolicy

type AnyMatchPolicy[T any] struct {
	Policies []Policy[T]
}

AnyMatchPolicy is a policy that allows access if any of the policies in the list allow access.

func (AnyMatchPolicy[T]) HasAccess

func (e AnyMatchPolicy[T]) HasAccess(ctx context.Context, resource T, principal auth.Principal) (*PolicyDecision, error)

type AnyonePolicy

type AnyonePolicy[T any] struct {
}

AnyonePolicy is a policy that allows access to anyone.

func (AnyonePolicy[T]) HasAccess

func (e AnyonePolicy[T]) HasAccess(ctx context.Context, resource T, principal auth.Principal) (*PolicyDecision, error)

type CarePlanCreatedEvent

type CarePlanCreatedEvent struct {
	fhir.CarePlan
}

func (CarePlanCreatedEvent) Entity

func (CarePlanCreatedEvent) Instance

func (c CarePlanCreatedEvent) Instance() events.Type

type CareTeamMemberPolicy

type CareTeamMemberPolicy[T fhir.CarePlan] struct {
}

CareTeamMemberPolicy is a policy that allows access if the user is a member of the care team.

func (CareTeamMemberPolicy[T]) HasAccess

func (c CareTeamMemberPolicy[T]) HasAccess(ctx context.Context, resource *T, principal auth.Principal) (*PolicyDecision, error)

type Config

type Config struct {
	Enabled bool         `koanf:"enabled"`
	Events  EventsConfig `koanf:"events"`
}

func DefaultConfig

func DefaultConfig() Config

func (Config) Validate

func (c Config) Validate() error

type CreatorPolicy

type CreatorPolicy[T fhir.HasExtension] struct {
}

CreatorPolicy is a policy that allows access if the principal is the creator of the resource.

func (CreatorPolicy[T]) HasAccess

func (o CreatorPolicy[T]) HasAccess(ctx context.Context, resource T, principal auth.Principal) (*PolicyDecision, error)

type EventsConfig

type EventsConfig struct {
	WebHooks []WebHookEventHandlerConfig `koanf:"webhooks"`
}

type FHIRClientFactory

type FHIRClientFactory func(ctx context.Context) (fhirclient.Client, error)

func FHIRClientFactoryFor

func FHIRClientFactoryFor(fhirClient fhirclient.Client) FHIRClientFactory

type FHIRCreateOperationHandler

type FHIRCreateOperationHandler[T fhir.HasExtension] struct {
	// contains filtered or unexported fields
}

func (FHIRCreateOperationHandler[T]) Handle

type FHIRHandler

FHIRHandler defines a function that handles a FHIR request and returns a function to write the response. It may be executed singular, or be part of a Bundle that causes multiple handlers to be executed. It is provided with a BundleBuilder to add FHIR resource operations that must be executed on the backing FHIR server. The handler itself must not cause side-effects in the FHIR server: those MUST be effectuated through the transaction.

type FHIRHandlerRequest

type FHIRHandlerRequest struct {
	ResourceId   string
	ResourcePath string
	ResourceData json.RawMessage
	HttpMethod   string
	HttpHeaders  http.Header
	FhirHeaders  *fhirclient.Headers
	QueryParams  url.Values
	RequestUrl   *url.URL
	FullUrl      string
	BaseURL      *url.URL
	Context      context.Context
	Tenant       tenants.Properties
	// Principal contains the identity of the client invoking the FHIR operation.
	Principal *auth.Principal
	// LocalIdentity contains the identifier of the local care organization handling the FHIR operation invocation.
	LocalIdentity *fhir.Identifier
	Upsert        bool
}

type FHIRHandlerResult

type FHIRHandlerResult func(txResult *fhir.Bundle) ([]*fhir.BundleEntry, []any, error)

FHIRHandlerResult is the result of a FHIRHandler execution. It returns: - the resources that should be returned, given the transaction result - a list of resources that should be notified to subscribers

type FHIROperation

type FHIROperation interface {
	Handle(context.Context, FHIRHandlerRequest, *coolfhir.BundleBuilder) (FHIRHandlerResult, error)
}

type FHIRReadOperationHandler

type FHIRReadOperationHandler[T fhir.HasExtension] struct {
	// contains filtered or unexported fields
}

func (FHIRReadOperationHandler[T]) Handle

type FHIRSearchOperationHandler

type FHIRSearchOperationHandler[T any] struct {
	// contains filtered or unexported fields
}

func (FHIRSearchOperationHandler[T]) Handle

type FHIRUpdateOperationHandler

type FHIRUpdateOperationHandler[T fhir.HasExtension] struct {
	// contains filtered or unexported fields
}

func (FHIRUpdateOperationHandler[T]) Handle

type LocalOrganizationPolicy

type LocalOrganizationPolicy[T any] struct {
	// contains filtered or unexported fields
}

LocalOrganizationPolicy is a policy that allows access if the principal is a local organization.

func (LocalOrganizationPolicy[T]) HasAccess

func (l LocalOrganizationPolicy[T]) HasAccess(ctx context.Context, _ T, principal auth.Principal) (*PolicyDecision, error)

type MockPolicy

type MockPolicy[T any] struct {
	// contains filtered or unexported fields
}

MockPolicy is a mock of Policy interface.

func NewMockPolicy

func NewMockPolicy[T any](ctrl *gomock.Controller) *MockPolicy[T]

NewMockPolicy creates a new mock instance.

func (*MockPolicy[T]) EXPECT

func (m *MockPolicy[T]) EXPECT() *MockPolicyMockRecorder[T]

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPolicy[T]) HasAccess

func (m *MockPolicy[T]) HasAccess(ctx context.Context, resource T, principal auth.Principal) (*PolicyDecision, error)

HasAccess mocks base method.

type MockPolicyMockRecorder

type MockPolicyMockRecorder[T any] struct {
	// contains filtered or unexported fields
}

MockPolicyMockRecorder is the mock recorder for MockPolicy.

func (*MockPolicyMockRecorder[T]) HasAccess

func (mr *MockPolicyMockRecorder[T]) HasAccess(ctx, resource, principal any) *gomock.Call

HasAccess indicates an expected call of HasAccess.

type PatientValidator

type PatientValidator struct {
}

func (*PatientValidator) Validate

func (v *PatientValidator) Validate(patient *fhir.Patient) []*validation.Error

type Policy

type Policy[T any] interface {
	HasAccess(ctx context.Context, resource T, principal auth.Principal) (*PolicyDecision, error)
}

func CreateConditionAuthzPolicy

func CreateConditionAuthzPolicy(profile profile.Provider) Policy[*fhir.Condition]

func CreatePatientAuthzPolicy

func CreatePatientAuthzPolicy(profile profile.Provider) Policy[*fhir.Patient]

func CreateQuestionnaireAuthzPolicy

func CreateQuestionnaireAuthzPolicy() Policy[*fhir.Questionnaire]

func CreateQuestionnaireResponseAuthzPolicy

func CreateQuestionnaireResponseAuthzPolicy(profile profile.Provider) Policy[*fhir.QuestionnaireResponse]

func CreateServiceRequestAuthzPolicy

func CreateServiceRequestAuthzPolicy(profile profile.Provider) Policy[*fhir.ServiceRequest]

func ReadCarePlanAuthzPolicy

func ReadCarePlanAuthzPolicy() Policy[*fhir.CarePlan]

func ReadConditionAuthzPolicy

func ReadConditionAuthzPolicy(fhirClientFactory FHIRClientFactory) Policy[*fhir.Condition]

func ReadPatientAuthzPolicy

func ReadPatientAuthzPolicy(fhirClientFactory FHIRClientFactory) Policy[*fhir.Patient]

func ReadQuestionnaireAuthzPolicy

func ReadQuestionnaireAuthzPolicy() Policy[*fhir.Questionnaire]

func ReadQuestionnaireResponseAuthzPolicy

func ReadQuestionnaireResponseAuthzPolicy(fhirClientFactory FHIRClientFactory) Policy[*fhir.QuestionnaireResponse]

func ReadServiceRequestAuthzPolicy

func ReadServiceRequestAuthzPolicy(fhirClientFactory FHIRClientFactory) Policy[*fhir.ServiceRequest]

func ReadTaskAuthzPolicy

func ReadTaskAuthzPolicy(fhirClientFactory FHIRClientFactory) Policy[*fhir.Task]

func UpdateConditionAuthzPolicy

func UpdateConditionAuthzPolicy() Policy[*fhir.Condition]

func UpdatePatientAuthzPolicy

func UpdatePatientAuthzPolicy() Policy[*fhir.Patient]

func UpdateQuestionnaireAuthzPolicy

func UpdateQuestionnaireAuthzPolicy() Policy[*fhir.Questionnaire]

func UpdateQuestionnaireResponseAuthzPolicy

func UpdateQuestionnaireResponseAuthzPolicy() Policy[*fhir.QuestionnaireResponse]

func UpdateServiceRequestAuthzPolicy

func UpdateServiceRequestAuthzPolicy() Policy[*fhir.ServiceRequest]

type PolicyDecision

type PolicyDecision struct {
	Allowed bool
	Reasons []string
}

type RelatedResourcePolicy

type RelatedResourcePolicy[T any, R any] struct {
	// contains filtered or unexported fields
}

RelatedResourcePolicy is a policy that allows access if the user has access to the related resource(s). For instance, if the user has access to a ServiceRequest, if the user has access to the related Task.

func (RelatedResourcePolicy[T, R]) HasAccess

func (r RelatedResourcePolicy[T, R]) HasAccess(ctx context.Context, resource T, principal auth.Principal) (*PolicyDecision, error)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(config Config, tenantCfg tenants.Config, profile profile.Provider, orcaPublicURL *url.URL, messageBroker messaging.Broker, eventManager events.Manager) (*Service, error)

func (*Service) RegisterHandlers

func (s *Service) RegisterHandlers(mux *http.ServeMux)

type TaskOwnerOrRequesterPolicy

type TaskOwnerOrRequesterPolicy[T fhir.Task] struct {
}

TaskOwnerOrRequesterPolicy is a policy that allows access if the user is the owner of the task or the requester of the task.

func (TaskOwnerOrRequesterPolicy[T]) HasAccess

func (t TaskOwnerOrRequesterPolicy[T]) HasAccess(ctx context.Context, resource *T, principal auth.Principal) (*PolicyDecision, error)

type WebHookEventHandlerConfig

type WebHookEventHandlerConfig struct {
	// URL is the URL to which the event should be sent.
	URL string
}

Directories

Path Synopsis
Package subscriptions is a generated GoMock package.
Package subscriptions is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL