The Interface: Week 4

The Weekly · Week 4 · Stream

The Interface

Next drop Monday Oct 12, 16:00 UTC

Week 4

hosted bydatadriven

Results

next drop

6 scored

32 submissions

first in coral_mesa_9943, 10h 49m

The challenge

You're a data engineer at a hospital. Every lab result reaches it as an HL7 message: 1 result per message, text segments, | between the fields, filed under the specimen's accession number. An interface engine logs each message as 1 JSON line, and the quality team needs 1 clean row per result from that log. Write the code that turns the log into that table.

The mess

Results come from the hospital's lab and an outside reference lab, over separate links. The lab keeps its own patient index, days behind registration. A result goes out when entered and again each time it is verified or changed. The engine logs its acknowledgements, notes and test runs in the same file. A sender that hears no acknowledgement sends again. Some lines end before their message does.

Streamed record examplesline 1 of 10
01{
02"received_at": "2026-09-14T04:00:04Z",string
03"connection": "lis-results",string
04"message": "MSH|^~\&|LIS|HOSP|ENGINE|HOSP|20260914000004-0400||ORU^R01|LIS0000000001|P|2.5.1 PID|1||10104553^^^HOSP^MR||KIM^MINA||19931116|F OBR|1|ORD00000001|LAB0112472|51990-0^Basic metabolic panel^LN|||20260913171353-0400 OBX|1|NM|2160-0^Creatinine^LN||3.24|mg/dL|0.6-1.2|H|||F"string
05}

1,000,000 messages

Output schema

Click a column for its requirements, or click the bottom of the sheet to see the 10 sample rows to produce.

Notes from the quality team

  • For 1 result, corrected beats final beats W beats preliminary.
  • A time with no offset is the sender's local time.
  • The hospital is in US Eastern, the reference lab in US Central.
  • received_at, connection and other engine extras are bookkeeping.
  • 2 layers write the log in turn, and each escapes what it gets.

How you're scored

  • +1the right value. A right null counts.
  • 0null where the source held a value. Silence is free.
  • −1a wrong value. Silent corruption costs.
  • −2a row that should not exist: no matching key, or a second row for the same key. The last row for a key is the one scored.
Drops Mon 05 Oct 16:00 UTC · freezes Sun 11 Oct 16:00 UTC · results post at the freeze · next drop Mon 12 Oct 16:00 UTC. Submit as often as you like; the last one counts. Questions go in this week's thread.