Translates an ATC code passed as an unnamed parameter to the function "translate" into the name of the navbox template associated with that ATC code on Wikipedia.
Use:
{{#invoke:ATC code to template name|translate|X00}}
The template returned does not have the Template: prefix.
-- this module provides a lookup from ATC codes to their associated navbox templates --
local p = {}
local getArgs
lookuptable = {}
lookuptable["A01"] = "Stomatological preparations"
lookuptable["A02A"] = "Antacids"
lookuptable["A02B"] = "Drugs for peptic ulcer and GORD"
lookuptable["A03"] = "Drugs for functional gastrointestinal disorders"
lookuptable["A04"] = "Antiemetics"
code = frame.args[1]
local function translate(code)
name = lookuptable[code]
return name
end
return p