Link lists in Open EMR

I’m quite new to OpenEMR and trying to do some customization for it. I want to link two Lists. For example if the City has typed I want to load the relevant postal code to the postal code box. In the relational databases there is a one to one relationship between city and the postal code. When you create the tables you need to copy the postal code to the city as the foreign key. But in OpenEMR how to do this? Thank you very much.

@H_A_R_Nilani

It is not possible to link two Lists in OpenEMR. Instead we can have both list (City and Postal code) values in single list.
For example:
Create a New list using:
INSERT INTO list_options(list_id,option_id,title) values (‘lists’,‘list_name’,‘List Name’);

Adding Entries to the list using:
INSERT INTO list_options(list_id,option_id,title,mapping) values (‘list_name’,‘city_name’,‘CITY NAME’,‘postal code’);

If you have to load values dynamically based on City, you need to make an Ajax call for loading the mapped Postal code from the database.

Thanks,
ViSolve

1 Like

Thank you very much