marmar-context / src / domain / medicines / strengths.ts
strengths.ts
Raw
/**
 * Common strengths, most common first, offered as chips when a medicine is
 * added. For picking only: the pack in her hand wins, and "Not sure" and
 * typing stay. A chip she picks is saved as the medicine's strength, which
 * the check reads, so a chip must never hide a dose the check could count
 * (tests/medicine-facts.test.ts runs the check on every chip).
 *
 * Single medicines are keyed by catalog ingredient. Products list the exact
 * catalog names whose packs they describe; another name of the same product
 * gets none of them ("Solpadeine" is not offered co-codamol's chips). A
 * single-ingredient product with no entry of its own uses its ingredient's
 * strengths. Herbal medicines have none: their strengths vary.
 *
 * Drafted from common UK and Nigerian packs and checked against DrugBank 5.1
 * products where it lists them. The pharmacist may correct any of them.
 */

export type StrengthForm =
  | 'tablet' | 'capsule' | 'liquid' | 'injection' | 'patch' | 'inhaler' | 'drops'
  | 'powder' | 'cream' | 'gel' | 'spray' | 'suppository' | 'lozenge';

export type Strengths = Partial<Record<StrengthForm, string[]>>;

export const INGREDIENT_STRENGTHS: Record<string, Strengths> = {
  // Pain and inflammation
  paracetamol: {
    tablet: ['500 mg', '325 mg', '650 mg'], capsule: ['500 mg'],
    liquid: ['120 mg/5 ml', '250 mg/5 ml', '125 mg/5 ml', '160 mg/5 ml'],
    suppository: ['125 mg', '250 mg', '500 mg'], injection: ['10 mg/ml'],
  },
  ibuprofen: {
    tablet: ['200 mg', '400 mg', '600 mg', '800 mg'], capsule: ['200 mg', '400 mg'],
    liquid: ['100 mg/5 ml', '200 mg/5 ml'], gel: ['5%', '10%'],
  },
  diclofenac: {
    tablet: ['50 mg', '25 mg', '75 mg', '100 mg'], gel: ['1.16%', '2.32%', '1%'],
    suppository: ['100 mg', '50 mg', '12.5 mg'], injection: ['25 mg/ml'],
  },
  naproxen: { tablet: ['250 mg', '500 mg', '220 mg', '375 mg'] },
  piroxicam: { capsule: ['20 mg', '10 mg'], gel: ['0.5%'] },
  meloxicam: { tablet: ['7.5 mg', '15 mg'] },
  celecoxib: { capsule: ['200 mg', '100 mg'] },
  indometacin: { capsule: ['25 mg', '50 mg', '75 mg'], suppository: ['100 mg'] },
  ketoprofen: { capsule: ['50 mg', '100 mg', '200 mg'], gel: ['2.5%'] },
  'mefenamic-acid': { capsule: ['250 mg'], tablet: ['500 mg'], liquid: ['50 mg/5 ml'] },
  aspirin: { tablet: ['75 mg', '300 mg', '81 mg', '325 mg'] },
  tramadol: { capsule: ['50 mg'], tablet: ['50 mg', '100 mg', '200 mg'], injection: ['50 mg/ml'] },
  codeine: { tablet: ['30 mg', '15 mg', '60 mg'], liquid: ['25 mg/5 ml'] },
  dihydrocodeine: { tablet: ['30 mg'] },
  morphine: { tablet: ['10 mg', '30 mg', '5 mg', '15 mg'], liquid: ['10 mg/5 ml'], injection: ['10 mg/ml'] },
  pentazocine: { tablet: ['25 mg', '50 mg'], injection: ['30 mg/ml'] },

  // Blood thinners
  warfarin: { tablet: ['1 mg', '3 mg', '5 mg', '0.5 mg'] },
  acenocoumarol: { tablet: ['1 mg', '4 mg'] },
  rivaroxaban: { tablet: ['20 mg', '15 mg', '10 mg', '2.5 mg'] },
  apixaban: { tablet: ['5 mg', '2.5 mg'] },
  dabigatran: { capsule: ['150 mg', '110 mg', '75 mg'] },
  edoxaban: { tablet: ['60 mg', '30 mg', '15 mg'] },
  clopidogrel: { tablet: ['75 mg', '300 mg'] },
  ticagrelor: { tablet: ['90 mg', '60 mg'] },
  prasugrel: { tablet: ['10 mg', '5 mg'] },

  // Heart and blood pressure
  amlodipine: { tablet: ['5 mg', '10 mg', '2.5 mg'] },
  nifedipine: { tablet: ['20 mg', '30 mg', '60 mg', '10 mg'], capsule: ['5 mg', '10 mg'] },
  lisinopril: { tablet: ['5 mg', '10 mg', '20 mg', '2.5 mg'] },
  enalapril: { tablet: ['5 mg', '10 mg', '20 mg', '2.5 mg'] },
  ramipril: { capsule: ['2.5 mg', '5 mg', '10 mg', '1.25 mg'], tablet: ['2.5 mg', '5 mg', '10 mg', '1.25 mg'] },
  captopril: { tablet: ['25 mg', '12.5 mg', '50 mg'] },
  perindopril: { tablet: ['4 mg', '8 mg', '5 mg', '10 mg', '2 mg'] },
  losartan: { tablet: ['50 mg', '100 mg', '25 mg'] },
  valsartan: { tablet: ['80 mg', '160 mg', '320 mg', '40 mg'] },
  telmisartan: { tablet: ['40 mg', '80 mg', '20 mg'] },
  irbesartan: { tablet: ['150 mg', '300 mg', '75 mg'] },
  candesartan: { tablet: ['8 mg', '16 mg', '4 mg', '32 mg'] },
  hydrochlorothiazide: { tablet: ['25 mg', '12.5 mg', '50 mg'] },
  bendroflumethiazide: { tablet: ['2.5 mg', '5 mg'] },
  chlortalidone: { tablet: ['25 mg', '50 mg', '12.5 mg'] },
  indapamide: { tablet: ['2.5 mg', '1.5 mg'] },
  furosemide: { tablet: ['40 mg', '20 mg'], liquid: ['20 mg/5 ml', '40 mg/5 ml'], injection: ['10 mg/ml'] },
  spironolactone: { tablet: ['25 mg', '50 mg', '100 mg'] },
  eplerenone: { tablet: ['25 mg', '50 mg'] },
  amiloride: { tablet: ['5 mg'] },
  'potassium-chloride': { tablet: ['600 mg'] },
  atenolol: { tablet: ['50 mg', '100 mg', '25 mg'] },
  propranolol: { tablet: ['40 mg', '10 mg', '80 mg', '160 mg'] },
  bisoprolol: { tablet: ['5 mg', '2.5 mg', '10 mg', '1.25 mg'] },
  metoprolol: { tablet: ['50 mg', '100 mg', '25 mg'] },
  carvedilol: { tablet: ['6.25 mg', '12.5 mg', '25 mg', '3.125 mg'] },
  digoxin: { tablet: ['125 mcg', '250 mcg', '62.5 mcg'], liquid: ['50 mcg/ml'] },
  amiodarone: { tablet: ['200 mg', '100 mg'] },
  simvastatin: { tablet: ['20 mg', '40 mg', '10 mg', '80 mg'] },
  atorvastatin: { tablet: ['10 mg', '20 mg', '40 mg', '80 mg'] },
  rosuvastatin: { tablet: ['10 mg', '5 mg', '20 mg', '40 mg'] },
  pravastatin: { tablet: ['20 mg', '40 mg', '10 mg'] },
  sildenafil: { tablet: ['50 mg', '100 mg', '25 mg', '20 mg'] },
  tadalafil: { tablet: ['20 mg', '10 mg', '5 mg', '2.5 mg'] },
  'isosorbide-mononitrate': { tablet: ['20 mg', '40 mg', '60 mg', '10 mg'] },
  'isosorbide-dinitrate': { tablet: ['10 mg', '5 mg', '20 mg'] },
  'glyceryl-trinitrate': { spray: ['400 mcg/dose'], tablet: ['500 mcg', '300 mcg'] },

  // Diabetes
  metformin: { tablet: ['500 mg', '850 mg', '1000 mg', '750 mg'] },
  glibenclamide: { tablet: ['5 mg', '2.5 mg'] },
  glimepiride: { tablet: ['2 mg', '1 mg', '3 mg', '4 mg'] },
  gliclazide: { tablet: ['80 mg', '30 mg', '60 mg'] },
  glipizide: { tablet: ['5 mg', '10 mg', '2.5 mg'] },
  insulin: { injection: ['100 units/ml', '300 units/ml', '200 units/ml'] },

  // Stomach
  omeprazole: { capsule: ['20 mg', '40 mg', '10 mg'], tablet: ['20 mg'] },
  esomeprazole: { tablet: ['20 mg', '40 mg'], capsule: ['20 mg', '40 mg'] },
  lansoprazole: { capsule: ['30 mg', '15 mg'] },
  pantoprazole: { tablet: ['40 mg', '20 mg'] },

  // Infections
  amoxicillin: { capsule: ['500 mg', '250 mg'], tablet: ['500 mg', '875 mg', '1 g'], liquid: ['125 mg/5 ml', '250 mg/5 ml'] },
  ampicillin: { capsule: ['250 mg', '500 mg'], liquid: ['125 mg/5 ml', '250 mg/5 ml'], injection: ['500 mg', '1 g'] },
  cloxacillin: { capsule: ['250 mg', '500 mg'], liquid: ['125 mg/5 ml'] },
  flucloxacillin: { capsule: ['250 mg', '500 mg'], liquid: ['125 mg/5 ml', '250 mg/5 ml'] },
  phenoxymethylpenicillin: { tablet: ['250 mg'], liquid: ['125 mg/5 ml', '250 mg/5 ml'] },
  benzylpenicillin: { injection: ['600 mg', '1.2 g'] },
  cefalexin: { capsule: ['250 mg', '500 mg'], liquid: ['125 mg/5 ml', '250 mg/5 ml'] },
  cefuroxime: { tablet: ['250 mg', '500 mg', '125 mg'], liquid: ['125 mg/5 ml'], injection: ['750 mg', '1.5 g'] },
  ceftriaxone: { injection: ['1 g', '250 mg', '500 mg', '2 g'] },
  cefixime: { tablet: ['400 mg', '200 mg'], capsule: ['400 mg', '200 mg'], liquid: ['100 mg/5 ml'] },
  ciprofloxacin: { tablet: ['500 mg', '250 mg', '750 mg'], drops: ['0.3%'] },
  levofloxacin: { tablet: ['500 mg', '250 mg', '750 mg'] },
  clarithromycin: { tablet: ['500 mg', '250 mg'], liquid: ['125 mg/5 ml', '250 mg/5 ml'] },
  erythromycin: { tablet: ['250 mg', '500 mg'], liquid: ['125 mg/5 ml', '250 mg/5 ml'] },
  azithromycin: { tablet: ['500 mg', '250 mg'], capsule: ['250 mg'], liquid: ['200 mg/5 ml'] },
  metronidazole: { tablet: ['400 mg', '200 mg', '500 mg'], liquid: ['200 mg/5 ml'], gel: ['0.75%'], injection: ['5 mg/ml'] },
  trimethoprim: { tablet: ['200 mg', '100 mg'], liquid: ['50 mg/5 ml'] },
  doxycycline: { capsule: ['100 mg', '50 mg'], tablet: ['100 mg'] },
  fluconazole: { capsule: ['150 mg', '50 mg', '200 mg'], liquid: ['50 mg/5 ml'] },
  ketoconazole: { tablet: ['200 mg'], cream: ['2%'] },
  itraconazole: { capsule: ['100 mg'] },
  rifampicin: { capsule: ['300 mg', '150 mg'], liquid: ['100 mg/5 ml'] },
  isoniazid: { tablet: ['100 mg', '300 mg', '50 mg'] },

  // Malaria (the usual combinations are under products)
  artemether: { injection: ['80 mg/ml', '20 mg/ml'] },
  artesunate: { tablet: ['50 mg', '100 mg', '200 mg'], injection: ['60 mg'], suppository: ['100 mg', '50 mg'] },
  amodiaquine: { tablet: ['200 mg'] },
  pyrimethamine: { tablet: ['25 mg'] },
  chloroquine: { tablet: ['250 mg', '150 mg'] },
  quinine: { tablet: ['300 mg', '200 mg'], injection: ['300 mg/ml'] },

  // HIV
  dolutegravir: { tablet: ['50 mg', '10 mg'] },
  efavirenz: { tablet: ['600 mg', '400 mg'], capsule: ['200 mg'] },
  emtricitabine: { capsule: ['200 mg'] },
  tenofovir: { tablet: ['300 mg', '245 mg', '25 mg'] },
  lamivudine: { tablet: ['150 mg', '300 mg', '100 mg'], liquid: ['10 mg/ml'] },
  nevirapine: { tablet: ['200 mg', '400 mg'], liquid: ['50 mg/5 ml'] },

  // Mental health and the nervous system
  sertraline: { tablet: ['50 mg', '100 mg', '25 mg'] },
  fluoxetine: { capsule: ['20 mg', '10 mg', '40 mg', '60 mg'], liquid: ['20 mg/5 ml'] },
  citalopram: { tablet: ['20 mg', '10 mg', '40 mg'] },
  escitalopram: { tablet: ['10 mg', '5 mg', '20 mg'] },
  paroxetine: { tablet: ['20 mg', '30 mg', '10 mg'] },
  amitriptyline: { tablet: ['10 mg', '25 mg', '50 mg'] },
  diazepam: { tablet: ['5 mg', '2 mg', '10 mg'], liquid: ['2 mg/5 ml'], injection: ['5 mg/ml'] },
  lorazepam: { tablet: ['1 mg', '2 mg', '0.5 mg'], injection: ['4 mg/ml'] },
  alprazolam: { tablet: ['0.25 mg', '0.5 mg', '1 mg'] },
  bromazepam: { tablet: ['3 mg', '1.5 mg', '6 mg'] },
  clonazepam: { tablet: ['0.5 mg', '2 mg'] },
  carbamazepine: { tablet: ['200 mg', '400 mg', '100 mg'], liquid: ['100 mg/5 ml'] },
  phenytoin: { capsule: ['100 mg', '50 mg', '300 mg', '25 mg'], tablet: ['100 mg'], liquid: ['30 mg/5 ml', '125 mg/5 ml'] },
  'sodium-valproate': { tablet: ['200 mg', '500 mg', '300 mg'], liquid: ['200 mg/5 ml'] },
  lithium: { tablet: ['400 mg', '200 mg', '250 mg'], liquid: ['520 mg/5 ml'] },

  // Breathing and allergy
  salbutamol: { inhaler: ['100 mcg/dose'], tablet: ['2 mg', '4 mg'], liquid: ['2 mg/5 ml'] },
  cetirizine: { tablet: ['10 mg'], liquid: ['5 mg/5 ml'] },
  loratadine: { tablet: ['10 mg'], liquid: ['5 mg/5 ml'] },
  chlorphenamine: { tablet: ['4 mg'], liquid: ['2 mg/5 ml'], injection: ['10 mg/ml'] },
  promethazine: { tablet: ['25 mg', '10 mg'], liquid: ['5 mg/5 ml'], injection: ['25 mg/ml'] },
  diphenhydramine: { tablet: ['25 mg', '50 mg'], capsule: ['25 mg', '50 mg'], liquid: ['12.5 mg/5 ml'] },
  dextromethorphan: { liquid: ['15 mg/5 ml', '7.5 mg/5 ml'] },
  pseudoephedrine: { tablet: ['60 mg', '120 mg'], liquid: ['30 mg/5 ml'] },

  // Steroids, thyroid, gout and the immune system
  prednisolone: { tablet: ['5 mg', '1 mg', '25 mg', '20 mg'], liquid: ['5 mg/5 ml'] },
  dexamethasone: { tablet: ['0.5 mg', '2 mg', '4 mg'], injection: ['4 mg/ml'] },
  levothyroxine: { tablet: ['50 mcg', '100 mcg', '25 mcg', '75 mcg'], liquid: ['25 mcg/5 ml', '50 mcg/5 ml'] },
  allopurinol: { tablet: ['100 mg', '300 mg'] },
  azathioprine: { tablet: ['50 mg', '25 mg'] },
  // 2.5 mg only: 2.5 mg and 10 mg tablets mixed up on a weekly dose have killed people (NPSA).
  methotrexate: { tablet: ['2.5 mg'] },

  // Vitamins and minerals. Iron packs print the salt. Calcium packs print the
  // calcium, the carbonate or both, so both appear: pharmacist to pick one.
  iron: { tablet: ['200 mg', '210 mg', '300 mg', '305 mg'] },
  calcium: { tablet: ['500 mg', '600 mg', '1.25 g', '1.5 g'] },
  zinc: { tablet: ['20 mg', '10 mg', '25 mg', '50 mg'] },
  magnesium: { tablet: ['250 mg', '400 mg', '500 mg'] },
};

