Ticket #889: patch.patch
| File patch.patch, 74.4 kB (added by nribeka, 1 year ago) |
|---|
replace the path |
-
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/.classpath
old new 35 35 <classpathentry kind="lib" path="lib/tomcat/servlet-api.jar" sourcepath="/openmrs-source/apache-tomcat-5.5.20-src.zip"/> 36 36 <classpathentry kind="lib" path="lib/tomcat/catalina.jar" sourcepath="/openmrs-source/apache-tomcat-5.5.20-src.zip"/> 37 37 <classpathentry kind="lib" path="lib/tomcat/naming-resources.jar" sourcepath="/openmrs-source/apache-tomcat-5.5.20-src.zip"/> 38 <classpathentry kind="lib" path="lib/dwr/dwr-1.1.3mod.jar"/>39 38 <classpathentry kind="lib" path="lib/spring-framework/spring-2.5.1.jar" sourcepath="/openmrs-source/spring-2.5.1-src.zip"/> 40 39 <classpathentry kind="lib" path="lib/spring-framework/spring-test.jar" sourcepath="/openmrs-source/spring-framework-2.5.1-with-dependencies.zip"/> 41 40 <classpathentry kind="lib" path="lib/spring-framework/spring-webmvc.jar" sourcepath="/openmrs-source/spring-webmvc-sources.zip"/> … … 65 64 <classpathentry kind="lib" path="lib/benerator/databene-commons-0.4.5.jar"/> 66 65 <classpathentry kind="lib" path="lib/benerator/databene-webdecs-0.4.5.jar"/> 67 66 <classpathentry kind="lib" path="lib/commons-io/commons-io-1.4.jar"/> 67 <classpathentry kind="lib" path="lib/dwr/dwr.jar"/> 68 68 <classpathentry kind="output" path="build/"/> 69 69 </classpath> -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/src/web/org/openmrs/notification/web/dwr/DWRMessageService.java
old new 23 23 import org.openmrs.notification.MessageService; 24 24 import org.openmrs.notification.NotificationConstants; 25 25 26 import uk.ltd.getahead.dwr.WebContextFactory;26 import org.directwebremoting.WebContextFactory;; 27 27 28 28 public class DWRMessageService { 29 29 -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/src/web/org/openmrs/web/dwr/OpenmrsDWRServlet.java
old new 19 19 import org.openmrs.module.web.WebModuleUtil; 20 20 import org.openmrs.util.OpenmrsClassLoader; 21 21 22 import uk.ltd.getahead.dwr.DWRServlet;22 import org.directwebremoting.servlet.DwrServlet; 23 23 24 24 /** 25 25 * Simply used so that we have a way we can restart the DWR HttpServlet 26 26 * @author bwolfe 27 27 */ 28 public class OpenmrsDWRServlet extends D WRServlet {28 public class OpenmrsDWRServlet extends DwrServlet { 29 29 30 30 private static final long serialVersionUID = 121212111335789L; 31 31 -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/src/web/org/openmrs/web/dwr/RelationshipListItem.java
old new 15 15 16 16 import org.apache.commons.logging.Log; 17 17 import org.apache.commons.logging.LogFactory; 18 import org.openmrs.Patient;19 18 import org.openmrs.Person; 20 19 import org.openmrs.Relationship; 21 import org.openmrs.api.context.Context;22 20 23 21 public class RelationshipListItem { 24 22 -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/src/web/org/openmrs/web/dwr/DWRObsService.java
old new 33 33 import org.openmrs.api.context.Context; 34 34 import org.openmrs.util.OpenmrsUtil; 35 35 36 import uk.ltd.getahead.dwr.WebContextFactory;36 import org.directwebremoting.WebContextFactory; 37 37 38 38 /** 39 39 * -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/dwr.xml
old new 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN" "http://www.getahead.ltd.uk/dwr/dwr10.dtd"> 2 <!DOCTYPE dwr PUBLIC 3 "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" 4 "http://directwebremoting.org/schema/dwr20.dtd"> 3 5 4 6 <dwr> 5 7 -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/dwr-modules.xml
old new 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN" "http://resources.openmrs.org/doctype/dwr-1.0mod.dtd"> 2 <!DOCTYPE dwr PUBLIC 3 "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" 4 "http://directwebremoting.org/schema/dwr20.dtd"> 3 5 4 6 <dwr> 5 7 -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/analysis/cohortBuilder.jsp
old new 151 151 str += '</form>'; 152 152 if (lookupAnswers) { 153 153 DWRConceptService.getAnswersForQuestion(concept.conceptId, function(list) { 154 DWRUtil.removeAllOptions('replace_with_answer_options');155 DWRUtil.addOptions('replace_with_answer_options', [" "]);156 DWRUtil.addOptions('replace_with_answer_options', list, 'conceptId', 'name');154 dwr.util.removeAllOptions('replace_with_answer_options'); 155 dwr.util.addOptions('replace_with_answer_options', [" "]); 156 dwr.util.addOptions('replace_with_answer_options', list, 'conceptId', 'name'); 157 157 }); 158 158 } 159 159 return str; … … 368 368 369 369 function refreshWorkflowOptions() { 370 370 hideDiv('workflow'); 371 var program = DWRUtil.getValue('program');371 var program = dwr.util.getValue('program'); 372 372 if (program == null || program == '') { 373 DWRUtil.removeAllOptions('workflow');373 dwr.util.removeAllOptions('workflow'); 374 374 refreshStateOptions(); 375 375 } else 376 376 DWRProgramWorkflowService.getWorkflowsByProgram(program, function(wfs) { 377 DWRUtil.removeAllOptions('workflow');378 DWRUtil.addOptions('workflow', [" "]);379 DWRUtil.addOptions('workflow', wfs, 'id', 'name');377 dwr.util.removeAllOptions('workflow'); 378 dwr.util.addOptions('workflow', [" "]); 379 dwr.util.addOptions('workflow', wfs, 'id', 'name'); 380 380 if (wfs.length > 0) 381 381 showDiv('workflow'); 382 382 refreshStateOptions(); … … 385 385 386 386 function refreshStateOptions() { 387 387 hideDiv('state'); 388 var workflow = DWRUtil.getValue('workflow');388 var workflow = dwr.util.getValue('workflow'); 389 389 if (workflow == null || workflow == '') { 390 DWRUtil.removeAllOptions('state');390 dwr.util.removeAllOptions('state'); 391 391 } else 392 392 DWRProgramWorkflowService.getStatesByWorkflow(workflow, function (states) { 393 DWRUtil.removeAllOptions('state');394 DWRUtil.addOptions('state', states, 'id', 'name');393 dwr.util.removeAllOptions('state'); 394 dwr.util.addOptions('state', states, 'id', 'name'); 395 395 if (states.length < 10) 396 396 $('state').size = states.length; 397 397 else … … 1062 1062 <c:if test="${iter.last}"> 1063 1063 <c:set var="temp" value="last"/> 1064 1064 </c:if> 1065 <a href="#" onClick=" DWRUtil.setValue('cohort_builder_preview_method', '${temp}'); refreshPreview();">1065 <a href="#" onClick="dwr.util.setValue('cohort_builder_preview_method', '${temp}'); refreshPreview();"> 1066 1066 ${iter.count}. 1067 1067 </a> 1068 1068 </td> -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/admin/person/addPerson.jsp
old new 52 52 var birthdate = "${param.addBirthdate}"; 53 53 var age = "${param.addAge}"; 54 54 var gender = "${param.addGender}"; 55 DWRPersonService.getSimilarPeople( searchWidget.simpleClosure(searchWidget, "doObjectsFound"), personName, birthdate, age, gender);55 DWRPersonService.getSimilarPeople(personName, birthdate, age, gender, searchWidget.simpleClosure(searchWidget, "doObjectsFound")); 56 56 57 57 searchWidget.allowAutoJump = function() { return false; }; 58 58 }); -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/admin/patients/findDuplicatePatients.jsp
old new 97 97 98 98 searchWidget.findObjects = function(phrase) { 99 99 if (searchOn.length > 1) 100 DWRPatientService.findDuplicatePatients(search Widget.simpleClosure(searchWidget, "doObjectsFound"), searchOn);100 DWRPatientService.findDuplicatePatients(searchOn, searchWidget.simpleClosure(searchWidget, "doObjectsFound")); 101 101 } 102 102 103 103 }); -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/admin/programs/conversionForm.jsp
old new 54 54 } 55 55 56 56 function populateStates(states) { 57 DWRUtil.removeAllOptions("programWorkflowState");58 DWRUtil.addOptions("programWorkflowState", states, "id", "name");57 dwr.util.removeAllOptions("programWorkflowState"); 58 dwr.util.addOptions("programWorkflowState", states, "id", "name"); 59 59 <c:if test="${not empty conversion.programWorkflowState}"> 60 DWRUtil.setValue("programWorkflowState", ${conversion.programWorkflowState.programWorkflowStateId});60 dwr.util.setValue("programWorkflowState", ${conversion.programWorkflowState.programWorkflowStateId}); 61 61 </c:if> 62 62 } 63 63 -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/admin/programs/programForm.jsp
old new 74 74 var value = $('workflowsValue').value; 75 75 value = value.substring(value.indexOf(":") + 1); 76 76 values = helper(value); 77 DWRUtil.removeAllRows(tableId);78 DWRUtil.addRows(tableId, values, [77 dwr.util.removeAllRows(tableId); 78 dwr.util.addRows(tableId, values, [ 79 79 function(id) { return idToNameMap[id]; }, 80 80 function(id) { return '<a href="javascript:removeWorkflow(' + id + ')">[x]</a>';}, 81 81 ]); -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/admin/programs/workflowForm.jsp
old new 24 24 }); 25 25 26 26 function refreshStateTable() { 27 DWRUtil.removeAllRows('stateTable');27 dwr.util.removeAllRows('stateTable'); 28 28 if (states.length != 0) { 29 DWRUtil.addRows('stateTable', states, [29 dwr.util.addRows('stateTable', states, [ 30 30 function (st) { return idToNameMap[st[0]]; }, 31 31 function (st) { return '<input type="checkbox" id="initial_' + st[0] + '" ' + (st[1] ? 'checked' : '') + '/>'; }, 32 32 function (st) { return '<input type="checkbox" id="terminal_' + st[0] + '" ' + (st[2] ? 'checked' : '') + '/>'; } 33 ] );33 ], { escapeHtml:false }); 34 34 } else { 35 DWRUtil.addRows('stateTable', ['<spring:message code="general.none"/>'], [35 dwr.util.addRows('stateTable', ['<spring:message code="general.none"/>'], [ 36 36 function(s) { return s;} 37 ] );37 ], { escapeHtml:false }); 38 38 } 39 39 } 40 40 -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/admin/concepts/conceptProposalForm.jsp
old new 16 16 17 17 var selectConceptId = function(id) { 18 18 var closure = function(thisObj, method) { return function(obj) { return thisObj[method]({"obj":obj}); }; }; 19 DWRConceptService.getConcept( closure(cSearch, "select"), id);19 DWRConceptService.getConcept(id, closure(cSearch, "select")); 20 20 return false; 21 21 } 22 22 -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/admin/observations/obsForm.jsp
old new 50 50 function() { 51 51 var codedSearch = dojo.widget.manager.getWidgetById("codedSearch"); 52 52 var conceptId = conceptSelection.hiddenInputNode.value; 53 DWRConceptService.findConceptAnswers( codedSearch.simpleClosure(codedSearch, 'doObjectsFound'), '', conceptId, false, true);53 DWRConceptService.findConceptAnswers('', conceptId, false, true, codedSearch.simpleClosure(codedSearch, 'doObjectsFound')); 54 54 } 55 55 ); 56 56 … … 77 77 var codedSearch = dojo.widget.manager.getWidgetById("codedSearch"); 78 78 var codedSelection = dojo.widget.manager.getWidgetById("codedSelection"); 79 79 var conceptId = codedSelection.conceptId; 80 DWRConceptService.findConceptAnswers( codedSearch.simpleClosure(codedSearch, 'doObjectsFound'), txt, conceptId, false, true);80 DWRConceptService.findConceptAnswers(txt, conceptId, false, true, codedSearch.simpleClosure(codedSearch, 'doObjectsFound')); 81 81 } 82 82 83 83 dojo.event.topic.subscribe("codedSearch/objectsFound", … … 123 123 else if (datatype == 'NM' || datatype == 'SN') { 124 124 $('valueNumericRow').style.display = ""; 125 125 $('valueNumericRow').style.visibility = "visible"; 126 DWRConceptService.getConceptNumericUnits( fillNumericUnits, tmpConcept.conceptId);126 DWRConceptService.getConceptNumericUnits(tmpConcept.conceptId, fillNumericUnits); 127 127 } 128 128 else if (datatype == 'CWE') { 129 129 $('valueCodedRow').style.display = ""; … … 147 147 else { 148 148 $('valueInvalidRow').style.display = ""; 149 149 $('valueInvalidRow').style.visibility = "visible"; 150 DWRConceptService.getQuestionsForAnswer( fillValueInvalidPossible(tmpConcept), tmpConcept.conceptId);150 DWRConceptService.getQuestionsForAnswer(tmpConcept.conceptId, fillValueInvalidPossible(tmpConcept)); 151 151 } 152 152 } 153 153 } … … 167 167 else 168 168 errorTag.innerHTML = errorTag.className = ""; 169 169 } 170 DWRConceptService.isValidNumericValue( numericErrorMessage, value, conceptId);170 DWRConceptService.isValidNumericValue(value, conceptId, numericErrorMessage); 171 171 } 172 172 } 173 173 -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/admin/reports/dataExportForm.jsp
old new 150 150 151 151 function setValueHelper(htmlEl, val) { 152 152 if (htmlEl.id != null && htmlEl.id != '') 153 DWRUtil.setValue(htmlEl.id, val);153 dwr.util.setValue(htmlEl.id, val); 154 154 else 155 DWRUtil.setValue(htmlEl.name, val);155 dwr.util.setValue(htmlEl.name, val); 156 156 } 157 157 158 158 function updateCohortColumn(sel) { 159 159 if (sel.value != "") { 160 160 var count = sel.name.substr(sel.name.indexOf("_")+1, 3); 161 var val = DWRUtil.getValue(sel.name);161 var val = dwr.util.getValue(sel.name); 162 162 var temp = val.split("."); 163 163 var opt = sel.options[sel.selectedIndex]; 164 164 var tbl = getParentByTagName(sel, "table"); … … 424 424 } 425 425 426 426 function ensureName() { 427 var name = DWRUtil.getValue('dataExportName');427 var name = dwr.util.getValue('dataExportName'); 428 428 if (name == null || name == '') { 429 429 window.alert('<spring:message code="error.name" />'); 430 430 return false; … … 743 743 var widget = dojo.widget.manager.getWidgetById("cSelection_" + count); 744 744 if ("${column.conceptId}" != "") { 745 745 widget.hiddenInputNode.value = "${column.conceptId}"; 746 DWRConceptService.getConcept( widget.searchWidget.simpleClosure(new cSelect(widget), "select"), "${column.conceptId}");746 DWRConceptService.getConcept("${column.conceptId}", widget.searchWidget.simpleClosure(new cSelect(widget), "select")); 747 747 } 748 748 else { 749 749 // left for backwards compatibility to pre 1.0.43 … … 771 771 </c:if> 772 772 </c:forEach> 773 773 774 DWREngine.setOrdered(true);774 dwr.engine.setOrdered(true); 775 775 var btn = $('newPatientButton'); 776 776 <c:forEach items="${dataExport.patientIds}" var="id"> 777 777 addNew(btn, "newPatient", '${id}'); 778 778 </c:forEach> 779 DWREngine.setOrdered(false);779 dwr.engine.setOrdered(false); 780 780 </c:if> 781 781 } 782 782 </script> -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/admin/reports/rowPerObsDataExportForm.jsp
old new 150 150 151 151 function setValueHelper(htmlEl, val) { 152 152 if (htmlEl.id != null && htmlEl.id != '') 153 DWRUtil.setValue(htmlEl.id, val);153 dwr.util.setValue(htmlEl.id, val); 154 154 else 155 DWRUtil.setValue(htmlEl.name, val);155 dwr.util.setValue(htmlEl.name, val); 156 156 } 157 157 158 158 function updateCohortColumn(sel) { 159 159 if (sel.value != "") { 160 160 var count = sel.name.substr(sel.name.indexOf("_")+1, 3); 161 var val = DWRUtil.getValue(sel.name);161 var val = dwr.util.getValue(sel.name); 162 162 var temp = val.split("."); 163 163 var opt = sel.options[sel.selectedIndex]; 164 164 var tbl = getParentByTagName(sel, "table"); … … 424 424 } 425 425 426 426 function ensureName() { 427 var name = DWRUtil.getValue('dataExportName');427 var name = dwr.util.getValue('dataExportName'); 428 428 if (name == null || name == '') { 429 429 window.alert('<spring:message code="error.name" />'); 430 430 return false; … … 749 749 var widget = dojo.widget.manager.getWidgetById("cSelection_" + count); 750 750 if ("${column.conceptId}" != "") { 751 751 widget.hiddenInputNode.value = "${column.conceptId}"; 752 DWRConceptService.getConcept( widget.searchWidget.simpleClosure(new cSelect(widget), "select"), "${column.conceptId}");752 DWRConceptService.getConcept("${column.conceptId}", widget.searchWidget.simpleClosure(new cSelect(widget), "select")); 753 753 } 754 754 else { 755 755 // left for backwards compatibility to pre 1.0.43 … … 777 777 </c:if> 778 778 </c:forEach> 779 779 780 DWREngine.setOrdered(true);780 dwr.engine.setOrdered(true); 781 781 var btn = $('newPatientButton'); 782 782 <c:forEach items="${dataExport.patientIds}" var="id"> 783 783 addNew(btn, "newPatient", '${id}'); 784 784 </c:forEach> 785 DWREngine.setOrdered(false);785 dwr.engine.setOrdered(false); 786 786 </c:if> 787 787 } 788 788 </script> -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/portlets/patientIdentifiers.jsp
old new 24 24 25 25 function handleSaveIdentifier(index) { 26 26 currIndex = index; 27 var identifierType = DWRUtil.getValue('identifierType_' + index);28 var identifier = DWRUtil.getValue('identifier_' + index);27 var identifierType = dwr.util.getValue('identifierType_' + index); 28 var identifier = dwr.util.getValue('identifier_' + index); 29 29 //alert("id is " + identifier + " and type is " + identifierType); 30 var identifierLocationId = DWRUtil.getValue('identifierLocationId_' + index);30 var identifierLocationId = dwr.util.getValue('identifierLocationId_' + index); 31 31 oldId = identifier; 32 32 oldLocation = identifierLocationId; 33 33 if (identifierType != null && identifierType != '' && identifier != null && identifier != '') … … 50 50 } 51 51 52 52 function displayIdError(index, msg) { 53 DWRUtil.setValue("msg_" + index, getMessage(msg));53 dwr.util.setValue("msg_" + index, getMessage(msg)); 54 54 if ( msg.length > 0 ) { 55 55 document.getElementById("msg_" + index).style.display = ""; 56 56 } else { … … 72 72 } 73 73 74 74 function identifierFieldChanged(index) { 75 var id = DWRUtil.getValue('identifier_' + index);75 var id = dwr.util.getValue('identifier_' + index); 76 76 if (id == null || id == '') { 77 77 document.getElementById('idSaveButton_' + index).disabled = true; 78 78 } else { -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/portlets/patientOverview.jsp
old new 72 72 <!-- 73 73 74 74 function updateCauseField() { 75 var outcomeType = DWRUtil.getValue("reasonForExit");75 var outcomeType = dwr.util.getValue("reasonForExit"); 76 76 <openmrs:globalProperty key="concept.patientDied" var="conceptPatientDied" /> 77 77 78 78 if ( outcomeType == '${conceptPatientDied}' ) { … … 93 93 } 94 94 95 95 function exitFormValidate() { 96 var outcomeType = DWRUtil.getValue("reasonForExit");97 var outcomeDate = DWRUtil.getValue("dateOfExit");98 var outcomeCauseOfDeath = DWRUtil.getValue("causeOfDeath");99 var outcomeCauseOther = DWRUtil.getValue("causeOfDeath_other");96 var outcomeType = dwr.util.getValue("reasonForExit"); 97 var outcomeDate = dwr.util.getValue("dateOfExit"); 98 var outcomeCauseOfDeath = dwr.util.getValue("causeOfDeath"); 99 var outcomeCauseOther = dwr.util.getValue("causeOfDeath_other"); 100 100 101 101 if ( outcomeType == '' ) { 102 102 alert("<spring:message code="Patient.outcome.error.noType" />"); … … 139 139 <script type="text/javascript"> 140 140 <spring:message code="general.voidReasonQuestion" var="reasonText"/> 141 141 function handleCancelExit() { 142 var reason = DWRUtil.getValue('cancelExitReason');142 var reason = dwr.util.getValue('cancelExitReason'); 143 143 if (reason == '') { 144 144 alert("<spring:message code="Patient.outcome.resumeCareReason.required" arguments="${reasonText}"/>"); 145 145 return; -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/portlets/findPatient.jsp
old new 70 70 function findObjects(text) { 71 71 if (text.length > 2) { 72 72 savedText = text; 73 DWRPatientService.findPatients( preFillTable, text, includeRetired);73 DWRPatientService.findPatients(text, includeRetired, preFillTable); 74 74 } 75 75 else { 76 76 var msg = new Array(); … … 106 106 var findPatientForm = document.getElementById("findPatientForm"); 107 107 108 108 function init() { 109 DWRUtil.useLoadingMessage();109 dwr.util.useLoadingMessage(); 110 110 111 111 <request:existsParameter name="patientId"> 112 112 <!-- User has 'patientId' in the request params -- selecting that patient --> -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/portlets/patientEncounters.jsp
old new 206 206 --%> 207 207 208 208 function handleRefreshTable(id, data, func) { 209 DWRUtil.removeAllRows(id);210 DWRUtil.addRows(id, data, func, {209 dwr.util.removeAllRows(id); 210 dwr.util.addRows(id, data, func, { 211 211 cellCreator:function(options) { 212 212 var td = document.createElement("td"); 213 213 return td; 214 } 214 }, 215 escapeHtml:false 215 216 }); 216 217 } 217 218 … … 227 228 } 228 229 229 230 function handleAddObs(encounterField, conceptField, valueTextField, obsDateField) { 230 var encounterId = DWRUtil.getValue($(encounterField));231 var conceptId = DWRUtil.getValue($(conceptField));232 var valueText = DWRUtil.getValue($(valueTextField));233 var obsDate = DWRUtil.getValue($(obsDateField));231 var encounterId = dwr.util.getValue($(encounterField)); 232 var conceptId = dwr.util.getValue($(conceptField)); 233 var valueText = dwr.util.getValue($(valueTextField)); 234 var obsDate = dwr.util.getValue($(obsDateField)); 234 235 var patientId = ${model.patient.patientId}; 235 236 //alert("Adding obs for encounter (" + encounterId + "): " + conceptId + " = " + valueText + " " + obsDate); 236 237 DWRObsService.createObs(patientId, encounterId, conceptId, valueText, obsDate); -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/portlets/personRelationships.jsp
old new 42 42 } 43 43 44 44 function refreshRelationshipsCallback(rels) { 45 DWRUtil.removeAllOptions('new_relationships');45 dwr.util.removeAllOptions('new_relationships'); 46 46 if (rels.length == 0) { 47 DWRUtil.addOptions('new_relationships', [ '<spring:message code="general.none" javaScriptEscape="true" />' ]);47 dwr.util.addOptions('new_relationships', [ '<spring:message code="general.none" javaScriptEscape="true" />' ]); 48 48 } 49 49 for (var i = 0; i < rels.length; ++i) { 50 50 var rel = rels[i]; … … 69 69 str += ' <input type="button" value="<spring:message code="general.delete" javaScriptEscape="true"/>" onClick="handleDeleteRelationship(' + relId + ')"/>'; 70 70 str += ' <input type="button" value="<spring:message code="general.cancel" javaScriptEscape="true"/>" onClick="showDiv(\'del_rel_' + relId + '\'); hideDiv(\'voidRel' + relId + '\')"/>'; 71 71 str += '</span>'; 72 DWRUtil.addOptions('new_relationships', [ str ]);72 dwr.util.addOptions('new_relationships', [ str ]); 73 73 } 74 74 } 75 75 … … 77 77 var personIdB = ${model.personId}; 78 78 var personPopup = dojo.widget.manager.getWidgetById("add_rel_target_selection"); 79 79 var personIdA = personPopup.hiddenInputNode.value; 80 var relType = DWRUtil.getValue('add_relationship_type');80 var relType = dwr.util.getValue('add_relationship_type'); 81 81 if (relType == null || relType == '' || personIdA == null || personIdA == '' || personIdB == null || personIdB == '') { 82 82 window.alert('<spring:message code="Relationship.error.everything" javaScriptEscape="true"/>'); 83 83 return; … … 93 93 personIdB = temp; 94 94 } 95 95 personPopup.hiddenInputNode.value = ""; 96 DWRUtil.setValue('add_relationship_type', null);96 dwr.util.setValue('add_relationship_type', null); 97 97 hideDiv('addRelationship'); 98 98 showDiv('addRelationshipLink'); 99 99 DWRRelationshipService.createRelationship(personIdA, personIdB, relType, refreshRelationships); 100 100 } 101 101 102 102 function handleDeleteRelationship(relationshipId) { 103 var reason = DWRUtil.getValue('void_reason_' + relationshipId);103 var reason = dwr.util.getValue('void_reason_' + relationshipId); 104 104 if (reason != null && reason != '') { 105 105 DWRRelationshipService.voidRelationship(relationshipId, reason, refreshRelationships); 106 106 } 107 107 } 108 108 109 109 function handlePickRelType(value, label) { 110 DWRUtil.setValue('add_relationship_type', value);110 dwr.util.setValue('add_relationship_type', value); 111 111 document.getElementById('add_relationship_name').innerHTML = label; 112 112 showDiv('add_rel_details'); 113 113 } -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/portlets/patientRegimen.jsp
old new 151 151 //alert("hasOrders starting as " + hasOrders); 152 152 153 153 function updateAddFields(drugFieldId, unitsFieldId, frequencyDayFieldId, frequencyWeekFieldId) { 154 var drugId = DWRUtil.getValue(drugFieldId);154 var drugId = dwr.util.getValue(drugFieldId); 155 155 gUnitsFieldId = unitsFieldId; 156 156 DWROrderService.getUnitsByDrugId(drugId, setUnitsField); 157 157 } 158 158 159 159 function setUnitsField(unitsText) { 160 DWRUtil.setValue(gUnitsFieldId + "Span", unitsText);161 DWRUtil.setValue(gUnitsFieldId, unitsText);160 dwr.util.setValue(gUnitsFieldId + "Span", unitsText); 161 dwr.util.setValue(gUnitsFieldId, unitsText); 162 162 hideOtherStandards("New"); 163 163 showAppropriateActions("New"); 164 164 } … … 170 170 showDiv('action' + codeName); 171 171 } else { 172 172 hideDiv('action' + codeName); 173 DWRUtil.setValue('actionSelect' + codeName, 'add');173 dwr.util.setValue('actionSelect' + codeName, 'add'); 174 174 showDiv('add' + codeName); 175 175 } 176 176 showDiv('cancel' + codeName); … … 220 220 showHideDiv('stDt' + codeName); 221 221 showHideDiv('submit' + codeName); 222 222 hideDiv('action' + codeName); 223 DWRUtil.setValue('actionSelect' + codeName, '');223 dwr.util.setValue('actionSelect' + codeName, ''); 224 224 hideDiv('reas' + codeName); 225 225 hideDiv('replace' + codeName); 226 226 hideDiv('add' + codeName); … … 229 229 <c:forEach var="standardRegimen" items="${model.standardRegimens}"> 230 230 231 231 function addStandard${standardRegimen.codeName}(canReplace) { 232 var startDate = DWRUtil.getValue('startDate${standardRegimen.codeName}');232 var startDate = dwr.util.getValue('startDate${standardRegimen.codeName}'); 233 233 if ( startDate && startDate != '' ) { 234 234 if ( canReplace ) { 235 var action = DWRUtil.getValue('actionSelect${standardRegimen.codeName}');236 var reason = DWRUtil.getValue('reason${standardRegimen.codeName}');237 DWRUtil.setValue('actionSelect${standardRegimen.codeName}', '');238 DWRUtil.setValue('reason${standardRegimen.codeName}', '');235 var action = dwr.util.getValue('actionSelect${standardRegimen.codeName}'); 236 var reason = dwr.util.getValue('reason${standardRegimen.codeName}'); 237 dwr.util.setValue('actionSelect${standardRegimen.codeName}', ''); 238 dwr.util.setValue('reason${standardRegimen.codeName}', ''); 239 239 if ( action == 'void' ) { 240 240 //alert('voiding with [${model.patientId}] [${standardRegimen.canReplace}] [' + reason + ']'); 241 241 DWROrderService.voidCurrentDrugSet(${model.patientId}, '${standardRegimen.canReplace}', reason, addComponents${standardRegimen.codeName}); … … 257 257 } 258 258 259 259 function addComponents${standardRegimen.codeName}() { 260 var startDate = DWRUtil.getValue('startDate${standardRegimen.codeName}');261 DWRUtil.setValue('startDate${standardRegimen.codeName}', '');260 var startDate = dwr.util.getValue('startDate${standardRegimen.codeName}'); 261 dwr.util.setValue('startDate${standardRegimen.codeName}', ''); 262 262 <c:forEach var="drugComponent" items="${standardRegimen.drugComponents}"> 263 263 addStack.push("DWROrderService.createDrugOrder(${drugComponent.drugId})"); 264 264 </c:forEach> … … 280 280 } 281 281 282 282 function handleStandardActionChange(codeName) { 283 var action = DWRUtil.getValue('actionSelect' + codeName);283 var action = dwr.util.getValue('actionSelect' + codeName); 284 284 if ( action == 'void' || action == 'discontinue' ) { 285 285 showDiv('reas' + codeName); 286 286 showDiv('replace' + codeName); 287 287 hideDiv('add' + codeName); 288 288 if ( action == 'void' ) { 289 DWRUtil.removeAllOptions('reason' + codeName);290 DWRUtil.addOptions('reason' + codeName, voidReasons, 'val', 'display');289 dwr.util.removeAllOptions('reason' + codeName); 290 dwr.util.addOptions('reason' + codeName, voidReasons, 'val', 'display'); 291 291 } else if ( action == 'discontinue') { 292 DWRUtil.removeAllOptions('reason' + codeName);293 DWRUtil.addOptions('reason' + codeName, discReasons, 'val', 'display');292 dwr.util.removeAllOptions('reason' + codeName); 293 dwr.util.addOptions('reason' + codeName, discReasons, 'val', 'display'); 294 294 } 295 295 } else if ( action == 'add' ) { 296 296 hideDiv('reas' + codeName); … … 306 306 } 307 307 308 308 function addNewDrugOrder() { 309 var action = DWRUtil.getValue('actionSelectNew');310 var reason = DWRUtil.getValue('reasonNew');311 var startDate = DWRUtil.getValue('startDate');312 var drugId = DWRUtil.getValue('drug');313 var dose = DWRUtil.getValue('dose');314 var units = DWRUtil.getValue('units');315 var freqDay = DWRUtil.getValue('frequencyDay');316 var freqWeek = DWRUtil.getValue('frequencyWeek');309 var action = dwr.util.getValue('actionSelectNew'); 310 var reason = dwr.util.getValue('reasonNew'); 311 var startDate = dwr.util.getValue('startDate'); 312 var drugId = dwr.util.getValue('drug'); 313 var dose = dwr.util.getValue('dose'); 314 var units = dwr.util.getValue('units'); 315 var freqDay = dwr.util.getValue('frequencyDay'); 316 var freqWeek = dwr.util.getValue('frequencyWeek'); 317 317 if ( validateNewOrder(drugId, dose, units, freqDay, freqWeek, startDate) ) { 318 DWRUtil.setValue('actionSelectNew', '');319 DWRUtil.setValue('reasonNew', '');318 dwr.util.setValue('actionSelectNew', ''); 319 dwr.util.setValue('reasonNew', ''); 320 320 if ( action == 'void' ) { 321 321 DWROrderService.voidCurrentDrugOrders(${model.patientId}, reason, addNewComponent); 322 322 showHideDiv('reasNew'); -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/portlets/globalProperties.jsp
old new 35 35 onClick=' 36 36 hideDiv("gp_${ind}_actions"); 37 37 showDiv("gp_${ind}_saving"); 38 DWRAdministrationService.setGlobalProperty("${prop.property}", DWRUtil.getValue("gp_${ind}"),38 DWRAdministrationService.setGlobalProperty("${prop.property}", dwr.util.getValue("gp_${ind}"), 39 39 function() { hideDiv("gp_${ind}_saving") }); 40 40 ' 41 41 /> 42 42 <input type="button" value="<spring:message code="general.cancel"/>" 43 43 onClick=' 44 44 hideDiv("gp_${ind}_actions"); 45 DWRUtil.setValue("gp_${ind}", "${prop.propertyValue}");45 dwr.util.setValue("gp_${ind}", "${prop.propertyValue}"); 46 46 '/> 47 47 </span> 48 48 <span id="gp_${ind}_saving" style="display: none; background-color: #e0e0e0"> … … 60 60 </c:if> 61 61 <script type="text/javascript"> 62 62 var gpVal = "<spring:message text="${prop.propertyValue}" javaScriptEscape="true"/>"; 63 DWRUtil.setValue('gp_${ind}', gpVal);63 dwr.util.setValue('gp_${ind}', gpVal); 64 64 </script> 65 65 </c:forEach> 66 66 </table> -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/portlets/patientPrograms.jsp
old new 115 115 patientProgramForWorkflowEdited = patientProgramId; 116 116 showLayer('editWorkflowPopup'); 117 117 $('workflowPopupTitle').innerHTML = wfName; 118 DWRUtil.removeAllRows('workflowTable');119 DWRUtil.addRows('workflowTable', ['<spring:message code="general.loading" javaScriptEscape="true"/>'], [ function(s) { return s; } ]);120 DWRUtil.removeAllOptions('changeToState');121 DWRUtil.addOptions('changeToState', ['<spring:message code="general.loading" javaScriptEscape="true"/>']);118 dwr.util.removeAllRows('workflowTable'); 119 dwr.util.addRows('workflowTable', ['<spring:message code="general.loading" javaScriptEscape="true"/>'], [ function(s) { return s; } ], { escapeHtml:false }); 120 dwr.util.removeAllOptions('changeToState'); 121 dwr.util.addOptions('changeToState', ['<spring:message code="general.loading" javaScriptEscape="true"/>']); 122 122 $('changeStateOnDate').value = ''; 123 123 DWRProgramWorkflowService.getPatientStates(patientProgramId, programWorkflowId, function(states) { 124 DWRUtil.removeAllRows('workflowTable');124 dwr.util.removeAllRows('workflowTable'); 125 125 var count = 0; 126 126 var goUntil = states.length; 127 DWRUtil.addRows('workflowTable', states, [127 dwr.util.addRows('workflowTable', states, [ 128 128 function(state) { return state.stateName; }, 129 129 function(state) { 130 130 ++count; … … 135 135 str += ' <a href="javascript:handleVoidLastState()" style="color: red">[x]</a>'; 136 136 return str; 137 137 } 138 ] );138 ], { escapeHtml:false }); 139 139 }); 140 140 DWRProgramWorkflowService.getPossibleNextStates(patientProgramId, programWorkflowId, function(items) { 141 DWRUtil.removeAllOptions('changeToState');142 DWRUtil.addOptions('changeToState', {'': '<spring:message code="State.select" javaScriptEscape="true"/>' });143 DWRUtil.addOptions('changeToState', items, 'id', 'name');141 dwr.util.removeAllOptions('changeToState'); 142 dwr.util.addOptions('changeToState', {'': '<spring:message code="State.select" javaScriptEscape="true"/>' }); 143 dwr.util.addOptions('changeToState', items, 'id', 'name'); 144 144 }); 145 145 } 146 146 -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/portlets/patientSet.jsp
old new 105 105 DWRPatientSetService.getMyPatientSetSize(function(sz) { PS_totalPatients = sz; document.getElementById("PS_totalNumber").innerHTML = sz; }); 106 106 } 107 107 <%-- TODO: this is commented out because it breaks the page in IE. Find the right place to put it. 108 DWRUtil.useLoadingMessage();108 dwr.util.useLoadingMessage(); 109 109 --%> 110 110 if (localList != null) { 111 111 var ptIds = new Array(); … … 134 134 showLayer('${model.id}'); 135 135 } 136 136 </c:if> 137 DWRUtil.removeAllRows("${tableBodyId}");137 dwr.util.removeAllRows("${tableBodyId}"); 138 138 if (PS_fromIndex > 0) { 139 139 var row = document.getElementById("${tableBodyId}").insertRow(0); 140 140 var cell = row.insertCell(0); … … 163 163 function(patient) { return patient.age; }, 164 164 function(patient) { return '<c:if test="${model.mutable}"><a href="javascript:remove(' + patient.patientId + ')" style="color: red">[x]<a></c:if>'; } 165 165 ]; 166 DWRUtil.addRows("${tableBodyId}", patients, cellFuncs);166 dwr.util.addRows("${tableBodyId}", patients, cellFuncs, { escapeHtml:false }); 167 167 if (PS_fromIndex + PS_pageSize < PS_totalPatients) { 168 168 var tbl = document.getElementById("${tableBodyId}"); 169 169 var row = tbl.insertRow(tbl.rows.length); -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/view/portlets/customMostRecentObs.jsp
old new 44 44 <script type="text/javascript"> 45 45 function handleAddCustomObs(conceptId) { 46 46 var encounterId = null; 47 var valueText = DWRUtil.getValue(document.getElementById('value_' + conceptId));48 var obsDate = DWRUtil.getValue(document.getElementById('date_' + conceptId));47 var valueText = dwr.util.getValue(document.getElementById('value_' + conceptId)); 48 var obsDate = dwr.util.getValue(document.getElementById('date_' + conceptId)); 49 49 var patientId = ${model.patient.patientId}; 50 50 var conceptNameId = null; 51 51 //alert("Adding obs for encounter (" + encounterId + "): " + conceptId + " = " + valueText + " " + obsDate); -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/WEB-INF/template/headerFull.jsp
old new 92 92 if (typeof ex == "string") 93 93 window.status = "DWR warning/error: " + ex; 94 94 }; 95 DWREngine.setErrorHandler(handler);96 DWREngine.setWarningHandler(handler);95 dwr.engine.setErrorHandler(handler); 96 dwr.engine.setWarningHandler(handler); 97 97 </script> 98 98 99 99 <openmrs:forEachAlert> -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/scripts/drugOrder.js.withjstl
old new 156 156 var gUnitsFieldId = ''; 157 157 158 158 function handleVoidCurrentDrugSet(drugSetId, voidReasonField) { 159 var voidReason = DWRUtil.getValue($(voidReasonField));159 var voidReason = dwr.util.getValue($(voidReasonField)); 160 160 var drugSetIdParam = '' + drugSetId; 161 161 DWROrderService.voidCurrentDrugSet(patientId, drugSetIdParam, voidReason, refreshCurrentRegimenTable); 162 162 } 163 163 164 164 function handleVoidCompletedDrugSet(drugSetId, voidReasonField) { 165 var voidReason = DWRUtil.getValue($(voidReasonField));165 var voidReason = dwr.util.getValue($(voidReasonField)); 166 166 var drugSetIdParam = '' + drugSetId; 167 167 DWROrderService.voidCompletedDrugSet(patientId, drugSetIdParam, voidReason, refreshCompletedRegimenTable); 168 168 } 169 169 170 170 function handleDiscontinueDrugSet(drugSetId, discDateField, discReasonField) { 171 var discDate = DWRUtil.getValue($(discDateField));172 var discReason = DWRUtil.getValue($(discReasonField));171 var discDate = dwr.util.getValue($(discDateField)); 172 var discReason = dwr.util.getValue($(discReasonField)); 173 173 var drugSetIdParam = '' + drugSetId; 174 174 if ( discDate == null || discDate == '' ) { 175 175 alert("<spring:message code="DrugOrder.drugSet.discontinue.error.noDate" />"); … … 190 190 } 191 191 192 192 function handleAddDrugOrder( patientId, drugField, doseField, unitsField, frequencyDayField, frequencyWeekField, startDateField) { 193 var drugId = DWRUtil.getValue($(drugField));194 var dose = DWRUtil.getValue($(doseField));195 var units = DWRUtil.getValue($(unitsField));196 var frequency = DWRUtil.getValue($(frequencyDayField)) + " x " + DWRUtil.getValue($(frequencyWeekField));197 var startDate = DWRUtil.getValue($(startDateField));193 var drugId = dwr.util.getValue($(drugField)); 194 var dose = dwr.util.getValue($(doseField)); 195 var units = dwr.util.getValue($(unitsField)); 196 var frequency = dwr.util.getValue($(frequencyDayField)) + " x " + dwr.util.getValue($(frequencyWeekField)); 197 var startDate = dwr.util.getValue($(startDateField)); 198 198 var instructions = ""; 199 199 if ( drugId != '' && dose != '' && units != '' && frequency != '' && startDate != '' ) { 200 200 blankAddNewOrder(drugField, doseField, unitsField, frequencyDayField, frequencyWeekField, startDateField); … … 209 209 } 210 210 211 211 function blankAddNewOrder(drugField, doseField, unitsField, frequencyDayField, frequencyWeekField, startDateField) { 212 DWRUtil.setValue($(drugField),"");213 DWRUtil.setValue($(doseField),"");214 DWRUtil.setValue($(unitsField),"");215 DWRUtil.setValue($(frequencyDayField),"");216 DWRUtil.setValue($(frequencyWeekField),"");217 DWRUtil.setValue($(startDateField),"");212 dwr.util.setValue($(drugField),""); 213 dwr.util.setValue($(doseField),""); 214 dwr.util.setValue($(unitsField),""); 215 dwr.util.setValue($(frequencyDayField),""); 216 dwr.util.setValue($(frequencyWeekField),""); 217 dwr.util.setValue($(startDateField),""); 218 218 } 219 219 220 220 function handleVoidCurrentDrugOrder(orderId, voidReasonField) { 221 var voidReason = DWRUtil.getValue($(voidReasonField));221 var voidReason = dwr.util.getValue($(voidReasonField)); 222 222 DWROrderService.voidOrder(orderId, voidReason, refreshCurrentRegimenTable); 223 223 } 224 224 225 225 function handleVoidCompletedDrugOrder(orderId, voidReasonField) { 226 var voidReason = DWRUtil.getValue($(voidReasonField));226 var voidReason = dwr.util.getValue($(voidReasonField)); 227 227 DWROrderService.voidOrder(orderId, voidReason, refreshCompletedRegimenTable); 228 228 } 229 229 230 230 function handleDiscontinueDrugOrder(orderId, discDateField, discReasonField) { 231 var discDate = DWRUtil.getValue($(discDateField));232 var discReason = DWRUtil.getValue($(discReasonField));231 var discDate = dwr.util.getValue($(discDateField)); 232 var discReason = dwr.util.getValue($(discReasonField)); 233 233 if ( discDate && discDate != '' ) { 234 234 DWROrderService.discontinueOrder(orderId, discReason, discDate, refreshRegimenTables); 235 235 } else { … … 306 306 var tableId = 'regimenTableCurrent_header_' + drugSetLabel; 307 307 308 308 if ( document.getElementById(tableId) ) { 309 DWRUtil.addRows(tableId, drugSet, currentRegimenTableHeaderCells, {309 dwr.util.addRows(tableId, drugSet, currentRegimenTableHeaderCells, { 310 310 cellCreator:function(options) { 311 311 var td = document.createElement("td"); 312 312 var cSpan = regimenMode == "view" ? "6" : "8"; 313 313 td.setAttribute("colspan", cSpan); 314 314 return td; 315 } 315 }, 316 escapeHtml:false 316 317 }); 317 318 //alert("about to try to populate " + "closegp_" + drugSetId + "_reason"); 318 319 if ( document.getElementById("closegp_" + drugSetId + "_reason") ) 319 DWRUtil.addOptions("closegp_" + drugSetId + "_reason", discReasons, "val", "display");320 dwr.util.addOptions("closegp_" + drugSetId + "_reason", discReasons, "val", "display"); 320 321 if ( document.getElementById("voidgp_" + drugSetId + "_reason") ) 321 DWRUtil.addOptions("voidgp_" + drugSetId + "_reason", voidReasons, "val", "display");322 dwr.util.addOptions("voidgp_" + drugSetId + "_reason", voidReasons, "val", "display"); 322 323 } 323 324 } 324 325 … … 332 333 var tableId = 'regimenTableCompleted_header_' + drugSetId; 333 334 334 335 if ( document.getElementById(tableId) ) { 335 DWRUtil.addRows(tableId, drugSet, completedRegimenTableHeaderCells, {336 dwr.util.addRows(tableId, drugSet, completedRegimenTableHeaderCells, { 336 337 cellCreator:function(options) { 337 338 var td = document.createElement("td"); 338 339 td.setAttribute("colspan", "8"); 339 340 return td; 340 } 341 }, 342 escapeHtml:false 341 343 }); 342 344 } 343 345 } … … 353 355 } 354 356 } 355 357 if ( document.getElementById(tableName) ) { 356 DWRUtil.addRows(tableName, drugOrders, currentRegimenTableCellFuncs, {358 dwr.util.addRows(tableName, drugOrders, currentRegimenTableCellFuncs, { 357 359 cellCreator:function(options) { 358 360 var td = document.createElement("td"); 359 361 return td; 360 } 362 }, 363 escapeHtml:false 361 364 }); 362 365 for ( var i = 0; i < drugOrders.length; i++ ) { 363 366 var orderId = drugOrders[i].orderId; 364 367 if ( document.getElementById("close_" + orderId + "_reason") ) 365 DWRUtil.addOptions("close_" + orderId + "_reason", discReasons, "val", "display");368 dwr.util.addOptions("close_" + orderId + "_reason", discReasons, "val", "display"); 366 369 if ( document.getElementById("void_" + orderId + "_reason") ) 367 DWRUtil.addOptions("void_" + orderId + "_reason", voidReasons, "val", "display");370 dwr.util.addOptions("void_" + orderId + "_reason", voidReasons, "val", "display"); 368 371 } 369 372 } 370 373 } … … 381 384 } 382 385 383 386 if ( document.getElementById(tableName) ) { 384 DWRUtil.addRows(tableName, drugOrders, completedRegimenTableCellFuncs, {387 dwr.util.addRows(tableName, drugOrders, completedRegimenTableCellFuncs, { 385 388 cellCreator:function(options) { 386 389 var td = document.createElement("td"); 387 390 return td; 388 } 391 }, 392 escapeHtml:false 389 393 }); 390 394 for ( var i = 0; i < drugOrders.length; i++ ) { 391 395 var orderId = drugOrders[i].orderId; 392 396 if ( document.getElementById("voidcp_" + orderId + "_reason") ) 393 DWRUtil.addOptions("voidcp_" + orderId + "_reason", voidReasons, "val", "display");397 dwr.util.addOptions("voidcp_" + orderId + "_reason", voidReasons, "val", "display"); 394 398 } 395 399 } 396 400 } … … 407 411 var headerId = tableName + "_header_" + currDrugSet; 408 412 var tableId = tableName + "_" + currDrugSet; 409 413 if ( document.getElementById(headerId) ) 410 DWRUtil.removeAllRows(tableName + '_header_' + currDrugSet);414 dwr.util.removeAllRows(tableName + '_header_' + currDrugSet); 411 415 if ( document.getElementById(tableId) ) 412 DWRUtil.removeAllRows(tableName + '_' + currDrugSet);416 dwr.util.removeAllRows(tableName + '_' + currDrugSet); 413 417 } 414 418 } 415 419 } else { 416 420 if ( document.getElementById(tableName) ) 417 DWRUtil.removeAllRows(tableName);421 dwr.util.removeAllRows(tableName); 418 422 } 419 423 } 420 424 -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/scripts/obs.js.withjstl
old new 41 41 42 42 function obsSearch( patientField, conceptField, encounterField, obsTable, obsDiv ) { 43 43 showDiv(obsDiv); 44 var patientId = patientField.length == 0 ? "" : DWRUtil.getValue(patientField);45 var conceptId = conceptField.length == 0 ? "" : DWRUtil.getValue(conceptField);46 var encounterId = encounterField.length == 0 ? "" : DWRUtil.getValue(encounterField);44 var patientId = patientField.length == 0 ? "" : dwr.util.getValue(patientField); 45 var conceptId = conceptField.length == 0 ? "" : dwr.util.getValue(conceptField); 46 var encounterId = encounterField.length == 0 ? "" : dwr.util.getValue(encounterField); 47 47 obsTableToRefresh = obsTable; 48 48 DWRObsService.getObsByPatientConceptEncounter(patientId, conceptId, encounterId, refreshObsTable); 49 49 } 50 50 51 51 function refreshObsTable(obss) { 52 52 if ( document.getElementById(obsTableToRefresh) ) { 53 DWRUtil.removeAllRows(obsTableToRefresh);53 dwr.util.removeAllRows(obsTableToRefresh); 54 54 if ( obss && obss.length > 0 ) { 55 DWRUtil.addRows(obsTableToRefresh, obss, obsCellFuncs, {55 dwr.util.addRows(obsTableToRefresh, obss, obsCellFuncs, { 56 56 cellCreator:function(options) { 57 57 var td = document.createElement("td"); 58 58 return td; 59 } 59 }, 60 escapeHtml:false 60 61 }); 61 62 } else { 62 63 var noObsMsg = "<spring:message code="ObsSearch.noneFound" />"; 63 64 var obsMsgs = [noObsMsg, ""]; 64 DWRUtil.addRows(obsTableToRefresh, obsMsgs, obsNoneCellFuncs, {65 dwr.util.addRows(obsTableToRefresh, obsMsgs, obsNoneCellFuncs, { 65 66 cellCreator:function(options) { 66 67 var td = document.createElement("td"); 67 68 return td; 68 } 69 }, 70 escapeHtml:false 69 71 }); 70 72 } 71 73 } else { … … 75 77 76 78 function obsSearchClear( patientField, conceptField, encounterField ) { 77 79 if ( patientField.length > 0 ) { 78 DWRUtil.setValue(patientField, "");80 dwr.util.setValue(patientField, ""); 79 81 var patPopup = dojo.widget.manager.getWidgetById("patientId_selection"); 80 82 if ( patPopup ) { 81 83 patPopup.displayNode.innerHTML = ""; … … 83 85 } 84 86 } 85 87 if ( conceptField.length > 0 ) { 86 DWRUtil.setValue(conceptField, "");88 dwr.util.setValue(conceptField, ""); 87 89 var conPopup = dojo.widget.manager.getWidgetById("conceptId_selection"); 88 90 if ( conPopup ) { 89 91 conPopup.displayNode.innerHTML = ""; … … 91 93 } 92 94 } 93 95 if ( encounterField.length > 0 ) { 94 DWRUtil.setValue(encounterField, "");96 dwr.util.setValue(encounterField, ""); 95 97 var encPopup = dojo.widget.manager.getWidgetById("encounterId_selection"); 96 98 if ( encPopup ) { 97 99 encPopup.displayNode.innerHTML = ""; -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/scripts/dojo/src/widget/openmrs/EncounterSearch.js
old new 21 21 dojo.debug("postCreate in encounterSearch"); 22 22 23 23 if (this.encounterId) 24 DWREncounterService.getEncounter(this. simpleClosure(this, "select"), this.encounterId);24 DWREncounterService.getEncounter(this.encounterId, this.simpleClosure(this, "select")); 25 25 }, 26 26 27 27 28 28 doFindObjects: function(text) { 29 29 30 30 var tmpIncludedVoided = (this.showIncludeVoided && this.includeVoided.checked); 31 DWREncounterService.findEncounters(t his.simpleClosure(this, "doObjectsFound"), text, tmpIncludedVoided);31 DWREncounterService.findEncounters(text, tmpIncludedVoided, this.simpleClosure(this, "doObjectsFound")); 32 32 33 33 return false; 34 34 }, -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/scripts/dojo/src/widget/openmrs/FieldSearch.js
old new 23 23 24 24 var closure = function(thisObj, method) { return function(obj) { return thisObj[method]({"obj":obj}); }; }; 25 25 if (this.fieldId != "") 26 DWRFormService.findFields( closure(this, "select"), this.fieldId);26 DWRFormService.findFields(this.fieldId, closure(this, "select")); 27 27 }, 28 28 29 29 doFindObjects: function(text) { 30 30 if (this.alsoSearchConcepts == true) 31 DWRFormService.findFieldsAndConcepts(t his.simpleClosure(this, "doObjectsFound"), text);31 DWRFormService.findFieldsAndConcepts(text, this.simpleClosure(this, "doObjectsFound")); 32 32 else 33 DWRFormService.findFields(t his.simpleClosure(this, "doObjectsFound"), text);33 DWRFormService.findFields(text, this.simpleClosure(this, "doObjectsFound")); 34 34 35 35 return false; 36 36 }, -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/scripts/dojo/src/widget/openmrs/UserSearch.js.withjstl
old new 30 30 31 31 var closure = function(thisObj, method) { return function(obj) { return thisObj[method]({"obj":obj}); }; }; 32 32 if (this.userId != "") { 33 DWRUserService.getUser( closure(this, "select"), this.userId);33 DWRUserService.getUser(this.userId, closure(this, "select")); 34 34 } 35 35 }, 36 36 37 37 doFindObjects: function(text) { 38 38 var tmpIncludeVoided = (this.showIncludeVoided && this.includeVoided.checked); 39 DWRUserService.findUsers(t his.simpleClosure(this, "doObjectsFound"), text, this.roles, tmpIncludeVoided);39 DWRUserService.findUsers(text, this.roles, tmpIncludeVoided, this.simpleClosure(this, "doObjectsFound")); 40 40 41 41 return false; 42 42 }, … … 53 53 54 54 showAll: function() { 55 55 var tmpIncludeVoided = (this.showIncludeVoided && this.includeVoided.checked); 56 DWRUserService.getAllUsers(this. simpleClosure(this, "doObjectsFound"), this.roles, tmpIncludeVoided);56 DWRUserService.getAllUsers(this.roles, tmpIncludeVoided, this.simpleClosure(this, "doObjectsFound")); 57 57 }, 58 58 59 59 getCellFunctions: function() { -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/scripts/dojo/src/widget/openmrs/LocationSearch.js
old new 20 20 postCreate: function(){ 21 21 dojo.debug("postCreate in LocationSearch"); 22 22 if (this.locationId) 23 DWREncounterService.getLocation(this. simpleClosure(this, "select"), this.locationId);23 DWREncounterService.getLocation(this.locationId, this.simpleClosure(this, "select")); 24 24 }, 25 25 26 26 showAll: function() { … … 28 28 }, 29 29 30 30 doFindObjects: function(text) { 31 DWREncounterService.findLocations(t his.simpleClosure(this, "doObjectsFound"), text);31 DWREncounterService.findLocations(text, this.simpleClosure(this, "doObjectsFound")); 32 32 return false; 33 33 }, 34 34 -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/scripts/dojo/src/widget/openmrs/ObsSearch.js.withjstl
old new 122 122 123 123 postCreate: function() { 124 124 if (this.patientId != "" || this.encounterId != "" || this.conceptId != "") { 125 DWRObsService.getObsByPatientConceptEncounter(this. simpleClosure(this, "doObjectsFound"), this.patientId, this.encounterId, this.conceptId, false);125 DWRObsService.getObsByPatientConceptEncounter(this.patientId, this.encounterId, this.conceptId, false, this.simpleClosure(this, "doObjectsFound")); 126 126 } 127 127 }, 128 128 129 129 selectObs: function(obsId) { 130 DWRObsService.getObs( this.simpleClosure(this, "select"), obsId);130 DWRObsService.getObs(obsId, this.simpleClosure(this, "select")); 131 131 }, 132 132 133 133 doFindObjects: function(patientId, encounterId, conceptId) { 134 134 135 135 if (this.patientId != "" || this.encounterId != "" || this.conceptId != "") { 136 DWRObsService.getObsByPatientConceptEncounter(this. simpleClosure(this, "doObjectsFound"), this.patientId, this.encounterId, this.conceptId, false);136 DWRObsService.getObsByPatientConceptEncounter(this.patientId, this.encounterId, this.conceptId, false, this.simpleClosure(this, "doObjectsFound")); 137 137 } 138 138 139 139 return false; -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/scripts/dojo/src/widget/openmrs/OpenmrsSearch.js.withjstl
old new 104 104 if (typeof ex == "string") 105 105 window.status = "DWR warning/error: " + ex; 106 106 }; 107 DWREngine.setErrorHandler(handler);108 DWREngine.setWarningHandler(handler);107 dwr.engine.setErrorHandler(handler); 108 dwr.engine.setWarningHandler(handler); 109 109 }, 110 110 111 111 fillInTemplate: function(args, frag){ … … 425 425 this.displayHeaderRow(); 426 426 } 427 427 428 dojo.debug("in doObjectsFound"); 428 429 this.fillTable(objs); 429 430 }, 430 431 … … 564 565 }, 565 566 566 567 cellCreator: function(options) { 567 if ( DWRUtil._isHTMLElement(options.data, "td") == true)568 if (dwr.util._isHTMLElement(options.data, "td") == true) 568 569 return options.data; 569 570 570 571 return document.createElement("td"); … … 572 573 573 574 574 575 fillTable: function(objects, cells) { 575 if (objects.length > 1 || typeof objects[0] != 'string')576 if (objects.length > 1 || typeof objects[0] != 'string') 576 577 dojo.event.topic.publish(this.eventNames.fillTable, {"objects": objects} ); 577 578 578 // If we get only one result and the enter key was pressed jump to that object579 // If we get only one result and the enter key was pressed jump to that object 579 580 if (objects.length == 1 && ((this.event && this.key == dojo.event.browser.keys.KEY_ENTER) || 580 581 (this.event == null && !(this.key)))) { 581 582 //alert("type: " (typeof objects[0])); … … 594 595 595 596 this.updatePagingNumbers(); 596 597 597 // signal to the using script that we've cleared the rows598 // signal to the using script that we've cleared the rows 598 599 this.onRemoveAllRows(this.objHitsTableBody); 599 DWRUtil.removeAllRows(this.objHitsTableBody); //clear out the current rows600 dwr.util.removeAllRows(this.objHitsTableBody); //clear out the current rows 600 601 601 602 var objs = objects.slice(this.firstItemDisplayed - 1, (this.firstItemDisplayed - 1) + this.numItemsDisplayed); 602 603 603 DWRUtil.addRows(this.objHitsTableBody, objs, this.getCellFunctions(), this.getRowOptions());604 dwr.util.addRows(this.objHitsTableBody, objs, this.getCellFunctions(), this.getRowOptions()); 604 605 605 setTimeout(this.simpleClosure(this, "updatePagingBars"), 0);606 setTimeout(this.simpleClosure(this, "updatePagingBars"), 0); 606 607 607 if (this.event && this.key == dojo.event.browser.keys.KEY_ENTER) {608 if (this.event && this.key == dojo.event.browser.keys.KEY_ENTER) { 608 609 // showHighlighting must be called here to assure it occurs after 609 610 // objects are returned. Must be called with Timeout because 610 611 // DWRUtil.addRows uses setTimeout … … 614 615 if (this.event) 615 616 dojo.debug("ending fillTable(). Keycode was: " + this.key); 616 617 617 this.postFillTable();618 this.postFillTable(); 618 619 }, 619 620 620 621 621 622 getRowOptions: function() { 622 623 var arr = { 'rowCreator': this.simpleClosure(this, "rowCreator"), 623 'cellCreator': this.simpleClosure(this, "cellCreator")}; 624 'cellCreator': this.simpleClosure(this, "cellCreator"), 625 'escapeHtml': false 626 }; 624 627 return arr; 625 628 }, 626 629 … … 653 656 this.hideHeaderRow(); 654 657 // signal to the using script that we've cleared the rows 655 658 this.onRemoveAllRows(this.objHitsTableBody); 656 DWRUtil.removeAllRows(this.objHitsTableBody); //clear out the current rows659 dwr.util.removeAllRows(this.objHitsTableBody); //clear out the current rows 657 660 this.inputNode.value = this.text = this.lastPhraseSearch = ""; 658 661 }, 659 662 … … 738 741 if (this.numItemsDisplayed + 1 == this.allObjectsFound.length) { 739 742 this.numItemsDisplayed = this.numItemsDisplayed + 1; 740 743 } 744 dojo.debug("end update paging"); 741 745 }, 742 746 743 747 getTableBodySize: function() { -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/scripts/dojo/src/widget/openmrs/ConceptSearch.js
old new 33 33 dojo.debug("postCreate in conceptsearch"); 34 34 35 35 if (this.drugId) { 36 DWRConceptService.getDrug(this. simpleClosure(this, "select"), this.drugId);36 DWRConceptService.getDrug(this.drugId, this.simpleClosure(this, "select")); 37 37 } 38 38 else if (this.conceptId) { 39 DWRConceptService.getConcept(this. simpleClosure(this, "select", true), this.conceptId);39 DWRConceptService.getConcept(this.conceptId, this.simpleClosure(this, "select", true)); 40 40 } 41 41 42 42 this.inputNode.value = this.searchPhrase; 43 43 dojo.debug("searchPhrase, before inserting to inputNode is " + this.searchPhrase); 44 44 45 45 if ( this.showAnswers && (this.searchPhrase || this.performInitialSearch) ) { 46 DWRConceptService.findConceptAnswers(this.s impleClosure(this, "doObjectsFound"), this.searchPhrase, this.showAnswers, false, this.includeDrugConcepts);46 DWRConceptService.findConceptAnswers(this.searchPhrase, this.showAnswers, false, this.includeDrugConcepts, this.simpleClosure(this, "doObjectsFound")); 47 47 } 48 48 else if (this.searchPhrase){ 49 DWRConceptService.findConcepts(this.s impleClosure(this, "doObjectsFound"), this.searchPhrase, false, this.includeClasses, this.excludeClasses, this.includeDatatypes, this.excludeDatatypes, this.includeDrugConcepts);49 DWRConceptService.findConcepts(this.searchPhrase, false, this.includeClasses, this.excludeClasses, this.includeDatatypes, this.excludeDatatypes, this.includeDrugConcepts, this.simpleClosure(this, "doObjectsFound")); 50 50 } 51 51 }, 52 52 … … 55 55 var tmpIncludedRetired = (this.showIncludeRetired && this.includeRetired.checked); 56 56 57 57 if ( this.showAnswers != "" ) { 58 DWRConceptService.findConceptAnswers(t his.simpleClosure(this, "doObjectsFound"), text, this.showAnswers, tmpIncludedRetired, this.includeDrugConcepts);58 DWRConceptService.findConceptAnswers(text, this.showAnswers, tmpIncludedRetired, this.includeDrugConcepts, this.simpleClosure(this, "doObjectsFound")); 59 59 } else { 60 DWRConceptService.findConcepts(t his.simpleClosure(this, "doObjectsFound"), text, tmpIncludedRetired, this.includeClasses, this.excludeClasses, this.includeDatatypes, this.excludeDatatypes, this.includeDrugConcepts);60 DWRConceptService.findConcepts(text, tmpIncludedRetired, this.includeClasses, this.excludeClasses, this.includeDatatypes, this.excludeDatatypes, this.includeDrugConcepts, this.simpleClosure(this, "doObjectsFound")); 61 61 } 62 62 63 //DWRConceptService.findConcepts(t his.simpleClosure(this, "doObjectsFound"), text, tmpIncludedRetired, this.includeClasses, this.excludeClasses, this.includeDatatypes, this.excludeDatatypes, this.includeDrugConcepts);63 //DWRConceptService.findConcepts(text, tmpIncludedRetired, this.includeClasses, this.excludeClasses, this.includeDatatypes, this.excludeDatatypes, this.includeDrugConcepts, this.simpleClosure(this, "doObjectsFound")); 64 64 65 65 return false; 66 66 }, … … 175 175 176 176 searchCleared: function() { 177 177 if ( this.showAnswers ) 178 DWRConceptService.findConceptAnswers( this.simpleClosure(this, "doObjectsFound"), "", this.showAnswers, false, this.includeDrugConcepts);178 DWRConceptService.findConceptAnswers("", this.showAnswers, false, this.includeDrugConcepts, this.simpleClosure(this, "doObjectsFound")); 179 179 } 180 180 181 181 }, -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/scripts/dojo/src/widget/openmrs/PatientSearch.js.withjstl
old new 34 34 this.selectPatient(this.patientId); 35 35 } 36 36 else if (this.searchPhrase) { 37 DWRPatientService.findPatients(this.s impleClosure(this, "doObjectsFound"), this.searchPhrase, false);37 DWRPatientService.findPatients(this.searchPhrase, false, this.simpleClosure(this, "doObjectsFound")); 38 38 } 39 39 }, 40 40 41 41 selectPatient: function(patientId) { 42 DWRPatientService.getPatient( this.simpleClosure(this, "select"), patientId);42 DWRPatientService.getPatient(patientId, this.simpleClosure(this, "select")); 43 43 }, 44 44 45 45 doFindObjects: function(text) { 46 dojo.debug("finding patient with: " + text); 46 47 47 48 var tmpIncludedVoided = (this.showIncludeVoided && this.includeVoided.checked); 48 DWRPatientService.findPatients(t his.simpleClosure(this, "doObjectsFound"), text, tmpIncludedVoided);49 DWRPatientService.findPatients(text, tmpIncludedVoided, this.simpleClosure(this, "doObjectsFound")); 49 50 50 51 return false; 51 52 }, -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/admin/forms/formSchemaDesign.js
old new 261 261 msg.newTree.containerNode.style.display = ""; 262 262 263 263 if (msg.child.data.isSet) 264 DWRConceptService.getConceptSet( addConceptSet(msg.child), msg.child.data.conceptId);264 DWRConceptService.getConceptSet(msg.child.data.conceptId, addConceptSet(msg.child)); 265 265 266 266 if (msg.skipEdit) { 267 267 updateSortWeight(msg.child); … … 307 307 var nodeRemoved = function(val) { 308 308 this.value = val; 309 309 this.execute = function(msg) { 310 DWREngine.setAsync(false);310 dwr.engine.setAsync(false); 311 311 removeNode(msg.child); 312 DWREngine.setAsync(true);312 dwr.engine.setAsync(true); 313 313 }; 314 314 } 315 315 … … 701 701 702 702 // save the field to the database 703 703 selectedNode = target; 704 DWRFormService.saveFormField( endSaveFormField(target),data.fieldId, data.fieldName, data.description, data.fieldType,704 DWRFormService.saveFormField(data.fieldId, data.fieldName, data.description, data.fieldType, 705 705 data.conceptId, data.tableName, data.attributeName, data.defaultValue, data.selectMultiple, 706 data.formFieldId, formId, data.parent, data.fieldNumber, data.fieldPart, data.pageNumber, data.minOccurs, data.maxOccurs, data.isRequired, data.sortWeight );706 data.formFieldId, formId, data.parent, data.fieldNumber, data.fieldPart, data.pageNumber, data.minOccurs, data.maxOccurs, data.isRequired, data.sortWeight, endSaveFormField(target)); 707 707 708 708 // update the field label in the tree 709 709 target.titleNode.innerHTML = target.title = getFieldLabel(data); -
/home/nribeka/Desktop/Work/PatientMatching/openmrs-trunk/web/openmrs.js
old new 1 1 2 2 function markAlertRead(self, alertId) { 3 DWRAlertService.markAlertRead( null, alertId);3 DWRAlertService.markAlertRead(alertId, null); 4 4 var parent = self.parentNode; 5 5 parent.style.display = "none"; 6 6 var unreadAlertSizeBox = document.getElementById('unreadAlertSize'); … … 139 139 if (message) loadingMessage = message; 140 140 else loadingMessage = "Loading"; 141 141 142 DWREngine.setPreHook(function() {142 dwr.engine.setPreHook(function() { 143 143 var disabledZone = $('disabledZone'); 144 144 if (!disabledZone) { 145 145 disabledZone = document.createElement('div'); … … 157 157 } 158 158 }); 159 159 160 DWREngine.setPostHook(function() {160 dwr.engine.setPostHook(function() { 161 161 $('disabledZone').style.display = 'none'; 162 162 }); 163 163 }
Download in other formats:
Powered by Trac 0.10.5
By Edgewall Software.
Visit the Trac open source project at
http://trac.edgewall.com/