Hospital v2 for developers. ER is incident response, ICU is critical production, pharmacy is hotfix repository, morgue is deprecated services.
- JavaScript 100%
| node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 | ||
| src | ||
| tests | ||
| package.json | ||
| README.md | ||
code-hospital-v2
Hospital v2 for developers. ER is incident response, ICU is critical production, pharmacy is hotfix repository, morgue is deprecated services.
Usage
const { Hospital, SEVERITY, STAFF_ROLES } = require('./src/hospital');
const h = new Hospital('Sacred Heart Production');
h.hireStaff('Alice', STAFF_ROLES.SURGEON);
h.hireStaff('Bob', STAFF_ROLES.NURSE);
// Admit incidents
h.admitPatient('Login page 500', SEVERITY.SERIOUS, 'er');
h.admitPatient('Memory leak in API', SEVERITY.CRITICAL, 'icu');
h.admitPatient('Typo in footer', SEVERITY.MILD, 'ward');
// Triage
const priority = h.triage();
// Treat
h.assignStaff('Alice', 2);
h.treat('Alice', 2, 'surgery');
// Time passes
for (let i = 0; i < 10; i++) h.tick();
h.advanceDay();
console.log(h.hospitalView());
console.log(h.report());
Departments
- ER (Incident Response) — Fast triage, quick fixes
- ICU (Critical Production) — 24/7 monitoring, barely alive
- General Ward (Staging) — Recovering, monitored
- Pharmacy (Hotfix Repository) — Hotfix dispensary
- Morgue (Deprecated Services) — Rest in peace
Severity Levels
- Mild — Minor glitch, cosmetic
- Moderate — Feature broken, workaround exists
- Serious — Major feature down
- Critical — Production down, everything on fire
- Fatal — Data loss, irreversible
Staff
- Surgeon (SRE) — Skill 9, major incident resolver
- Nurse (DevOps) — Skill 5, keeps everything running
- Pharmacist (Release Engineer) — Dispenses hotfixes
- Intern (On-Call) — First responder, pages the surgeon
- Psychiatrist (PM) — Manages expectations, spin control