WorklistPatient::getCurrentAttributesById PHP Method

getCurrentAttributesById() public method

Get the current worklist patient attributes indexed by the worklist mapping Ids.
public getCurrentAttributesById ( ) : array
return array
    public function getCurrentAttributesById()
    {
        $res = array();
        foreach ($this->worklist_attributes as $wa) {
            $res[$wa->worklist_attribute_id] = $wa;
        }
        return $res;
    }

Usage Example

 /**
  * @dataProvider getCurrentAttributesByIdProvider
  *
  * @param $wp_attrs
  */
 public function test_getCurrentAttributesById($wp_attrs)
 {
     $worklist_patient_attrs = array();
     $expected = array();
     foreach ($wp_attrs as $attr) {
         $wpa = ComponentStubGenerator::generate('WorklistPatientAttribute', $attr);
         $expected[$attr['worklist_attribute_id']] = $wpa;
         $worklist_patient_attrs[] = $wpa;
     }
     $worklist_patient = new WorklistPatient();
     $worklist_patient->worklist_attributes = $worklist_patient_attrs;
     $this->assertEquals($expected, $worklist_patient->getCurrentAttributesById());
 }
All Usage Examples Of WorklistPatient::getCurrentAttributesById