/**
  * Get all the form contents for rendering
  * @return type renderable array
  */
 function getForm($form, &$form_state, $disabled, $myvalues)
 {
     $loaded = module_load_include('inc', 'raptor_contraindications', 'core/ContraIndEngine');
     if (!$loaded) {
         $msg = 'Failed to load the Contraindication Engine';
         throw new \Exception($msg);
         //This is fatal, so stop everything now.
     }
     $oCIE = new \raptor\ContraIndEngine(NULL);
     $form["data_entry_area1"] = array('#prefix' => "\n<section class='raptor-report'>\n", '#suffix' => "\n</section>\n");
     $form['data_entry_area1']['blurb']['p2'] = array('#type' => 'item', '#markup' => '<p>The flags and measures listed as "database" are configured in the database.  The items listed as "coded" are implemented by programmers in the RAPTOR codebase.  The "database" configured flags and measures can be customized for a deployed site, the "coded" items cannot.</p>');
     $form['data_entry_area1']['blurb']['p3'] = array('#type' => 'item', '#markup' => '<p>Both the flags and the measures listed here can be used in flag formulas, but only boolean items can be used in Rule formulas.  Boolean items are shown in this report as having value type "boolean".  A boolean flag can have one of three values "True","False", or "Null".  A "Null" value occurs when input criteria for a flag or measure is not available or is unknown at evaluation time.</p>');
     $form["data_entry_area1"]['table_container'] = array('#type' => 'item', '#prefix' => '<div class="raptor-dialog-table-container">', '#suffix' => '</div>', '#tree' => TRUE);
     $rows = "\n";
     $aAllInputs = $oCIE->getSREContext()->getDictionary()->getActiveRuleInputs();
     foreach ($aAllInputs as $aInputs) {
         $sLocked = isset($aInputs['locked']) && $aInputs['locked'] == 1 ? 'Yes' : 'No';
         $return_type = $aInputs['return'];
         if ($return_type > '') {
             $rtparts = explode(' ', $return_type);
             $rtclassmarkup = ' class="' . $rtparts[0] . '-measure" ';
         } else {
             $rtclassmarkup = '';
         }
         $rows .= "\n" . '<tr>' . '<td>' . $aInputs['source'] . '</td>' . '<td>' . $sLocked . '</td>' . '<td><span ' . $rtclassmarkup . '>' . $return_type . '</span></td>' . '<td>' . $aInputs['category_nm'] . '</td>' . '<td>' . $aInputs['name'] . '</td>' . '<td>' . $aInputs['purpose_tx'] . '</td>' . '<td>' . $aInputs['criteria_tx'] . '</td>' . '</tr>';
     }
     $form["data_entry_area1"]['table_container']['users'] = array('#type' => 'item', '#markup' => '<table id="my-raptor-dialog-table" class="raptor-dialog-table dataTable">' . '<thead><tr>' . '<th>Implementation Location</th>' . '<th>Read Only</th>' . '<th>Value Type</th>' . '<th>Category Date</th>' . '<th>Name</th>' . '<th>Purpose</th>' . '<th>Formula</th>' . '</tr>' . '</thead>' . '<tbody>' . $rows . '</tbody>' . '</table>');
     $form['data_entry_area1']['action_buttons'] = array('#type' => 'item', '#prefix' => '<div class="raptor-action-buttons">', '#suffix' => '</div>', '#tree' => TRUE);
     $form['data_entry_area1']['action_buttons']['refresh'] = array('#type' => 'submit', '#attributes' => array('class' => array('admin-action-button'), 'id' => 'refresh-report'), '#value' => t('Refresh Report'));
     $form['data_entry_area1']['action_buttons']['cancel'] = array('#type' => 'item', '#markup' => '<input class="admin-cancel-button" type="button" value="Exit" data-redirect="/drupal/worklist?dialog=viewReports">');
     return $form;
 }
 /**
  * Get all the form contents for rendering
  * @return type renderable array
  */
 function getForm($form, &$form_state, $disabled, $myvalues)
 {
     $loaded = module_load_include('inc', 'raptor_contraindications', 'core/ContraIndEngine');
     if (!$loaded) {
         $msg = 'Failed to load the Contraindication Engine';
         throw new \Exception($msg);
         //This is fatal, so stop everything now.
     }
     $oCIE = new \raptor\ContraIndEngine(NULL);
     $oSREContext = $oCIE->getSREContext();
     $basereploaded = module_load_include('php', 'simplerulesengine_ui', 'report/ReportRules');
     $aURLS = array('return' => 'raptor/viewReports');
     $oReport = new \simplerulesengine\ReportRules($oSREContext, NULL);
     $form = $oReport->getForm($form, $form_state, $disabled, $myvalues);
     $form['data_entry_area1']['top_blurb'] = array('#markup' => "\n<p>Contraindication warnings are displayed to users at runtime when the rule formula evaluates to a value of True.  Formulas are built by using simple boolean logic on available boolean inputs.</p>" . "\n<p>The rule formulas can be edited by RAPTOR users that have sufficient priviledges.</p>");
     $form['data_entry_area1']['action_buttons'] = array('#type' => 'item', '#prefix' => '<div class="raptor-action-buttons">', '#suffix' => '</div>', '#tree' => TRUE);
     $form['data_entry_area1']['action_buttons']['refresh'] = array('#type' => 'submit', '#attributes' => array('class' => array('admin-action-button'), 'id' => 'refresh-report'), '#value' => t('Refresh Report'));
     $form['data_entry_area1']['action_buttons']['cancel'] = array('#type' => 'item', '#markup' => '<input class="admin-cancel-button" type="button" value="Exit" data-redirect="/drupal/worklist?dialog=viewReports">');
     return $form;
 }