Skip to content

snbyrnes/HPRA-SearchPlus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HPRA SearchPlus

A fast, client-side browser for the HPRA (Health Products Regulatory Authority) medicines database XML export. Search, filter, and explore Ireland's authorised medications — no server required.

Live Demo →


Features

Search & Filter

  • Full-text search across all fields (product name, substances, ATC codes, holders, licence numbers, etc.) with multi-word support — all terms must match
  • Search highlighting — matched terms are highlighted in results
  • Multiselect filters with searchable dropdowns for Dosage Form, PA Holder, Active Substance, Route of Administration, and ATC Code
  • Single-select filters for Market Status, Product Type, Registration Status, Legal Basis, and Dispensing Status
  • ATC Hierarchical Browser — drill into the ATC classification tree by therapeutic level (Anatomical → Therapeutic → Pharmacological → Chemical → Substance), with product counts at each node and click-to-filter
  • Clear All button to reset every filter and search in one click

Views & Display

  • Card view — visual product cards with key details and active substance tags
  • Table view — compact tabular format for power users
  • Detail modal — click any product for a comprehensive 4-section breakdown:
    • Identification (Licence Number, Drug ID, Product Type, ATC Codes)
    • Authorization (PA Holder, Authorised Date, Registration Status, Market Info, Legal Basis)
    • Product Details (Dosage Form, Active Substances, Routes of Administration)
    • Legal & Supply Status (Dispensing, Supply, Promotion statuses, Supply Comments)
  • Statistics bar — live counts of total, marketed, not marketed, and unknown products
  • Sort controls — sort by Name, Holder, Date (newest/oldest), or Market Status
  • Pagination — configurable 25/50/100/250 items per page

Data Handling

  • Auto-load — automatically finds and loads XML from the data/ folder (or root fallback)
  • Drag & drop — drop any HPRA XML file directly onto the page
  • File picker — manual XML loading via the "Load XML" button
  • Hot-reload — load a new XML file at any time without refreshing
  • CSV export — export filtered results with all 17 fields plus a Reviewed status column, UTF-8 BOM for Excel compatibility

Review Workflow

  • Mark as Reviewed — tick the checkbox on any row (table view) or card (card view) to flag it as reviewed
  • Visual highlight — reviewed items are highlighted with a green tint so they stand out at a glance
  • Reviewed filter☑ Reviewed (N) button in the toolbar filters the view to show only reviewed items
  • Reviewed stats pill — teal counter in the statistics bar shows total reviewed count at a glance
  • Persistent — reviewed marks survive page refreshes (stored in localStorage)

UX

  • Dark mode — toggle with the theme button (persisted via localStorage)
  • Resizable table columns — drag the right edge of any column header to adjust its width; widths are saved per-column in localStorage and restored on next visit; reset all widths via the ⚙️ Columns picker
  • Shareable links — every filter, search, sort, and view state is encoded into the URL; click 🔗 Share to copy a link colleagues can open to see exactly what you see
  • Keyboard shortcuts — press ? or the ? toolbar button to open a full reference; available shortcuts:
    • / — focus the search bar
    • Escape — close modal or dismiss open dropdowns
    • n / p — next / previous page
    • e — export current results to CSV
    • t — toggle Table / Cards view
    • ? — open the keyboard shortcuts help modal
    • / — navigate table rows (existing)
    • Enter — open detail for focused row (existing)
  • Responsive — works on desktop and mobile
  • Zero dependencies — pure vanilla HTML/CSS/JS, no build step
  • Feedback — footer link to GitHub Issues for bug reports and feature requests

XML Fields Parsed

All 17 data fields from the HPRA product list are extracted and searchable:

Field Description
DrugIDPK Internal unique identifier
LicenceNumber PA/EU licence number
ProductName Full product name
PAHolder Marketing Authorisation Holder
AuthorisedDate Date of authorisation
ProductType Human, Veterinary, etc.
MarketInfo Marketed / Not marketed / Unknown
RegistrationStatus Current registration state
DosageForm Tablet, Solution, Capsule, etc.
LegalBasis Legal basis for authorisation
ActiveSubstances One or more active ingredients
RoutesOfAdministration Oral, Intravenous, Topical, etc.
ATCs ATC classification codes
DispensingLegalStatus Dispensing classification(s)
SupplyLegalStatus Supply classification
PromotionLegalStatus Promotion classification
SupplyComments Additional supply notes

Project Structure

hpra-search/
├── index.html              # Main application page
├── css/
│   └── styles.css          # All styles (light mode, dark mode, responsive)
├── js/
│   └── app.js              # Application logic (parsing, filtering, rendering)
├── data/
│   └── latestHumanlist.xml  # ← Auto-updated daily by GitHub Actions
├── .github/
│   └── workflows/
│       └── update-xml.yml  # Scheduled workflow to refresh XML data
├── .nojekyll               # Prevents GitHub Pages Jekyll processing
├── .gitattributes          # Line-ending normalisation
└── README.md               # This file

Getting Started

Local Usage

  1. Clone or download this repository
  2. Place the HPRA XML file in the data/ folder (named latestHumanlist.xml)
  3. Serve the folder with any local HTTP server:
    # Python
    python -m http.server 8000
    
    # Node.js (npx)
    npx serve .
    
    # VS Code
    # Use the "Live Server" extension — right-click index.html → Open with Live Server
  4. Open http://localhost:8000 in your browser

Note: Opening index.html directly as a file:// URL will not auto-load the XML due to browser security restrictions (CORS). Use a local server, or use the drag-and-drop / file picker to load it manually.

GitHub Pages Deployment

  1. Push this repository to GitHub
  2. Go to Settings → Pages
  3. Set Source to Deploy from a branch, select main (or master), root /
  4. Click Save — the site will be live at https://<username>.github.io/<repo-name>/

Updating the Data

The XML data is updated automatically — a GitHub Actions workflow runs daily at 05:00 UTC, downloads the latest file from assets.hpra.ie, and commits it to the data/ folder. No manual steps required.

You can also trigger a manual update at any time from the Actions tab in GitHub → select Update HPRA XML DataRun workflow.

If you need to load a different XML file manually, use the drag-and-drop or Load XML button in the app. The app also accepts these filename variants as fallbacks: latestHumanList.xml, LatestHumanList.xml, humanlist.xml, HumanList.xml, products.xml.


Technology Choices

This project deliberately uses vanilla JavaScript with no frameworks or build tools:

  • No build step — edit and deploy directly, no npm install, no bundler
  • Zero dependencies — nothing to update, no supply-chain risk
  • Fast loading — ~25KB total (HTML + CSS + JS) before the XML data
  • Easy maintenance — a single JS file with clear sections, no abstraction layers
  • GitHub Pages compatible — pure static files with a single lightweight GitHub Actions workflow for automated data updates

The XML data (~13MB) is parsed client-side using the browser's native DOMParser, which handles it in ~1–2 seconds on modern hardware.


Browser Support

Works in all modern browsers:

  • Chrome / Edge 80+
  • Firefox 78+
  • Safari 14+

Licence

This tool provides a browser interface for publicly available HPRA data. The data itself is published by the Health Products Regulatory Authority (HPRA). This project is not affiliated with or endorsed by the HPRA.

Releases

No releases published

Packages

 
 
 

Contributors