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

SetSizeNeedsCovers
hl7-practice18 problems: 7 Easy, 8 Medium, 3 HardPython 3.10+, standard library onlyReading and writing messages by hand, MLLP framing, validation, routing, reconciliation, a v2 → FHIR mapping
mellp38 problems: 14 Easy, 20 Medium, 4 Hard; 2 labsPython 3.12, uv; python-hl7 from problem 06 on; Docker for Lab BFraming, 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

Open the week 3 exercises

Lecture sectionhl7-practicemellp
Anatomy of a message, the carriage-return trap01, 02, 04–07: split segments, fields, components and repeats by hand08: delimiters and escapes by hand
Use a parser06, 07, 11: MSH, PID and OBX with python-hl7
Message types and trigger events03, 13: read MSH-9; map ADT events to actions12: tell ADT, ORU and ORM apart
Getting messages across: MLLP10, 11: frame, unframe, read a split stream01–05: framing; 15–17, 20, 21: listeners and senders on real sockets
Acknowledgments08: build the ACK09, 10: echo MSH-10; choose AA, AE or AR
Delivery: at least once18, 19, 23, 24: retries, duplicate detection, a listener that survives bad peers and restarts
Patient identity17: link one person's identifiers across facilities
Building the bridge32, 33, 35: message to JSON, PID to Patient, a small FHIR server to post to
When the FHIR server is down36: turn each HTTP outcome into AA, AE or AR
Integration engines09: change one field and keep the rest intact25, 26: route by type; transform
The broken message set12, 14: reject bad headers and bad results13, 14: one site's rules, then the standard's own with hl7apy

Week 4: FHIR APIs

Open the week 4 exercises

Lecture sectionhl7-practicemellp
The week 3 bridge's output18: ORU to a Patient and Observations34: ORU to a transaction Bundle

Week 5: Privacy + AI

Open the week 5 exercises

Lecture sectionhl7-practicemellp
MLLP on the wire37, 38: TLS and client certificates. Lab A: read a capture in Wireshark

Week 6: Ship + get hired

Open the week 6 exercises

Lecture sectionhl7-practicemellp
Deploying an OIE channel31: a small engine in one process. Lab B: your code against Mirth Connect
Replaying a day of traffic safely15, 16: reconcile ACKs with what was sent, and results with orders22, 27, 28: load test, message log, replay
When the bridge goes down29, 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.