database

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateExamParams

type CreateExamParams struct {
	VisitID             pgtype.Int8
	MrnID               pgtype.Int8
	SiteID              pgtype.Int4
	ProcedureID         pgtype.Int4
	OrderingPhysicianID pgtype.Int8
	Accession           string
	CurrentStatus       string
	ScheduleDt          pgtype.Timestamp
	BeginExamDt         pgtype.Timestamp
	EndExamDt           pgtype.Timestamp
	ExamCancelledDt     pgtype.Timestamp
	MessageID           pgtype.Int8
	SendingApp          string
	Priority            pgtype.Text
}

type CreateMessageParams

type CreateMessageParams struct {
	FieldSeparator       string
	EncodingCharacters   string
	SendingApplication   string
	SendingFacility      string
	ReceivingApplication string
	ReceivingFacility    string
	ReceivedAt           pgtype.Timestamp
	MessageType          string
	TriggerEvent         string
	ControlID            string
	ProcessingID         string
	VersionID            string
}

type CreateMrnParams

type CreateMrnParams struct {
	SiteID    int32
	PatientID pgtype.Int8
	Mrn       string
	MessageID pgtype.Int8
}

type CreatePatientParams

type CreatePatientParams struct {
	FirstName  string
	LastName   string
	MiddleName pgtype.Text
	Suffix     pgtype.Text
	Prefix     pgtype.Text
	Degree     pgtype.Text
	Dob        pgtype.Date
	Sex        string
	Ssn        pgtype.Text
	HomePhone  pgtype.Text
	WorkPhone  pgtype.Text
	CellPhone  pgtype.Text
	MessageID  pgtype.Int8
}

type CreatePhysicianParams

type CreatePhysicianParams struct {
	FirstName  string
	LastName   string
	MiddleName pgtype.Text
	Suffix     pgtype.Text
	Prefix     pgtype.Text
	Degree     pgtype.Text
	AppCode    string
	Npi        pgtype.Text
	MessageID  pgtype.Int8
}

type CreateProcedureParams

type CreateProcedureParams struct {
	SiteID      pgtype.Int4
	Code        string
	Description string
	Specialty   pgtype.Text
	Modality    pgtype.Text
	MessageID   pgtype.Int8
}

type CreateReportParams

type CreateReportParams struct {
	RadiologistID  pgtype.Int8
	Body           string
	Impression     string
	ReportStatus   string
	SubmittedDt    pgtype.Timestamp
	DictationStart pgtype.Timestamp
	DictationEnd   pgtype.Timestamp
	MessageID      pgtype.Int8
}

type CreateSiteParams

type CreateSiteParams struct {
	Code      string
	Name      pgtype.Text
	Address   string
	IsCms     bool
	MessageID pgtype.Int8
}

type CreateVisitParams

