/** * Get all the form contents for rendering * @return type renderable array */ public function getForm($form, &$form_state, $disabled, $myvalues) { $oUser = $this->m_oContext->getUserInfo(); $localmsg = NULL; if (!$oUser->getPrivilegeSetting('SP1')) { $disabled = TRUE; //Do not let this user edit the schedule information. $localmsg = 'Your account does not have privileges to edit the schedule information.'; } $form['data_entry_area1'] = array('#prefix' => "\n<section id='raptor-admin-container' class='user-profile-dataentry'>\n", '#suffix' => "\n</section>\n", '#disabled' => $disabled); //Hidden values $form['hiddenthings']['tid'] = array('#type' => 'hidden', '#value' => $myvalues['tid']); $form['hiddenthings']['procName'] = array('#type' => 'hidden', '#value' => $myvalues['procName']); $form['hiddenthings']['suggested_alreadyset_uid'] = array('#type' => 'hidden', '#value' => $myvalues['suggested_alreadyset_uid']); $form['data_entry_area1']['toppart']['heading'] = array('#markup' => '<table id="raptor-schedule-table"><tbody>' . '<tr><th>Tracking ID</th><td>' . $myvalues['tid'] . '</td>' . '<th>Patient Name</th><td>' . $myvalues['PatientName'] . '</td></tr>' . '<tr><th>Study</th><td>' . $myvalues['procName'] . '</td>' . '<th>Patient DOB</th><td>' . $myvalues['PatientDOB'] . '</td></tr>' . '<tr><th>Requested Date</th><td>' . $myvalues['RequestedDate'] . '</td>' . '<th>Urgency</th><td>' . $myvalues['Urgency'] . '</td></tr>' . '</tbody></table>'); $form['data_entry_area1']['toppart']['location_tx'] = array('#type' => 'textfield', '#title' => t('Location'), '#default_value' => $myvalues['location_tx'], '#size' => 20, '#maxlength' => 20, '#required' => FALSE); if ($disabled || !is_array($myvalues['rooms'])) { } else { $htmlroomoptions = '<ul>'; $aRooms = $myvalues['rooms']; foreach ($aRooms as $aRoom) { $htmlroomoptions .= '<li><span class="location-option selectable-text"><a href="javascript:setTextboxByName(' . "'location_tx','" . $aRoom[0] . "' )" . '"' . ' title="' . $aRoom[1] . '" >' . $aRoom[0] . '</a></span>'; } $htmlroomoptions .= '</ul>'; $form['data_entry_area1']['toppart']['rooms'] = array('#markup' => $htmlroomoptions); } $form['data_entry_area1']['toppart']['event_date_tx'] = array('#type' => 'textfield', '#title' => t('Event Date'), '#default_value' => $myvalues['event_date_tx'], '#size' => 20, '#maxlength' => 20, '#required' => FALSE, '#attributes' => array('class' => array('datepicker'))); $form['data_entry_area1']['toppart']['event_starttime_tx'] = array('#type' => 'textfield', '#title' => t('Start Time'), '#default_value' => $myvalues['event_starttime_tx'], '#size' => 20, '#maxlength' => 20, '#required' => FALSE); $form['data_entry_area1']['toppart']['duration_am'] = array('#type' => 'textfield', '#title' => t('Duration (minutes)'), '#default_value' => $myvalues['duration_am'], '#size' => 3, '#maxlength' => 3, '#required' => FALSE); //Provide clickable duration options on same row as duration field if ($disabled) { $myvalues['durations'] = array(); //Empty list of minutes } else { if (!isset($myvalues['durations']) || !is_array($myvalues['durations']) || count($myvalues['durations']) == 0) { //Default hardcoded list. $myvalues['durations'] = array('10', '15', '20', '30', '45', '60'); } } $htmldurations = '<ul>'; $aDurations = $myvalues['durations']; foreach ($aDurations as $aDuration) { $htmldurations .= '<li><span class="duration-option selectable-text"><a href="javascript:setTextboxByName(' . "'duration_am','" . $aDuration . "' )" . '"' . ' title="' . $aDuration . ' minutes" >' . $aDuration . '</a></span>'; } $htmldurations .= '</ul>'; $form['data_entry_area1']['toppart']['durations'] = array('#markup' => $htmldurations); $optionsConfirmed = array(0 => t('No'), 1 => t('Yes' . (isset($myvalues['confirmed_by_patient_dt']) ? ' (' . $myvalues['confirmed_by_patient_dt'] . ')' : ''))); $form['data_entry_area1']['middlepart']['confirmed_by_patient_yn'] = array('#type' => 'radios', '#title' => t('Confirmed by patient'), '#default_value' => isset($myvalues['confirmed_by_patient_dt']) ? 1 : 0, '#options' => $optionsConfirmed, '#description' => t('Has the patient confirmed this appointment?')); $mdwsDao = $this->m_oContext->getMdwsClient(); $aCancelOptions = \raptor\MdwsUtils::getRadiologyCancellationReasons($mdwsDao); $fulloptionlist = array(); $fulloptionlist[] = ''; foreach ($aCancelOptions as $option) { $fulloptionlist[] = $option; } $form['data_entry_area1']['middlepart']['canceled_reason_tx'] = array("#type" => "select", "#title" => t("Reason for cancelation (If canceled)"), "#options" => $fulloptionlist, '#default_value' => $myvalues['canceled_reason_tx'], "#description" => t("Select reason for canceling this procedure." . (isset($myvalues['canceled_dt']) ? ' ( Canceled ' . $myvalues['canceled_dt'] . ' )' : '')), "#required" => FALSE); if (is_array($myvalues['assignment_options'])) { $options = $myvalues['assignment_options']; } else { $options[''] = ''; } $form['data_entry_area1']['middlepart']['suggested_uid'] = array("#type" => "select", "#title" => t("Attention of suggestion"), "#options" => $options, '#default_value' => $myvalues['suggested_uid'], "#description" => t('Suggested for the attention of a specific Resident or Radiologist' . ($myvalues['suggested_alreadyset_note'] != NULL ? ' (' . $myvalues['suggested_alreadyset_note'] . ')' : '')), "#required" => FALSE); $form['data_entry_area1']['bottom']['notes_tx'] = array('#type' => 'textarea', '#title' => t('Scheduler Notes'), '#rows' => 3, '#disabled' => $disabled, '#default_value' => $myvalues['notes_tx']); $optionsConfirmed = array(0 => t('No'), 1 => t('Yes')); $form['data_entry_area1']['bottom']['notes_critical_yn'] = array('#type' => 'radios', '#title' => t('Notes contain patient care information?'), '#default_value' => isset($myvalues['notes_critical_yn']) ? $myvalues['notes_critical_yn'] : 0, '#options' => $optionsConfirmed, '#description' => t('Should system ask Radiologist and Technologist to confirm reading the note?')); if ($localmsg != NULL) { $form['data_entry_area1']['bottom']['buttonmsg'] = array('#markup' => '<p class="action-button-message">' . $localmsg . '</p>'); } if (!$disabled) { $form['data_entry_area1']['action_buttons']['schedule'] = array('#type' => 'submit', '#attributes' => array('class' => array('simple-action-button')), '#value' => t('Save Settings'), '#disabled' => $disabled); $form['data_entry_area1']['action_buttons']['addnewschedule'] = array('#type' => 'submit', '#attributes' => array('class' => array('simple-action-button')), '#value' => t('Save these Settings and Add Another Schedule Event for Same Ticket'), '#disabled' => $disabled); } $form['data_entry_area1']['action_buttons']['cancel'] = array('#type' => 'item', '#markup' => '<input class="raptor-dialog-cancel" type="button" value="Cancel">'); return $form; }