s += '<query_timing>SAMEINSTANCENUM</query_timing>\n';
s += '<specificity_scale>0</specificity_scale>\n';
}
for (var p = 0; p < panel_cnt; p++) {
s += '\t<panel>\n';
s += '\t\t<panel_number>' + (p+1) + '</panel_number>\n';
// date range constraints
if (panel_list[p].dateFrom) {
s += '\t\t<panel_date_from>'+panel_list[p].dateFrom.Year+'-'+padNumber(panel_list[p].dateFrom.Month,2)+'-'+padNumber(panel_list[p].dateFrom.Day,2)+'T00:00:00.000-05:00</panel_date_from>\n';
}
if (panel_list[p].dateTo) {
s += '\t\t<panel_date_to>'+panel_list[p].dateTo.Year+'-'+padNumber(panel_list[p].dateTo.Month,2)+'-'+padNumber(panel_list[p].dateTo.Day,2)+'T00:00:00.000-05:00</panel_date_to>\n';
}
s += "\t\t<panel_accuracy_scale>" + panel_list[p].relevance + "</panel_accuracy_scale>\n";
// Exclude constraint (invert flag)
if (panel_list[p].exclude) {
s += '\t\t<invert>1</invert>\n';
} else {
s += '\t\t<invert>0</invert>\n';
}
// Panel Timing
s += '\t\t<panel_timing>' + panel_list[p].timing + '</panel_timing>\n';
// Occurs constraint
s += '\t\t<total_item_occurrences>'+((panel_list[p].occurs*1)+1)+'</total_item_occurrences>\n';
// Concepts
for (i=0; i < panel_list[p].items.length; i++) {
var sdxData = panel_list[p].items[i];
s += '\t\t<item>\n';
switch(sdxData.sdxInfo.sdxType) {
case "QM":
s += '\t\t\t<item_key>masterid:' + sdxData.origData.id + '</item_key>\n';
s += '\t\t\t<item_name>' + sdxData.origData.title + '</item_name>\n';
s += '\t\t\t<tooltip>' + sdxData.origData.name + '</tooltip>\n';
s += '\t\t\t<item_is_synonym>false</item_is_synonym>\n';
s += '\t\t\t<hlevel>0</hlevel>\n';
break;
case "PRS":
s += '\t\t\t<item_key>patient_set_coll_id:' + sdxData.sdxInfo.sdxKeyValue + '</item_key>\n';
s += '\t\t\t<item_name>' + sdxData.sdxInfo.sdxDisplayName + '</item_name>\n';
s += '\t\t\t<tooltip>' + sdxData.sdxInfo.sdxDisplayName + '</tooltip>\n';
s += '\t\t\t<item_is_synonym>false</item_is_synonym>\n';
s += '\t\t\t<hlevel>0</hlevel>\n';
break;
case "ENS":
s += '\t\t\t<item_key>patient_set_enc_id:' + sdxData.sdxInfo.sdxKeyValue + '</item_key>\n';
s += '\t\t\t<item_name>' + sdxData.sdxInfo.sdxDisplayName + '</item_name>\n';
s += '\t\t\t<tooltip>' + sdxData.sdxInfo.sdxDisplayName + '</tooltip>\n';
s += '\t\t\t<item_is_synonym>false</item_is_synonym>\n';
s += '\t\t\t<hlevel>0</hlevel>\n';
break;
default:
if (sdxData.origData.isModifier) {
var modParent = sdxData.origData.parent;
var level = sdxData.origData.level;
var key = sdxData.origData.parent.key;
var name = (sdxData.origData.parent.name != null ? i2b2.h.Escape(sdxData.origData.parent.name) : i2b2.h.Escape(sdxData.origData.name)) ;
var tooltip = sdxData.origData.tooltip;
var itemicon = sdxData.origData.hasChildren;
while (modParent != null)
{
if (modParent.isModifier)
{
modParent = modParent.parent;
} else {
level = modParent.level;
key = modParent.key;
name = modParent.name;
tooltip = modParent.tooltip;
itemicon = modParent.hasChildren;
break;
}
}
s += '\t\t\t<hlevel>' + level + '</hlevel>\n';
s += '\t\t\t<item_key>' + key + '</item_key>\n';
s += '\t\t\t<item_name>' + name + '</item_name>\n';
s += '\t\t\t<item_key>' + sdxData.origData.key + '</item_key>\n';
s += '\t\t\t<tooltip>' + sdxData.origData.tooltip + '</tooltip>\n';
s += '\t\t\t<class>ENC</class>\n';
s += '\t\t\t<item_icon>' + sdxData.origData.hasChildren + '</item_icon>\n';
}
try {
var t = i2b2.h.XPath(sdxData.origData.xmlOrig,'descendant::synonym_cd/text()');
t = (t[0].nodeValue=="Y");
} catch(e) {
var t = "false";
}
s += '\t\t\t<item_is_synonym>'+t+'</item_is_synonym>\n';
if (sdxData.LabValues) {
//s += '\t\t\t<constrain_by_value>\n';
s += this.getValues( sdxData.LabValues);
}
break;
}
//TODO add contraint to the item in the future
/*
s += '\t\t\t<constrain_by_date>\n';
if (panel_list[p].dateFrom) {
s += '\t\t\t\t<date_from>'+panel_list[p].dateFrom.Year+'-'+padNumber(panel_list[p].dateFrom.Month,2)+'-'+padNumber(panel_list[p].dateFrom.Day,2)+'Z</date_from>\n';
}
if (panel_list[p].dateTo) {
s += '\t\t\t\t<date_to>'+panel_list[p].dateTo.Year+'-'+padNumber(panel_list[p].dateTo.Month,2)+'-'+padNumber(panel_list[p].dateTo.Day,2)+'Z</date_to>\n';
"<span class='no-print' style='font-family:Arial'><img src=\"js-i2b2/cells/CRC/assets/print.png\"/> <a href='javascript:window.print()' title='Click here to print the report.'>Print Report</a></span>"+
"<span class='no-print' style='font-family:Arial'><img src=\"js-i2b2/cells/CRC/assets/print.png\"/> <a href='javascript:window.print()' title='Click here to print the report.'>Print Report</a></span>"+