This may be a silly question, but im working on a preventive form and wanted to add sections for results of tests, date and result. How would you suggest that I get the result to show in the flowsheet under the date the test was performed and not the date I entered the data on my form. I want to link the date of exam and result together ....
You should be able to put the following into your VFE form. The following adds a value to the Observation Term AAASCREENING. In this example, the value added is in the variable DOCUMENT.AAA_SCREENING and the date of the actual result is in the variable DOCUMENT.CLINICAL_DATE1.
obsnow("AAASCREENING",DOCUMENT.AAA_SCREENING,DOCUMENT.CLINICAL_DATE1)
You will need to use a function that gets called from within the form. I can send you an example form (.dlg file) that provides a coding example of what you desire. I've included an image of the form below. Here's a general description of the form. The purpose of the form is to demonstrate how to use MEL code to insert a discrete data point into an OBS Term and associate that data value to a specific date (not necessarily the date you opened the form). This is useful for entering historical data so it appears properly when viewing a flowsheet.
The dropdown list on the form contains the OBS Terms in which I can insert data. In the screenshot below, I chose the HGBA1C OBS term (i.e. an A1c lab value). I am writing the value of 5.1 to that OBS term but assigning that value to a clinical date of 10/30/2015 (even though I opened the form on 03/22/2016). I've thoroughly documented the code in the form so with a little programming knowledge, you should be able to apply the same principle to your form. One thing to be aware of is that you cannot store a comment along with the Observation value if you use a an observation date that occurred in the past. This is a limitation of MEL. Let me know if you would have any interest in getting the form.
Oh my gosh, you are awesome. It works great!!!!! Wished I hadn't waited so long ask for this.
VirtualHITman --
That is a cool looking form. Would you share the program here so all could review?
I never thought to approach as you did.
I've included a link to the VFE file below (.dlg file). Please vote up my response if you find this form useful.
Some additional info:
I created this form primarily to educate our team on how to insert historical observation values when using a form instead of using the flowsheet. The "Insert Data" button calls a function "InsertData()" that is contained in the function view of the form. The four variables on the form (OBS Term, OBS Term Value, OBS Term Date, OBS Term Comment) are passed to the function as follows:
InsertData(DOCUMENT.VAR_OBSTERM,DOCUMENT.VAR_OBSVAL,
DOCUMENT.VAR_OBSDATE,DOCUMENT.VAR_OBSCOM)
The function uses OBSNOW() and OBSMODIFIERNOW() MEL functions to insert the data entered on the form. You can easily add different OBS terms to the dropdown list on the form if you want to load values into other OBS terms. This approach can be helpful if you are wanting to conserve real estate on a form, or need to load a bunch of historical discrete data for a patient.
Here is a link to download the form: