Documentation
¶
Overview ¶
Package careplanservice is a generated GoMock package.
Index ¶
- Constants
- func FHIRBaseURL(tenantID string, orcaBaseURL *url.URL) *url.URL
- func SetCreatorExtensionOnResource[T fhir.HasExtension](resource T, identifier *fhir.Identifier)
- func TracedHandlerWrapper(operationName string, ...) ...
- type AnyMatchPolicy
- type AnyonePolicy
- type CarePlanCreatedEvent
- type CareTeamMemberPolicy
- type Config
- type CreatorPolicy
- type EventsConfig
- type FHIRClientFactory
- type FHIRCreateOperationHandler
- type FHIRHandler
- type FHIRHandlerRequest
- type FHIRHandlerResult
- type FHIROperation
- type FHIRReadOperationHandler
- type FHIRSearchOperationHandler
- type FHIRUpdateOperationHandler
- type LocalOrganizationPolicy
- type MockPolicy
- type MockPolicyMockRecorder
- type PatientValidator
- type Policy
- func CreateConditionAuthzPolicy(profile profile.Provider) Policy[*fhir.Condition]
- func CreatePatientAuthzPolicy(profile profile.Provider) Policy[*fhir.Patient]
- func CreateQuestionnaireAuthzPolicy() Policy[*fhir.Questionnaire]
- func CreateQuestionnaireResponseAuthzPolicy(profile profile.Provider) Policy[*fhir.QuestionnaireResponse]
- func CreateServiceRequestAuthzPolicy(profile profile.Provider) Policy[*fhir.ServiceRequest]
- func ReadCarePlanAuthzPolicy() Policy[*fhir.CarePlan]
- func ReadConditionAuthzPolicy(fhirClientFactory FHIRClientFactory) Policy[*fhir.Condition]
- func ReadPatientAuthzPolicy(fhirClientFactory FHIRClientFactory) Policy[*fhir.Patient]
- func ReadQuestionnaireAuthzPolicy() Policy[*fhir.Questionnaire]
- func ReadQuestionnaireResponseAuthzPolicy(fhirClientFactory FHIRClientFactory) Policy[*fhir.QuestionnaireResponse]
- func ReadServiceRequestAuthzPolicy(fhirClientFactory FHIRClientFactory) Policy[*fhir.ServiceRequest]
- func ReadTaskAuthzPolicy(fhirClientFactory FHIRClientFactory) Policy[*fhir.Task]
- func UpdateConditionAuthzPolicy() Policy[*fhir.Condition]
- func UpdatePatientAuthzPolicy() Policy[*fhir.Patient]
- func UpdateQuestionnaireAuthzPolicy() Policy[*fhir.Questionnaire]
- func UpdateQuestionnaireResponseAuthzPolicy() Policy[*fhir.QuestionnaireResponse]
- func UpdateServiceRequestAuthzPolicy() Policy[*fhir.ServiceRequest]
- type PolicyDecision
- type RelatedResourcePolicy
- type Service
- type TaskOwnerOrRequesterPolicy
- type WebHookEventHandlerConfig
Constants ¶
const ( EmailRequired = "E0001" PhoneRequired = "E0002" InvalidEmail = "E0003" InvalidPhone = "E0004" PatientRequired = "E9999" )
const CreatorExtensionURL = "http://santeonnl.github.io/shared-care-planning/StructureDefinition/resource-creator"
Variables ¶
This section is empty.
Functions ¶
func SetCreatorExtensionOnResource ¶
func SetCreatorExtensionOnResource[T fhir.HasExtension](resource T, identifier *fhir.Identifier)
func TracedHandlerWrapper ¶
func TracedHandlerWrapper(operationName string, handler func(context.Context, FHIRHandlerRequest, *coolfhir.BundleBuilder) (FHIRHandlerResult, error), ) func(context.Context, FHIRHandlerRequest, *coolfhir.BundleBuilder) (FHIRHandlerResult, error)
Types ¶
type AnyMatchPolicy ¶
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 ¶
func (CarePlanCreatedEvent) Entity ¶
func (c CarePlanCreatedEvent) Entity() messaging.Entity
func (CarePlanCreatedEvent) Instance ¶
func (c CarePlanCreatedEvent) Instance() events.Type
type CareTeamMemberPolicy ¶
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
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 ¶
func (h FHIRCreateOperationHandler[T]) Handle(ctx context.Context, request FHIRHandlerRequest, tx *coolfhir.BundleBuilder) (FHIRHandlerResult, error)
type FHIRHandler ¶
type FHIRHandler func(http.ResponseWriter, *http.Request, *coolfhir.BundleBuilder) (FHIRHandlerResult, error)
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 ¶
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 ¶
func (h FHIRReadOperationHandler[T]) Handle(ctx context.Context, request FHIRHandlerRequest, tx *coolfhir.BundleBuilder) (FHIRHandlerResult, error)
type FHIRSearchOperationHandler ¶
type FHIRSearchOperationHandler[T any] struct { // contains filtered or unexported fields }
func (FHIRSearchOperationHandler[T]) Handle ¶
func (h FHIRSearchOperationHandler[T]) Handle(ctx context.Context, request FHIRHandlerRequest, tx *coolfhir.BundleBuilder) (FHIRHandlerResult, error)
type FHIRUpdateOperationHandler ¶
type FHIRUpdateOperationHandler[T fhir.HasExtension] struct { // contains filtered or unexported fields }
func (FHIRUpdateOperationHandler[T]) Handle ¶
func (h FHIRUpdateOperationHandler[T]) Handle(ctx context.Context, request FHIRHandlerRequest, tx *coolfhir.BundleBuilder) (FHIRHandlerResult, error)
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.
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 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 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 UpdateQuestionnaireAuthzPolicy ¶
func UpdateQuestionnaireAuthzPolicy() Policy[*fhir.Questionnaire]
func UpdateQuestionnaireResponseAuthzPolicy ¶
func UpdateQuestionnaireResponseAuthzPolicy() Policy[*fhir.QuestionnaireResponse]
func UpdateServiceRequestAuthzPolicy ¶
func UpdateServiceRequestAuthzPolicy() Policy[*fhir.ServiceRequest]
type PolicyDecision ¶
type RelatedResourcePolicy ¶
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 (*Service) RegisterHandlers ¶
type TaskOwnerOrRequesterPolicy ¶
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
}
Source Files
¶
- authz.go
- authz_careplan.go
- authz_condition.go
- authz_mock.go
- authz_patient.go
- authz_questionnaire.go
- authz_questionnaireresponse.go
- authz_servicerequest.go
- authz_task.go
- config.go
- event.go
- handle_createtask.go
- handle_updatetask.go
- operation_create.go
- operation_read.go
- operation_search.go
- operation_update.go
- service.go
- test.go
- util.go
- validate_patient.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package subscriptions is a generated GoMock package.
|
Package subscriptions is a generated GoMock package. |