models

package
v0.0.0-...-5d294c8 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// static indicators
	HeightIndicator = "height"
	WeightIndicator = "weight"

	// dynamic indicators
	HeartRateIndicator     = "heart_rate"
	BloodPressureIndicator = "blood_pressure"
)

Variables

View Source
var (
	ErrGetStaticIndicators  = errors.New("failed to get static indicators")
	ErrGetDynamicIndicators = errors.New("failed to get dynamic indicators")
)

Functions

This section is empty.

Types

type BloodPressure

type BloodPressure struct {
	gorm.Model
	Value         int64     `gorm:"column:value"`
	Timestamp     time.Time `gorm:"column:timestamp"`
	InteractionID uint      `gorm:"column:interaction_id"`
}

type HeartRate

type HeartRate struct {
	gorm.Model
	Value         int64     `gorm:"column:value"`
	Timestamp     time.Time `gorm:"column:timestamp"`
	InteractionID uint      `gorm:"column:interaction_id"`
}

type Height

type Height struct {
	gorm.Model
	Value         float64   `gorm:"column:value"`
	Timestamp     time.Time `gorm:"column:timestamp"`
	InteractionID uint      `gorm:"column:interaction_id"`
}

type IndicatorInteraction

type IndicatorInteraction struct {
	gorm.Model

	Height         Height          `gorm:"foreignKey:InteractionID"`
	Weight         Weight          `gorm:"foreignKey:InteractionID"`
	HeartRates     []HeartRate     `gorm:"foreignKey:InteractionID"`
	BloodPressures []BloodPressure `gorm:"foreignKey:InteractionID"`

	PatientID uint
}

func (*IndicatorInteraction) GetDynamicIndicators

func (i *IndicatorInteraction) GetDynamicIndicators(indicatorName string) ([]float64, error)

func (*IndicatorInteraction) GetStaticIndicators

func (i *IndicatorInteraction) GetStaticIndicators(indicatorName string) (float64, error)

func (*IndicatorInteraction) SendDynamicIndicators

func (i *IndicatorInteraction) SendDynamicIndicators(indicatorName string, indicatorValues []float64)

func (*IndicatorInteraction) SetStaticIndicators

func (i *IndicatorInteraction) SetStaticIndicators(indicatorName string, value float64)

type MedicalWorker

type MedicalWorker struct {
	gorm.Model
	Username string `gorm:"unique;not null"`
	Password string `gorm:"not null"`

	Patients []Patient
}

func (*MedicalWorker) SetPassword

func (u *MedicalWorker) SetPassword(password string) error

type Patient

type Patient struct {
	gorm.Model

	Name string `gorm:"column:name;not null" json:"name"`

	MedicalWorkerID      uint                 `json:"-"`
	IndicatorInteraction IndicatorInteraction `json:"-"`
}

type Weight

type Weight struct {
	gorm.Model
	Value         float64   `gorm:"column:value"`
	Timestamp     time.Time `gorm:"column:timestamp"`
	InteractionID uint      `gorm:"column:interaction_id"`
}

Jump to

Keyboard shortcuts

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