lh-ehr icon indicating copy to clipboard operation
lh-ehr copied to clipboard

Cannot Save Patient’s Edited History

Open maggienegm opened this issue 5 years ago • 9 comments

A) Outreachy Username: maggie.negm B) Issue Title: Cannot Save Patient’s Edited History C) Report Date: 04/15/2019 D) Sites Affected: Documentation Site E) OS/Browser Used: Chrome and Firefox browsers in Linux OS F) EHR Workflow Module: Patient Profile, Patient/History Lifestyle G) Steps to Reproduce the Issue:

  1. Go to a patient’s profile.
  2. Click on the “History” link under the patient’s name.
  3. Click on the “Edit” button.
  4. Fill out the form as needed, and then click the “Save” button.

H) Expected Behavior: The patient’s edited history is successfully saved. I) What Actually Happened: Once the “Save” button is clicked, an error message shows up. J) Screenshots with Explanation: In the patient’s profile, click the “History” link. edit-patient-history-1-w-outline Once the “Patient History/Lifestyle” module is loaded, click the “Edit” button. edit-patient-history-2-w-outline After filling out the forms to edit a patient’s history, click the “Save” button. edit-patient-history-3-w-outline The following is the error message that is encountered after hitting “Save”: edit-patient-history-error K) Estimation of Severity: module's function ceases at this point or crashes/ disables the EHR itself

(This issue was submitted twice before, but both issues are now closed: Issue #881 & Issue #964.)

maggienegm avatar Apr 16 '19 02:04 maggienegm

Error: Unknown column 'usertext11' in 'field list' Seems to reference these two files: /opt/ehr/library/patient.inc at 1490:sqlInsert /opt/ehr/interface/patient_file/history/history_save.php at 42:updateHistoryData(84,Array)

KoniKodes avatar Apr 16 '19 13:04 KoniKodes

It ends at risk factors. Not sure of what that usertext11 means.

On Tue, Apr 16, 2019 at 2:48 PM Toni Shortsleeve [email protected] wrote:

Error: Unknown column 'usertext11' in 'field list' Seems to reference these two files: /opt/ehr/library/patient.inc at 1490:sqlInsert /opt/ehr/interface/patient_file/history/history_save.php at 42:updateHistoryData(84,Array)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/LibreHealthIO/lh-ehr/issues/1467#issuecomment-483666709, or mute the thread https://github.com/notifications/unsubscribe-auth/APl-XiEVjBHiN2Fx2KFw9XIxMyQo80uNks5vhdSlgaJpZM4cxQCg .

muarachmann avatar Apr 16 '19 14:04 muarachmann

Yes @muarachmann According to the other two posts, it should not be calling 'usertext11'. I think it was supposed to be renamed to "riskFactors" or something similar.

KoniKodes avatar Apr 16 '19 14:04 KoniKodes

usertext11 is a junk chunk of the database. I don't want to go into what it was originally, but it was like a "sample custom field" thing about 20 years ago, and got hijacked by lazy slob devs and used, then hard-coded, and now should die. Same thing happened with some other fields in the patient_data table. I think I am going to do a review, and since the protests from changing that table have died down, I think we need to pare out anything not hard-coded or required, and anything that assumes a field that is not an absolute required field (lots of things need it), then no tool should every enumerate it and just assume the field exists. patient_data table has user-configurable fields, and too many columns anyway. All user-configurable patient_data fields via the Administration/Layout editor should be moved to a second table, and the absolutely required ones should be protected (yet the labels still renamable).

Difficulty is in the demographics display engine (Layout engine). Getting it to look at two tables at once was never really part of the concept.

aethelwulffe avatar May 09 '19 15:05 aethelwulffe

I understand. Elizabeth had been looking at the ACL with the thought in mind of cleaner namespace. She's supposed to have a wrap-up report to me at the end of the week. Would you like her to work with you on this?

KoniKodes avatar May 09 '19 15:05 KoniKodes

I think Elizabeth should choose her own team, but yes, I would like to be on it, or at least consult in her write-up. The GACL asset/tool in the application is something like 17 years old. Still uses smarty templates, is huge, and does very little in the application. The whole ACL scheme needs refactoring. This is no small thing, but actually implementing to the limit we are using it is quite simple...we never used GACL to any great extent, it has just gummed up development. That Facility ACL PR I have up is part of the ACL functionality we need. Basically, it comes down to Patient, Facility, Context, then feature access. We have a couple of pieces of that concept missing, and the rest out of priority order. Needs a project @Ngai-E

aethelwulffe avatar May 09 '19 17:05 aethelwulffe

This issue is different. This is just a case of someone requiring fields that may not always exist, instead of asking the database which ones exist first.

aethelwulffe avatar May 09 '19 17:05 aethelwulffe

Is this the Document install? IF so, then there is probably a bad thingie with the database used for that. This is probably a configuration of Administration/Layout/Demographics. usertext11 no longer exists in the database, and is only called with "ifexists" functions within a couple of old features that cannot be accessed, and need to be deleted (files with "ippf" in them.)

aethelwulffe avatar May 09 '19 17:05 aethelwulffe

If I remember right, this was a checklist that could checked to add to the patient history. As if he just remembered he was once told he had hypertension, but had ignored it until now. So we want to update the record by checking "hypertension". This is the error that was shown.

So I do agree that it is probably in the function that looks to see if that field exists.

KoniKodes avatar May 09 '19 23:05 KoniKodes