Wondering if a more experienced VFE form builder can help me with this. We would like to put a button or check box on a form allowing the doctor to add or remove a component from the note- i.e. if the Past Medical History is on the form but they do not want it to be in the note they can click and it will not be visible in the note.
I cannot get this to work. Any suggestions?
This code is based on 3 edit fields being populated or not (adds 1 to 3 forms, in reverse order after the current form so they appear in order)(also sets a hidden field to signify the form has already been loaded):
{/* load forms based on periods in protocol */}
{if gblPeriod2=="" then
if DOCUMENT.FORM_2<>"" then
REMOVE_FORM_COMP("Oncology Chemo Orders 2 PP")
REMOVE_FORM_COMP("Oncology Chemo Orders 2 TS")
DOCUMENT.FORM_2 = ""
endif
else
if DOCUMENT.FORM_2=="" then
AddOpenForm("Enterprise\Hematology&Oncology^Oncology Chemo Orders 2 TS", "Oncology Chemo Orders 1 TS", "AFTER_CURRENT", "")
AddOpenForm("Enterprise\Hematology&Oncology^Oncology Chemo Orders 2 PP", "Oncology Chemo Orders 1 TS", "AFTER_CURRENT", "")
DOCUMENT.FORM_2 = "added"
endif
endif}
{if gblPeriod3=="" then
if DOCUMENT.FORM_3<>"" then
REMOVE_FORM_COMP("Oncology Chemo Orders 3 PP")
REMOVE_FORM_COMP("Oncology Chemo Orders 3 TS")
DOCUMENT.FORM_3 = ""
endif
else
if DOCUMENT.FORM_3=="" then
if DOCUMENT.FORM_2<>"" then
REMOVE_FORM_COMP("Oncology Chemo Orders 2 PP")
REMOVE_FORM_COMP("Oncology Chemo Orders 2 TS")
endif
AddOpenForm("Enterprise\Hematology&Oncology^Oncology Chemo Orders 3 TS", "Oncology Chemo Orders 1 TS", "AFTER_CURRENT", "")
AddOpenForm("Enterprise\Hematology&Oncology^Oncology Chemo Orders 3 PP", "Oncology Chemo Orders 1 TS", "AFTER_CURRENT", "")
DOCUMENT.FORM_3 = "added"
AddOpenForm("Enterprise\Hematology&Oncology^Oncology Chemo Orders 2 TS", "Oncology Chemo Orders 1 TS", "AFTER_CURRENT", "")
AddOpenForm("Enterprise\Hematology&Oncology^Oncology Chemo Orders 2 PP", "Oncology Chemo Orders 1 TS", "AFTER_CURRENT", "")
DOCUMENT.FORM_2 = "added"
endif
endif}
{if gblPeriod4=="" then
if DOCUMENT.FORM_4<>"" then
REMOVE_FORM_COMP("Oncology Chemo Orders 4 PP")
REMOVE_FORM_COMP("Oncology Chemo Orders 4 TS")
DOCUMENT.FORM_4 = ""
endif
else
if DOCUMENT.FORM_4=="" then
if DOCUMENT.FORM_2<>"" then
REMOVE_FORM_COMP("Oncology Chemo Orders 2 PP")
REMOVE_FORM_COMP("Oncology Chemo Orders 2 TS")
endif
if DOCUMENT.FORM_3<>"" then
REMOVE_FORM_COMP("Oncology Chemo Orders 3 PP")
REMOVE_FORM_COMP("Oncology Chemo Orders 3 TS")
endif
AddOpenForm("Enterprise\Hematology&Oncology^Oncology Chemo Orders 4 TS", "Oncology Chemo Orders 1 TS", "AFTER_CURRENT", "")
AddOpenForm("Enterprise\Hematology&Oncology^Oncology Chemo Orders 4 PP", "Oncology Chemo Orders 1 TS", "AFTER_CURRENT", "")
DOCUMENT.FORM_4 = "added"
AddOpenForm("Enterprise\Hematology&Oncology^Oncology Chemo Orders 3 TS", "Oncology Chemo Orders 1 TS", "AFTER_CURRENT", "")
AddOpenForm("Enterprise\Hematology&Oncology^Oncology Chemo Orders 3 PP", "Oncology Chemo Orders 1 TS", "AFTER_CURRENT", "")
DOCUMENT.FORM_3 = "added"
AddOpenForm("Enterprise\Hematology&Oncology^Oncology Chemo Orders 2 TS", "Oncology Chemo Orders 1 TS", "AFTER_CURRENT", "")
AddOpenForm("Enterprise\Hematology&Oncology^Oncology Chemo Orders 2 PP", "Oncology Chemo Orders 1 TS", "AFTER_CURRENT", "")
DOCUMENT.FORM_2 = "added"
endif
endif}