models

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOrderEntities

func NewOrderEntities(visitSiteCode string, mrn CX, orderGroups ...orderGroup) []orderEntity

Types

type ADT

type ADT struct {
	MSH MessageModel   `json:"MSH"`
	EVN EventModel     `json:"EVN"`
	PID PatientModel   `json:"PID"`
	PV1 VisitModel     `json:"PV1"`
	IN1 InsuranceModel `json:"IN1"`
}

type CE

type CE struct {
	Identifier      string `json:"1"`
	Text            string `json:"2"`
	CodingSystem    string `json:"3"`
	AltIdentifier   string `json:"4"`
	AltText         string `json:"5"`
	AltCodingSystem string `json:"6"`
}

Coded Element

func (*CE) UnmarshalJSON

func (c *CE) UnmarshalJSON(data []byte) error

type CM_MSG

type CM_MSG struct {
	Type         string `json:"1"`
	TriggerEvent string `json:"2"`
}

Messate Type

func (*CM_MSG) UnmarshalJSON

func (m *CM_MSG) UnmarshalJSON(data []byte) error

type CX

type CX struct {
	ID                 string `json:"1"`
	CheckDigit         string `json:"2"`
	CheckDigitScheme   string `json:"3"`
	AssigningAuthority string `json:"4"`
	IdentifierTypeCode string `json:"5"`
}

Extended Composite ID

func (*CX) UnmarshalJSON

func (c *CX) UnmarshalJSON(data []byte) error

type EI

type EI struct {
	EntityIdentifier string `json:"1"`
	NamespaceID      string `json:"2"`
	UniversalID      string `json:"3"`
	UniversalIDType  string `json:"4"`
}

Entity Identifier

func (*EI) UnmarshalJSON

func (e *EI) UnmarshalJSON(data []byte) error

type EventModel

type EventModel struct {
	Code       string `json:"EVN.1"`
	DT         string `json:"EVN.2"`
	OperatorID XCN    `json:"EVN.5"`
	OccurredDT string `json:"EVN.6"`
}

type ExamModel

type ExamModel struct {
	Accession   string `json:"OBR.3"`
	Service     CE     `json:"OBR.4"`
	StatusDT    string `json:"OBR.22"`
	Status      string `json:"OBR.25"`
	Radiologist XCN    `json:"OBR.32"`
}

func (*ExamModel) ToEntity

func (e *ExamModel) ToEntity(siteCode string, status string, mrn CX) entity.Exam

type HD

type HD struct {
	NamespaceID     string `json:"1"`
	UniversalID     string `json:"2"`
	UniversalIDType string `json:"3"`
}

Hierarchic Designator

func (*HD) UnmarshalJSON

func (h *HD) UnmarshalJSON(data []byte) error

type InsuranceModel

type InsuranceModel struct {
	SetID          string `json:"IN1.1"`
	PlanID         string `json:"IN1.2"`
	CompanyName    string `json:"IN1.4"`
	CompanyAddress string `json:"IN1.5"`
	CompanyPhone   string `json:"IN1.7"`
	GroupNumber    string `json:"IN1.8"`
	PolicyNumber   string `json:"IN1.36"`
}

type MessageModel

type MessageModel struct {
	FieldSeparator string `json:"MSH.1"`
	EncodingChars  string `json:"MSH.2"`
	SendingApp     string `json:"MSH.3"`
	SendingFac     string `json:"MSH.4"`
	ReceivingApp   string `json:"MSH.5"`
	ReceivingFac   string `json:"MSH.6"`
	DateTime       string `json:"MSH.7"`
	Type           CM_MSG `json:"MSH.9"`
	ControlID      string `json:"MSH.10"`
	ProcessingID   string `json:"MSH.11"`
	Version        string `json:"MSH.12"`
}

func (*MessageModel) ToEntity

func (m *MessageModel) ToEntity() entity.Message

type ORM

type ORM struct {
	MSH MessageModel `json:"MSH"`
	PID PatientModel `json:"PID"`
	PV1 VisitModel   `json:"PV1"`
	ORC OrderModel   `json:"ORC"`
	OBR ExamModel    `json:"OBR"`
}

