コード例 #1
0
$comment_types = $comments->getAllCommentTypes();
// loop through the comment types
$i = 0;
foreach ($comment_types as $comment_type_id => $comment_array) {
    $CommentTpl =& $tpl_data['comment'][$i];
    // print the status select field if it exists
    if (!empty($comment_array['field']) && $comments->objectType == 'volume') {
        if ($user->hasPermission('imaging_browser_qc')) {
            $CommentTpl['select_name'] = $comment_array['field'];
            $CommentTpl['select_value_array'] = $comment_array['values'];
        }
        $CommentTpl['selected'] = $comments->getMRIValue($comment_array['field']);
    }
    $CommentTpl['name'] = $comment_array['name'];
    // get the list of predefined comments for the current type
    $predefined_comments = $comments->getAllPredefinedComments($comment_type_id);
    // loop through the predefined comments
    $j = 0;
    foreach ($predefined_comments as $predefined_comment_id => $predefined_comment_text) {
        $PredefinedTpl =& $CommentTpl['predefined'][$j];
        // print a form element
        $PredefinedTpl['id'] = $predefined_comment_id;
        $PredefinedTpl['predefined_text'] = $predefined_comment_text['Comment'];
        // print the comment text
        $Saved = $saved_comments[$comment_type_id];
        if ($Saved['predefined'][$predefined_comment_id]) {
            $CommentTpl['predefined'][$j]['checked'] = true;
        }
        $j++;
    }
    // print a form element for a free-form comment
コード例 #2
0
 /**
  * Builds data dictionary for given scan types
  *
  * @param array $types list of scan types
  *
  * @return void
  */
 private function _buildDataDictionary($types)
 {
     $this->Dictionary = array('QCComment' => array('Type' => 'varchar(255)', 'Description' => 'QC Comment for Session'));
     /* creating dummy mri feedback object so all the mri feedback
      *  types can be added to the dictionary */
     $mri_feedback = new FeedbackMRI(1, "");
     foreach ($types as $type) {
         $ScanType = $type['ScanType'];
         $SelectedArray = array('Type' => 'varchar(255)', 'Description' => "Selected {$ScanType} file for session", 'IsFile' => true);
         $QCStatusArray = array('Type' => "enum('Pass', 'Fail')", 'Description' => "QC Status for {$ScanType} file");
         $this->Dictionary["Selected_{$ScanType}"] = $SelectedArray;
         $this->Dictionary[$ScanType . "_QCStatus"] = $QCStatusArray;
         $feedback_types = $mri_feedback->getAllCommentTypes();
         foreach ($feedback_types as $CommentTypeID => $comments) {
             if (!empty($comments['field'])) {
                 $fieldName = $comments['field'];
                 $type = "enum ('" . implode("','", $comments['values']) . "')";
                 $cmt_field = "Comment_" . $fieldName . "_{$ScanType}";
                 $scanfield = "{$fieldName} {$ScanType}";
                 $cmt_Array = array('Type' => 'varchar(255)', 'Description' => "Overall Comment for {$scanfield}");
                 $this->Dictionary[$cmt_field] = $cmt_Array;
             } else {
                 $fieldName = $comments['name'];
                 $type = 'varchar(255)';
             }
             $this->feedback_Comments[$CommentTypeID] = $fieldName;
             $cmt_scanArray = array('Type' => $type, 'Description' => $comments['name'] . " {$ScanType}");
             $this->Dictionary[$fieldName . "_{$ScanType}"] = $cmt_scanArray;
             $preDefinedComments = $mri_feedback->getAllPredefinedComments($CommentTypeID);
             $this->feedback_PreDefinedComments[$CommentTypeID] = array();
             $pre = array();
             foreach ($preDefinedComments as $preDefinedCommentTypeID => $preDefinedComment) {
                 $preDef_field = $preDefinedComment['field'] . "_{$ScanType}";
                 $preDef_cmt = $preDefinedComment['Comment'];
                 $preDef_Array = array('Type' => "enum('Yes', 'No')", 'Description' => "{$preDef_cmt} {$ScanType}");
                 $this->Dictionary[$preDef_field] = $preDef_Array;
                 $pre[$preDefinedCommentTypeID] = $preDefinedComment['field'];
             }
             $this->feedback_PreDefinedComments[$CommentTypeID] = $pre;
         }
         $mri_array = array('ScannerID' => 'Scanner ID', 'Pipeline' => 'Pipeline', 'OutputType' => 'Output Type', 'AcquisitionProtocol' => 'Protocol', 'CoordinateSpace' => 'Space', 'Algorithm' => 'Algorithm', 'AcquisitionDate' => 'Acquisition Date', 'FileInsertDate' => 'Insert date', 'SeriesDescription' => 'Series Description', 'SeriesNumber' => 'Series Number', 'EchoTime' => 'Echo Time', 'RepetitionTime' => 'Repetition Time', 'SliceThickness' => 'Slice Thickness', 'Time' => 'No of volumes', 'Comment' => 'Comment', 'SlicewiseRejected' => 'Slicewise correlations (Nb)', 'InterlaceRejected' => 'Interlace correlations (Nb)', 'IntergradientReject' => 'Gradient-wise correlations (Nb)', 'TotalRejected' => 'No. of rejected directions', 'Caveat' => 'Caveat', 'ProcessingPipeline' => 'Processing Pipleline');
         $this->mri_header_fields = $mri_array;
         foreach ($this->mri_header_fields as $field => $desc) {
             $mri_field = $field . "_{$ScanType}";
             $this->Dictionary[$mri_field] = array('Type' => "varchar(255)", 'Description' => $desc . " {$ScanType}");
         }
     }
 }