2,851
edits
No edit summary |
No edit summary |
||
Line 13: | Line 13: | ||
function p.createCrossTable(frame) | function p.createCrossTable(frame) | ||
-- Start of the wiki table | -- Start of the wiki table | ||
local wikitable = '{| class="wikitable"\n!' | local wikitable = '{| class="wikitable sortable"\n!' | ||
-- Column headers: Biomarker and System | -- Column headers: Biomarker and System | ||
Line 37: | Line 37: | ||
wikitable = wikitable .. '|-\n' | wikitable = wikitable .. '|-\n' | ||
wikitable = wikitable .. '| ' .. system.system .. ' || ' .. bm.name | wikitable = wikitable .. '| ' .. system.system .. ' || ' .. bm.name | ||
local count = 0 | |||
for _, study in ipairs(studies) do | |||
if study.biomarkers[bm.key] ~= nil then | |||
count = count + 1 | |||
end | |||
end | |||
wikitable = wikitable .. string.format(' || %d', count) | |||
for _, study in ipairs(studies) do | for _, study in ipairs(studies) do | ||
-- Retrieve data value for the current cell, using the nested structure | -- Retrieve data value for the current cell, using the nested structure |