cbcparser

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCSV       = errors.New("invalid csv file")
	ErrInsufficientRows = errors.New("csv must have at least 2 rows")
	ErrBlankCBCRecord   = errors.New("cbc record was a blank")
	ErrInvalidOutFormat = errors.New("invalid output format")
)

Functions

This section is empty.

Types

type CBCMultiWriter

type CBCMultiWriter []CBCWriter

Data structure for multiple CBC records

func (CBCMultiWriter) Write

func (list CBCMultiWriter) Write(out io.Writer, format OutFormat) error

type CBCNormalRange

type CBCNormalRange struct {
	WBC        NormalRange `json:"wbc"`
	LYM        NormalRange `json:"lym"`
	MID        NormalRange `json:"mid"`
	GRA        NormalRange `json:"gra"`
	LYMPercent NormalRange `json:"lym_percent"`
	MIDPercent NormalRange `json:"mid_percent"`
	GRAPercent NormalRange `json:"gra_percent"`
	RBC        NormalRange `json:"rbc"`
	HGB        NormalRange `json:"hgb"`
	HCT        NormalRange `json:"hct"`
	MCV        NormalRange `json:"mcv"`
	MCH        NormalRange `json:"mch"`
	MCHC       NormalRange `json:"mchc"`
	RDWs       NormalRange `json:"rdw_s"`
	RDWc       NormalRange `json:"rdw_c"`
	PLT        NormalRange `json:"plt"`
	PCT        NormalRange `json:"pct"`
	MPV        NormalRange `json:"mpv"`

	// PDW is used by Edan machine
	PDW NormalRange `json:"pdw"`
	// Used by Human Machine
	PDWs NormalRange `json:"pdw_s"`
	// Used by Human Machine
	PDWc NormalRange `json:"pdw_c"`
	PLCC NormalRange `json:"plcc"`
	PLCR NormalRange `json:"plcr"`
}

func ReadNormalRanges

func ReadNormalRanges(r io.Reader) (*CBCNormalRange, error)

type CBCValue

type CBCValue struct {
	Value       float32     `json:"value"`
	Units       string      `json:"units"`
	Flag        string      `json:"flag"`
	NormalRange NormalRange `json:"normal_range"`
}

type CBCWriter

type CBCWriter interface {
	// Writes all the data into out writer.
	Write(out io.Writer, format OutFormat) error
}

Concrete type containing CBC fields values, units and flags Each CBCResult must implement a single Write method.

type CSVMultiParser

type CSVMultiParser interface {
	ParseMulti(r io.Reader, normal_ranges *CBCNormalRange) (CBCMultiWriter, error)
}

Parses a csv with multiple rows and returns a slice of CBCWriter structs.

type CSVParser

type CSVParser interface {
	Parse(r io.Reader, normal_ranges *CBCNormalRange) (CBCWriter, error)
}

Parses a csv file with a single CBC record.

type NormalRange

type NormalRange struct {
	Lower float32 `json:"lower"`
	Upper float32 `json:"upper"`
}

type OutFormat

type OutFormat int
const (
	JSON OutFormat = iota
	JSONIndent
)

Directories

Path Synopsis
parses cbc tsv/csv to print the cbc report to stdout Ascii char go from: https://theasciicode.com.ar/extended-ascii-code/box-drawing-character-single-line-upper-left-corner-ascii-code-218.html
parses cbc tsv/csv to print the cbc report to stdout Ascii char go from: https://theasciicode.com.ar/extended-ascii-code/box-drawing-character-single-line-upper-left-corner-ascii-code-218.html

Jump to

Keyboard shortcuts

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