service

package
v0.0.0-...-e2cfa69 Latest Latest
Warning

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

Go to latest
Published: May 6, 2016 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BundleToEventStream

func BundleToEventStream(bundle *models.Bundle) (es *plugin.EventStream, err error)

BundleToEventStream takes a bundle of resources and converts them to an EventStream. Currently only a limited set of resource types are supported, with unsupported resource types resulting in an error. If the bundle contains more than one patient, this is also considered an error.

func UpdateRiskAssessmentsAndPies

func UpdateRiskAssessmentsAndPies(fhirEndpoint string, patientID string, results []plugin.RiskServiceCalculationResult, pieCollection *mgo.Collection, basisPieURL string, config plugin.RiskServicePluginConfig, notApplicable bool) error

UpdateRiskAssessmentsAndPies removes existing risk assessments from the FHIR server and replaces them with new ones. It also removes old pies from the Mongo database and replaces them with new ones.

Types

type ReferenceRiskService

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

ReferenceRiskService is a container for risk service plugins that can handle the details of getting data needed for the plugins, invoking the calculations on the plugins, posting the new results back to the FHIR server, and saving the risk pies to the database.

func NewReferenceRiskService

func NewReferenceRiskService(db *mgo.Database) *ReferenceRiskService

NewReferenceRiskService creates a new risk service backed by the passed in MongoDB instance

func (*ReferenceRiskService) Calculate

func (rs *ReferenceRiskService) Calculate(patientID string, fhirEndpointURL string, basisPieURL string) error

Calculate invokes the register plugins to calculate scores for the given patient and post them back to FHIR. This deletes all previous risk assessment instances for the patient and replaces them with new instances.

func (*ReferenceRiskService) RegisterPlugin

func (rs *ReferenceRiskService) RegisterPlugin(plugin plugin.RiskServicePlugin)

RegisterPlugin registers a plugin for use by the risk service

type RiskService

type RiskService interface {
	Calculate(patientID string, fhirEndpointURL string, basisPieURL string) error
}

RiskService is an interface for the functions that must be supported by a risk service used in our reference implementation risk service server.

Jump to

Keyboard shortcuts

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