Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register
Show
Ignore:
Timestamp:
05/06/08 00:36:37 (8 months ago)
Author:
djazayeri
Message:

Allow voiding the obs that exits a patient from care. Added global property listeners and supporting infrastructure. The xml for this needs to be changed slightly, but the method signatures are fine.
Also fixing CR/LF issue in a few files

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs/trunk/web/WEB-INF/view/portlets/patientOverview.jsp

    r4095 r4113  
    33<openmrs:htmlInclude file="/dwr/interface/DWRRelationshipService.js" /> 
    44<openmrs:htmlInclude file="/dwr/interface/DWRPatientService.js" /> 
     5<openmrs:htmlInclude file="/dwr/interface/DWRObsService.js" /> 
    56<openmrs:htmlInclude file="/dwr/engine.js" /> 
    67<openmrs:htmlInclude file="/dwr/util.js" /> 
     
    910<openmrs:globalProperty key="use_patient_attribute.healthCenter" defaultValue="false" var="showHealthCenter"/> 
    1011 
    11 <openmrs:extensionPoint pointId="org.openmrs.patientDashboard.overviewBox" type="html" parameters="patientId=${model.patient.patientId}"
     12<openmrs:extensionPoint pointId="org.openmrs.patientDashboard.overviewBox" type="html"
    1213        <openmrs:hasPrivilege privilege="${extension.requiredPrivilege}"> 
    1314                <div class="boxHeader${model.patientVariation}"><spring:message code="${extension.title}" /></div> 
    14                 <div class="box${model.patientVariation}"><spring:message code="${extension.content}"/></div> 
     15                <div class="box${model.patientVariation}"><spring:message code="${extension.content}" /></div> 
    1516                <br /> 
    1617        </openmrs:hasPrivilege> 
     
    2930        </table> 
    3031        <table id="patientActions"> 
    31                 <openmrs:extensionPoint pointId="org.openmrs.patientDashboard.patientActionsContent" type="html" parameters="patientId=${model.patient.patientId}"/> 
    3232                <tr> 
    3333                <c:if test="${empty model.patientReasonForExit}"> 
     
    132132                </c:if> 
    133133                <c:if test="${not empty model.patientReasonForExit}"> 
     134                        <script type="text/javascript"> 
     135                                <spring:message code="general.voidReasonQuestion" var="reasonText"/> 
     136                                function handleCancelExit() { 
     137                                        var reason = DWRUtil.getValue('cancelExitReason'); 
     138                                        if (reason == '') { 
     139                                                alert("<spring:message code="general.required" arguments="${reasonText}"/>"); 
     140                                                return; 
     141                                        } else { 
     142                                                DWRObsService.voidObservation(${model.patientReasonForExit.obsId}, reason, 
     143                                                        function() { window.location.reload(); } ); 
     144                                        } 
     145                                } 
     146                        </script> 
    134147                        <td id="patientActionsOutcome"> 
    135                                 <span id="reasonForExit"><spring:message code="Patient.outcome.exitType" />: <b>${model.patientReasonForExit} (${model.patientDateOfExit})</b></span> 
     148                                <span id="reasonForExit"><spring:message code="Patient.outcome.exitType" />: <b><openmrs_tag:concept conceptId="${model.patientReasonForExit.valueCoded.conceptId}"/> (<openmrs:formatDate date="${model.patientReasonForExit.obsDatetime}"/>)</b></span> 
     149                                <a id="cancelExitButton" href="javascript:showDiv('cancelExit'); hideDiv('cancelExitButton')">[X]</a> 
     150                                <span id="cancelExit" style="display: none; border: 1px black dashed"> 
     151                                        <spring:message code="Patient.outcome.exit.cancelReason"/>: 
     152                                        <input type="text" id="cancelExitReason" value="<spring:message code="general.dataEntryError"/>"/> 
     153                                        <input type="button" value="<spring:message code="general.delete"/>" onClick="handleCancelExit()" /> 
     154                                        <input type="button" value="<spring:message code="general.cancel"/>" onClick="hideDiv('cancelExit'); showDiv('cancelExitButton')"/> 
     155                                </span> 
    136156                        </td> 
    137157                </c:if> 
     
    169189        <openmrs:portlet url="personRelationships" size="normal" patientId="${patient.patientId}" /> 
    170190</div> 
    171