func (*ORM) ToDB

func (orm *ORM) ToDB(ctx context.Context, db *database.Queries) error

type ORU

type ORU struct {
	MSH MessageModel  `json:"MSH"`
	PID PatientModel  `json:"PID"`
	PV1 VisitModel    `json:"PV1"`
	ORC []OrderModel  `json:"ORC"`
	OBR []ExamModel   `json:"OBR"`
	OBX []ReportModel `json:"OBX"`
}

func (*ORU) GetReport

func (oru *ORU) GetReport() entity.Report

func (*ORU) GroupOrders

func (oru *ORU) GroupOrders() ([]orderGroup, error)

func (*ORU) ToDB

func (oru *ORU) ToDB(ctx context.Context, db *database.Queries) error

func (*ORU) UnmarshalJSON

func (oru *ORU) UnmarshalJSON(data []byte) error

type OrderModel

type OrderModel struct {
	OrderNo          string `json:"ORC.2"`
	FillerOrderNo    string `json:"ORC.3"`
	Status           string `json:"ORC.5"`
	OrderDT          string `json:"ORC.9"`
	OrderingProvider XCN    `json:"ORC.12"`
}

func (*OrderModel) ToEntity

func (o *OrderModel) ToEntity() entity.Order

type PL

type PL struct {
	PointOfCare         string `json:"1"`
	Room                string `json:"2"`
	Bed                 string `json:"3"`
	Facility            string `json:"4"`
	LocationStatus      string `json:"5"`
	PersonLocationType  string `json:"6"`
	Building            string `json:"7"`
	Floor               string `json:"8"`
	LocationDescription string `json:"9"`
}

Person Location

func (*PL) UnmarshalJSON

func (p *PL) UnmarshalJSON(data []byte) error

type PatientModel

type PatientModel struct {
	MRN  CX     `json:"PID.3"`
	Name XPN    `json:"PID.5"`
	DOB  string `json:"PID.7"`
	Sex  string `json:"PID.8"`
	SSN  string `json:"PID.19"`
}

func (*PatientModel) ToEntity

func (p *PatientModel) ToEntity() entity.Patient

type ReportModel

type ReportModel struct {
	SetID            string `json:"OBX.1"`
	ValueType        string `json:"OBX.2"`
	Service          CE     `json:"OBX.3"`
	ObservationSubID string `json:"OBX.4"`
	ObservationValue string `json:"OBX.5"`
	ResultStatus     string `json:"OBX.11"`
	ObservationDT    string `json:"OBX.14"`
}

type VisitModel

type VisitModel struct {
	VisitNo          string `json:"PV1.19"`
	Class            string `json:"PV1.2"`
	AssignedLocation PL     `json:"PV1.3"`
}

func (*VisitModel) ToEntity

func (v *VisitModel) ToEntity(siteCode string, mrn CX) entity.Visit

type XAD

type XAD struct {
	StreetAddress    string `json:"1"`
	OtherDesignation string `json:"2"`
	City             string `json:"3"`
	State            string `json:"4"`
	Zip              string `json:"5"`
	Country          string `json:"6"`
}

Extended Address

func (*XAD) UnmarshalJSON

func (x *XAD) UnmarshalJSON(data []byte) error

type XCN

type XCN struct {
	IDNumber   string `json:"1"`
	FamilyName string `json:"2"`
	GivenName  string `json:"3"`
	MiddleName string `json:"4"`
	Suffix     string `json:"5"`
	Prefix     string `json:"6"`
	Degree     string `json:"7"`
}

Extended Composite ID & Name

func (*XCN) UnmarshalJSON

func (x *XCN) UnmarshalJSON(data []byte) error

type XPN

type XPN struct {
	LastName   string `json:"1"`
	FirstName  string `json:"2"`
	MiddleName string `json:"3"`
	Suffix     string `json:"4"`
	Prefix     string `json:"5"`
	Degree     string `json:"6"`
}

Extended Person Name

func (*XPN) UnmarshalJSON

func (x *XPN) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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