client

package
v1.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var REDCapRiskServiceConfig = plugin.RiskServicePluginConfig{
	Name: "Multi-Factor Risk Service",
	Method: models.CodeableConcept{
		Coding: []models.Coding{{System: "http://interventionengine.org/risk-assessments", Code: "MultiFactor"}},
		Text:   "Multi-Factor",
	},
	PredictedOutcome: models.CodeableConcept{Text: "Catastrophic Health Event"},
	DefaultPieSlices: []plugin.Slice{
		{Name: "Clinical Risk", Weight: 25, MaxValue: 4},
		{Name: "Functional and Environmental Risk", Weight: 25, MaxValue: 4},
		{Name: "Psychosocial and Mental Health Risk", Weight: 25, MaxValue: 4},
		{Name: "Utilization Risk", Weight: 25, MaxValue: 4},
	},
	RequiredResourceTypes: []string{},
}

Functions

func GetREDCapData

func GetREDCapData(endpoint string, token string) (models.StudyMap, error)

GetREDCapData queries REDCap at the specified endpoint with the specifed token, returning a StudyMap containing the resulting data.

func LogResultSummary

func LogResultSummary(results []Result)

LogResultSummary prints out a log of the result summary (# patients, # errors, # assessments)

Types

type Result

type Result struct {
	StudyID             string
	FHIRPatientID       string
	RiskAssessmentCount int
	Error               error
}

Result represents the result (successful or not) of posting REDCap risk assessments to a FHIR server

func PostRiskAssessments

func PostRiskAssessments(fhirEndpoint string, studies models.StudyMap, pieCollection *mgo.Collection, basisPieURL string) []Result

PostRiskAssessments posts the risk assessments from the studies to the FHIR server and also stores the risk pies to the local Mongo database

func RefreshRiskAssessments

func RefreshRiskAssessments(fhirEndpoint string, redcapEndpoint string, redcapToken string, pieCollection *mgo.Collection, basisPieURL string) ([]Result, error)

RefreshRiskAssessments pulls the risk assessment data from REDCap and posts it to the FHIR server, replacing older risk assessments and storing pie representations.

func (*Result) MarshalJSON

func (r *Result) MarshalJSON() ([]byte, error)

MarshalJSON handles the marshalling of the errors since Go doesn't

Jump to

Keyboard shortcuts

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