Skip to content

3.0.3

Choose a tag to compare

@MonkeyWhisper MonkeyWhisper released this 22 Mar 00:28
· 24 commits to main since this release

Full Changelog: 3.0.2...3.0.3

Run this if you already have ps-mdt installed and want backwards compatibility with the EMS.

-- 1. Add job_type column (safe to run multiple times, will error silently if exists)
ALTER TABLE `mdt_tags` ADD COLUMN `job_type` ENUM('leo','ems','all') NOT NULL DEFAULT 'all' AFTER `color`;

-- 2. Set all existing officer tags to LEO
UPDATE `mdt_tags` SET `job_type` = 'leo' WHERE `type` = 'officer';

-- 3. Set all existing report tags to LEO
UPDATE `mdt_tags` SET `job_type` = 'leo' WHERE `type` = 'report';

-- 4. Insert EMS officer tags
INSERT IGNORE INTO `mdt_tags` (`name`, `type`, `color`, `job_type`) VALUES
('Paramedic',    'officer', '#ef4444', 'ems'),
('EMT',          'officer', '#f97316', 'ems'),
('Supervisor',   'officer', '#8b5cf6', 'ems'),
('Flight Medic', 'officer', '#06b6d4', 'ems'),
('Training',     'officer', '#10b981', 'ems');

-- 5. Insert EMS report tags
INSERT IGNORE INTO `mdt_tags` (`name`, `type`, `color`, `job_type`) VALUES
('Cardiac',       'report', '#ef4444', 'ems'),
('Trauma',        'report', '#f97316', 'ems'),
('Overdose',      'report', '#8b5cf6', 'ems'),
('Respiratory',   'report', '#06b6d4', 'ems'),
('Burn',          'report', '#f59e0b', 'ems'),
('Psychiatric',   'report', '#ec4899', 'ems'),
('DOA',           'report', '#6b7280', 'ems'),
('Mass Casualty', 'report', '#ef4444', 'ems'),
('Transport',     'report', '#3b82f6', 'ems'),
('Routine',       'report', '#10b981', 'ems');


-- 1. Add job_type column to mdt_report_templates
ALTER TABLE `mdt_report_templates` 
ADD COLUMN `job_type` ENUM('leo','ems','all') NOT NULL DEFAULT 'all' AFTER `content`,
ADD KEY `idx_job_type` (`job_type`);

-- 2. Tag existing LEO templates
UPDATE `mdt_report_templates` SET `job_type` = 'leo' WHERE `job_type` = 'all';

-- 3. Insert default EMS templates
INSERT INTO `mdt_report_templates` (`name`, `type`, `content`, `job_type`) VALUES
('Standard Medical', 'Medical Report', '<h2>Medical Response Summary</h2>\n<p>On [DATE] at approximately [TIME] hours, [EMS NAME/UNIT] responded to a medical call at [LOCATION].</p>\n\n<h2>Patient Information</h2>\n<p><strong>Name:</strong> [PATIENT NAME]</p>\n<p><strong>Citizen ID:</strong> [ID]</p>\n<p><strong>Age/DOB:</strong> [AGE/DOB]</p>\n\n<h2>Assessment</h2>\n<p><strong>Chief Complaint:</strong> [COMPLAINT]</p>\n<p><strong>Vitals:</strong> BP [BP] / HR [HR] / SpO2 [SPO2] / Temp [TEMP]</p>\n<p><strong>Level of Consciousness:</strong> [ALERT/VERBAL/PAIN/UNRESPONSIVE]</p>\n\n<h2>Treatment Provided</h2>\n<ul>\n<li>[TREATMENT 1]</li>\n<li>[TREATMENT 2]</li>\n</ul>\n\n<h2>Transport</h2>\n<p><strong>Destination:</strong> [HOSPITAL/FACILITY]</p>\n<p><strong>Condition on Arrival:</strong> [STABLE/CRITICAL/DECEASED]</p>\n\n<h2>Notes</h2>\n<p>[ADDITIONAL OBSERVATIONS]</p>', 'ems'),

('Trauma Report', 'Trauma Report', '<h2>Trauma Response Summary</h2>\n<p>On [DATE] at approximately [TIME] hours, [EMS NAME/UNIT] responded to a trauma call at [LOCATION].</p>\n\n<h2>Patient Information</h2>\n<p><strong>Name:</strong> [PATIENT NAME]</p>\n<p><strong>Citizen ID:</strong> [ID]</p>\n\n<h2>Mechanism of Injury</h2>\n<p>[DESCRIBE: GSW, MVA, FALL, STABBING, ASSAULT, ETC.]</p>\n\n<h2>Injuries Observed</h2>\n<ul>\n<li>[INJURY 1 - LOCATION AND SEVERITY]</li>\n<li>[INJURY 2 - LOCATION AND SEVERITY]</li>\n</ul>\n\n<h2>Treatment Provided</h2>\n<ul>\n<li>[TREATMENT 1]</li>\n<li>[TREATMENT 2]</li>\n</ul>\n\n<h2>Scene Information</h2>\n<p><strong>LEO on Scene:</strong> [YES/NO - OFFICER NAME IF APPLICABLE]</p>\n<p><strong>Scene Safety:</strong> [SECURE/UNSECURE]</p>\n\n<h2>Transport</h2>\n<p><strong>Destination:</strong> [HOSPITAL]</p>\n<p><strong>Condition:</strong> [STABLE/CRITICAL/DECEASED]</p>', 'ems'),

