繁体   English   中英

在不同的HTML页面上显示同一对象的JSON属性

[英]Displaying JSON properties of same object on different HTML pages

我将以下js脚本和json附加到HTML表中。

根据希望在表中单击哪个“ MD_PERCENT”(MD列),我希望它链接到另一个html文档(indexmd.html),并显示该对象的其他属性(DISCHARGE_NOTE,DN_NOTE_STATUS,HP_NOTE,HP_NOTE_STATUS)单击的MD_PERCENT与另一个HTML表关联。

我将表的MD_PERCENT列作为锚点。...但是单击该如何使“新表”显示适当/相关的数据?

希望我的菜鸟问题有道理...

主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>

如果将页面更改,例如从index_1.htmlindex_2.html ,则几乎没有引用。 您无法在index_2.html确定在第一页上确切单击了什么。

您必须自己创建某种参考。 例如查询字符串参数。

您可以在此处阅读有关查询字符串的内容。

如果您随后想知道在index_2.html上使用了查询字符串,则可能要使用一些解析查询字符串的javascript代码。

收到必要的参数后,您可以过滤数据并仅获取所需的零件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM