HOWTO: Customize A Demographics User Defined Field

From OpenEMR Project Wiki


OpenEMR's Demographics form provides several data entry fields that can be customized to store in the database virtually any arbitrary datum you may desire. This capability has been available since nearly the beginning, and except for some minor differences in the interface, works the same in all versions of OpenEMR.

The ability to do this customization comes from the fact that the Demographics form is what is called a ‘Layout Based Form’- search the wiki to learn more about those. This is a neat hack that you can do without knowing all about LBFs BUT remember that you’re altering one of the fundamental data forms of the system so be sure to follow these instructions exactly.


Here's a default patient demographics display.

Note the 'User Defined' field (oval)

This is the one we'll be customizing.


Now let's look at the layout form that produces that display.

1. From the main menu go to: Admin/ Forms/ Layouts


2. Select Demographics


and see the form.


Of the many controls on this screen, we're only going to pay attention to the column headings 'ID', 'Label' and 'UOR' (long oval above) and the blue ‘Save Changes’ button at top right.

The rest of them you should leave alone unless you know that you know what they do.

3. Scroll down to the item with the label 'User Defined' which we saw in the Demographics display… but has been changed to ‘My Datum’ in the picture below

Numbered in the picture:

#1. Leave the field ID as 'genericname1', since this is the name of the column in the OpenEMR database that holds this datum.
#2. Change the label 'User Defined' to any alphanumeric string you want to call your data field... for example, 'My Datum'?
#3. Make sure the 'UOR' dropdown says 'Optional'


4. Save the changes (blue button at top right of previous picture) then go back to edit a patient’s demographics screen to see what you’ve made.

Note the other text areas available for customizing (arrows)



For more on LBFs (AKA ‘LBV Forms’) see the OpenEMR wiki



or search the forum for ‘LBF’


  • UOR = Unused/ Optional/ Required.
Unused = does not appear on the demographics display
Optional = appears there but does not need to be used
Required = appears on demographics panel and must have data entered in order to save the panel
  • The data held in this customized field will be kept in the OpenEMR database's 'patient_data' table, the column 'genericname1'.
  • this process may be used for any of the demographics fields with IDs ‘genericname’ or ‘genericval’, and the label field either 'User Defined' or empty.
  • See the wiki page HOWTO:_Change_Search_Columns_in_Patient_Finder for one really handy use of this capability .