0

I have the following js script and json that I am appending to an HTML table.

Depending on which "MD_PERCENT" (MD column) is clicked within the table, I want it to link to another html document (indexmd.html) and display a few more properties (DISCHARGE_NOTE, DN_NOTE_STATUS, HP_NOTE, HP_NOTE_STATUS) of the object that the clicked MD_PERCENT is associated to within another HTML table.

I have the MD_PERCENT column of the table as an anchor....but how can I make the "new table" display the appropriate/related data when clicked?

Hopefully my noob question makes sense...

Main html table:

<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 function to append data to main html table:

 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 table that I wish to display additional info:

<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>
gwells2
  • 5
  • 4

1 Answers1

0

If you change the page, for example from index_1.html to index_2.html then there is almost no reference. You cannot determine on index_2.html what exactly was clicked on the first page.

You have to create some sort of reference by yourself. For example a query string parameter.

You can read something about query strings here.

if you then want to know, was query string is used on index_2.html, you might want to use some javascript code that parses the query string. Example

After receiving the necessary parameter, you can then filter your data and fetch only the part you want.

Community
  • 1
  • 1
Luke
  • 8,235
  • 3
  • 22
  • 36