r/HealthInformatics • u/woodywooder123 • 1d ago
❓ Help / Advice Software testing and QA missing rare data conversion errors in clinical systems
During the recent update to our clinical data exchange system, we ran into a massive problem. Our standard software testing and QA process completely missed rare errors when converting lab results from different laboratories.
This is critical. If a doctor gets the wrong data because the conversion logic failed on a rare edge case, it could be a life-or-death situation. The standard automated tests we run only cover the happy path, and they are failing to catch these weird formatting issues from smaller labs.
We need to overhaul our testing strategy immediately. Health informatics experts, how do you build automated tests that actually catch these rare anomalies?
Do you use synthetic data to simulate weird lab formats, or is there a specific validation framework you trust?
I'm trying to figure out how to verify the integrity of medical data before release without manually checking every single record.
We clearly need a more rigorous QA process, but I don't even know where to start.
Any advice on how to build a testing pipeline that actually protects patient safety would be incredibly helpful right now
1
u/Particular-Rock6086 1d ago
I'd look at this as two separate problems: improving your test coverage and making sure unexpected conversion errors can't silently pass through the system in production. Even a very comprehensive test suite won't cover every format a new lab might introduce. Out of curiosity, are you working with HL7/FHIR messages, custom lab formats, or a mixture of both? And is the conversion logic centralized or handled separately for each lab?
1
u/HealthDataPlumber 23h ago
Happy-path tests won't catch this, because the edge cases live in real lab feeds and not in your test data.
What's worked for us:
Build a regression corpus from real messages. Pull de-identified samples from every sending lab, especially the small ones, and save them as golden files. Every release has to convert them to the same output as before. Each time a new weird case turns up, add it to the corpus.
Run old and new side by side before cutover. Send live traffic through both versions and diff the outputs. Any difference gets reviewed.
Validate against standards, not just structure. Check that LOINC codes map correctly, that units are valid UCUM, that value types match (numeric vs. string vs. ranges like "<0.5"), and that reference ranges make sense. Most silent errors turn out to be unit or value-type problems.
Quarantine instead of passing through. Unmapped codes, unknown units, or out-of-range values should go to a review queue and not reach the clinician as-is.
Fuzz the parser. Property-based tests with odd delimiters, missing fields, and extra OBX segments will find failures that nobody would think to write by hand.
Tools worth a look: the HAPI FHIR validator and the NIST HL7v2 validation tools.
1
u/Likh-98 1d ago
Happy path tests miss this because the bad cases come from the source labs, so I'd build the test set from their real output. Pull a sample of raw messages from each lab, especially the small ones, and group them by what varies: units, reference range formats, values like <5 or >100, text instead of numbers, missing fields, odd character encoding, decimal commas. Turn each variation into a test case, with the expected result agreed with a clinical or lab person.
Synthetic data helps once you know the patterns, but start from real ones with identifiers removed. Then add a rule that anything the converter cannot map confidently goes to a review queue instead of passing through silently. Also compare input and output counts per lab per day, so a sudden drop in converted results shows up quickly.
When a new edge case turns up in production, add it to the test set.