Manual Attributes Configuration - openeyes/OphCiExamination GitHub Wiki

The attributes model is described in the configuration page.

The steps to set up an attribute list for an element is as follows:

  1. define a new attribute with a name.
  2. associate the new attribute with the examination element type that it should appear on.
  3. add options to the attribute on that element type.

The following example will define an attribute called "misc" on the conclusion element. It will have an option for all subspecialties ('Booked for surgery') and one specifically for MR ('Discharge to DRSS').

insert into ophciexamination_attribute (`name`, `label`) values ('conclusion', 'misc');
set @conc_id := LAST_INSERT_ID();
select @mr_id := `id` from subspecialty where name = 'Medical Retinal';
select @conc_el_id := `id` from element_type where class_name = 'Element_OphCiExamination_Conclusion';
insert into ophciexamination_attribute_element (`attribute_id`,`element_type_id`) values (@conc_id, @conc_el_id);
set @ae_id := LAST_INSERT_ID();
insert into ophciexamination_attribute_option (`value`, `subspecialty_id`, `attribute_element_id`) values ('Booked for surgery',null,@ae_id),('Discharge to DRSS',@mr_id,@ae_id);