Closed jeromecc closed 6 years ago
EHR complains about the fact that the file of a form added to database through Documents/... doesn't exist in the app forms folder: ERROR(xmlformio.cpp:129) File /home/$user/git/freehealth/global_resources/forms/subforms/simplest/central.xml does not exist"
This is a big mess. We just want to put a few files in a database and be able to update them if they change... how is it possible that this requirement becomes such a mess? Ok.
Pull mechanism:
Base everything on a real uuid: the name of the form "this::is::a:form::that::does::this", not on path names. Directory structure should be there only to help developers. In practice, forms (MedForms) are independent, discrete entities. They should be organized in a tree structure independently from their own content. Embedding forms inside forms to organize the tree structure leads to a complete mess that is impossible to maintain because the data is at two different places: inside the xml structure of the forms themselves, and in the fmf_episodes (why???) database: FORM_FILES table. The data about the structure should be kept in one place. Each user should be able to have her own structure (with a visual clue that other forms exist for this patient), adapted to each patient.
FreeHealth will switch to problem list and 3D data visualization as the main entry points to data. Forms skeleton/structure will not matter much. Recursive forms (1 MedForms inside another MedForms) is a nice idea in theory but it leads to an incredible mess. Tree structure should be used to classify forms, not to classify medical data.
during MySQL/MariaDB install forms are copied to freehealth folder but they do not appear in the selection list. fmf_xmlforms database is empty.
Clean way to manage extra forms on Linux would be to add code to check /usr/local/share/freehealth/forms <- host specific forms managed by system administrator in addition to /usr/share/freehealth/forms <- standard forms installed by package manager
staff: Allows users to add local modifications to the system (/usr/local) without needing root privileges (note that executables in /usr/local/bin are in the PATH variable of any user, and they may "override" the executables in /bin and /usr/bin with the same name). Compare with group "adm", which is more related to monitoring/security.
Summary: user form code was commented out and incomplete. It will be removed in a future release. I added local(Sub/Complete)Forms code that will allow a local Linux admin to add forms inside /usr/local/share/freehealth/forms This will do for v0.11 until a complete rewrite of forms architecture in a future release.
Workaround: delete the fmf_xmlforms database, it will be recreated automagically without any intervention on your part from the forms inside the application folder and from the modified version of your modified form inside Documents/forms