[prev in list] [next in list] [prev in thread] [next in thread]
List: openmrs-svn
Subject: [30987] openmrs-modules/chica/branches/cerner/web: Electronic PWS updates.
From: svn-noreply () openmrs ! org
Date: 2014-11-03 21:36:21
Message-ID: 20141103213622.03BB2401A1 () openmrs ! osuosl ! org
[Download RAW message or body]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[30987] openmrs-modules/chica/branches/cerner/web: Electronic PWS \
updates.</title> </head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: \
verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: \
bold} #msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: \
bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: \
6px; } #logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em \
0; } #logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg \
h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; } \
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; \
} #logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: \
-1.5em; padding-left: 1.5em; } #logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em \
1em 0 1em; background: white;} #logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid \
#fa0; border-bottom: 1px solid #fa0; background: #fff; } #logmsg table th { \
text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted \
#fa0; } #logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: \
0.2em 0.5em; } #logmsg table thead th { text-align: center; border-bottom: 1px solid \
#fa0; } #logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: \
6px; } #patch { width: 100%; }
#patch h4 {font-family: \
verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins \
{background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del \
{background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, \
.info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd>30987</dd>
<dt>Author</dt> <dd>sjmckee</dd>
<dt>Date</dt> <dd>2014-11-03 21:36:21 +0000 (Mon, 03 Nov 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Electronic PWS updates.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#openmrsmoduleschicabranchescernerwebmoduleforcePrintJITsjsp">openmrs-modules/chica/branches/cerner/web/module/forcePrintJITs.jsp</a></li>
<li><a href="#openmrsmoduleschicabranchescernerwebmoduleresourcesforcePrintJITscss">o \
penmrs-modules/chica/branches/cerner/web/module/resources/forcePrintJITs.css</a></li> \
<li><a href="#openmrsmoduleschicabranchescernerwebmoduleresourcesforcePrintJITsjs">ope \
nmrs-modules/chica/branches/cerner/web/module/resources/forcePrintJITs.js</a></li> \
<li><a href="#openmrsmoduleschicabranchescernerwebsrcorgopenmrsmodulechicawebChicaMobi \
leServletjava">openmrs-modules/chica/branches/cerner/web/src/org/openmrs/module/chica/web/ChicaMobileServlet.java</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="openmrsmoduleschicabranchescernerwebmoduleforcePrintJITsjsp"></a>
<div class="modfile"><h4>Modified: \
openmrs-modules/chica/branches/cerner/web/module/forcePrintJITs.jsp (30986 => \
30987)</h4> <pre class="diff"><span>
<span class="info">--- \
openmrs-modules/chica/branches/cerner/web/module/forcePrintJITs.jsp 2014-11-03 \
19:41:26 UTC (rev 30986)
+++ openmrs-modules/chica/branches/cerner/web/module/forcePrintJITs.jsp 2014-11-03 \
21:36:21 UTC (rev 30987) </span><span class="lines">@@ -13,38 +13,40 @@
</span><span class="cx"> <title>Force Print Handouts</title>
</span><span class="cx"> </head>
</span><span class="cx"> <body>
</span><del>- <form>
- <div id="formsLoading">
- <span id="formsLoadingPanel"><img \
src="/openmrs/moduleResources/chica/images/ajax-loader.gif"/>Loading \
forms...</span>
- </div>
- <div id="formsServerError">
- <div id="formsServerErrorText" \
class="ui-state-error"></div>
- <br/><br/><a href="#" \
id="retryButton" class="icon-button ui-state-default \
ui-corner-all">Retry</a>
- <a href="#" id="retryCloseButton" \
class="icon-button ui-state-default \
ui-corner-all">Close</a>
- </div>
- <div id="formsContainer">
- <fieldset>
- <label for="forms">Select a form</label>
- <select name="forms" \
id="forms"></select>
- </fieldset>
- </div>
- <div id="buttonPanel">
- <a href="#" id="createButton" \
class="icon-button ui-state-default \
ui-corner-all">Create</a>
- <a href="#" id="closeButton" \
class="icon-button ui-state-default \
ui-corner-all">Close</a>
- </div>
- <div id="frameContainer">
- <iframe id="formFrame" src="" \
frameBorder="0" seamless></iframe>
- </div>
- <div id="frameLoading">
- <span id="frameLoadingPanel"><img \
src="/openmrs/moduleResources/chica/images/ajax-loader.gif"/>Creating \
form...</span>
- </div>
- <div id="frameError">
- <div id="frameServerErrorText" \
class="ui-state-error"></div>
- </div>
- <input type="hidden" value="${patientId}" \
id="patientId" />
- <input type="hidden" value="${sessionId}" \
id="sessionId" />
- <input type="hidden" value="${locationId}" \
id="locationId" />
- <input type="hidden" value="${locationTagId}" \
id="locationTagId" />
- </form>
</del><ins>+ <div id="content">
+ <form>
+ <div id="formsLoading">
+ <span id="formsLoadingPanel"><img \
src="/openmrs/moduleResources/chica/images/ajax-loader.gif"/>Loading \
forms...</span> + </div>
+ <div id="formsServerError">
+ <div id="formsServerErrorText" \
class="ui-state-error"></div> + \
<br/><br/><a href="#" id="retryButton" \
class="icon-button ui-state-default ui-corner-all">Retry</a> + \
<a href="#" id="retryCloseButton" class="icon-button \
ui-state-default ui-corner-all">Close</a> + </div>
+ <div id="formsContainer">
+ <fieldset>
+ <label for="forms">Select a form</label>
+ <select name="forms" \
id="forms"></select> + </fieldset>
+ </div>
+ <div id="buttonPanel">
+ <a href="#" id="createButton" \
class="icon-button ui-state-default ui-corner-all">Create</a> + \
<a href="#" id="closeButton" class="icon-button \
ui-state-default ui-corner-all">Close</a> + </div>
+ <div id="frameContainer">
+ <iframe id="formFrame" src="" \
frameBorder="0" seamless \
onload="iframeLoaded()"></iframe> + </div>
+ <div id="frameLoading">
+ <span id="frameLoadingPanel"><img \
src="/openmrs/moduleResources/chica/images/ajax-loader.gif"/>Creating \
form...</span> + </div>
+ <div id="frameError">
+ <div id="frameServerErrorText" \
class="ui-state-error"></div> + </div>
+ <input type="hidden" value="${patientId}" \
id="patientId" /> + <input type="hidden" \
value="${sessionId}" id="sessionId" /> + <input \
type="hidden" value="${locationId}" id="locationId" \
/> + <input type="hidden" value="${locationTagId}" \
id="locationTagId" /> + </form>
+ </div>
</ins><span class="cx"> </body>
</span><span class="cx"> </page>
</span></span></pre></div>
<a id="openmrsmoduleschicabranchescernerwebmoduleresourcesforcePrintJITscss"></a>
<div class="modfile"><h4>Modified: \
openmrs-modules/chica/branches/cerner/web/module/resources/forcePrintJITs.css (30986 \
=> 30987)</h4> <pre class="diff"><span>
<span class="info">--- \
openmrs-modules/chica/branches/cerner/web/module/resources/forcePrintJITs.css 2014-11-03 \
19:41:26 UTC (rev 30986)
+++ openmrs-modules/chica/branches/cerner/web/module/resources/forcePrintJITs.css 2014-11-03 \
21:36:21 UTC (rev 30987) </span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+#content {
+ background-color: #F5FBEF;
+ width: 80%;
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ text-align: center;
+ padding: 20px;
+ box-shadow: 10px 10px 5px #2E2E2E;
+ -webkit-box-shadow: 10px 10px 5px #2E2E2E;
+ -moz-box-shadow: 10px 10px 5px #2E2E2E;
+ border-radius: 10px;
+ -webkit-border-radius: 10px;
+ -moz-border-radius: 10px;
+}
+
</ins><span class="cx"> #formsLoading {
</span><span class="cx"> text-align: center;
</span><span class="cx"> margin: 0 auto;
</span><span class="lines">@@ -43,7 +59,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> body {
</span><del>- background-color:#F5FBEF;
</del><ins>+ font-size:14px;
+ background: #b24926;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> iframe {
</span></span></pre></div>
<a id="openmrsmoduleschicabranchescernerwebmoduleresourcesforcePrintJITsjs"></a>
<div class="modfile"><h4>Modified: \
openmrs-modules/chica/branches/cerner/web/module/resources/forcePrintJITs.js (30986 \
=> 30987)</h4> <pre class="diff"><span>
<span class="info">--- \
openmrs-modules/chica/branches/cerner/web/module/resources/forcePrintJITs.js 2014-11-03 \
19:41:26 UTC (rev 30986)
+++ openmrs-modules/chica/branches/cerner/web/module/resources/forcePrintJITs.js 2014-11-03 \
21:36:21 UTC (rev 30987) </span><span class="lines">@@ -1,11 +1,18 @@
</span><ins>+var isIE = true;
</ins><span class="cx"> $(document).ready(function () {
</span><ins>+ isIE = checkForIE();
</ins><span class="cx"> $(window).resize(function() {
</span><span class="cx"> // Update the iframe height
</span><del>- $("#formFrame").height($(window).height() - 200);
</del><ins>+ $("#formFrame").height($(window).height() - 220);
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> setSize();
</span><del>-
</del><ins>+
+ $("#formFrame").on("load", function () {
+ $("#frameLoading").hide();
+ $("#frameContainer").show();
+ });
+
</ins><span class="cx"> $("#createButton").button({ disabled: true });
</span><span class="cx"> $("#closeButton").button();
</span><span class="cx"> $("#retryCloseButton").button();
</span><span class="lines">@@ -33,6 +40,21 @@
</span><span class="cx"> loadForms();
</span><span class="cx"> });
</span><span class="cx">
</span><ins>+function checkForIE() {
+ var ua = window.navigator.userAgent;
+ var msie = ua.indexOf("MSIE ");
+
+ if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If \
Internet Explorer, return version number + return true;
+ else // If another browser, return 0
+ return false;
+}
+
+function iframeLoaded() {
+ $("#frameLoading").hide();
+ $("#frameContainer").show();
+}
+
</ins><span class="cx"> function setSize() {
</span><span class="cx"> window.resizeTo($(window).width() * 0.95,$(window).height() \
* 0.95); </span><span class="cx"> }
</span><span class="lines">@@ -115,10 +137,10 @@
</span><span class="cx"> "#view=fit&navpanes=0";
</span><span class="cx"> var url = \
"/openmrs/moduleServlet/chica/chicaMobile?"; </span><span class="cx">
</span><del>- $('#formFrame').load(function(){
- $("#frameLoading").hide();
- $("#frameContainer").show();
- });
</del><ins>+ $('#formFrame').attr("src", url + action);
</ins><span class="cx">
</span><del>- $('#formFrame').attr("src", url + action);
</del><ins>+ // IE doesn't fire the onload event for the iframe.
+ if (isIE) {
+ setTimeout(iframeLoaded, 2000);
+ }
</ins><span class="cx"> }
</span></span></pre></div>
<a id="openmrsmoduleschicabranchescernerwebsrcorgopenmrsmodulechicawebChicaMobileServletjava"></a>
<div class="modfile"><h4>Modified: \
openmrs-modules/chica/branches/cerner/web/src/org/openmrs/module/chica/web/ChicaMobileServlet.java \
(30986 => 30987)</h4> <pre class="diff"><span>
<span class="info">--- \
openmrs-modules/chica/branches/cerner/web/src/org/openmrs/module/chica/web/ChicaMobileServlet.java 2014-11-03 \
19:41:26 UTC (rev 30986)
+++ openmrs-modules/chica/branches/cerner/web/src/org/openmrs/module/chica/web/ChicaMobileServlet.java 2014-11-03 \
21:36:21 UTC (rev 30987) </span><span class="lines">@@ -846,31 +846,35 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (location == null) {
+ String message = "Location not found: " + locationString;
+ log.error(message);
+ throw new IllegalArgumentException(message);
+ }
+
</ins><span class="cx"> String locationTags = \
request.getParameter("locationTagId"); </span><span class="cx"> Integer \
locationId = null; </span><span class="cx"> Integer locationTagId = null;
</span><del>- if (location != null) {
- locationId = location.getLocationId();
- if (locationTags != null && locationTags.trim().length() > 0) {
- try {
- locationTagId = Integer.parseInt(locationTags);
- } catch (NumberFormatException e) {
- String message = "Invalid locationTagId parameter: " + locationTags;
- log.error(message);
- throw new IllegalArgumentException(message);
- }
- } else {
- locationTags = user.getUserProperty("locationTags");
- if (locationTags != null) {
- StringTokenizer tokenizer = new StringTokenizer(locationTags, ",");
- while (tokenizer.hasMoreTokens()) {
- String locationTagName = tokenizer.nextToken();
- locationTagName = locationTagName.trim();
- Set<LocationTag> tags = location.getTags();
- for (LocationTag tag : tags) {
- if (tag.getName().equalsIgnoreCase(locationTagName)) {
- locationTagId = tag.getLocationTagId();
- }
</del><ins>+ locationId = location.getLocationId();
+ if (locationTags != null && locationTags.trim().length() > 0) {
+ try {
+ locationTagId = Integer.parseInt(locationTags);
+ } catch (NumberFormatException e) {
+ String message = "Invalid locationTagId parameter: " + locationTags;
+ log.error(message);
+ throw new IllegalArgumentException(message);
+ }
+ } else {
+ locationTags = user.getUserProperty("locationTags");
+ if (locationTags != null) {
+ StringTokenizer tokenizer = new StringTokenizer(locationTags, ",");
+ while (tokenizer.hasMoreTokens()) {
+ String locationTagName = tokenizer.nextToken();
+ locationTagName = locationTagName.trim();
+ Set<LocationTag> tags = location.getTags();
+ for (LocationTag tag : tags) {
+ if (tag.getName().equalsIgnoreCase(locationTagName)) {
+ locationTagId = tag.getLocationTagId();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -918,22 +922,43 @@
</span><span class="cx"> // Check the output type
</span><span class="cx"> FormAttributeValue fav = \
chirdlutilbackportsService.getFormAttributeValue( </span><span class="cx"> formId, \
"outputType", locationTagId, locationId); </span><del>- if (fav != null \
&& fav.getValue() != null && \
fav.getValue().contains("pdf")) { </del><ins>+ if (fav == null || \
fav.getValue() == null || fav.getValue().trim().length() == 0) { \
+ response.setContentType("text/xml"); \
+ response.setHeader("Cache-Control", "no-cache"); \
+ PrintWriter pw = response.getWriter(); + String message = "<span>No \
outputType attribute set for form: " + formName + + ". Request cannot \
be completed.</span>"; + log.error(message);
+ pw.write(message);
+ return;
+ }
+
+ String[] outputTypes = fav.getValue().split(",");
+ String firstOutputType = outputTypes[0];
+ if ("pdf".equalsIgnoreCase(firstOutputType)) {
</ins><span class="cx"> String formInstanceTag = result.toString();
</span><span class="cx"> locatePatientJITs(response, formInstanceTag);
</span><del>- } else if (fav != null && fav.getValue() != null && \
fav.getValue().contains("teleformXML")) { </del><ins>+ } else if \
("teleformXML".equalsIgnoreCase(firstOutputType)) { </ins><span class="cx"> \
response.setContentType("text/xml"); </span><span class="cx"> \
response.setHeader("Cache-Control", "no-cache"); </span><span \
class="cx"> PrintWriter pw = response.getWriter(); \
</span><del>- FormAttributeValue attributeValue = \
chirdlutilbackportsService.getFormAttributeValue(form.getFormId(), \
"displayName",
- locationTagId, locationId);
</del><ins>+ FormAttributeValue attributeValue = \
chirdlutilbackportsService.getFormAttributeValue(form.getFormId(), \
+ "displayName", locationTagId, locationId); </ins><span class="cx"> \
if (attributeValue != null && attributeValue.getValue() != null && \
attributeValue.getValue().length() > 0) { </span><span class="cx"> formName = \
attributeValue.getValue(); </span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String resultMessage = formName + " successfully \
sent to the printer."; </span><del>- map.put("resultMessage", \
resultMessage); </del><span class="cx"> pw.write("<span>" + \
resultMessage + "</span>"); </span><ins>+ } else {
+ response.setContentType("text/xml");
+ response.setHeader("Cache-Control", "no-cache");
+ PrintWriter pw = response.getWriter();
+ String message = "<span>Invalid outputType attribute '" + \
firstOutputType + "' found for form: " + formName + \
+ "</span>"; + log.error(message);
+ pw.write(message);
+ return;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>
<p></p>
-- <br />
-- OpenMRS Subversion Commits: <a \
href="http://go.openmrs.org/svn">http://go.openmrs.org/svn</a><br /> Posting is not \
allowed - please join dev@openmrs.org for discussion.<br />
Unsubscribe: svn+unsubscribe@openmrs.org<br />
<p></p>
To unsubscribe from this group and stop receiving emails from it, send an email to <a \
href="mailto:svn+unsubscribe@openmrs.org">svn+unsubscribe@openmrs.org</a>.<br />
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic