Problem Summary
When the user opens a patient's encounter screen from the demographic search, and then opens it from the appointment, 2 encounter screen instances are opened.
Expected Result
There should only ever be one encounter screen open. If another encounter link is clicked while that screen is opened, the window should focus and refresh
Actual Result
Clicking both links results in 2 windows being opened
Steps to reproduce
Reproduced in: Deb 396
Additional Information:
Error traced back to the popupWithAppointmentNo on the appointmentprovideradminday jsp page. JavaScript Function calls "popupEncounter" and passes parameter "encounter" as the window name. popupEncounter implementation shows that it ignores this parameter and instead uses the window name of "Encounter"
function popupWithApptNo(vheight,vwidth,varpage,name,apptNo) {
if (apptNo) storeApptNo(apptNo);
if (name=='master')
popup(vheight,vwidth,varpage,name);
else if (name=='encounter')
popUpEncounter(vheight, vwidth, varpage);
else
popupOscarRx(vheight,vwidth,varpage);
}
...
function popUpEncounter(vheight,vwidth,varpage) {
var page = "" + varpage;
windowprops = "height="+vheight+",width="+vwidth+",location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=yes,screenX=50,screenY=50,top=0,left=0";
var popup=window.open(page, "Encounter", windowprops);
if (popup != null) {
if (popup.opener == null) {
popup.opener = self;
}
popup.focus();
}
}
most commonly used JS function for opening the encounter window is "popupEChart" that function uses "encounter" as the name.
function popupEChart(vheight,vwidth,varpage) {
var page = "" + varpage;
windowprops = "height="+vheight+",width="+vwidth+",location=no,scrollbars=yes,menubars=no,toolbars=no,resiz able=yes,screenX=50,screenY=50,top=20,left=20";
var popup=window.open(page, "encounter", windowprops);
if (popup != null) {
if (popup.opener == null) {
popup.opener = self;
}
popup.focus();
}
}
also noted is that the implementation of popupEchart in the appointmentprovideradminday is incorrect, it uses the "Encounter" naming
function popupEChart(vheight,vwidth,varpage) { //open a new popup window
var page = "" + varpage;
windowprops = "height="+vheight+",width="+vwidth+",location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=yes,screenX=50,screenY=50,top=20,left=20";
var popup=window.open(page, "Encounter", windowprops);
if (popup != null) {
if (popup.opener == null) {
popup.opener = self;
}
popup.focus();
}
}
The bug has been replicated on R12.1 (build# 396).
It does not apply to Master.
Changing status to open-accepted.
RELEASE_12_1_1_TRIMARA commit: https://source.oscartools.org:8080/#/c/10620/
Could it be merged into R12.1 then we can validate and close the ticket?
Here is a fix for 12_1:
https://source.oscartools.org:8080/#/c/12039/
It includes a fix for the same issue in caseload as well. I am going to apply this fix for caseload to master also.
This fix to master will include caseload:
https://source.oscartools.org:8080/#/c/12040/
release_15_beta - https://source.oscartools.org:8080/#/c/12041/
There are more places that allow to open 2 encounters:
Messenger when the demographic is linked to the message (R12_1, Trunk)
Inbox / Open Document /Select echart button (Trunk)
Inbox/Open Lab/ Select echart button (Trunk)
R12_1: https://source.oscartools.org:8080/#/c/12074/
Master: https://source.oscartools.org:8080/#/c/12075/
R15_Beta: https://source.oscartools.org:8080/#/c/12076/
The issue is resolved in caseload, 'E' on search result and 'E' on the appointment, 'E' when viewing in Messenger with ptt attached, E-chart in Inbox/ Documents in R12_1, Master, Beta branches.
However, I am able to open 2 encounters when selected "E-chart" button in Inbox/ Labs in Beta/ Master.
The issue also should be revised in CAISI view when set caisi=on in properties file in both R12_1 and Master.
commit:
master - https://source.oscartools.org:8080/#/c/12601/
release_15_beta - https://source.oscartools.org:8080/#/c/12602/