I’m interfacing with Blood Analyzers in my veterinary emergency hospital via a serial connection.
I need to draw a simple bar graph given 3 pieces of data. I have a description, a value, and a range. I’m contemplating just using a Canvas, but thought I’d throw this out there in case there is a better method. I’m trying to duplicate the view shown in the attached image. I’ve highlighted one line in blue. In this example I’d have data sent via serial to me like this
ALB 3.1 2.5-4.4 g/dL
I parse the data and get the description as “ALB” (Alanine transaminase ) the value as “3.1” (I append the ‘g/dL’ to this) and then the range is “2.5 to 4.4”. From this, if it is out of range I just plot a red bar (to the left if it is low or to the right if it is high), if it is in range I plot where it falls within the range instead. There will be multiple results, and the quantity of results will vary depending on what main test is being run on the analyzer. I just keep parsing the received data and adding another set of values and graph below the previous one. I’ll need to be able to print and also export the whole page of results to a JPG to be sent to our Practice Management software.
Any smart folks have a better way of doing this than drawing each graph in a canvas
full sample of results received via the serial port from one type of test we run. In this instance I’d have 10 small graphs to plot under each other:
[code] VetScan VS2
Kidney Profile Plus
07 Jan 2019 02:38 AM
Sample Type: Dog
Patient ID: 25008
Rotor Lot Number: 8141BB3
Serial Number: 0000Vxxxxx
…
GLU 93 60-110 mg/dL
BUN 17 7-25 mg/dL
CA 11.3 8.6-11.8 mg/dL
CRE 1.1 0.3-1.4 mg/dL
ALB 3.2 2.5-4.4 g/dL
PHOS 5.5 2.9-6.6 mg/dL
NA+ 129 * 138-160 mmol/L
K+ 7.1 * 3.7-5.8 mmol/L
CL- 105 95-119 mmol/L
tCO2 21 12-27 mmol/L
QC OK
HEM 1+ LIP 0 ICT 0 [/code]
Values with a “*” warn me the value is out of range, just in case anyone wondered why some values had this.