Advertisement
yony258

Untitled

Dec 11th, 2012
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.98 KB | None | 0 0
  1. <%@ include file="/WEB-INF/template/include.jsp" %>
  2.  
  3. <%@ include file="/WEB-INF/template/header.jsp" %>
  4. <openmrs:htmlInclude file="/scripts/timepicker/timepicker.js" />
  5. <openmrs:htmlInclude file="/moduleResources/appointment/createAppointmentStyle.css"/>
  6. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
  7. <script type="text/javascript">
  8. function forceMaxLength(object, maxLength) {
  9. if( object.value.length >= maxLength) {
  10. object.value = object.value.substring(0, maxLength);
  11. }
  12. }
  13. </script>
  14. <script type="text/javascript" src='${pageContext.request.contextPath}/dwr/engine.js'></script>
  15. <script type="text/javascript" src='${pageContext.request.contextPath}/dwr/util.js'></script>
  16. <script type="text/javascript" src='${pageContext.request.contextPath}/dwr/interface/DWRAppointmentService.js'></script>
  17. <script type="text/javascript">
  18. function updatePatient(formFieldId, patientObj, isPageLoad) {
  19. if(patientObj!=null){
  20. addPatientLink(patientObj);
  21. DWRAppointmentService.getPatientDescription(patientObj.patientId, function(details){
  22. if(!details){
  23. document.getElementById('patientDataCell').innerHTML = "";
  24. return;
  25. }
  26. var phone = "<spring:message code='appointment.Appointment.create.patientNoPhoneNumber'/>";
  27. var dateMissedLastAppointment = "<spring:message code='appointment.Appointment.create.patientNotMissedLastAppointment'/>";
  28.  
  29. if(details.phoneNumber)
  30. phone = details.phoneNumber;
  31. if(details.dateMissedLastAppointment)
  32. dateMissedLastAppointment = details.dateMissedLastAppointment;
  33.  
  34. var detailsText = "<spring:message code='appointment.Appointment.create.patientPhoneNumber'/>"+phone+"<br/><spring:message code='appointment.Appointment.create.patientMissedMeeting'/>"+dateMissedLastAppointment;
  35. document.getElementById('patientDataCell').innerHTML = detailsText;
  36. });
  37. }
  38. }
  39. function addPatientLink(patientObj){
  40. if(patientObj!=null){
  41. var message = "<spring:message code='appointment.Appointment.create.link.viewPatient'/>";
  42. var link = "<a href='${pageContext.request.contextPath}/patientDashboard.form?patientId="+patientObj.patientId+"'>";
  43. document.getElementById('patientLinkCell').innerHTML = link+message+"</a>";
  44. }
  45. else
  46. document.getElementById('patientLinkCell').innerHTML = "";
  47. }
  48. </script>
  49.  
  50. <h2 id="headline"><spring:message code="appointment.Appointment.create.title"/></h2>
  51. <spring:hasBindErrors name="appointment">
  52. <spring:message code="fix.error"/>
  53. <br />
  54. </spring:hasBindErrors>
  55. <form:form modelAttribute="appointment" method="post">
  56. <fieldset>
  57. <table id="createAppointmentTable">
  58. <tr>
  59. <td><spring:message code="appointment.Appointment.create.label.findPatient"/></td>
  60.  
  61. <td>
  62. <spring:bind path="appointment.patient">
  63. <openmrs_tag:patientField formFieldName="patient" callback="updatePatient" initialValue="${status.value}"/>
  64. <c:if test="${status.errorMessage != ''}"><span class="error">${status.errorMessage}</span></c:if>
  65. </spring:bind>
  66. </td>
  67. <td id="patientLinkCell"></td>
  68. </tr>
  69. <tr>
  70. <td></td>
  71. <td colspan="2" id="patientDataCell">
  72.  
  73. </td>
  74. </tr>
  75.  
  76. <tr>
  77. <td><spring:message code="appointment.Appointment.create.label.appointmentType"/></td>
  78. <td>
  79. <select name="appointmentTypeSelect" id="appointmentTypeSelect">
  80. <c:forEach var="appointmentType" items="${appointmentTypeList}">
  81. <option value="${appointmentType.appointmentTypeId}" ${param.appointmentTypeSelect==appointmentType.appointmentTypeId ? 'selected' : ''}>${appointmentType.name}</option>
  82. </c:forEach>
  83. </select>
  84. </td>
  85. </tr>
  86. <tr>
  87. <td><spring:message code="appointment.Appointment.create.label.clinician"/></td>
  88. <td>
  89. <select name="providerSelect" id="providerSelect">
  90. <option value="null" ${null==param.providerSelect ? 'selected' : ''}><spring:message code="appointment.Appointment.create.label.clinicianNotSpecified"/></option>
  91. <c:forEach var="provider" items="${providerList}">
  92. <option value="${provider.providerId}" ${provider.providerId==param.providerSelect ? 'selected' : ''} >${provider.name}</option>
  93. </c:forEach>
  94. </select>
  95. </td>
  96. </tr>
  97. <tr>
  98. <td><spring:message code="appointment.Appointment.create.label.betweenDates"/></td>
  99. <td>
  100. <input type="text" name="fromDate" id="fromDate" size="16" value="${param.fromDate}" onfocus="showDateTimePicker(this)"/>
  101. <img src="${pageContext.request.contextPath}/moduleResources/appointment/calendarIcon.png" class="calendarIcon" alt="" onClick="document.getElementById('fromDate').focus();"/>
  102. and
  103. <input type="text" name="toDate" id="toDate" size="16" value="${param.toDate}" onfocus="showDateTimePicker(this)"/>
  104. <img src="${pageContext.request.contextPath}/moduleResources/appointment/calendarIcon.png" class="calendarIcon" alt="" onClick="document.getElementById('toDate').focus();"/>
  105. </td>
  106. </tr>
  107. <tr>
  108. <td/><td><input type="submit" name="findAvailableTime" class="appointmentButton" value="<spring:message code="appointment.Appointment.create.findTime"/>"></td>
  109. <td>
  110. <spring:bind path="appointment.timeSlot">
  111. <c:if test="${status.errorMessage != ''}"><span class="error">${status.errorMessage}</span></c:if>
  112. </spring:bind>
  113. </td>
  114. </tr>
  115. <tr>
  116. <td><spring:message code="appointment.Appointment.create.label.availableTimes"/></td>
  117. <td>
  118. <table id="availbleTimesTable" cellspacing="0">
  119. <tr class="tableHeader">
  120. <th><spring:message code="appointment.Appointment.create.header.selectedOption"/></th>
  121. <th><spring:message code="appointment.Appointment.create.header.clinician"/></th>
  122. <th><spring:message code="appointment.Appointment.create.header.appointmentType"/></th>
  123. <th><spring:message code="appointment.Appointment.create.header.date"/></th>
  124. <th><spring:message code="appointment.Appointment.create.header.timeSlot"/></th>
  125. </tr>
  126. <c:forEach var="slot" items="${availableTimes}">
  127. <tr>
  128. <td>
  129. <spring:bind path="appointment.timeSlot">
  130. <input type="radio" name="${status.expression}" value="${slot.timeSlotId}" ${slot.timeSlotId == appointment.timeSlot.timeSlotId ? 'selected' : ''} />
  131. </spring:bind>
  132. </td>
  133.  
  134. <td>${slot.appointmentBlock.provider.name}</td>
  135. <td>
  136. <c:forEach var="appointmentType" items="${slot.appointmentBlock.types}">
  137. ${appointmentType.name},
  138. </c:forEach>
  139. </td>
  140. <td><fmt:formatDate type="date" value="${slot.startDate}" /></td>
  141. <td><fmt:formatDate type="time" pattern="hh:mm a" value="${slot.startDate}" /> - <fmt:formatDate type="time" pattern="hh:mm a" value="${slot.endDate}" /></td>
  142. </tr>
  143. </c:forEach>
  144. </table>
  145. </td>
  146. </tr>
  147. <tr>
  148. <td><spring:message code="appointment.Appointment.create.label.reason"/></td>
  149. <spring:bind path="appointment.reason">
  150. <td><textarea name="reason" rows="3" cols="50" style="resize:none" onkeypress="return forceMsaxLength(this, 1024);">${status.value}</textarea></td>
  151. </spring:bind>
  152. </tr>
  153. <tr><td><input type="submit" class="appointmentButton" value="<spring:message code="appointment.Appointment.create.save"/>" name="save"></td>
  154. <td><input type="reset" class="appointmentButton" value="<spring:message code="appointment.Appointment.create.cancel"/>" name="cancel"></td>
  155. </tr>
  156. </table>
  157. </fieldset>
  158. </form:form>
  159. <%@ include file="/WEB-INF/template/footer.jsp" %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement