Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EHR doesn't take into account updates of forms added in user Documents folder. #93

Closed
jeromecc opened this issue May 8, 2017 · 7 comments
Assignees
Labels

Comments

@jeromecc
Copy link
Contributor

jeromecc commented May 8, 2017

  1. Add a well formed form directory into 1 of the 2 user form directories:
    ~/$USER/freehealth/Documents/forms/subforms
    ~/$USER/freehealth/Documents/forms/completeforms
  2. Restat the application.
  3. Add the new form to the current form structure.
  4. It is integrated in the database.
  5. Stop the app.
  6. Modify the same form, bump the version
  7. Start the app
  8. Nothing happens. The modifications of the form are not included in the database.

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

@jeromecc jeromecc added the bug label May 8, 2017
@jeromecc jeromecc self-assigned this May 8, 2017
@jeromecc jeromecc changed the title EHR doesn't take into account forms added in user Documents folder. EHR doesn't take into account updates of forms added in user Documents folder. May 8, 2017
@jeromecc
Copy link
Contributor Author

jeromecc commented May 8, 2017

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"

@jeromecc
Copy link
Contributor Author

jeromecc commented May 8, 2017

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.

Simplification:

  • don't make any difference between app supplied and user supplied forms: remove userCompleteForms & userSubForms all forms will be completeForms & subForms
  • security: if user forms inside ~/$USER/freehealth/Documents/forms can update app forms, we need security mechanisms: GPG sign all files, give possibility to users that have GPG installed to verify the signature
  • should the app update the form? instead of complicated/slow versioning, sha256 the files and trigger the update mechanism only if the checksum changed
  • keep previous versions of files for easy rollback in case of problem?

Pull mechanism:

  • option to turn forms folder into a git folder, and to trigger git pull when the app starts
  • option to delegate the git pull & database update mechanism to a separate app on the server

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.

@jeromecc
Copy link
Contributor Author

jeromecc commented Jul 1, 2017

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.

@jeromecc
Copy link
Contributor Author

jeromecc commented Jul 2, 2017

during MySQL/MariaDB install forms are copied to freehealth folder but they do not appear in the selection list. fmf_xmlforms database is empty.

@jeromecc
Copy link
Contributor Author

jeromecc commented Nov 9, 2017

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

@jeromecc
Copy link
Contributor Author

jeromecc commented Dec 4, 2017

About staff group in Debian

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.

@jeromecc
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant