I have a form with 5 items.
1 - data display = OBS_LIST_CHANGES() just so I can see changes made
2 - drop down list (choices = Pneumovax, Tdap, Influenza, etc)
3 - drop down list (Abnormal, Normal, etc)
4 - edit field - date
5 - action button - commit === with runprocess
commit_procedures_to_obs()
I want users to fill in #2, #3 and #4
when the "commit" button is pressed I want the fields to be added to the flowsheet, then the boxes cleared and each time the button is pressed a new line to print in the chart translation.
I am having trouble with parts 2 and 3. the part where it goes into the flowsheet works fine.
my function code is below
{fn commit_procedures_to_obs(){
local proc=DOCUMENT.CHOOSE_PROCE
local procdate=DOCUMENT.DATE_OF_RESU
local result=DOCUMENT.EX_RESULTS
if result==""
then userok("You must fill in result fields." + hret + hret + "Sorry, nothing recorded.") return ""
else ""
endif
if (counter=0) then
local obs=""
cond
case proc=="Colonoscopy" obs="COLONOSCOPY"
case proc=="Mammogram" obs="MAMMOGRAM"
case proc=="Influenza" obs="INFLUENZA"
case proc=="PSA" obs="PSA"
case proc=="Pneumovax" obs="PNEUMOVAX"
case proc=="Tdap" obs="TDAP"
case proc=="HgbA1c" obs="HGBA1C"
case proc=="MicroAlb" obs="Microalb urn"
case proc=="Optho" obs="REF_OPTH"
case proc=="Podiatrist" obs="REFER PODIAT"
case proc=="GlaucomaScrn" obs="GlaucomaScrn"
else ""
endcond
obsnow(obs,result,procdate)
else
endif
?
return ""}
}
So you are having trouble clearing the fields and adding a new line in the chart translation? What are you using for the chart translation? For clearing the fields just add -
DOCUMENT.CHOOSE_PROCE = ""
DOCUMENT.DATE_OF_RESU = ""
DOCUMENT.EX_RESULTS = ""
at the end of the function right before the return ""
i did that. it doesnt clear it. i know, it doesn't make sense
Did you run a trace? You should have empty quotes after the last else, that might throw an error before you clear the fields, thats the only thing I can see that might be an issue. You must be getting an error somewhere though...
I don't know how to run a trace. please advise
From the test document, hit ctrl + alt + 'm'. The title bar on the chart should say MEL TRACE ENABLED. Fill out the fields and click the action button. Then hit ctrl+alt+'m' again to turn off the trace. Now the tricky part is finding the trace file, it depends on your OS where it is stored, in Windows 7 mine is here -
C:\Users\username\AppData\Local\Centricity\Logs
and it the TraceMel.log file, open it and I usually start by using ctrl + 'f' and searching for keyword 'error'
corillion said:
I don't know how to run a trace. please advise
If you are using a thin client, it won't be stored on your local harddrive. You'll have to go to the virtual computer you are logged on for Centricity to find it. Location should still be the same, though: C:\Users\username\AppData\Local\Centricity\Logs
I got it!
set my data display boxes to LASTOBSVALUEDATE("OBSTERM")
my chart note to :
{CFMT(LASTOBSVALUEDATE("obsterm"), "", "Date of obsterm", "B", "" )}
and my code to:
{fn commit_procedures_to_obs(){
local proc=DOCUMENT.TEST
local result=DOCUMENT.RESULTS
local procdate=DOCUMENT.DATE
if result==""
then userok("You must fill in result fields." + hret + hret + "Sorry, nothing recorded.") return ""
else ""
endif
local obs=""
cond
case proc=="Colonoscopy" obs="COLONOSCOPY"
case proc=="Mammogram" obs="MAMMOGRAM"
case proc=="PapSmear" obs="PAP SMEAR"
case proc=="PSA" obs="PSA"
case proc=="Influenza" obs="INFLUENZA"
case proc=="Pneumovax" obs="PNEUMOVAX"
case proc=="Tdap" obs="TDAP"
case proc=="HgbA1c" obs="HGBA1C"
case proc=="MicroAlb" obs="Microalb urn"
case proc=="Optho" obs="REF_OPTH"
case proc=="Podiatrist" obs="REFER PODIAT"
case proc=="GlaucomaScrn" obs="GlaucomaScrn"
endcond
obsnow(obs,result,procdate)
DOCUMENT.TEST = ""
DOCUMENT.RESULTS = ""
DOCUMENT.DATE = ""
return "XXXX"}
}