export interface ProductStrengths {
  /** The catalog product names (catalog.ts) whose packs these are. Another name of the same product gets none. */
  names: string[];
  forms: Strengths;
  /**
   * For chips giving one amount per ingredient ("30/500 mg"): the ingredient keys in the order the pack prints them.
   * The check reads a combination's strength by these chips, typed either way round ("500mg/30mg"), so each amount
   * counts towards its own ingredient's daily maximum (domain/checks/amounts.ts).
   */
  amountOrder?: string[];
  /** Each chip is the pack's total for all its ingredients: Augmentin "625 mg" is amoxicillin 500 mg with clavulanic acid 125 mg. */
  total?: true;
}

/**
 * Combinations, and single-ingredient products whose usual strengths differ
 * from the ingredient's. A combination whose other ingredient is only caffeine
 * gives the main medicine's amount alone ("500 mg" for Panadol Extra), the one
 * the check counts: with no chip to tell its amounts apart, the check cannot
 * read "500/65 mg" unless each amount is named ("paracetamol 500 mg, caffeine
 * 65 mg").
 */
export const PRODUCT_STRENGTHS: ProductStrengths[] = [
  { names: ['panadol extra', 'panadol actifast extra'], forms: { tablet: ['500 mg'] } },
  { names: ['co-codamol', 'paracetamol and codeine'], forms: { tablet: ['8/500 mg', '15/500 mg', '30/500 mg'], capsule: ['30/500 mg'] },
    amountOrder: ['codeine', 'paracetamol'] },
  { names: ['panadeine'], forms: { tablet: ['8/500 mg'] }, amountOrder: ['codeine', 'paracetamol'] },
  { names: ['tylenol with codeine'], forms: { tablet: ['300/30 mg'] }, amountOrder: ['paracetamol', 'codeine'] },
  { names: ['co-dydramol'], forms: { tablet: ['10/500 mg', '20/500 mg', '30/500 mg'] }, amountOrder: ['dihydrocodeine', 'paracetamol'] },
  { names: ['nurofen plus'], forms: { tablet: ['200/12.8 mg'] }, amountOrder: ['ibuprofen', 'codeine'] },
  { names: ['alabukun'], forms: { powder: ['760 mg'] } },
  { names: ['cardiprin', 'low dose aspirin', 'baby aspirin'], forms: { tablet: ['75 mg', '81 mg', '100 mg'] } },
  { names: ['disprin'], forms: { tablet: ['300 mg', '75 mg'] } },
  { names: ['ecotrin'], forms: { tablet: ['81 mg', '325 mg'] } },
  { names: ['moduretic'], forms: { tablet: ['5/50 mg', '2.5/25 mg'] }, amountOrder: ['amiloride', 'hydrochlorothiazide'] },
  { names: ['augmentin', 'co-amoxiclav'], forms: { tablet: ['625 mg', '1 g', '375 mg'], liquid: ['228 mg/5 ml', '457 mg/5 ml', '156 mg/5 ml', '312 mg/5 ml'] },
    total: true },
  { names: ['ampiclox'], forms: { capsule: ['500 mg'] }, total: true },
  { names: ['septrin', 'septrine', 'bactrim', 'co-trimoxazole', 'cotrimoxazole'], forms: { tablet: ['480 mg', '960 mg'], liquid: ['240 mg/5 ml', '480 mg/5 ml'] },
    total: true },
  { names: ['coartem', 'lonart', 'lumartem'], forms: { tablet: ['20/120 mg', '80/480 mg'] }, amountOrder: ['artemether', 'lumefantrine'] },
  { names: ['asaq'], forms: { tablet: ['100/270 mg', '50/135 mg', '25/67.5 mg'] }, amountOrder: ['artesunate', 'amodiaquine'] },
  { names: ['p-alaxin'], forms: { tablet: ['40/320 mg', '20/160 mg'] }, amountOrder: ['dihydroartemisinin', 'piperaquine'] },
  { names: ['fansidar'], forms: { tablet: ['500/25 mg'] }, amountOrder: ['sulfadoxine', 'pyrimethamine'] },
  { names: ['tld'], forms: { tablet: ['300/300/50 mg'] }, amountOrder: ['tenofovir', 'lamivudine', 'dolutegravir'] },
  { names: ['tle'], forms: { tablet: ['300/300/600 mg', '300/300/400 mg'] }, amountOrder: ['tenofovir', 'lamivudine', 'efavirenz'] },
  { names: ['atripla'], forms: { tablet: ['600/200/245 mg'] }, amountOrder: ['efavirenz', 'emtricitabine', 'tenofovir'] },
  { names: ['tylenol pm'], forms: { tablet: ['500/25 mg'] }, amountOrder: ['paracetamol', 'diphenhydramine'] },
  { names: ['advil pm'], forms: { tablet: ['200/38 mg', '200/25 mg'] }, amountOrder: ['ibuprofen', 'diphenhydramine'] },
  { names: ['claritin d', 'clarityn d'], forms: { tablet: ['5/120 mg', '10/240 mg'] }, amountOrder: ['loratadine', 'pseudoephedrine'] },
  { names: ['zyrtec d'], forms: { tablet: ['5/120 mg'] }, amountOrder: ['cetirizine', 'pseudoephedrine'] },
  { names: ['slow-k'], forms: { tablet: ['600 mg'] } },
];