I am trying to use IMMUN_GETLIST to pull the ImmunizationID (field 1 of the output). So I can use it in IMMUN_UPDATE to recommit an immunization in a form once there has been a change.
{!fn Immunupdate() {
local hold=getfield(IMMUN_GETLIST("Influenza","last"),"^","")
local date=hold[30]
if fcn_is_later(str(._TODAYSDATE),ADDDATES(str(date),"0","0","14")) then
return hold[1]
else
return ""
endif
}}
{!DOCUMENT.IMM_ID=immunupdate()}
IMMUN_UPDATE(DOCUMENT.Imm_ID+'^Influenza^' + document.vaxtype + '^' + document.vaxtype + '^^Y^^N^^' + vfcid + '^^^^^^^' + (size(document.fludose)-2) + '^mL^' + document.fluroute + '^^' + document.flusite + '^^' + document.fluman + '^^' + document.flulot + '^' + document.fluexp + '^' + document.vfluvis + '^' + USER.LOGINNAME + '^^' + str(._TODAYSDATE) + '^^^^^^^^^^^')
Any ideas?
I take it the code you pasted does not work? You do not state what the issue is.
If the code is not running, try turning on a mel trace (CTRL-ALT-M) before running the code and see what is being returned from the code. If you are unable to interpret it upload the file here and I will take a look at it for you.
The mel trace file will exist in %appdata% if you are running C-EMR (Oracle). If you are on CPS (MsSQL) it has a slightly different location. Your profile says you have both.
The first thing I noticed is there isn't any boolean logic in your if statement.
if fcn_is_later(str(._TODAYSDATE),ADDDATES(str(date),”0″,”0″,”14″)) then
I don't know what fcn_is_later() does, but you need to have something in the if statement that can return as either true or false. So something like this dependent on what the fcn_is_later() does:
if fcn_is_later(str(._TODAYSDATE),ADDDATES(str(date),”0″,”0″,”14″) == "true) then
if fcn_is_later(str(._TODAYSDATE),ADDDATES(str(date),”0″,”0″,”14″) > 0) then
So I got rid of the date logic
{fn Immunupdate(){
local hold=getfield(IMMUN_GETLIST("Influenza","last"),"^","")
local temp=getfield(hold [1],"","")
return temp
}}
{!DOCUMENT.IMM_ID = Immunupdate()}
This works successfully for me to get the immunization ID that I need to use later on.
I have also stopped trying to use the IMMUN_UPDATE instead using IMMUN_REMOVE and then IMMUN_ADD.
IMMUN_REMOVE(DOCUMENT.IMM_ID ,'documentation error')
I get the error -11 which means the immunizationID is not valid.
If I manually past the ID number into this it works. Is it something to do with the fact that it is a number? should I be making it a string?
Example formatting
syntax
IMMUN_REMOVE (ImmunizationID, reasonRemoved)
example
IMMUN_REMOVE('1600689406001145', 'Historical Information Incorrect')
This is a somewhat related topic. We have a handout that should pull in all immunizations and suddenly, the IMMUN_GETLIST data symbol is missing from the database. The handout itself was created using it but when you search for it under data symbols to be inserted, it's not there. We recently upgraded to CPS 12.3.0.1585. Not sure if this has anything to do with it.
Thank you!
Hello, I am trying to add the immunization list to a handout and I can't seem to get anything to work. I have a data display in a VFE form that displays the HPV immunizations. so I tried taking it and took out the specific vaccine group but it isn't working on the handout. What am I missing?
Here is what is on the data display....
{!fn fnDisplayHPVHx() {
local hold = getfield(IMMUN_GETLIST("Human Papillomavirus", "All"), "|", "")
local temp
local rslt = ""
for i = 1, i <= size(hold), i = i + 1 do
temp = getfield(hold[i], "^", "")
if (rslt <> "") then
rslt = rslt
endif
rslt = rslt + temp[3] + " Vaccine" + " - " + temp[30] + "
"
endfor
return rslt
}}
Linda
Do you have code in your handout to run the mel function?
For example, do you have something that looks like this:
{fnDisplayHPVHx()}
If this doesn't solve your problem, you are probably better off asking a new question about it instead of posting on this old one.
Thanks! That was what I was missing.
Linda