Practice problems
Small test-driven exercises for weeks 3 to 6
The lectures build one project. These two problem sets drill the skills underneath it, one small function at a time: you fill in a stub and run its tests until they pass. They are optional and not counted in the ~10 h per week.
The two sets
| Set | Size | Needs | Covers |
|---|---|---|---|
| hl7-practice | 18 problems: 7 Easy, 8 Medium, 3 Hard | Python 3.10+, standard library only | Reading and writing messages by hand, MLLP framing, validation, routing, reconciliation, a v2 → FHIR mapping |
| mellp | 38 problems: 14 Easy, 20 Medium, 4 Hard; 2 labs | Python 3.12, uv; python-hl7 from problem 06 on; Docker for Lab B | Framing, ACKs, sockets, retries, a small interface engine, FHIR, TLS; a Wireshark lab and a Mirth Connect lab |
hl7-practice ships with this course, in
static/files/hl7-practice/. Its
README.md holds all 18 specs. Problems 01 to 09 parse and
build messages by hand; 10 to 18 are written as integration tickets that reuse
those answers.
$ git clone https://github.com/HeyItWorked/health-it-semester.git
$ cd health-it-semester/static/files/hl7-practice
$ python3 test_practice.py # every problem; untouched ones show "not started"
$ python3 test_practice.py p05 # one problem
$ python3 test_practice.py --solution # the reference solutions
mellp is its own repository. Each problem is a folder with a statement, a stub and tests.
$ git clone https://github.com/HeyItWorked/mellp.git
$ cd mellp
$ uv sync
$ uv run pytest problems/01-* # red until you fill in problems/01-wrap-it/solution.py
$ uv run pytest problems/01-* --ref # the same tests against the reference solution
Inside a set, go in number order: later problems reuse earlier ones.
Where they fit
Each week has a page with the full text of its exercises and a reference solution collapsed under each one. The tables below are the map: they show which problems go with which lecture section. The numbers are problem numbers in each set, and every problem appears once. Some rows go a step past the lecture: the course bridge maps patients from ADT messages, and the week 4 row maps lab results from ORU messages too.
Week 3: HL7 v2 + patient identity
| Lecture section | hl7-practice | mellp |
|---|---|---|
| Anatomy of a message, the carriage-return trap | 01, 02, 04–07: split segments, fields, components and repeats by hand | 08: delimiters and escapes by hand |
| Use a parser | 06, 07, 11: MSH, PID and OBX with python-hl7 | |
| Message types and trigger events | 03, 13: read MSH-9; map ADT events to actions | 12: tell ADT, ORU and ORM apart |
| Getting messages across: MLLP | 10, 11: frame, unframe, read a split stream | 01–05: framing; 15–17, 20, 21: listeners and senders on real sockets |
| Acknowledgments | 08: build the ACK | 09, 10: echo MSH-10; choose AA, AE or AR |
| Delivery: at least once | 18, 19, 23, 24: retries, duplicate detection, a listener that survives bad peers and restarts | |
| Patient identity | 17: link one person's identifiers across facilities | |
| Building the bridge | 32, 33, 35: message to JSON, PID to Patient, a small FHIR server to post to | |
| When the FHIR server is down | 36: turn each HTTP outcome into AA, AE or AR | |
| Integration engines | 09: change one field and keep the rest intact | 25, 26: route by type; transform |
| The broken message set | 12, 14: reject bad headers and bad results | 13, 14: one site's rules, then the standard's own with hl7apy |
Week 4: FHIR APIs
| Lecture section | hl7-practice | mellp |
|---|---|---|
| The week 3 bridge's output | 18: ORU to a Patient and Observations | 34: ORU to a transaction Bundle |
Week 5: Privacy + AI
| Lecture section | hl7-practice | mellp |
|---|---|---|
| MLLP on the wire | 37, 38: TLS and client certificates. Lab A: read a capture in Wireshark |
Week 6: Ship + get hired
| Lecture section | hl7-practice | mellp |
|---|---|---|
| Deploying an OIE channel | 31: a small engine in one process. Lab B: your code against Mirth Connect | |
| Replaying a day of traffic safely | 15, 16: reconcile ACKs with what was sent, and results with orders | 22, 27, 28: load test, message log, replay |
| When the bridge goes down | 29, 30: dead-letter queue; store and forward |
How this was tested
On 13 Nov 2026, with Python 3.12.3, the hl7-practice reference solutions
passed all 162 checks
(python3 test_practice.py --solution). mellp runs every
reference solution in CI on each push, and its last run on that date passed.
Not tested yet: working the two sets alongside the lectures in the order
above, which is a match by topic.
Course content © 2026 HeyItWorked. All rights reserved.
Site design adapted from The Missing Semester of Your CS Education under CC BY-NC-SA 4.0. See copyright and license.