entity

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderScheduled   orderStatus = "SC"
	OrderInProgress  orderStatus = "IP"
	OrderComplete    orderStatus = "CM"
	OrderCancelled   orderStatus = "CA"
	OrderRescheduled orderStatus = "RS"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	ID        int
	CreatedAt time.Time
	UpdatedAt time.Time
}

type Exam

type Exam struct {
	Base
	Accession   string
	MRN         MRN
	Procedure   Procedure
	Site        Site
	Scheduled   time.Time
	Begin       time.Time
	End         time.Time
	Cancelled   time.Time
	Rescheduled map[time.Time]struct{} // this might be interesting
}

func (*Exam) ToDB

func (e *Exam) ToDB(ctx context.Context, orderID, visitID, mrnID int64, siteID, procedureID int32, currentStatus string, db *database.Queries) (int64, error)

type MRN

type MRN struct {
	Base
	Value string
	// TODO: handle assigning authority
	AssigningAuthority string
}

func (*MRN) Coalesce

func (m *MRN) Coalesce(other MRN)

func (*MRN) Equal

func (m *MRN) Equal(other MRN) bool

func (*MRN) ToDB

func (m *MRN) ToDB(ctx context.Context, siteID int32, patientID int64, db *database.Queries) (int64, error)

type Message

type Message struct {
	Base
	FieldSeparator string
	EncodingChars  string
	SendingApp     string
	SendingFac     string
	ReceivingApp   string
	ReceivingFac   string
	DateTime       time.Time
	Type           string
	TriggerEvent   string
	ControlID      string
	ProcessingID   string
	Version        string
}

func (*Message) ToDB

type Order

type Order struct {
	Base
	Number        string
	CurrentStatus orderStatus
	Date          time.Time
	Site          Site
	Visit         Visit
	MRN           MRN
	Provider      Physician
}

func DBtoOrder

func DBtoOrder(order database.GetOrderBySiteIDNumberRow) Order

func NewOrder added in v0.5.1

func NewOrder(number, status string, orderDT time.Time, physician Physician) Order

func (*Order) ToDB

func (o *Order) ToDB(ctx context.Context, siteID int32, visitID, mrnID, providerID int64, db *database.Queries) (int64, string, error)

type Patient

type Patient struct {
	Base
	Name objects.Name
	DOB  time.Time
	Sex  string
	// TODO: encrypt SSN
	SSN       objects.SSN
	HomePhone objects.PhoneNumber
	WorkPhone objects.PhoneNumber
	CellPhone objects.PhoneNumber
}

func DBtoPatient

func DBtoPatient(patient database.Patient) Patient

func (*Patient) ToDB

func (p *Patient) ToDB(ctx context.Context, db *database.Queries) (int64, error)

type Physician

type Physician struct {
	Base
	Name      objects.Name
	NPI       string
	Specialty objects.Specialty
}

func DBtoPhysician

func DBtoPhysician(physician database.Physician) Physician

func (*Physician) ToDB

func (p *Physician) ToDB(ctx context.Context, db *database.Queries) (int64, error)

type Procedure

type Procedure struct {
	Base
	Site        Site
	Code        string
	Description string
	Specialty   objects.Specialty
	Modality    objects.Modality
}

func (*Procedure) ToDB

func (p *Procedure) ToDB(ctx context.Context, siteID int32, db *database.Queries) (int32, error)

type Report

type Report struct {
	Base
	Radiologist Physician
	Body        string
	Impression  string
	Status      objects.ReportStatus
	SubmittedDT time.Time
}

func (*Report) ToDB

func (r *Report) ToDB(ctx context.Context, db *database.Queries) (database.Report, error)

type Site

type Site struct {
	Base
	Code    string
	Name    string
	Address string
	Phone   string
}

func DBtoSite

func DBtoSite(site database.Site) Site

func (*Site) Equal

func (s *Site) Equal(other Site) bool

func (*Site) ToDB

func (s *Site) ToDB(ctx context.Context, db *database.Queries) (int32, error)

type Visit

type Visit struct {
	Base
	VisitNo string
	Site    Site
	MRN     MRN
	Type    objects.PatientType
}

func DBtoVisit

func DBtoVisit(visit database.GetVisitBySiteIdNumberRow) Visit

func (*Visit) ToDB

func (v *Visit) ToDB(ctx context.Context, siteID int32, mrnID int64, db *database.Queries) (int64, error)

Jump to

Keyboard shortcuts

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