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