Error with Querying Medical problems

ERROR: query failed: SELECT type, title, comments, diagnosis, udi_data FROM lists WHERE id = ?

Does anyone get this when they do a report on medical problems?

Hi @CalvinTy , which report are you running and what version of OpenEMR?

I am running patient reports with their Demographic, History and Medical problems. I am running 6.0.0 v4 and on Ubuntu 20.04

Hi CalvinTy!

the columns ‘udi’ and ‘udi_data’ are added when running the sql_patch for 6.0.0 to 6.1.0… Unfortunately, 6.0.0.4 has the Report php file searching for ‘udi_data’ column which does not exist, hence the crash.
I believe the ‘udi_data’ are supposed to be column fields in SQL for Unique Device Identifiers, such as prosthetics, implantable devices, stents, pacemakers, etc. (see: UDI at FDA )
I’ll bet some industrious coder added it to the report php file, but didn’t add it to the SQL patch file… hence the blip.
however: if you are savvy with SQL, here are the relevent portions from the 6.0.0 to 6.1.0 patch file and you could enter those columns into the appropriate tables:

#IfMissingColumn lists udi

ALTER TABLE lists ADD COLUMN udi varchar(255) default NULL;

#EndIf

#IfMissingColumn lists udi_data

ALTER TABLE lists ADD COLUMN udi_data text;

#EndIf

I entered the columns (rows?) via phpmyadmin as above and Voila! It worked.

Hope this helps someone who is sticking with 6.0.0.4 for now! :slight_smile:

Mark Sarnov