Skip to content

Mass Import (roots_hemms_mass_import)

The Mass Import module turns "give us your Excel file" into a 5-minute operation for hospitals migrating their existing equipment register into HEMMS. A 200-bed hospital typically has 800–2,000 medical devices, 30–80 vendors, and 15–40 departments already tracked in Excel — manual entry is unrealistic and produces transcription errors that silently corrupt the HA Annual PM Report.

What it does

Capability Notes
3 object types Equipment, Vendors, Locations (one file per object, one object per file)
Server-generated XLSX templates Always in sync with the live model schema; localised headers (TH/EN) follow the user's session lang
Full-simulation dry-run Parses → resolves FKs → checks uniqueness → MoPH match → per-row OK / WARN / FAIL verdict, with no DB writes
Idempotent re-import Business-key match upserts existing records — re-running the same file yields 0 new, N updated
Strict MoPH 82-class match Exact match against the Q5 seed (case-sensitive on EN, NFC-normalised); fuzzy matches REJECTED to protect HA-report data quality
Batch-tagged delete Every imported record carries roots_hemms_import_batch_id; user can undo a recent batch in one click (within 7 days, if no downstream PM events or contracts reference the records)
Error XLSX export Failed rows downloadable as a single-sheet XLSX with Row / Verdict / Field / Severity / Message / Raw Value
Transactional commit cr.savepoint()-wrapped, all-or-nothing — any write-time error rolls back the entire batch

How it slots into the HEMMS stack

┌─────────────────────────────────────────────────────────────────┐
│  Hospital Excel register (existing legacy data)                  │
└────────────────────────────────┬────────────────────────────────┘
                                 │  download template + fill in
┌─────────────────────────────────────────────────────────────────┐
│  Mass Import wizard (Q6.4)                                       │
│   Upload → Preview (dry-run) → Commit                            │
└────────────────────────────────┬────────────────────────────────┘
                                 │  records tagged with batch_id
┌─────────────────────────────────────────────────────────────────┐
│  HEMMS data plane                                                 │
│   maintenance.equipment / res.partner / hr.department             │
│   ↓                                                                │
│   Q1 PM events, Q3 service contracts, Q5 HA annual report         │
└─────────────────────────────────────────────────────────────────┘

Module facts

Module ID roots_hemms_mass_import
Layer 3 (Hospital lens)
License LGPL-3
Depends on mail, hr, roots_hemms_pm (Q1), roots_hemms_asset_master, roots_hemms_ha_report (Q5)
Status Alpha
Maintainer jakapolr