Jump to content

Module:ATC code to template name

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Berchanhimez (talk | contribs) at 07:00, 5 July 2020 (test). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- this module provides a lookup from ATC codes to their associated navbox templates --

p = {}

input = frame.args[1]

p.lookuptable = {
{ code="A01", template="Stomatological preparations",},
{ code="A02A", template="Antacids", },
{ code="A02B", template="Drugs for peptic ulcer and GORD", },
{ code="A03", template="Drugs for functional gastrointestinal disorders", },
{ code="A04", template="Antiemetics", },
}

function translate ( param )
	for k,v in pairs(p.lookuptable) do
		if v.code == param then
			p.out = v.template
			print(p.out)
        end
    end
    if p.out == nil then
        error("None")
    end
    return p.out
end

return p