Example #1
0
 public function nsdrPopulate($tthis, $context, $data)
 {
     $context = (int) $context;
     $attributes = $tthis->_attributes;
     $nsdrNamespace = $tthis->_nsdrNamespace;
     $aliasedNamespace = $tthis->_aliasedNamespace;
     if ($context == '*') {
         if (isset($attributes['isDefaultContext']) && $attributes['isDefaultContext']) {
             // get genericData
             $objectClass = 'ClinicalNote';
             $clinicalNoteId = 0;
             if (isset($attributes['clinicalNoteId'])) {
                 $clinicalNoteId = (int) $attributes['clinicalNoteId'];
             }
             $revisionId = 0;
             if (isset($attributes['revisionId'])) {
                 $revisionId = (int) $attributes['revisionId'];
             }
             $gd = new self();
             $gd->objectClass = $objectClass;
             $gd->objectId = $clinicalNoteId;
             $gd->name = $nsdrNamespace;
             $gd->revisionId = $revisionId;
             $gd->loadValue();
             return $gd->value;
         } else {
             // all
             $ret = array();
             $gd = new self();
             $gdIterator = $gd->getIterator();
             foreach ($gdIterator as $g) {
                 $ret[] = $g->toArray();
             }
             return $ret;
         }
     }
     $gd = new self();
     $gd->genericDataId = $context;
     $gd->populate();
     return $gd->toArray();
 }