tirsoflores
New Member
I am implementing a system for a clinical analysis laboratory.
In this laboratory, it is necessary to establish panels or profiles of laboratory tests, which are intended to meet a specific diagnostic need. Some panels are made up of 2 or 3 laboratory tests (image 1) and others have more than 30. (Image 2)
In the system that I am creating, there is a table with the catalog of panels whose main form contains the fields with the alias, name, type of panel and other relevant information, but also includes in a repeated form each of the tests that are part of said panel. The repeated form, in addition to the id and parent_id fields, contains the following fields: Exam, Units, Reference Values.
Subsequently, in another table, the results of the panels requested by the patients are recorded, in whose form the identification data of the request, the patient data and the results of the examinations performed on the patients are included.
When the panel contains only 3 exams (image 3), it is easy to obtain the names, units and reference data of each exam that are registered in the catalog of panels using the Fabrik plugin "autofill" for each of the exams, row per row (this is currently the case); but if the panel contains 32 exams (image 4) as is the case with a Complete Blood Count, this method is very slow and leads to errors.
What I need is a function in javascript or php that is executed in the results form, preferably when pressing a button, and executes a query to extract from the catalog of panels, all the names, units and reference values of the specific panel that the results form is being registered and transfers them to the respective columns of the current results form (image 5), so that the user is limited to writing in the results column the values obtained in each of the exams that are part of that panel.
It would be like an autofill plugin but instead of getting and copying the values of the fields of a single record, it extracts all the values of the fields of all the records that match a reference value, in this case, the alias or id of the panel and copy them into the repeated form of the current results form.
Someone who can guide me on how to solve this.
I appreciate your comments and help in advance.
In this laboratory, it is necessary to establish panels or profiles of laboratory tests, which are intended to meet a specific diagnostic need. Some panels are made up of 2 or 3 laboratory tests (image 1) and others have more than 30. (Image 2)
In the system that I am creating, there is a table with the catalog of panels whose main form contains the fields with the alias, name, type of panel and other relevant information, but also includes in a repeated form each of the tests that are part of said panel. The repeated form, in addition to the id and parent_id fields, contains the following fields: Exam, Units, Reference Values.
Subsequently, in another table, the results of the panels requested by the patients are recorded, in whose form the identification data of the request, the patient data and the results of the examinations performed on the patients are included.
When the panel contains only 3 exams (image 3), it is easy to obtain the names, units and reference data of each exam that are registered in the catalog of panels using the Fabrik plugin "autofill" for each of the exams, row per row (this is currently the case); but if the panel contains 32 exams (image 4) as is the case with a Complete Blood Count, this method is very slow and leads to errors.
What I need is a function in javascript or php that is executed in the results form, preferably when pressing a button, and executes a query to extract from the catalog of panels, all the names, units and reference values of the specific panel that the results form is being registered and transfers them to the respective columns of the current results form (image 5), so that the user is limited to writing in the results column the values obtained in each of the exams that are part of that panel.
It would be like an autofill plugin but instead of getting and copying the values of the fields of a single record, it extracts all the values of the fields of all the records that match a reference value, in this case, the alias or id of the panel and copy them into the repeated form of the current results form.
Someone who can guide me on how to solve this.
I appreciate your comments and help in advance.