This is a question about creating new fields for the Document Template Manager. I am putting it here and reviving this thread instead of starting a new one because I got a lot of help from the thread and links above. If I should start another thread I'll do that.
I find the document templates to be very helpful for simple templates like referral requests where all you need is a patients name and DOB. I would really like to pull data from layout based forms to populate a report.
I am not a coder but am dangerous enough to look through the code to follow how it works ... and then can copy and paste as well as anyone. I have added a couple new keywords by duplicating some of the code in "download_template.php" (around line 200) and modifying slightly like this:
This gives a new keyword, {DiagnosisCodes}, to pull ICD10 codes (diag_codes) out of the "Patient_Data" table which holds demographics info. But, this only works for getting data from the this table. I would like to get "organization" and "fax" data from another table, the "Users" table, and would especially like "field_value" data from the "lbf_data" table to pull into a report.
If this makes sense, is there a concise bit of code I can add to these few lines to point to say the "Users" table? Or, does anyone have a recommendation for a useful resource I could consult to get some help?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is a question about creating new fields for the Document Template Manager. I am putting it here and reviving this thread instead of starting a new one because I got a lot of help from the thread and links above. If I should start another thread I'll do that.
I find the document templates to be very helpful for simple templates like referral requests where all you need is a patients name and DOB. I would really like to pull data from layout based forms to populate a report.
I am not a coder but am dangerous enough to look through the code to follow how it works ... and then can copy and paste as well as anyone. I have added a couple new keywords by duplicating some of the code in "download_template.php" (around line 200) and modifying slightly like this:
else if (keySearch($s, '{DiagnosisCodes}')) {
$s = keyReplace($s, dataFixup($ptrow['diag_codes'], xl('diag_codes')));
}
This gives a new keyword, {DiagnosisCodes}, to pull ICD10 codes (diag_codes) out of the "Patient_Data" table which holds demographics info. But, this only works for getting data from the this table. I would like to get "organization" and "fax" data from another table, the "Users" table, and would especially like "field_value" data from the "lbf_data" table to pull into a report.
If this makes sense, is there a concise bit of code I can add to these few lines to point to say the "Users" table? Or, does anyone have a recommendation for a useful resource I could consult to get some help?
Hello Joel,
It appears the code to include field data for LBF encounter forms is already present...
{LBFxxx:fieldid}
Using {LBFxxx:fieldid} when there are multiple instances of a single LBF form seems to be a problem.