('Overdose Report', 'Overdose Report', '<h2>Overdose Response Summary</h2>\n<p>On [DATE] at approximately [TIME] hours, [EMS NAME/UNIT] responded to a suspected overdose at [LOCATION].</p>\n\n<h2>Patient Information</h2>\n<p><strong>Name:</strong> [PATIENT NAME]</p>\n<p><strong>Citizen ID:</strong> [ID]</p>\n\n<h2>Substance Information</h2>\n<p><strong>Suspected Substance:</strong> [SUBSTANCE]</p>\n<p><strong>Route of Administration:</strong> [ORAL/IV/INHALATION/UNKNOWN]</p>\n<p><strong>Time of Ingestion:</strong> [ESTIMATED TIME]</p>\n\n<h2>Patient Presentation</h2>\n<p><strong>Level of Consciousness:</strong> [ALERT/VERBAL/PAIN/UNRESPONSIVE]</p>\n<p><strong>Respiratory Status:</strong> [NORMAL/DEPRESSED/ABSENT]</p>\n<p><strong>Pupil Response:</strong> [PINPOINT/DILATED/NORMAL]</p>\n\n<h2>Treatment Provided</h2>\n<ul>\n<li>[NARCAN ADMINISTERED - DOSE AND ROUTE]</li>\n<li>[ADDITIONAL TREATMENT]</li>\n</ul>\n\n<h2>Transport and Outcome</h2>\n<p><strong>Destination:</strong> [HOSPITAL]</p>\n<p><strong>Condition on Transport:</strong> [CONDITION]</p>', 'ems'),

('Psychiatric Response', 'Psychiatric Report', '<h2>Psychiatric Response Summary</h2>\n<p>On [DATE] at approximately [TIME] hours, [EMS NAME/UNIT] responded to a psychiatric emergency at [LOCATION].</p>\n\n<h2>Patient Information</h2>\n<p><strong>Name:</strong> [PATIENT NAME]</p>\n<p><strong>Citizen ID:</strong> [ID]</p>\n\n<h2>Presenting Behavior</h2>\n<p>[DESCRIBE BEHAVIOR: SUICIDAL IDEATION, PSYCHOSIS, AGITATION, ETC.]</p>\n<p><strong>Threat to Self:</strong> [YES/NO]</p>\n<p><strong>Threat to Others:</strong> [YES/NO]</p>\n\n<h2>Assessment</h2>\n<p><strong>Mental Status:</strong> [ORIENTED/DISORIENTED]</p>\n<p><strong>Mood/Affect:</strong> [DESCRIBE]</p>\n\n<h2>Intervention</h2>\n<ul>\n<li>[DE-ESCALATION TECHNIQUES USED]</li>\n<li>[MEDICATIONS ADMINISTERED IF ANY]</li>\n</ul>\n\n<h2>Transport</h2>\n<p><strong>Destination:</strong> [FACILITY]</p>\n<p><strong>Voluntary/Involuntary:</strong> [STATUS]</p>', 'ems'),

('Mass Casualty', 'Mass Casualty Report', '<h2>Mass Casualty Incident Report</h2>\n<p>On [DATE] at approximately [TIME] hours, a mass casualty incident was declared at [LOCATION].</p>\n\n<h2>Incident Type</h2>\n<p>[DESCRIBE: MVA, EXPLOSION, SHOOTING, NATURAL DISASTER, ETC.]</p>\n\n<h2>Triage Summary</h2>\n<p><strong>Total Patients:</strong> [NUMBER]</p>\n<ul>\n<li><strong>Red (Immediate):</strong> [NUMBER]</li>\n<li><strong>Yellow (Delayed):</strong> [NUMBER]</li>\n<li><strong>Green (Minor):</strong> [NUMBER]</li>\n<li><strong>Black (Deceased):</strong> [NUMBER]</li>\n</ul>\n\n<h2>EMS Units on Scene</h2>\n<ul>\n<li>[UNIT 1 - ASSIGNED PATIENTS]</li>\n<li>[UNIT 2 - ASSIGNED PATIENTS]</li>\n</ul>\n\n<h2>Transport Destinations</h2>\n<ul>\n<li>[HOSPITAL 1] - [NUMBER] patients</li>\n<li>[HOSPITAL 2] - [NUMBER] patients</li>\n</ul>\n\n<h2>Incident Command</h2>\n<p><strong>IC:</strong> [NAME]</p>\n<p><strong>LEO Liaison:</strong> [NAME]</p>\n\n<h2>Notes</h2>\n<p>[ADDITIONAL DETAILS]</p>', 'ems');