type CreateVisitParams struct {
	SiteID      pgtype.Int4
	MrnID       pgtype.Int8
	Number      string
	PatientType int16
	MessageID   pgtype.Int8
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Exam

type Exam struct {
	ID                  int64
	CreatedAt           pgtype.Timestamp
	UpdatedAt           pgtype.Timestamp
	VisitID             pgtype.Int8
	MrnID               pgtype.Int8
	SiteID              pgtype.Int4
	ProcedureID         pgtype.Int4
	FinalReportID       pgtype.Int8
	AddendumReportID    pgtype.Int8
	Accession           string
	CurrentStatus       string
	ScheduleDt          pgtype.Timestamp
	BeginExamDt         pgtype.Timestamp
	EndExamDt           pgtype.Timestamp
	ExamCancelledDt     pgtype.Timestamp
	PrelimReportID      pgtype.Int8
	OrderingPhysicianID pgtype.Int8
	MessageID           pgtype.Int8
	SendingApp          string
	Priority            pgtype.Text
}

type GetExamBySendingAppAccessionParams added in v0.7.0

type GetExamBySendingAppAccessionParams struct {
	SendingApp string
	Accession  string
}

type GetExamBySendingAppAccessionRow added in v0.7.0

type GetExamBySendingAppAccessionRow struct {
	ID                   int64
	CreatedAt            pgtype.Timestamp
	UpdatedAt            pgtype.Timestamp
	VisitID              pgtype.Int8
	MrnID                pgtype.Int8
	SiteID               pgtype.Int4
	ProcedureID          pgtype.Int4
	FinalReportID        pgtype.Int8
	AddendumReportID     pgtype.Int8
	Accession            string
	CurrentStatus        string
	ScheduleDt           pgtype.Timestamp
	BeginExamDt          pgtype.Timestamp
	EndExamDt            pgtype.Timestamp
	ExamCancelledDt      pgtype.Timestamp
	PrelimReportID       pgtype.Int8
	OrderingPhysicianID  pgtype.Int8
	MessageID            pgtype.Int8
	SendingApp           string
	Priority             pgtype.Text
	MrnCreatedAt         pgtype.Timestamp
	MrnUpdatedAt         pgtype.Timestamp
	MrnValue             pgtype.Text
	ProcedureCreatedAt   pgtype.Timestamp
	ProcedureUpdatedAt   pgtype.Timestamp
	ProcedureCode        pgtype.Text
	ProcedureDescription pgtype.Text
	ProcedureSpecialty   pgtype.Text
	ProcedureModality    pgtype.Text
	ProviderCreatedAt    pgtype.Timestamp
	ProviderUpdatedAt    pgtype.Timestamp
	ProviderFirstName    pgtype.Text
	ProviderLastName     pgtype.Text
	ProviderMiddleName   pgtype.Text
	ProviderSuffix       pgtype.Text
	ProviderPrefix       pgtype.Text
	ProviderDegree       pgtype.Text
	ProviderNpi          pgtype.Text
	ProviderSpecialty    pgtype.Text
	SiteCreatedAt        pgtype.Timestamp
	SiteUpdatedAt        pgtype.Timestamp
	SiteCode             pgtype.Text
	SiteName             pgtype.Text
	SiteAddress          pgtype.Text
	SiteIsCms            pgtype.Bool
}

type GetExamIDBySendingAppAccessionParams added in v0.7.0

type GetExamIDBySendingAppAccessionParams struct {
	SendingApp string
	Accession  string
}

type GetMrnBySitePatientParams

type GetMrnBySitePatientParams struct {
	SiteID    int32
	PatientID pgtype.Int8
}

type GetPatientByNameSSNParams

type GetPatientByNameSSNParams struct {
	FirstName string
	LastName  string
	Dob       pgtype.Date
	Ssn       pgtype.Text
}

type GetPhysicianByNameAppCodeParams added in v0.6.0

type GetPhysicianByNameAppCodeParams struct {
	FirstName string
	LastName  string
	AppCode   string
}

type GetPhysicianByNameNPIParams

type GetPhysicianByNameNPIParams struct {
	FirstName string
	LastName  string
	Npi       pgtype.Text
}

type GetProcedureBySiteIDCodeParams

type GetProcedureBySiteIDCodeParams struct {
	SiteID pgtype.Int4
	Code   string
}

type GetReportByUniqueFieldsParams

type GetReportByUniqueFieldsParams struct {
	RadiologistID pgtype.Int8
	Impression    string
	ReportStatus  string
	SubmittedDt   pgtype.Timestamp
}

type GetVisitByIdRow

type GetVisitByIdRow struct {
	ID            int64
	CreatedAt     pgtype.Timestamp
	UpdatedAt     pgtype.Timestamp
	SiteID        pgtype.Int4
	MrnID         pgtype.Int8
	Number        string
	PatientType   int16
	MessageID     pgtype.Int8
	SiteCreatedAt pgtype.Timestamp
	SiteUpdatedAt pgtype.Timestamp
	SiteCode      pgtype.Text
	SiteName      pgtype.Text
	SiteAddress   pgtype.Text
	SiteIsCms     pgtype.Bool
	MrnCreatedAt  pgtype.Timestamp
	MrnUpdatedAt  pgtype.Timestamp
	MrnValue      pgtype.Text
}

type GetVisitBySiteIdNumberParams

type GetVisitBySiteIdNumberParams struct {
	SiteID pgtype.Int4
	Number string
}

type GetVisitBySiteIdNumberRow

type GetVisitBySiteIdNumberRow struct {
	ID            int64
	CreatedAt     pgtype.Timestamp
	UpdatedAt     pgtype.Timestamp
	SiteID        pgtype.Int4
	MrnID         pgtype.Int8
	Number        string
	PatientType   int16
	MessageID     pgtype.Int8
	SiteCreatedAt pgtype.Timestamp
	SiteUpdatedAt pgtype.Timestamp
	SiteCode      pgtype.Text
	SiteName      pgtype.Text
	SiteAddress   pgtype.Text
	SiteIsCms     pgtype.Bool
	MrnCreatedAt  pgtype.Timestamp
	MrnUpdatedAt  pgtype.Timestamp
	MrnValue      pgtype.Text
}

type Message

type Message struct {
	ID                   int64
	CreatedAt            pgtype.Timestamp
	UpdatedAt            pgtype.Timestamp
	FieldSeparator       string
	EncodingCharacters   string
	SendingApplication   string
	SendingFacility      string
	ReceivingApplication string
	ReceivingFacility    string
	ReceivedAt           pgtype.Timestamp
	MessageType          string
	TriggerEvent         string
	ControlID            string
	ProcessingID         string
	VersionID            string
}

type Metasite

type Metasite struct {
	ID        int32
	CreatedAt pgtype.Timestamp
	UpdatedAt pgtype.Timestamp
	Name      string
	IsOrg     bool
}

type Mrn

type Mrn struct {
	ID        int64
	CreatedAt pgtype.Timestamp
	UpdatedAt pgtype.Timestamp
	PatientID pgtype.Int8
	Mrn       string
	SiteID    int32
	MessageID pgtype.Int8
}

type Patient

type Patient struct {
	ID         int64
	CreatedAt  pgtype.Timestamp
	UpdatedAt  pgtype.Timestamp
	FirstName  string
	LastName   string
	MiddleName pgtype.Text
	Suffix     pgtype.Text
	Prefix     pgtype.Text
	Degree     pgtype.Text
	Dob        pgtype.Date
	Sex        string
	Ssn        pgtype.Text
	HomePhone  pgtype.Text
	WorkPhone  pgtype.Text
	CellPhone  pgtype.Text
	MessageID  pgtype.Int8
}

type Physician

type Physician struct {
	ID         int64
	CreatedAt  pgtype.Timestamp
	UpdatedAt  pgtype.Timestamp
	FirstName  string
	LastName   string
	MiddleName pgtype.Text
	Suffix     pgtype.Text
	Prefix     pgtype.Text
	Degree     pgtype.Text
	Npi        pgtype.Text
	Specialty  pgtype.Text
	AppCode    string
	MessageID  pgtype.Int8
}

type Procedure

type Procedure struct {
	ID          int32
	CreatedAt   pgtype.Timestamp
	UpdatedAt   pgtype.Timestamp
	SiteID      pgtype.Int4
	Code        string
	Description string
	Specialty   pgtype.Text
	Modality    pgtype.Text
	MessageID   pgtype.Int8
	UpdatedBy   string
	Reportable  pgtype.Bool
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CreateExam

func (q *Queries) CreateExam(ctx context.Context, arg CreateExamParams) (int64, error)

func (*Queries) CreateMessage

func (q *Queries) CreateMessage(ctx context.Context, arg CreateMessageParams) (int64, error)

func (*Queries) CreateMrn

func (q *Queries) CreateMrn(ctx context.Context, arg CreateMrnParams) (int64, error)

func (*Queries) CreatePatient

func (q *Queries) CreatePatient(ctx context.Context, arg CreatePatientParams) (int64, error)

func (*Queries) CreatePhysician

func (q *Queries) CreatePhysician(ctx context.Context, arg CreatePhysicianParams) (int64, error)

func (*Queries) CreateProcedure

func (q *Queries) CreateProcedure(ctx context.Context, arg CreateProcedureParams) (int32, error)

func (*Queries) CreateReport

func (q *Queries) CreateReport(ctx context.Context, arg CreateReportParams) (int64, error)

func (*Queries) CreateSite

func (q *Queries) CreateSite(ctx context.Context, arg CreateSiteParams) (int32, error)

func (*Queries) CreateVisit

func (q *Queries) CreateVisit(ctx context.Context, arg CreateVisitParams) (int64, error)

func (*Queries) GetAllExams

func (q *Queries) GetAllExams(ctx context.Context) ([]Exam, error)

func (*Queries) GetAllReports

func (q *Queries) GetAllReports(ctx context.Context) ([]Report, error)

func (*Queries) GetExamById

func (q *Queries) GetExamById(ctx context.Context, id int64) (Exam, error)

func (*Queries) GetExamBySendingAppAccession added in v0.7.0

func (*Queries) GetExamIDBySendingAppAccession added in v0.7.0

func (q *Queries) GetExamIDBySendingAppAccession(ctx context.Context, arg GetExamIDBySendingAppAccessionParams) (int64, error)

func (*Queries) GetMessageByID

func (q *Queries) GetMessageByID(ctx context.Context, id int64) (Message, error)

func (*Queries) GetMrnById

func (q *Queries) GetMrnById(ctx context.Context, id int64) (Mrn, error)

func (*Queries) GetMrnBySitePatient

func (q *Queries) GetMrnBySitePatient(ctx context.Context, arg GetMrnBySitePatientParams) (Mrn, error)

func (*Queries) GetPatientById

func (q *Queries) GetPatientById(ctx context.Context, id int64) (Patient, error)

func (*Queries) GetPatientByNameSSN

func (q *Queries) GetPatientByNameSSN(ctx context.Context, arg GetPatientByNameSSNParams) (Patient, error)

func (*Queries) GetPhysicianById

func (q *Queries) GetPhysicianById(ctx context.Context, id int64) (Physician, error)

func (*Queries) GetPhysicianByNameAppCode added in v0.6.0

func (q *Queries) GetPhysicianByNameAppCode(ctx context.Context, arg GetPhysicianByNameAppCodeParams) (Physician, error)

func (*Queries) GetPhysicianByNameNPI

func (q *Queries) GetPhysicianByNameNPI(ctx context.Context, arg GetPhysicianByNameNPIParams) (Physician, error)

func (*Queries) GetProcedureById

func (q *Queries) GetProcedureById(ctx context.Context, id int32) (Procedure, error)

func (*Queries) GetProcedureBySiteIDCode

func (q *Queries) GetProcedureBySiteIDCode(ctx context.Context, arg GetProcedureBySiteIDCodeParams) (Procedure, error)

func (*Queries) GetProceduresForModalityUpdate added in v0.6.12

func (q *Queries) GetProceduresForModalityUpdate(ctx context.Context, id int32) ([]Procedure, error)

func (*Queries) GetProceduresForSpecialtyUpdate added in v0.6.11

func (q *Queries) GetProceduresForSpecialtyUpdate(ctx context.Context, id int32) ([]Procedure, error)

func (*Queries) GetReportById

func (q *Queries) GetReportById(ctx context.Context, id int64) (Report, error)

func (*Queries) GetReportByRadID added in v0.6.0

func (q *Queries) GetReportByRadID(ctx context.Context, radiologistID pgtype.Int8) (Report, error)

func (*Queries) GetReportByUniqueFields

func (q *Queries) GetReportByUniqueFields(ctx context.Context, arg GetReportByUniqueFieldsParams) (Report, error)

func (*Queries) GetSiteByCode

func (q *Queries) GetSiteByCode(ctx context.Context, code string) (Site, error)

func (*Queries) GetSiteById

func (q *Queries) GetSiteById(ctx context.Context, id int32) (Site, error)

func (*Queries) GetVisitById

func (q *Queries) GetVisitById(ctx context.Context, id int64) (GetVisitByIdRow, error)

func (*Queries) GetVisitBySiteIdNumber

func (q *Queries) GetVisitBySiteIdNumber(ctx context.Context, arg GetVisitBySiteIdNumberParams) (GetVisitBySiteIdNumberRow, error)

func (*Queries) UpdateExam

func (q *Queries) UpdateExam(ctx context.Context, arg UpdateExamParams) (Exam, error)

func (*Queries) UpdateExamAddendumReport

func (q *Queries) UpdateExamAddendumReport(ctx context.Context, arg UpdateExamAddendumReportParams) (Exam, error)

func (*Queries) UpdateExamFinalReport

func (q *Queries) UpdateExamFinalReport(ctx context.Context, arg UpdateExamFinalReportParams) (Exam, error)

func (*Queries) UpdateExamPrelimReport added in v0.5.1

func (q *Queries) UpdateExamPrelimReport(ctx context.Context, arg UpdateExamPrelimReportParams) (Exam, error)

func (*Queries) UpdatePatient

func (q *Queries) UpdatePatient(ctx context.Context, arg UpdatePatientParams) (Patient, error)

func (*Queries) UpdatePhysician

func (q *Queries) UpdatePhysician(ctx context.Context, arg UpdatePhysicianParams) (Physician, error)

func (*Queries) UpdateProcedureModality added in v0.6.12

func (q *Queries) UpdateProcedureModality(ctx context.Context, arg UpdateProcedureModalityParams) error

func (*Queries) UpdateProcedureSpecialty added in v0.6.11

func (q *Queries) UpdateProcedureSpecialty(ctx context.Context, arg UpdateProcedureSpecialtyParams) error

func (*Queries) UpdateVisit

func (q *Queries) UpdateVisit(ctx context.Context, arg UpdateVisitParams) (Visit, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Report

type Report struct {
	ID             int64
	CreatedAt      pgtype.Timestamp
	UpdatedAt      pgtype.Timestamp
	RadiologistID  pgtype.Int8
	Body           string
	Impression     string
	ReportStatus   string
	SubmittedDt    pgtype.Timestamp
	MessageID      pgtype.Int8
	DictationStart pgtype.Timestamp
	DictationEnd   pgtype.Timestamp
}

type Site

type Site struct {
	ID         int32
	CreatedAt  pgtype.Timestamp
	UpdatedAt  pgtype.Timestamp
	Code       string
	Name       pgtype.Text
	Address    string
	IsCms      bool
	MessageID  pgtype.Int8
	MetasiteID pgtype.Int4
}

type UpdateExamAddendumReportParams

type UpdateExamAddendumReportParams struct {
	ID               int64
	AddendumReportID pgtype.Int8
}

type UpdateExamFinalReportParams

type UpdateExamFinalReportParams struct {
	ID            int64
	FinalReportID pgtype.Int8
}

type UpdateExamParams

type UpdateExamParams struct {
	ID                  int64
	VisitID             pgtype.Int8
	MrnID               pgtype.Int8
	SiteID              pgtype.Int4
	ProcedureID         pgtype.Int4
	OrderingPhysicianID pgtype.Int8
	Accession           string
	CurrentStatus       string
	ScheduleDt          pgtype.Timestamp
	BeginExamDt         pgtype.Timestamp
	EndExamDt           pgtype.Timestamp
}

type UpdateExamPrelimReportParams added in v0.5.1

type UpdateExamPrelimReportParams struct {
	ID             int64
	PrelimReportID pgtype.Int8
}

type UpdatePatientParams

type UpdatePatientParams struct {
	ID         int64
	FirstName  string
	LastName   string
	MiddleName pgtype.Text
	Suffix     pgtype.Text
	Prefix     pgtype.Text
	Degree     pgtype.Text
	Dob        pgtype.Date
	Sex        string
	Ssn        pgtype.Text
	HomePhone  pgtype.Text
	WorkPhone  pgtype.Text
	CellPhone  pgtype.Text
}

type UpdatePhysicianParams

type UpdatePhysicianParams struct {
	ID         int64
	FirstName  string
	LastName   string
	MiddleName pgtype.Text
	Suffix     pgtype.Text
	Prefix     pgtype.Text
	Degree     pgtype.Text
	AppCode    string
	Npi        pgtype.Text
	Specialty  pgtype.Text
}

type UpdateProcedureModalityParams added in v0.6.12

type UpdateProcedureModalityParams struct {
	ID       int32
	Modality pgtype.Text
}

type UpdateProcedureSpecialtyParams added in v0.6.11

type UpdateProcedureSpecialtyParams struct {
	ID        int32
	Specialty pgtype.Text
}

type UpdateVisitParams

type UpdateVisitParams struct {
	ID          int64
	SiteID      pgtype.Int4
	MrnID       pgtype.Int8
	Number      string
	PatientType int16
}

type Visit

type Visit struct {
	ID          int64
	CreatedAt   pgtype.Timestamp
	UpdatedAt   pgtype.Timestamp
	SiteID      pgtype.Int4
	MrnID       pgtype.Int8
	Number      string
	PatientType int16
	MessageID   pgtype.Int8
}

Jump to

Keyboard shortcuts

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