Advertisement
Guest User

Untitled

a guest
Dec 11th, 2012
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.93 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.  
  40. function addPatientLink(patientObj){
  41. if(patientObj!=null){
  42. var message = "<spring:message code='appointment.Appointment.create.link.viewPatient'/>";
  43. var link = "<a href='${pageContext.request.contextPath}/patientDashboard.form?patientId="+patientObj.patientId+"'>";
  44. document.getElementById('patientLinkCell').innerHTML = link+message+"</a>";
  45. }
  46. else
  47. document.getElementById('patientLinkCell').innerHTML = "";
  48. }
  49. </script>
  50.  
  51. <h2 id="headline"><spring:message code="appointment.Appointment.create.title"/></h2>
  52. <spring:hasBindErrors name="appointment">
  53. <spring:message code="fix.error"/>
  54. <br />
  55. </spring:hasBindErrors>
  56. <form:form modelAttribute="appointment" method="post">
  57. <fieldset>
  58. <table id="createAppointmentTable">
  59. <tr>
  60. <td><spring:message code="appointment.Appointment.create.label.findPatient"/></td>
  61.  
  62. <td>
  63. <spring:bind path="appointment.patient">
  64. <openmrs_tag:patientField formFieldName="patient" callback="updatePatient" initialValue="${status.value}"/>
  65. <c:if test="${status.errorMessage != ''}"><span class="error">${status.errorMessage}</span></c:if>
  66. </spring:bind>
  67. </td>
  68. <td id="patientLinkCell"></td>
  69. </tr>
  70. <tr>
  71. <td></td>
  72. <td colspan="2" id="patientDataCell">
  73.  
  74. </td>
  75. </tr>
  76.  
  77. <tr>
  78. <td><spring:message code="appointment.Appointment.create.label.appointmentType"/></td>
  79. <td>
  80. <select name="appointmentTypeSelect">
  81. <c:forEach var="appointmentType" items="${appointmentTypeList}">
  82. <option value="${appointmentType.appointmentTypeId}">${appointmentType.name}</option>
  83. </c:forEach>
  84. </select>
  85. </td>
  86. </tr>
  87. <tr>
  88. <td><spring:message code="appointment.Appointment.create.label.clinician"/></td>
  89. <td>
  90. <select name="providerSelect">
  91. <option value="null"><spring:message code="appointment.Appointment.create.label.clinicianNotSpecified"/></option>
  92. <c:forEach var="provider" items="${providerList}">
  93. <option value="${provider.providerId}">${provider.name}</option>
  94. </c:forEach>
  95. </select>
  96. </td>
  97. </tr>
  98. <tr>
  99. <td><spring:message code="appointment.Appointment.create.label.betweenDates"/></td>
  100. <td><input type="text" name="fromDate" id="fromDate" size="16" value="" onfocus="showDateTimePicker(this)"/><img src="${pageContext.request.contextPath}/moduleResources/appointment/calendarIcon.png" class="calendarIcon" alt="" onClick="document.getElementById('fromDate').focus();"/> and <input type="text" name="toDate" id="toDate" size="16" value="" onfocus="showDateTimePicker(this)"/><img src="${pageContext.request.contextPath}/moduleResources/appointment/calendarIcon.png" class="calendarIcon" alt="" onClick="document.getElementById('toDate').focus();"/></td>
  101. </tr>
  102. <tr>
  103. <td/><td><input type="submit" name="findAvailableTime" class="appointmentButton" value="<spring:message code="appointment.Appointment.create.findTime"/>" name="cancel"></td>
  104. </tr>
  105. <tr>
  106. <td><spring:message code="appointment.Appointment.create.label.availableTimes"/></td>
  107. <td>
  108. <table id="availbleTimesTable" cellspacing="0">
  109. <tr class="tableHeader">
  110. <th><spring:message code="appointment.Appointment.create.header.selectedOption"/></th>
  111. <th><spring:message code="appointment.Appointment.create.header.clinician"/></th>
  112. <th><spring:message code="appointment.Appointment.create.header.appointmentType"/></th>
  113. <th><spring:message code="appointment.Appointment.create.header.date"/></th>
  114. <th><spring:message code="appointment.Appointment.create.header.timeSlot"/></th>
  115. </tr>
  116. <c:forEach var="slot" items="${availableTimes}">
  117. <tr>
  118. <td>
  119. <spring:bind path="appointment.timeSlot">
  120. <input type="radio" name="${status.expression}" value="${slot.timeSlotId}" <c:if test="${slot.timeSlotId == appointment.timeSlot.timeSlotId}">checked="checked"</c:if> />
  121. </spring:bind>
  122. </td>
  123.  
  124. <td>${slot.appointmentBlock.provider.name}</td>
  125. <td>
  126. <c:forEach var="appointmentType" items="${slot.appointmentBlock.types}">
  127. ${appointmentType.name},
  128. </c:forEach>
  129. </td>
  130. <td><fmt:formatDate type="date" value="${slot.startDate}" /></td>
  131. <td><fmt:formatDate type="time" pattern="hh:mm a" value="${slot.startDate}" /> - <fmt:formatDate type="time" pattern="hh:mm a" value="${slot.endDate}" /></td>
  132. </tr>
  133. </c:forEach>
  134. </table>
  135. </td>
  136. </tr>
  137. <tr>
  138. <td><spring:message code="appointment.Appointment.create.label.reason"/></td>
  139. <spring:bind path="appointment.reason">
  140. <td><textarea name="reason" rows="3" cols="50" style="resize:none" onkeypress="return forceMsaxLength(this, 1024);">${status.value}</textarea></td>
  141. </spring:bind>
  142. </tr>
  143. <tr><td><input type="submit" class="appointmentButton" value="<spring:message code="appointment.Appointment.create.save"/>" name="save"></td>
  144. <td><input type="reset" class="appointmentButton" value="<spring:message code="appointment.Appointment.create.cancel"/>" name="cancel"></td>
  145. </tr>
  146. </table>
  147. </fieldset>
  148. </form:form>
  149. <%@ include file="/WEB-INF/template/footer.jsp" %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement