calculator

package
v0.0.1-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2016 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "wizard"

Name is currently `wizard` for backwards compatability but will be migrated to `calculator`

Variables

This section is empty.

Functions

func InsulinOnBoardValidator

func InsulinOnBoardValidator(v *validator.Validate, topStruct reflect.Value, currentStructOrField reflect.Value, field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string) bool

func InsulinSensitivityValidator

func InsulinSensitivityValidator(v *validator.Validate, topStruct reflect.Value, currentStructOrField reflect.Value, field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string) bool

Types

type BloodGlucoseTarget

type BloodGlucoseTarget struct {
	High *float64 `json:"high" bson:"high" valid:"-"`
	Low  *float64 `json:"low" bson:"low" valid:"-"`
}

type Bolus

type Bolus struct {
	Type     *string `json:"type" bson:"type" valid:"-"`
	SubType  *string `json:"subType" bson:"subType" valid:"bolussubtype"`
	Time     *string `json:"time" bson:"time" valid:"offsetOrZuluTimeString"`
	DeviceID *string `json:"deviceId" bson:"deviceId" valid:"required"`
}

type Event

type Event struct {
	*Recommended        `json:"recommended,omitempty" bson:"recommended,omitempty"`
	*BloodGlucoseTarget `json:"bgTarget,omitempty" bson:"bgTarget,omitempty"`
	*Bolus              `json:"bolus,omitempty" bson:"bolus,omitempty"` // TODO_DATA: Reversed changes as Tandem does not have bolus as string id, but as structure

	BolusID            *string  `json:"bolusId,omitempty" bson:"bolusId,omitempty" valid:"-"`
	CarbohydrateInput  *int     `json:"carbInput,omitempty" bson:"carbInput,omitempty" valid:"omitempty,required"`
	InsulinOnBoard     *float64 `json:"insulinOnBoard,omitempty" bson:"insulinOnBoard,omitempty" valid:"omitempty,insulinvalue"`
	InsulinSensitivity *int     `json:"insulinSensitivity,omitempty" bson:"insulinSensitivity,omitempty" valid:"omitempty,insulinsensitivity"`
	BloodGlucoseInput  *float64 `json:"bgInput,omitempty" bson:"bgInput,omitempty" valid:"-"`
	Units              *string  `json:"units" bson:"units" valid:"-"`
	types.Base         `bson:",inline"`
}

func Build

func Build(datum types.Datum, errs validate.ErrorProcessing) *Event
type Recommended struct {
	Carbohydrate *float64 `json:"carb" bson:"carb" valid:"-"` // TODO_DATA: We can't have `required` validation here because it can be zero.

	//TODO: validation to be confirmed but based on device uploads isn't always present
	Correction *float64 `json:"correction" bson:"correction" valid:"-"`
	Net        *float64 `json:"net" bson:"net" valid:"-"`
}

Jump to

Keyboard shortcuts

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