A standalone PHP microservice that turns raw patient data into a printable, branded PDF report — biomarker results, old-vs-new charts and personalised health tips — called as an API by the main React app.
The React app never builds PDFs itself. It sends one JSON payload to the service and gets a finished document back — so the report logic lives in one place, and any app can call it.
Collects patient info, biomarker results, insights and tips.
One structured request to the service API.
Builds the report as styled HTML with the patient's data and tips.
Draws old-vs-new comparisons for every biomarker.
Renders the page to a print-ready PDF and returns it.
A simplified version of the contract between the app and the service, next to the kind of page it produces.
{
"patient": { "name": "Demo Patient", "age": 42 },
"biomarkers": [
{ "name": "Haemoglobin", "unit": "g/dL",
"previous": 13.1, "current": 14.2,
"status": "normal" },
{ "name": "Vitamin D", "unit": "ng/mL",
"previous": 24, "current": 18,
"status": "low" }
],
"insights": [ "Vitamin D dropped since last test" ],
"tips": [ "15 minutes of morning sun daily" ]
}
Recreated with demo data — no real patient information.
The reports looked right everywhere — but on some iPhones and some browsers, tapping "Download" simply did nothing.
Users on certain iPhones and browsers tapped Download and got nothing — no file, no error. Everywhere else, it worked fine.
The PDF takes a moment to generate. By the time it was ready, the browser no longer linked opening it to the user's tap — so it treated it like a popup and blocked it.
Wrote detection for the affected devices and browsers. On those, an empty window opens the instant the user taps, then receives the PDF once it's generated — downloads, and closes in a split second.
The service was mine from the first endpoint to the final page layout.
Built the PHP service and the API the React app calls.
Designed the dynamic HTML/CSS template that adapts to each patient's results.
Wired Chart.js into the template to show old vs. new values for each biomarker.
Made sure complex health data lands in the PDF correctly — every value, every page.