我有以下js脚本和json,我将其附加到HTML表格。
根据在表格中单击的“MD_PERCENT”(MD列),我希望它链接到另一个html文档(indexmd.html)并显示更多属性(DISCHARGE_NOTE,DN_NOTE_STATUS,HP_NOTE,HP_NOTE_STATUS)单击的MD_PERCENT与另一个HTML表关联的对象。
我将表的MD_PERCENT列作为锚....但是如何在单击时使“新表”显示相应的/相关数据?
希望我的noob问题有道理......
主html表:
<table class="footable">
<thead>
<th width="150">Patient Name</th>
<th width="75">FIN</th>
<th width="50">Nurse Unit</th>
<th width="50">Room</th>
<th width="50">Bed</th>
<th width="150">Attending Physician</th>
<th width="100">Length of Stay</th>
<th width="100">Medical Assessment</th>
<th width="50">RT</th>
<th width="50">SW</th>
<th width="50">MD</th>
<th width="50">RN</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
JSON:
{
"COPD_QUAL": 15,
"LIST": [
{
"PATIENT": "TEST, TRICKLE",
"FIN": "70100905",
"NURSE_UNIT": "TIC",
"ROOM": "C219",
"BED": "A",
"ATTENDING_PHYS": "LEVITEN , DANIEL L",
"LENGTH_OF_STAY": "171days 02:14:15",
"MED_ASSESS": "Mild exacerbation",
"RT_PERCENT":0,
"SW_PERCENT":0,
"MD_PERCENT":20,
"RN_PERCENT":0,
"DISCHARGE_NOTE": "General Procedure",
"DN_NOTE_STATUS": "Auth (Verified)",
"HP_NOTE": "Admission H&P",
"HP_NOTE_STATUS": "Auth (Verified)",
"ACTIVITY_ID": 305675472.0000,
"PERSON_ID": 8986122,
"ENCNTR_ID": 14150574
},
{
"PATIENT":"TEST, GRAYSON2",
"FIN":"65002059",
"NURSE_UNIT":"B7A",
"ROOM":"B701",
"BED":"B",
"ATTENDING_PHYS":"Test , Physician",
"LENGTH_OF_STAY":"155days 00:43:16",
"MED_ASSESS":"",
"RT_PERCENT":0,
"SW_PERCENT":0,
"MD_PERCENT":60,
"RN_PERCENT":0,
"DISCHARGE_NOTE": "Angina",
"DN_NOTE_STATUS": "Modified",
"HP_NOTE": "Fever",
"HP_NOTE_STATUS": "Auth (Verified)",
"ACTIVITY_ID":0.0,
"PERSON_ID":9100122,
"ENCNTR_ID":14278577
}
]
}
js函数将数据附加到主html表:
function createPatientTable(json) {
$.each(json.LIST, function(i, COPD_QUAL) {
$('.footable > tbody:last').append('<tr><td>' + COPD_QUAL.PATIENT + '</td><td><a href="javascript:APPLINK(0,\'powerchart.exe\',\'/PERSONID=' + COPD_QUAL.PERSON_ID + ' /ENCNTRID=' + COPD_QUAL.ENCNTR_ID + '\')">' + COPD_QUAL.FIN + '</a></td><td>' + COPD_QUAL.NURSE_UNIT + '</td><td>' + COPD_QUAL.ROOM + '</td><td>' + COPD_QUAL.BED + '</td><td>' + COPD_QUAL.ATTENDING_PHYS + '</td><td>' + COPD_QUAL.LENGTH_OF_STAY + '</td><td id ="medassess" class="assessment ' + getSeverity(COPD_QUAL.MED_ASSESS) + '" onclick="openPowerform(\'' + COPD_QUAL.PERSON_ID + '\', \'' + COPD_QUAL.ENCNTR_ID + '\', \'' + COPD_QUAL.ACTIVITY_ID + '\')">' + COPD_QUAL.MED_ASSESS + '</td><td>' + COPD_QUAL.RT_PERCENT + '\%</td><td>' + COPD_QUAL.SW_PERCENT + '\%</td><td><a href="../indexmd.html">' + COPD_QUAL.MD_PERCENT + '\%</a></td><td>' + COPD_QUAL.RN_PERCENT + '\%</td></tr>');
});
$('.footable').footable();
};
md html表,我希望显示其他信息:
<h3>Patient Name</h3>
<table id="tablemd">
<thead>
<tr>
<th>Discharge Note</th>
<th>Discharge Note Status</th>
</tr>
<tr>
<td>General Procedure</td>
<td>Auth (Verified)</td>
</tr>
</thead>
<tbody>
<tr>
<th>H&P Note</th>
<th>H&P Note Status</th>
</tr>
<tr>
<td>Admission H&P</td>
<td>Auth (Verified)</td>
</tr>
</tbody>
</table>