vetinf

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VetInfSpec = conf.SectionSpec{
	{
		Name:        "Directory",
		Type:        conf.StringType,
		Required:    true,
		Description: "Path to the vetinf Infdat directory",
	},
	{
		Name:        "Encoding",
		Type:        conf.StringType,
		Default:     "IBM852",
		Description: "Text encoding of the Infdat DBase files",
	},
	{
		Name:        "ImportSchedule",
		Type:        conf.StringType,
		Default:     "@every 10m",
		Description: "Schedule for the VetInf data import",
	},
	{
		Name:        "UserIDProperty",
		Type:        conf.StringType,
		Default:     "",
		Description: "The name of the user property that maps to the user identifier in VetInf.",
	},
}

VetInfSpec describes the allowed configuration directives for the Vetinf import.

Functions

func Register

func Register(ctx context.Context, manager *importer.Manager) error

Types

type ExportedAnimal

type ExportedAnimal struct {
	v1alpha.PatientRecord
	Deleted bool
}

ExportedAnimal is a animal patient record exported from a VetInf installation.

type ExportedCustomer

type ExportedCustomer struct {
	customerdb.Customer
	Deleted bool
}

ExportedCustomer is a customer exported from a VetInf installation.

type Exporter

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

Exporter is capable of exporting and extracting data of a VetInf installation.

func NewExporter

func NewExporter(cfg VetInf, country string) (*Exporter, error)

NewExporter creates a new exporter for vetinf.

func (*Exporter) ExportAnimals

func (e *Exporter) ExportAnimals(ctx context.Context) (<-chan *ExportedAnimal, int, error)

func (*Exporter) ExportCustomers

func (e *Exporter) ExportCustomers(ctx context.Context) (<-chan *ExportedCustomer, int, error)

ExportCustomers exports all vetinf customers and streams them to the returned channel. Errors encountered when exporting single customers are logged and ignored.

type ImportResults

type ImportResults struct {
	New      int
	Pristine int
	Updated  int
	Deleted  int
}

func ImportCustomers

func ImportCustomers(ctx context.Context, exporter *Exporter, customers customerdb.Database) (*ImportResults, error)

func ImportPatients

func ImportPatients(ctx context.Context, exporter *Exporter, patients patientdb.Database) (*ImportResults, error)

type VetInf

type VetInf struct {
	Directory      string
	Encoding       string
	ImportSchedule string
	UserIDProperty string
}

VetInf describes the configuration required to import data from a Vetinf installation.

Jump to

Keyboard shortcuts

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