Difference between revisions of "MediaWiki:Gadget-calculator-drugs-data.js"
From WikiAnesthesia
Chris Rishel (talk | contribs) |
Chris Rishel (talk | contribs) |
||
Line 124: | Line 124: | ||
name: 'Antimicrobial prophylaxis', | name: 'Antimicrobial prophylaxis', | ||
abbreviation: 'Abx.' | abbreviation: 'Abx.' | ||
}, | |||
anxiolysis: { | |||
name: 'Anxiolysis', | |||
abbreviation: 'Anxiety' | |||
}, | }, | ||
generalAnesthesia: { | generalAnesthesia: { | ||
Line 140: | Line 144: | ||
name: 'Monitored anesthesia care', | name: 'Monitored anesthesia care', | ||
abbreviation: 'MAC' | abbreviation: 'MAC' | ||
}, | |||
ponv: { | |||
name: 'Postoperative nausea & vomiting', | |||
abbreviation: 'PONV' | |||
}, | }, | ||
tiva: { | tiva: { | ||
Line 152: | Line 160: | ||
* Drug data | * Drug data | ||
*/ | */ | ||
var drugId; | |||
Line 157: | Line 167: | ||
* Cefazolin | * Cefazolin | ||
*/ | */ | ||
mw.calculators.addDrugs( { | drugId = 'cefazolin'; | ||
mw.calculators.addDrugs( [ | |||
{ | |||
id: drugId, | |||
name: 'Cefazolin' | name: 'Cefazolin' | ||
} | } | ||
] ); | |||
mw.calculators.addDrugDosages( | mw.calculators.addDrugDosages( drugId, [ | ||
{ | { | ||
indication: 'abxProphylaxis', | indication: 'abxProphylaxis', | ||
Line 173: | Line 186: | ||
] ); | ] ); | ||
mw.calculators.addDrugPreparations( | mw.calculators.addDrugPreparations( drugId, [ | ||
{ | { | ||
concentration: '1 g/vial' | concentration: '1 g/vial' | ||
} | } | ||
] ); | ] ); | ||
Line 212: | Line 226: | ||
indication: 'generalAnesthesia', | indication: 'generalAnesthesia', | ||
population: 'general', | population: 'general', | ||
route: ' | route: 'im', | ||
dose: { | dose: { | ||
min: '4 mg/kg', | min: '4 mg/kg', | ||
Line 219: | Line 233: | ||
} | } | ||
] ); | ] ); | ||
Line 238: | Line 253: | ||
} | } | ||
] ); | ] ); | ||
/** | |||
* Midazolam | |||
*/ | |||
mw.calculators.addDrugs( { | |||
midazolam: { | |||
name: 'Midazolam', | |||
color: 'benzodiazepine' | |||
} | |||
} ); | |||
mw.calculators.addDrugDosages( 'midazolam', [ | |||
{ | |||
indication: 'anxiolysis', | |||
population: 'general', | |||
dose: { | |||
min: '0.01 mg/kg', | |||
max: '0.03 mg/kg' | |||
} | |||
}, { | |||
indication: 'anxiolysis', | |||
population: 'general', | |||
route: 'im', | |||
dose: { | |||
min: '0.07 mg/kg', | |||
max: '0.08 mg/kg' | |||
} | |||
}, { | |||
indication: 'anxiolysis', | |||
population: 'pediatric', | |||
route: 'po', | |||
dose: { | |||
dose: '0.5 mg/kg', | |||
absoluteMax: '20 mg' | |||
} | |||
}, { | |||
indication: 'generalAnesthesia', | |||
population: 'general', | |||
dose: { | |||
min: '0.1 mg/kg', | |||
max: '0.3 mg/kg', | |||
weightCalculation: 'lbw' | |||
} | |||
} | |||
] ); | |||
mw.calculators.addDrugPreparations( 'midazolam', [ | |||
{ | |||
concentration: '1 mg/mL' | |||
}, { | |||
concentration: '5 mg/mL' | |||
} | |||
] ); | |||
/** | |||
* Ondansetron | |||
*/ | |||
mw.calculators.addDrugs( { | |||
ondansetron: { | |||
name: 'Ondansetron' | |||
} | |||
} ); | |||
mw.calculators.addDrugDosages( 'ondansetron', [ | |||
{ | |||
indication: 'ponv', | |||
population: 'general', | |||
dose: { | |||
dose: '4 mg' | |||
} | |||
}, { | |||
indication: 'ponv', | |||
population: 'pediatric', | |||
dose: { | |||
dose: '0.1 mg/kg', | |||
absoluteMax: '4 mg' | |||
} | |||
} | |||
] ); | |||
mw.calculators.addDrugPreparations( 'ondansetron', [ | |||
{ | |||
concentration: '2 mg/mL' | |||
} | |||
] ); | |||
Revision as of 17:51, 11 August 2021
/** * @author Chris Rishel */ ( function() { /** * DrugColor data */ mw.calculators.addDrugColors( { anticholinergic: { primaryColor: '#00ac8c' }, benzodiazepine: { primaryColor: '#ff6c2f' }, benzodiazepineReversal: { parentColor: 'benzodiazepine', striped: true }, cardiovascularAgonist: { primaryColor: '#ba93df' }, cardiovascularAntagonist: { parentColor: 'cardiovascularAgonist', striped: true }, default: { primaryColor: '#fff' }, desflurane: { primaryColor: '#0ab8fd' }, enflurane: { primaryColor: '#f58733' }, epinephrine: { parentColor: 'cardiovascularAntagonist', highlightColor: '#000' }, halothane: { primaryColor: '#b20107' }, isoflurane: { primaryColor: '#ca7fc0' }, localAnesthetic: { primaryColor: '#dad9d6' }, neuromuscularBlocker: { primaryColor: '#fe5442' }, neuromuscularBlockerReversal: { parentColor: 'neuromuscularBlocker', striped: true }, nitrousOxide: { primaryColor: '#2d549f' }, opioid: { primaryColor: '#6cd1ef' }, opioidReversal: { parentColor: 'opioid', striped: true }, sedativeHypnotic: { primaryColor: '#ffe800' }, sevoflurane: { primaryColor: '#f8da00' }, succinylcholine: { parentColor: 'neuromuscularBlocker', highlightColor: '#000' } } ); /** * DrugPopulation data */ mw.calculators.addDrugPopulations( { general: { name: 'General', abbreviation: 'Gen.' }, neonatal: { name: 'Neonatal', abbreviation: 'Neo.', variables: { age: { max: '0 yo' } } }, pediatric: { name: 'Pediatric', abbreviation: 'Ped.', variables: { age: { min: '0 yo', max: '17.9 yo' } } }, elderly: { name: 'Elderly', abbreviation: 'Eld.', variables: { age: { min: '65 yo' } } } } ); /** * DrugIndication data */ mw.calculators.addDrugIndications( { abxProphylaxis: { name: 'Antimicrobial prophylaxis', abbreviation: 'Abx.' }, anxiolysis: { name: 'Anxiolysis', abbreviation: 'Anxiety' }, generalAnesthesia: { name: 'General anesthesia', abbreviation: 'GA' }, intubation: { name: 'Intubation (non-RSI)', abbreviation: 'non-RSI' }, intubationRsi: { name: 'Rapid sequence induction', abbreviation: 'RSI' }, mac: { name: 'Monitored anesthesia care', abbreviation: 'MAC' }, ponv: { name: 'Postoperative nausea & vomiting', abbreviation: 'PONV' }, tiva: { name: 'Total intravenous anesthesia', abbreviation: 'TIVA' } } ); /** * Drug data */ var drugId; /** * Cefazolin */ drugId = 'cefazolin'; mw.calculators.addDrugs( [ { id: drugId, name: 'Cefazolin' } ] ); mw.calculators.addDrugDosages( drugId, [ { indication: 'abxProphylaxis', population: 'general', dose: { dose: '2 g' } } ] ); mw.calculators.addDrugPreparations( drugId, [ { concentration: '1 g/vial' } ] ); /** * Ketamine */ mw.calculators.addDrugs( { ketamine: { name: 'Ketamine', color: 'sedativeHypnotic' } } ); mw.calculators.addDrugPreparations( 'ketamine', [ { concentration: '10 mg/mL' }, { concentration: '50 mg/mL' }, { concentration: '100 mg/mL' } ] ); mw.calculators.addDrugDosages( 'ketamine', [ { indication: 'generalAnesthesia', population: 'general', dose: { min: '1 mg/kg', max: '2 mg/kg', weightCalculation: 'lbw' } }, { indication: 'generalAnesthesia', population: 'general', route: 'im', dose: { min: '4 mg/kg', max: '6 mg/kg' } } ] ); /** * Lidocaine */ mw.calculators.addDrugs( { lidocaine: { name: 'Lidocaine', color: 'localAnesthetic' } } ); mw.calculators.addDrugPreparations( 'lidocaine', [ { concentration: '1 pct' }, { concentration: '2 pct' } ] ); /** * Midazolam */ mw.calculators.addDrugs( { midazolam: { name: 'Midazolam', color: 'benzodiazepine' } } ); mw.calculators.addDrugDosages( 'midazolam', [ { indication: 'anxiolysis', population: 'general', dose: { min: '0.01 mg/kg', max: '0.03 mg/kg' } }, { indication: 'anxiolysis', population: 'general', route: 'im', dose: { min: '0.07 mg/kg', max: '0.08 mg/kg' } }, { indication: 'anxiolysis', population: 'pediatric', route: 'po', dose: { dose: '0.5 mg/kg', absoluteMax: '20 mg' } }, { indication: 'generalAnesthesia', population: 'general', dose: { min: '0.1 mg/kg', max: '0.3 mg/kg', weightCalculation: 'lbw' } } ] ); mw.calculators.addDrugPreparations( 'midazolam', [ { concentration: '1 mg/mL' }, { concentration: '5 mg/mL' } ] ); /** * Ondansetron */ mw.calculators.addDrugs( { ondansetron: { name: 'Ondansetron' } } ); mw.calculators.addDrugDosages( 'ondansetron', [ { indication: 'ponv', population: 'general', dose: { dose: '4 mg' } }, { indication: 'ponv', population: 'pediatric', dose: { dose: '0.1 mg/kg', absoluteMax: '4 mg' } } ] ); mw.calculators.addDrugPreparations( 'ondansetron', [ { concentration: '2 mg/mL' } ] ); /** * Propofol */ mw.calculators.addDrugs( { propofol: { name: 'Propofol', color: 'sedativeHypnotic' } } ); mw.calculators.addDrugPreparations( 'propofol', [ { concentration: '10 mg/mL' } ] ); mw.calculators.addDrugDosages( 'propofol', [ { indication: 'generalAnesthesia', population: 'general', dose: [ { name: 'Induction', min: '1 mg/kg', max: '2.5 mg/kg', weightCalculation: 'lbw' }, { name: 'Maintenance', min: '100 mcg/kg/min', max: '200 mcg/kg/min' } ] }, { indication: 'generalAnesthesia', population: 'pediatric', dose: [ { name: 'Induction', min: '2.5 mg/kg', max: '3.5 mg/kg', weightCalculation: 'lbw' }, { name: 'Maintenance', min: '125 mcg/kg/min', max: '300 mcg/kg/min' } ] }, { indication: 'generalAnesthesia', population: 'elderly', dose: [ { name: 'Induction', min: '1 mg/kg', max: '1.5 mg/kg', weightCalculation: 'lbw' }, { name: 'Maintenance', min: '50 mcg/kg/min', max: '100 mcg/kg/min' } ] }, { indication: 'mac', population: 'general', dose: [ { min: '25 mcg/kg/min', max: '75 mcg/kg/min' } ] } ] ); /** * Rocuronium */ mw.calculators.addDrugs( { rocuronium: { name: 'Rocuronium', color: 'neuromuscularBlocker' } } ); mw.calculators.addDrugPreparations( 'rocuronium', [ { concentration: '10 mg/mL' } ] ); mw.calculators.addDrugDosages( 'rocuronium', [ { indication: 'intubation', population: 'general', dose: { dose: '0.6 mg/kg' } }, { indication: 'intubationRsi', population: 'general', dose: { dose: '1.2 mg/kg' } } ] ); /** * Sufentanil */ mw.calculators.addDrugs( { sufentanil: { name: 'Sufentanil', color: 'opioid' } } ); mw.calculators.addDrugPreparations( 'sufentanil', [ { concentration: '5 mcg/mL' }, { concentration: '50 mcg/mL' } ] ); mw.calculators.addDrugDosages( 'sufentanil', [ { indication: 'tiva', population: 'general', dose: [ { name: 'Load', min: '0.25 mcg/kg', max: '2 mcg/kg', weightCalculation: 'lbw' }, { name: 'Maintenance', min: '0.5 mcg/kg/hr', max: '1.5 mcg/kg/hr' } ] } ] ); /** * DrugDosage * * Structure is: * * drugId: { * indicationId: { * doseId: { * * } * } * } */ var drugDosages = { cefazolin: { abxProphylaxis: { general: { population: 'general', dose: '2 g' }, general120kg: { population: { id: 'general', variables: { weight: { min: '120 kg' } } }, dose: '3 g' }, pediatric: { dose: { absoluteMax: '2 g', dose: '30 mg/kg' } }, pediatric120kg: { population: { id: 'pediatric', variables: { weight: { min: '120 kg' } } }, dose: { dose: '3 g' } } } } }; }() );