Your Cart
Loading

Code Clinic - HL7 Lab - Book 3: Chopping Data with split()

On Sale
$10.00
$10.00
Added to cart

One method does most of the work here. split() takes a line packed with data and hands back a list, and this whole book is about using it well. It starts with the problem: a single HL7 line holds a dozen separate values with nothing but a symbol between them, and reading it by eye does not scale. Then split() arrives, and you see what it actually returns, a list, which means every field is now available by index and you can ask for part three without touching the rest. You choose the delimiter yourself, so the same method handles a pipe in an HL7 line, a comma in an exported file, or a caret inside a single field. The default behavior with no argument, splitting on whitespace, gets its own chapter so you know when it helps and when it quietly ruins your data. There is a counting rule you will use constantly, that the number of pieces equals the number of separators plus one. The book finishes by parsing a real record line from one end to the other.


Eighteen A4 pages, in full color. Written in short sentences and plain English, for readers whose first language is not English and clearer for everyone else because of it.


Every code example in this book was run before the page was printed, so the output you read is the output you get. Instant PDF download. By M.R. Sterling.

You will get a PDF (764KB) file