Mòdul:Infobox medical intervention

De Viquipèdia
Salta a la navegació Salta a la cerca
--[[
For translation of this module, you must customize:
Module:Infobox medical intervention/i18n
Module:Infotable images/i18n
Module:Medical infotable items/i18n
--]]
local p = {}
local SA = require "Module:SimpleArgs"
local SD = require "Module:SimpleDebug"
local WD = require "Module:Wikidata"
local WDFI = require "Module:Wikidata from infobox"
local Infobox = require "Module:Infobox"
local InfoColors = require "Module:InfotableColors"
local II = require "Module:Infotable images"
local MII = require "Module:Medical infotable items"

p.i18n = {
	["Args"] = {
		["Name"]		= "Name",
		["data4"]		= "ICD10",
		["data5"]		= "ICD9",
		["data6"]		= "ICD9unlinked",
		["data8"]		= "OPS301",
		["data9"]		= "LOINC",
		["data10"]		= {"other_codes","OtherCodes"},
		["data11"]		= "MedlinePlus",
		["data13"]		= "HCPCSlevel2",
		["data14"]		= "CPT",
	},
	["Labels"] = {
		["Intervention"]= "''Intervention''",
		["label4"]		= "[[ICD-10 Procedure Coding System|ICD-10-PCS]]",
		["label5"]		= "[[ICD-9-CM Volume_3|ICD-9-CM]]",
		["label6"]		= "[[ICD-9-CM Volume_3|ICD-9]]",
		["label7"]		= "[[Medical Subject Headings|MeSH]]",
		["label8"]		= "[[OPS-301|OPS-301 code]]",
		["label9"]		= "[[LOINC]]",
		["label10"] 	= "Other [[procedure codes|codes]]",
		["label11"] 	= "[[MedlinePlus]]",
		["label13"] 	= "[[HCPCS Level 2|HCPCS-L2]]",
		["label14"] 	= "[[Current Procedural Terminology|CPT]]",
	},	
}
p.i18n = SA.loadI18n ('Infobox medical intervention', p.i18n)

local function I18nArg (S)
	return SA.CheckIsStrOrTab (p.i18n["Args"][S], S)
end

local function I18nLabel (S)
	return SA.CheckIsStr (p.i18n["Labels"][S], S)
end

function p.infobox(frame)
	local args, NArgs = SA.GetArgs (frame)
	tab = {}
	local InfotableColor = InfoColors.colors['science']
	tab["titlestyle"] = 'background-color:'..InfotableColor
	tab["headerstyle"] = 'background-color:'..InfotableColor
	tab["subheaderstyle"] = 'background-color:'..InfotableColor
	tab["labelstyle"] = 'background:#eeeeee'
	tab["subheader"] = I18nLabel('Intervention')
	tab["title"] = SA.Str_Par (args, I18nArg('Name')) or frame:getParent():getTitle()
	tab = II.main (frame, args, tab)
	function loadH (N, Prop, Format)
		tab = WDFI.LoadArg (args, tab, I18nArg('data'..N), I18nLabel('label'..N), N, Prop, Format)
	end	
	loadH (4, 'P1690')
	loadH (5, 'P1692', '{{ICD9proc|$1}}')
	loadH (6, 'P493')
	tab = MII.mesh (frame, args, tab, 7)
	loadH (8, 'P1691')
	loadH (9, 'P4338', '{{LOINC|$1}}')
	loadH (10, '')
	loadH (11, 'P604', '[http://www.nlm.nih.gov/medlineplus/ency/article/$1.htm $1]') 
	tab = MII.eMedicine (frame, args, tab, 12)
	loadH (13, 'P7410')
	loadH (14, '')
	SA.CheckParamsM (args, {p.i18n["Args"], II.i18n, MII.i18n["ArgMesh"], MII.i18n["ArgeMed"]})
	return Infobox.infobox (tab)
end --infobox

return p