protected function mapAttributes(\WorklistPatient $wp)
{
$attributes = $this->resolveAttributes();
if ($this->partial_record) {
// get current values for attributes that have not been passed in as part of
// this partial record so we are applying the full set of attributes in later
// worklist resolution.
foreach ($wp->worklist_attributes as $attr) {
if (!$attr->worklistattribute) {
throw new \Exception("Data consistency issue with worklist attribute {$attr->id}");
}
if (!array_key_exists($attr->worklistattribute->name, $attributes)) {
$attributes[$attr->worklistattribute->name] = $attr->attribute_value;
}
}
}
return $attributes;
}