Advertisement
yony258

Untitled

Dec 12th, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ...
  2. <script id="patient-description-template" type="text/template">
  3.     <div class="patient-description">
  4.         <spring:message code='appointment.Appointment.create.patientId'/>{{- patientId}}<br/>
  5.         <spring:message code='appointment.Appointment.create.patientPhoneNumber'/>{{- phoneNumber}}<br/>
  6.         <spring:message code='appointment.Appointment.create.patientMissedMeeting'/>{{- dateMissedLastAppointment}}<br/>
  7.     </div>
  8. </script>
  9. ...
  10. function updatePatient(formFieldId, patientObj, isPageLoad) {
  11.         if(patientObj!=null){
  12.                 addPatientLink(patientObj);
  13.                 DWRAppointmentService.getPatientDescription(patientObj.patientId, function(details){
  14.                         if(!details){
  15.                                 document.getElementById('patientDataCell').innerHTML = "";
  16.                                 return;
  17.                         }
  18.                         if(!details.phoneNumber)
  19.                             details.phoneNumber = "<spring:message code='appointment.Appointment.create.patientNoPhoneNumber'/>";;
  20.                         if(!details.dateMissedLastAppointment)
  21.                                 details.dateMissedLastAppointment = "<spring:message code='appointment.Appointment.create.patientNotMissedLastAppointment'/>";;
  22.                        
  23.                         var values = [{patientId : details.patientId}, {phoneNumber : details.phoneNumber}, {dateMissedLastAppointment : details.dateMissedLastAppointment}];
  24.                         var parsed = _.template(${'#patient-description-template'},values);
  25.                 });
  26.         }
  27.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement