CSV to Medical Report Automation

Job ID: 40159066

Budget: £250 – £750 GBP

Overview

I run a UK medico-legal reporting practice. I need a Python-based automated report generator that takes CSV exports from Jotform questionnaires (completed by claimants in first person) and produces a professionally formatted medico-legal medical report PDF written in the expert’s voice (third person, formal tone).

This is NOT a simple CSV-to-PDF “copy/paste” solution. The output must be 90–95% ready and require only light human tidying at the end.

Key Point (must understand before applying)

The CSV responses are written like:

“I attended A&E”

“My neck pain is ongoing”

“I had 6 physio sessions”

The report must convert this into expert narrative like:

“The claimant attended Accident & Emergency following the index accident…”

“The claimant reports ongoing neck symptoms at the time of examination…”

“The claimant confirms having undertaken six physiotherapy sessions…”

So the system must create correct sentences from raw inputs using a clause/sentence library + rules (not just dump the raw text).

Deliverables
1) Input parsing

Read CSV files (Jotform export format).

Handle missing fields, blanks, “N/A”, inconsistent formatting, and common text variations.

2) Rules engine + clause library (core feature)

Build a mapping system that selects the correct sentences/paragraphs based on the CSV values, including:

First-person to third-person conversion (with correct tense and medico-legal tone).

Conditional logic:

If A&E = Yes, include A&E paragraph; if No, omit.

If GP visits = 0, state none; if >0, summarise number + advice.

If symptoms ongoing = Yes, include current symptoms + prognosis logic.

If treatment = None, include “no treatment undertaken” phrasing.

Grammar correctness:

“1 session” vs “6 sessions”

“minute/minutes”

Capitalisation rules (Title Case for headings; correct sentence case in narrative)

Postcodes uppercase

Ability for me to maintain/extend a sentence library (JSON/YAML) without editing core code.

3) Report generation (PDF)

Produce a properly formatted PDF that looks like a professional medico-legal report (not a plain document).

Consistent styling, headings, spacing, pagination, and table formatting where required.

Footer on every page with:

“Expert report on [Claimant Name] by Dr [Name], dated [Report Date] – Page X of Y”

Page numbering must be correct from cover onwards.

4) Output structure

The report must populate standard medico-legal sections such as (example):

Claimant details

Index accident history

Symptoms/injuries reported

Treatment summary

Examination findings (where present in data)

Opinion on causation (templated phrasing)

Prognosis (rule-based, based on injury status/treatment)

Recommendations (e.g., physio sessions)

Statement of truth / declarations (templated)

(Exact section list and wording provided by me.)

5) Human-in-the-loop workflow

The tool should generate a PDF that is 90–95% correct, after which a human can:

add any missing bespoke lines

adjust nuance where required

final-check for compliance

The goal is to remove most manual writing, not just formatting.

Tech Requirements

Python 3.x

Clean, maintainable code (modular)

Works locally on Windows

Config-driven templates (JSON/YAML)

Logging (so we can trace which rules fired and why)

Unit tests for key mappings (recommended)

PDF libraries: ReportLab / WeasyPrint / wkhtmltopdf acceptable (tell me what you’ll use and why).

What you must include in your application (to filter out time-wasters)

A short explanation of how you will implement:

clause library

rules engine

first-person → third-person narrative conversion

What PDF approach you’ll use and how you’ll handle:

“Page X of Y”

consistent formatting

Examples of similar work (report generators / document automation)

Confirmation you can deliver an initial working prototype using my sample CSV within a short timeframe.

Data + compliance note

This is medical/legal content (UK medico-legal). You must handle data securely. Real claimant data will only be shared with shortlisted candidates and ideally anonymised for development.

Milestones (recommended)

Prototype: parse sample CSV → produce structured PDF with basic sections

Add rules engine + clause library

Improve narrative quality + grammar handling

Final formatting polish + footers/pagination + logs/tests

Documentation: how I add/edit clause rules + templates

Budget & speed

I need someone competent - not the cheapest. I’m happy to pay properly for a robust solution.