Prognocis Printable Ledger v3

adds css code to correct page layout, adds letterhead and patient name and chart number, adds print button at bottom of page to print correctly

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Prognocis Printable Ledger v3
// @namespace    prognocis.com
// @version      2025.01.24.0905
// @description  adds css code to correct page layout, adds letterhead and patient name and chart number, adds print button at bottom of page to print correctly
// @author       mrkrag
// @match        *.prognocis.com/prognocis/scrPrint.jsp?mode=pataccactivity*
// @icon         https://prognocis.com/wp-content/uploads/2020/07/cropped-Fav-192x192.png
// @grant        none
// @license      MIT
// ==/UserScript==
// THIS SECTION INSERTS CSS CODE TO GET THE PAGE TO PRINT CORRECTLY INSTEAD OF 150% WIDE
function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}
addGlobalStyle('tr.CLAIM {background-color: lightgray;} table.MAIN {width: 100%;} #Total > td {border-style: solid; border-width: 1px 0px 0px 0px; font-weight: bold;} #printClean{border: 2px solid #1ab26b; color: #1ab26b; font-weight: bold; width: 200px; height: 30px; margin: 20px auto; text-align: center; vertical-align: middle;} #printClean:hover{cursor: pointer; background-color: #1ab26b; color: #ffffff;}');
addGlobalStyle('@media print {#printClean{display: none;}}');
// END INSERT CSS


// THIS SECTION ADDS OUR OWN PRINT BUTTON ON THE RESULTING SCREEN VIEW OF THE LEDGER
var bigdiv = document.createElement("div");
bigdiv.innerHTML = '<div id="printClean" role="button" onclick="window.print()">PRINT CLEANLY</div>';
document.body.appendChild (bigdiv);
// END CUSTOM PRINT BUTTON

// THIS SECTION ADDS LETTERHEAD
// prognocis stores the letterhead image used on progress notes in the "testdiagrams" directory
// if the clinic login page is mydrclinic.prognocis.com, the file would be mydrclinic_letterhead.gif
// if the letterhead is updated, a number is added, so the next revision would be mydrclinic_letterhead1.gif, _letterhead2.gif, etc.
// edit the img scr= below to match your clinic or point to any other image url you want as letterhead
let today = new Date().toLocaleDateString()
var ltrhead = document.createElement("table");
ltrhead.setAttribute('width', '100%');
ltrhead.innerHTML = '<tr><td colspan=2 align=center><img src="testdiagrams/handsonortho_letterhead1.gif"></td></tr><tr><td colspan=2 align=center><span style="font-size:14pt; font-weight:bold;">Patient Account Activity as of ' +
today +
'</span></td></tr><tr><td width=50%><b>Patient:</b>&nbsp;<u>' +
    localStorage.getItem('patientName') +
    '</u></td><td width=50% align=right><b>Chart #</b><u>' +
    localStorage.getItem('patientAcct') +
    '</u></td></tr>';
document.body.prepend(ltrhead);
// 10-30-2024 the second field named ptinfo is still null
// END LETTERHEAD