# module JosieHealth::LUT::RouteLUT

##
Defined in:

drug_lut.cr
fuzzy.cr

##
Constant Summary

ROUTE_MAPPINGS = `{"aerosolized" => ["aerosolized", "puff", "puffs", "puffed", "inhaled", "inhalation"], "oral" => ["oral", "po", "p.o.", "os", "mouth", "swallowed", "eaten", "buccal", "orla"], "insufflated" => ["insufflated", "insuff", "nasal", "intranasal", "snorted", "sniffed", "snort", "sniff", "in", "insuflated"], "intramuscular" => ["im", "i.m.", "intramuscular", "intra muscular", "muscle injection"], "intravenous" => ["iv", "i.v.", "intravenous", "intra venous", "injection", "injected"], "smoked" => ["smoked", "smoke", "smoking", "smoled"], "vaped" => ["vaped", "vaping", "vaporized", "vaporised", "vapd"], "sublingual" => ["sublingual", "under tongue", "sl", "s.l.", "subligual"], "rectal" => ["rectal", "anal", "rectally", "boofed", "boof", "plugged", "pr", "p.r."], "topical" => ["topical", "skin", "dermal", "applied", "transdermal", "td", "patch"], "subcutaneous" => ["subcutaneous", "subq", "sq", "sc", "s.c.", "s.q.", "subcut"]}`

  Route normalization mappings

ROUTE_SHORT_NAMES = `{"aerosolized" => "INH", "oral" => "PO", "insufflated" => "IN", "intramuscular" => "IM", "intravenous" => "IV", "smoked" => "SMK", "vaped" => "VAP", "sublingual" => "SL", "rectal" => "PR", "topical" => "TD", "subcutaneous" => "SC"}`

  Short names for routes (medical abbreviations)

##
Class Method Summary

- .all_canonical_names : Array(String)
- .build_lookup

  Create reverse lookup for fast normalization

- .export_alias_map : Hash(String, String)

  Export alias -> canonical map for diffing

- .fuzzy_normalize(input : String) : FuzzyResult | Nil
- .normalize(input : String) : String | Nil
- .short_name(input : String) : String | Nil

##
Class Method Detail

def self.all_canonical_names : Array(String) #
def self.build_lookup #

Create reverse lookup for fast normalization

def self.export_alias_map : Hash(String, String) #

Export alias -> canonical map for diffing

def self.fuzzy_normalize(input : String) : FuzzyResult | Nil #
def self.normalize(input : String) : String | Nil #
def self.short_name(input : String) : String | Nil #