edan

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

Documentation

Overview

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

CBC format: Sample ID,Mode,Analysis Time,WBC(10^3/��L),LYM#(10^3/��L),LYM%(%),MXD#(),MXD%(),NEUT#(),NEUT%(),RBC(10^6/��L),HGB(g/dL),HCT(%),MCV(fL),MCH(pg),MCHC(g/dL),RDW_CV(%),RDW_SD(fL),PLT(10^3/��L),PDW(fL),MPV(fL),PCT(%),P_LCR(%),P_LCC(10^3/��L)

Index

Constants

This section is empty.

Variables

View Source
var (
	// Regular expression to extract units from brackets
	// e.g WBC(10^3/uL) extracts 10^3/uL
	UnitsRegex = regexp.MustCompile(`\((.*?)\)`)
)

Functions

func New

func New() cbcparser.CSVParser

Initialize a new CSV Parser

func NewMultiParser

func NewMultiParser() cbcparser.CSVMultiParser

Types

type EdanCBCResult added in v1.0.4

type EdanCBCResult struct {
	SID          string `json:"sid"`
	Mode         string `json:"mode"`
	AnalysisTime string `json:"analysis_time"`
	PID          string `json:"pid"`

	WBC        cbcparser.CBCValue `json:"wbc"`
	LYM        cbcparser.CBCValue `json:"lym"`
	LYMPercent cbcparser.CBCValue `json:"lym_percent"`
	MID        cbcparser.CBCValue `json:"mid"`
	MIDPercent cbcparser.CBCValue `json:"mid_percent"`
	GRA        cbcparser.CBCValue `json:"gra"`
	GRAPercent cbcparser.CBCValue `json:"gra_percent"`

	RBC  cbcparser.CBCValue `json:"rbc"`
	HGB  cbcparser.CBCValue `json:"hgb"`
	HCT  cbcparser.CBCValue `json:"hct"`
	MCV  cbcparser.CBCValue `json:"mcv"`
	MCH  cbcparser.CBCValue `json:"mch"`
	MCHC cbcparser.CBCValue `json:"mchc"`
	RDWc cbcparser.CBCValue `json:"rdw_c"`
	RDWs cbcparser.CBCValue `json:"rdw_s"`

	PLT cbcparser.CBCValue `json:"plt"`
	PDW cbcparser.CBCValue `json:"pdw"`
	MPV cbcparser.CBCValue `json:"mpv"`
	PCT cbcparser.CBCValue `json:"pct"`

	PLCC cbcparser.CBCValue `json:"plcc"`
	PLCR cbcparser.CBCValue `json:"plcr"`
}

Sample ID,Mode,Analysis Time,WBC(10^3/��L),LYM#(10^3/��L),LYM%(%),MXD#(),MXD%(),NEUT#(),NEUT%(),RBC(10^6/��L),HGB(g/dL),HCT(%),MCV(fL),MCH(pg),MCHC(g/dL),RDW_CV(%),RDW_SD(fL),PLT(10^3/��L),PDW(fL),MPV(fL),PCT(%),P_LCR(%),P_LCC(10^3/��L) Structure to store data parsed from the text file exported by the Edan Pro30 CBC Machine.

func (EdanCBCResult) Parse added in v1.0.4

func (cbc EdanCBCResult) Parse(r io.Reader, normal_ranges *cbcparser.CBCNormalRange) (cbcparser.CBCWriter, error)

ParseTSV reads from r and parses the data into an slice of CBCResult structs. The text file is expected to be in the csv format. The first line of the file is expected to be the header.

The header is expected to be in the following format(with 24 columns):

func (EdanCBCResult) Write added in v1.0.4

func (cbc EdanCBCResult) Write(out io.Writer, format cbcparser.OutFormat) error

type EdanCBCResultMulti added in v1.0.4

type EdanCBCResultMulti []EdanCBCResult

func (EdanCBCResultMulti) ParseMulti added in v1.0.4

MultiParse reads from r and parses the data into an slice of a CBCWriter struct.

Jump to

Keyboard shortcuts

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