hcris

package module
v0.0.0-...-a44f8c9 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2018 License: MIT Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

hcris-tools

A package for archiving and handling HCRIS data from CMS.

See hcris-archiver for more information on how to use this package.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB

DB holds the open database connection.

View Source
var OutputFile *os.File
View Source
var OutputQueue []string

Functions

func BuildQuery

func BuildQuery(table string) string

func Check

func Check(err error)

Check handles checking err in a standard way. It triggers a generic message if an error is present.

func CheckExtractFiles

func CheckExtractFiles() error

func CheckMem

func CheckMem(msg string)

func Debug

func Debug(msg string)

Debug prints out generic messages if the configuration turns Debug on.

func DebugVerbose

func DebugVerbose(msg string)

func DownloadFiles

func DownloadFiles(url string, path string, attr string, list string, tag string, prefix string, ext string) []string

func Error

func Error(msg AppMsg, shutdown bool)

func ExtractFile

func ExtractFile(file string)

ExtractFile - Open a zip archive for reading.

func ExtractToFolder

func ExtractToFolder(file string, outputDirectory string)

func Fail

func Fail(msg string)

func GetDataFolder

func GetDataFolder() string

func GetFieldList

func GetFieldList(table string) []string

func GetOutputFolder

func GetOutputFolder() string

func GetPage

func GetPage(url string) *http.Response

GetPage loads the provided url and returns the response.

func HandleAlpha

func HandleAlpha(record []string) string

func HandleAlphaLong

func HandleAlphaLong(record []string) string

func HandleNumeric

func HandleNumeric(record []string) string

func HandleNumericJson

func HandleNumericJson(record []string) string

func HandleNumericLong

func HandleNumericLong(record []string) string

func HandleReport

func HandleReport(record []string) string

func HandleReportJson

func HandleReportJson(record []string) string

func HandleReportLong

func HandleReportLong(record []string) string

func HandleRollup

func HandleRollup(record []string) string

func HandleRollupJson

func HandleRollupJson(record []string) string

func HandleRollupLong

func HandleRollupLong(record []string) string

func LoadConfig

func LoadConfig(file string) error

LoadConfig expects a file in yaml format. It returns any error encountered reading the file.

func Match

func Match(n *html.Node, tag string, text string) bool

func Ok

func Ok(msg string)

func ParseContent

func ParseContent(response *http.Response) *html.Node

func Pass

func Pass(msg string)

func ReadCsv

func ReadCsv(content string, data string)

func SQLiteClose

func SQLiteClose() error

SQLiteClose closes the database connection.

func SQLiteConnect

func SQLiteConnect(file string) error

SQLiteConnect connects to the supplied sqlite file path.

func SQLiteExecute

func SQLiteExecute(sql string) (int64, error)

SQLiteExecute executes the supplied SQL string.

func SetupDb

func SetupDb() error

func WatchMem

func WatchMem()

func WriteQueueToDb

func WriteQueueToDb(table string) error

func WriteQueueToFile

func WriteQueueToFile(fileType string) error

func WriteResultToDb

func WriteResultToDb(query string) error

func WriteStringToFile

func WriteStringToFile(output string, file string) error

func WriteToLog

func WriteToLog(msg string)

func WriteToLogFAIL

func WriteToLogFAIL(msg string)

func WriteToLogOK

func WriteToLogOK(msg string)

Types

type AppMsg

type AppMsg struct {
	Severity string
	Source   string
	Message  string
	Code     int
	Error    error
}

AppMsg holds a formatted error response.

type BaseTableAlpha

type BaseTableAlpha struct {
	C1_RptRecNum         string `json:"C1_RptRecNum"`
	C2_WkshtNum          string `json:"C2_WkshtNum"`
	C3_LineNum           string `json:"C3_LineNum"`
	C4_ClmnNum           string `json:"C4_ClmnNum"`
	C5_ItmAlphnmrcItmTxt string `json:"C5_ItmAlphnmrcItmTxt"`
}

func HandleAlphaJson

func HandleAlphaJson(record []string) BaseTableAlpha

type BaseTableNumeric

type BaseTableNumeric struct {
	C1_RptRecNum string
	C2_WkshtNum  string
	C3_LineNum   string
	C4_ClmnNum   string
	C5_ItmValNum string
}

type BaseTableReport

type BaseTableReport struct {
	C1_RptRecNum       string
	C2_PrvdrCtrlTypeCd string
	C3_PrvdrNum        string
	C4_Npi             string
	C5_RptStusCd       string
	C6_FyBgnDt         string
	C7_FyEndDt         string
	C8_ProcDt          string
	C9_InitlRptSw      string
	C10_LastRptSw      string
	C11_TrnsmtlNum     string
	C12_FiNum          string
	C13_AdrVndrCd      string
	C14_FiCreatDt      string
	C15_UtilCd         string
	C16_NprDt          string
	C17_SpecInd        string
	C18_FiRcptDt       string
}

type BaseTableRollup

type BaseTableRollup struct {
	C1_RptRecNum string
	C2_Label     string
	C3_Item      string
}

type Config

type Config struct {
	Source struct {
		Download  bool   `yaml:"download"`
		Directory string `yaml:"directory"`
		FixedDate string `yaml:"fixedDate"`
		Url       string `yaml:"url"`
		Path      string `yaml:"path"`
		List      string `yaml:"list"`
		TagAttr   string `yaml:"tagAttr"`
		TagMatch  string `yaml:"tagMatch"`
		Host      string `yaml:"host"`
		Password  string `yaml:"password"`
	} `yaml:"source"`
	Store struct {
		Extract   bool   `yaml:"extract"`
		Directory string `yaml:"directory"`
		Prefix    string `yaml:"prefix"`
		Ext       string `yaml:"ext"`
		File      string `yaml:"file"`
		MaxQueue  int    `yaml:"maxqueue"`
	} `yaml:"store"`
	Settings struct {
		Debug   bool   `yaml:"debug"`
		Verbose bool   `yaml:"verbose"`
		Output  string `yaml:"output"`
		Logfile string `yaml:"logfile"`
	} `yaml:"settings"`
}

Config is built from the yaml configuration file. It provides all configuration values for the application.

var AppConfig Config

AppConfig holds the configuration from the loaded yaml file.

Jump to

Keyboard shortcuts

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