I have a home blood sugar form that someone gave us (I can't remember who, sorry!), but the endocrinologist wants the spacing perfect all the time. The problem is that the spacing changes depending on whether you enter a 2 or 3 digit sugar. Can someone help me with a code to make the spacing permanent so that no matter what values are added, it will always line up? I have no idea how to do this, it is far beyond what my nurse brain is programmed to do!! Thanks in advance!
Malissa
If I can figure out how to add an attachment, here's the Blood Sugar Log I created. It is coded so everything lines up.
Enjoy!
I'm not sure, but I may have started with an existing form and then tweaked it. So, my apologies if this looks familiar to anyone who isn't being properly credited!!
Thank you! I believe that is the same form I started with before I modified it too! That is exactly what I needed!!
Jennifer,
By chance, could you help me modify this form into a 1 week form? I tried to cut it down to a 1 week and adjusted all the code (at least I thought I did!) but then the form won't work properly. It only fills in part of the numbers.... Any ideas? This provider doesn't want the second week to show up, he only wants 1 week. He is very particular...
I've just started a new job and don't yet have VFE installed. Sorry! Is it the averages that aren't working correctly? You may want to check the calculation function in the white space on the right.
No, it is the actual columns. Only the first column will fill in if any changes are made. I went through all the code on the right and redid the functions and calculation to match only 7 rows, but then it won't work, however, if you remove it from the note and reinsert, it will work then?? Not sure what is happening now.....
I think the easiest thing to do would be to hide the parts he doesn't want in a visibility field (if it were one of my physicians he would probably change his mind in a week or so anyway). Place the first seven rows in a visibility field with no criteria (it will always display) and then add a second visibility on top of it with something like document.always_hide_this == "T" (an impossible statement since this doesn't exist) and place the rows you dont want in there. Also, make sure to check the box on the hidden visibility region that says supress translation, then you will not have a problem with extra dates in the translation. Hope this helps!
I will try that, thanks!
Me again with another plea for help!! Now he wants me to add a column after each group of before and after with the heading of dose. I don't know how to write code, so I mimicked what you wrote. However, it then throws error messages for everything. We are doing VFE training in April, but he is tapping his foot wondering why I don't just put the column in already... I think I need to build a function for that column, but I don't know how. So, how do I build a function? For instance, you wrote the below and I mimicked it (and more throughout) to match the column I inserted but it says invalid. What else do I need to do to complete the function? I apologize for all the questions, I will be learning this soon (I hope!!) Thanks in advance!
!fn CommentTrans(field_count)
{
local comment_trans = ""
local comment_field = ""
comment_field = EVAL("DOCUMENT.COMMENT"+field_count)
if (comment_field = "") then
comment_trans = ""
else
if EVAL("DOCUMENT.BED"+field_count) <> "" AND (comment_field <> "") then
comment_trans = numtoascii(9) + comment_field
else
if EVAL("DOCUMENT.DN_A"+field_count) <> "" AND (comment_field <> "") then
comment_trans = numtoascii(9) + numtoascii(9) + comment_field
else
if EVAL("DOCUMENT.DN_B"+field_count) <> "" AND (comment_field <> "") then
comment_trans = numtoascii(9) + numtoascii(9) + numtoascii(9) + comment_field
else
if EVAL("DOCUMENT.LU_A"+field_count) <> "" AND (comment_field <> "") then
comment_trans = numtoascii(9) + numtoascii(9) + numtoascii(9) + numtoascii(9) + comment_field
else
if EVAL("DOCUMENT.LU_B"+field_count)<> "" AND (comment_field <> "") then
comment_trans = numtoascii(9) + numtoascii(9) + numtoascii(9) + numtoascii(9) + numtoascii(9) + comment_field
else
if EVAL("DOCUMENT.BR_A"+field_count)<> "" AND (comment_field <> "") then
comment_trans = numtoascii(9) + numtoascii(9) + numtoascii(9) + numtoascii(9) + numtoascii(9) + numtoascii(9) + comment_field
else
if EVAL("DOCUMENT.BR_B"+field_count)<> "" AND (comment_field <> "") then
comment_trans = numtoascii(9) + numtoascii(9) + numtoascii(9) + numtoascii(9) + numtoascii(9) + numtoascii(9) + numtoascii(9) + comment_field
else
comment_trans = numtoascii(9) + numtoascii(9) + numtoascii(9) +numtoascii(9) + numtoascii(9) +numtoascii(9) + numtoascii(9) + numtoascii(9) + comment_field
endif
endif
endif
endif
endif
endif
endif
endif
This is the function that controls how many times to tab over (numtoascii(9) is the tab command), based upon which fields are populated. This is how the table stays table shaped, even if some fields are left blank.
To add a new column, first make sure you're using the same naming convention (as in, document.newfield1, document.newfield2, etc. all down the column). The number at the end is the "field_count" in the function you pasted above. A function is called from the translation area of each edit field. You'll want to make sure that the functions are sending the correct "field_count" as well. Look at the variable name and translation tab for each field and see if it starts to make sense.
That said, it may be easiest to start by copying an existing column and tweaking it from there.
Good luck!
Ok, I finally got it all figured out! Thank you for all your help! If you want a copy of what I have done, email me and I will send you the file! It's the least I can do! Thanks again!
Malissa
I'm so glad you got it working!