markleeds wrote on Friday, May 06, 2005:
I believe a form must currently follow the following standards:
1) form related files are stored in a directory with the same name as the form (any further references here to ‘the form’ will mean this directory and its contents).
2) the form will be placed in a forms directory, currently located at $webserver_root/interface/forms
3) the form will include the following files:
new.php: the page which you see when adding new encounter data. An html form is generated whose action is to go to the save.php file.
save.php: the script responsible for saving data to the database appropriately by screening the submitted data and calling the appropriate form related functions. As far as updating a database record, I don’t know if this is supported anymore.
report.php: responsible for rendering form data within a report of encounters for a patient.
table.sql: the sql statement for creating the table which corresponds to the data collected in the new.php generated page.
I believe that view.php is for updating records and I think I read somewhere that it was deprecated because we don’t want records changed.
I don’t know if info.txt is still required, but it should not be. This is the file with a single line of text stating the name of the form.
I just want to clarify these points. If anyone who has worked on OpenEMR for some time can contribute their knowledge on this subject, I would greatly appreciate it. It is easy to make forms that work, but I don’t want to throw in extra garbage that isn’t needed. Particularly, there is the long line in most save.php files dedicated to updating the record if the mode is set to update (I think this comes from view.php). If updating form records is deprecated, we don’t need this. If it is not, there should be a single function which handles adding new records and updating old ones depending on the parameters submitted. It would be in forms.inc. If we do not update forms ever, then it’s not needed and we can stop putting the sql update statement in save.php.
Thanks!
Mark