entity

package
v0.2.2-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

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
	Priority    string
	Scheduled   time.Time
	Begin       time.Time
	End         time.Time
	Cancelled   time.Time
	Rescheduled map[time.Time]struct{} // this might be interesting
}

func (*Exam) Coalesce

func (e *Exam) Coalesce(other Exam)

func (*Exam) Equal

func (e *Exam) Equal(other Exam) bool

func (*Exam) ToDB

func (e *Exam) ToDB(ctx context.Context, orderID, visitID, mrnID int64, siteID, procedureID int32, currentStatus string, db *database.Queries) (database.Exam, 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) (database.Mrn, 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 MrnPatientMap

type MrnPatientMap map[string]Patient

type Order

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

func DBtoOrder

func DBtoOrder(order database.GetOrderBySiteIDNumberRow) Order

func (*Order) Coalesce

func (o *Order) Coalesce(other Order)

func (*Order) Equal

func (o *Order) Equal(other Order) bool

func (*Order) ToDB

func (o *Order) ToDB(ctx context.Context, siteID int32, visitID, mrnID, providerID int64, db *database.Queries) (database.Order, 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) Coalesce

func (p *Patient) Coalesce(other Patient)

func (*Patient) Equal

func (p *Patient) Equal(other Patient) bool

func (*Patient) String

func (p *Patient) String() string

func (*Patient) ToDB

type Physician

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

func DBtoPhysician

func DBtoPhysician(physician database.Physician) Physician

func (*Physician) Coalesce

func (p *Physician) Coalesce(other Physician)

func (*Physician) Equal

func (p *Physician) Equal(other Physician) bool

func (*Physician) ToDB

type Procedure

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

func (*Procedure) Coalesce

func (p *Procedure) Coalesce(other Procedure)

func (*Procedure) Equal

func (p *Procedure) Equal(other Procedure) bool

func (*Procedure) ToDB

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

type Report

type Report struct {
	Base
	Exam        Exam
	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) Coalesce

func (s *Site) Coalesce(other Site)

func (*Site) Equal

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

func (*Site) ToDB

func (s *Site) ToDB(ctx context.Context, db *database.Queries) (database.Site, 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) Coalesce

func (v *Visit) Coalesce(other Visit)

func (*Visit) Equal

func (v *Visit) Equal(other Visit) bool

func (*Visit) ToDB

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

Jump to

Keyboard shortcuts

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