Presentation 2 - Association for Pathology Informatics

Download Report

Transcript Presentation 2 - Association for Pathology Informatics

VB Programming Example
Paul G. Catrou, MD
APiii Breakout Session
10/10/2007
What do we want to do with the data?
By drug
Count total number of samples
Percent and total out of range low
Percent and total out of range high
Sort by drug
Output in tab delimited file with column headings
Look at the data
delimited or columnar
Our case is columnar
Does the file contain miscellaneous stuff we don't need? If
yes, figure out how to identify valid lines (records) to
process.
Assign computing variable names to data we need (the
discreet data elements in the line).
In our case, we will parse all the data elements.
pn
patient name
hn
medical record number
doc ordering doctor
loc
patient location
acno accession number
coldt collect date
coltm collect time
test test code
res result
lo
low limit of reference interval
hi
high limit of reference interval
Identify other variables needed:
tLo total number of low results
tHi
total number of high results
pLo percentage of low results
pHi percentage of high results
total total number of results
dName
drug name
dl
delimiter (tab character)
dat(5000)
array for to hold output strings
(records or lines)
DN(8,2)
array to hold drug test code and
drug name
Ary(18,3)
array to hold drug counts, highs,
and lows
Read line and parse into distinct data elements which
may be needed.
Do counts as each line is processed
Assemble the output line with sorting fields first and
inserting tab delimiter.
Store in temporary array (list)
Sort the array (list)
Calculate the percentages
Create the output file
Write out sorted list
Write out summary data
End