entity

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: MIT Imports: 13 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       `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type Exam

type Exam struct {
	Base
	Accession     string
	Priority      string
	Procedure     Procedure
	CurrentStatus ExamStatus
	Provider      Physician
	Site          Site
	Scheduled     time.Time
	Begin         time.Time
	End           time.Time
	Cancelled     time.Time
}

type ExamStatus added in v0.6.0

type ExamStatus string
const (
	ExamScheduled  ExamStatus = "SC"
	ExamInProgress ExamStatus = "IP"
	ExamComplete   ExamStatus = "CM"
	ExamCancelled  ExamStatus = "CA"
)

func NewExamStatus added in v0.6.0

func NewExamStatus(s string) ExamStatus

func (ExamStatus) String added in v0.6.0

func (o ExamStatus) String() string

type HL7Repo added in v0.6.3

type HL7Repo struct {
	DB      *pgxpool.Pool
	Queries *database.Queries
}

func NewRepo added in v0.6.3

func NewRepo(db *pgxpool.Pool) *HL7Repo

func (*HL7Repo) GetProcedures added in v0.6.11

func (h *HL7Repo) GetProcedures(ctx context.Context, cursorID int32) ([]byte, error)

func (*HL7Repo) SaveORM added in v0.6.3

func (h *HL7Repo) SaveORM(ctx context.Context, orm *Order) error

func (*HL7Repo) SaveORU added in v0.6.3

func (h *HL7Repo) SaveORU(ctx context.Context, oru *Observation) error

func (*HL7Repo) UpdateProcedures added in v0.6.11

func (h *HL7Repo) UpdateProcedures(ctx context.Context, data []byte) (requested, updated int, err 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

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
}

type Observation added in v0.6.3

type Observation struct {
	Message   Message
	Patient   Patient
	Visit     Visit
	Provider  Physician
	Procedure Procedure
	Exams     []Exam
	Report    Report
}

type Order

type Order struct {
	Message   Message
	Patient   Patient
	Visit     Visit
	Provider  Physician
	Procedure Procedure
	Exam      Exam
}

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

type Physician

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

func DBtoPhysician

func DBtoPhysician(physician database.Physician) Physician

type Procedure

type Procedure struct {
	Base
	Site        Site              `json:"site"`
	Code        string            `json:"code"`
	Description string            `json:"description"`
	Specialty   objects.Specialty `json:"specialty,omitempty"`
	Modality    objects.Modality  `json:"modality,omitempty"`
}

type Report

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

func DBtoReport added in v0.6.0

func DBtoReport(report database.Report) Report

type Site

type Site struct {
	Base
	Code    string `json:"code"`
	Name    string `json:"name,omitempty"`
	Address string `json:"address,omitempty"`
	Phone   string `json:"phone,omitempty"`
}

func DBtoSite

func DBtoSite(site database.Site) Site

func (*Site) Equal

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

type Visit

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

func DBtoVisit

func DBtoVisit(visit database.GetVisitBySiteIdNumberRow) Visit

Jump to

Keyboard shortcuts

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