api

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 Address

type Address struct {
	Street  *string `json:"street"`
	ZipCode *string `json:"zipCode"`
	City    *string `json:"city"`
}

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 NewRecord

type NewRecord struct {
	File       io.Reader
	ReceivedAt time.Time
	Sender     string
	Date       *time.Time
	PatientId  *string
	Status     *Status
	Comment    *string
	Category   *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 Patient

type Patient struct {
	Id        string     `json:"id"`
	FirstName string     `json:"firstName"`
	LastName  string     `json:"lastName"`
	BirthDate *time.Time `json:"birthDate"`
	Address   Address    `json:"address"`
}

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