api

package
v0.0.0-...-d8b21ba Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MatchTypeNone  = ""
	MatchTypeRegex = "regex"
	MatchTypeExact = "exact"
	MatchTypeAll   = "all"
	MatchTypeAny   = "any"
)
View Source
const (
	EventTypeCreated EventType = "CREATE"
	EventTypeUpdated           = "UPDATE"
	EventTypeDeleted           = "DELETE"
)
View Source
const RecordTopic = "records"

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	Id    string      `bson:"_id,omitempty" json:"id"`
	Name  string      `bson:"name,omitempty" json:"name"`
	Match MatchConfig `bson:"match,omitempty" json:"match"`
}

func NewCategory

func NewCategory(id, name string, matchConfig MatchConfig) *Category

type CreateRecord

type CreateRecord struct {
	Date       time.Time `form:"date" time_format:"2006-01-02T15:04:05Z07:00"`
	ReceivedAt time.Time `form:"receivedAt" time_format:"2006-01-02T15:04:05Z07:00"`
	Sender     string    `form:"sender"`
	Comment    *string   `form:"comment"`
	PatientId  *string   `form:"patientId"`
	Tags       []string  `form:"tags"`
	Status     Status    `form:"status"`
	Category   *string   `form:"category"`
	Pages      []Page
}

type Event

type Event[T any] struct {
	Type      EventType `json:"type"`
	Topic     Topic     `json:"topic"`
	Timestamp time.Time `json:"timestamp"`
	Id        string    `json:"id"`
	Data      T         `json:"data"`
}

func NewEvent

func NewEvent[T any](topic Topic, eventType EventType, id string, data T) Event[T]

type EventType

type EventType string

type MatchConfig

type MatchConfig struct {
	Type       MatchType `bson:"type,omitempty" json:"type"`
	Expression string    `bson:"expression,omitempty" json:"expression"`
}

type MatchType

type MatchType string

type Page

type Page struct {
	Id        string    `bson:"id" json:"id"`
	Url       string    `json:"url"`
	Content   *string   `bson:"content,omitempty" json:"content"`
	Format    string    `bson:"format" json:"format"`
	UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"`
}

func (*Page) Clone

func (p *Page) Clone() *Page

type PageUpdate

type PageUpdate struct {
	Id      string  `json:"id"`
	Rotate  float64 `json:"rotate,omitempty"`
	Content *string `json:"content,omitempty"`
}

type Record

type Record struct {
	Id          string     `bson:"_id,omitempty" json:"id"`
	Date        *time.Time `bson:"date,omitempty" json:"date"`
	ReceivedAt  time.Time  `bson:"receivedAt,omitempty" json:"receivedAt"`
	PatientId   *string    `bson:"patientId,omitempty" json:"patientId"`
	Comment     *string    `bson:"comment,omitempty" json:"comment"`
	Sender      string     `bson:"sender,omitempty" json:"sender" form:"user" binding:"required"`
	Category    *string    `bson:"category,omitempty" json:"category"`
	Tags        *[]string  `bson:"tags,omitempty" json:"tags"`
	Pages       []Page     `bson:"pages,omitempty" json:"pages"`
	Status      *Status    `bson:"status,omitempty" json:"status"`
	UpdatedAt   time.Time  `bson:"updatedAt" json:"updatedAt"`
	ArchivedPDF string     `json:"archivedPDF"`
}

func (*Record) Clone

func (r *Record) Clone() Record

func (*Record) MarshalJSON

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

type Status

type Status string
const (
	StatusNone      Status = ""
	StatusInbox     Status = "inbox"
	StatusEscalated Status = "escalated"
	StatusReview    Status = "review"
	StatusOther     Status = "other"
	StatusDone      Status = "done"
)

func (*Status) IsNone

func (s *Status) IsNone() bool

func (*Status) IsValid

func (s *Status) IsValid() bool

func (*Status) Status

func (s *Status) Status() Status

func (*Status) String

func (s *Status) String() string

type Topic

type Topic string

Jump to

Keyboard shortcuts

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