Documentation
¶
Index ¶
- Variables
- func LoadTestQuestionnairesAndHealthcareSevices(t *testing.T, client fhirclient.Client)
- type FhirApiQuestionnaireLoader
- type FhirApiWorkflowProvider
- type MemoryWorkflowProvider
- func (e *MemoryWorkflowProvider) Load(ctx context.Context, questionnaireUrl string) (*fhir.Questionnaire, error)
- func (e *MemoryWorkflowProvider) LoadBundle(ctx context.Context, bundleUrl string) error
- func (e *MemoryWorkflowProvider) Provide(ctx context.Context, serviceCode fhir.Coding, conditionCode fhir.Coding) (*Workflow, error)
- func (e *MemoryWorkflowProvider) QuestionnaireLoader() QuestionnaireLoader
- type QuestionnaireLoader
- type TestQuestionnaireLoader
- type TestWorkflowProvider
- type Workflow
- type WorkflowProvider
- type WorkflowStep
Constants ¶
This section is empty.
Variables ¶
var ErrWorkflowNotFound = errors.New("workflow not found")
Functions ¶
func LoadTestQuestionnairesAndHealthcareSevices ¶
func LoadTestQuestionnairesAndHealthcareSevices(t *testing.T, client fhirclient.Client)
Types ¶
type FhirApiQuestionnaireLoader ¶
type FhirApiQuestionnaireLoader struct {
// contains filtered or unexported fields
}
func (FhirApiQuestionnaireLoader) Load ¶
func (f FhirApiQuestionnaireLoader) Load(ctx context.Context, u string) (*fhir.Questionnaire, error)
type FhirApiWorkflowProvider ¶
type FhirApiWorkflowProvider struct {
Client fhirclient.Client
}
FhirApiWorkflowProvider is a WorkflowProvider queries a FHIR API to provide workflows.
func (FhirApiWorkflowProvider) Provide ¶
func (f FhirApiWorkflowProvider) Provide(ctx context.Context, serviceCode fhir.Coding, conditionCode fhir.Coding) (*Workflow, error)
Provide returns the workflow for a given service and condition. It looks up the workflow through FHIR HealthcareServices in the FHIR API, searching for instances that match:
- Service code must be present in HealthcareService.category
- Condition code must be present in the HealthcareService.type
func (FhirApiWorkflowProvider) QuestionnaireLoader ¶
func (f FhirApiWorkflowProvider) QuestionnaireLoader() QuestionnaireLoader
type MemoryWorkflowProvider ¶
type MemoryWorkflowProvider struct {
// contains filtered or unexported fields
}
MemoryWorkflowProvider is a WorkflowProvider that uses in-memory FHIR resources to provide workflows. To use this provider, you must first load the resources using LoadBundle.
func (*MemoryWorkflowProvider) Load ¶
func (e *MemoryWorkflowProvider) Load(ctx context.Context, questionnaireUrl string) (*fhir.Questionnaire, error)
func (*MemoryWorkflowProvider) LoadBundle ¶
func (e *MemoryWorkflowProvider) LoadBundle(ctx context.Context, bundleUrl string) error
LoadBundle fetches the FHIR Bundle from the given URL and adds the contained Questionnaires and HealthcareServices to the provider. They can then be used to provide workflows.
func (*MemoryWorkflowProvider) QuestionnaireLoader ¶
func (e *MemoryWorkflowProvider) QuestionnaireLoader() QuestionnaireLoader
type QuestionnaireLoader ¶
type TestQuestionnaireLoader ¶
type TestQuestionnaireLoader struct { }
func (TestQuestionnaireLoader) Load ¶
func (t TestQuestionnaireLoader) Load(ctx context.Context, u string) (*fhir.Questionnaire, error)
type TestWorkflowProvider ¶
TestWorkflowProvider is an in-memory WorkflowProvider. It's a map of a care service (e.g. Telemonitoring, http://snomed.info/sct|719858009), to conditions (e.g. COPD, http://snomed.info/sct|13645005) and their workflows.
func DefaultTestWorkflowProvider ¶
func DefaultTestWorkflowProvider() TestWorkflowProvider
func (TestWorkflowProvider) QuestionnaireLoader ¶
func (m TestWorkflowProvider) QuestionnaireLoader() QuestionnaireLoader
type Workflow ¶
type Workflow struct {
Steps []WorkflowStep
}
func (Workflow) Proceed ¶
func (w Workflow) Proceed(previousQuestionnaireRef string) (*WorkflowStep, error)
func (Workflow) Start ¶
func (w Workflow) Start() WorkflowStep
type WorkflowProvider ¶
type WorkflowProvider interface { // Provide returns the workflow for a given service and condition. // If no workflow is found, an error is returned. Provide(ctx context.Context, serviceCode fhir.Coding, conditionCode fhir.Coding) (*Workflow, error) QuestionnaireLoader() QuestionnaireLoader }
WorkflowProvider provides workflows (a set of questionnaires required for accepting a Task) to the Task Filler.
type WorkflowStep ¶
type WorkflowStep struct {
QuestionnaireUrl string
}