I am trying to build a button that will resolve one particular problem, the issue with using the MEL_REMOVE_PROBLEM is that it requires the use of the PRID, it wouldn't be so bad IF the PRID didn't change every time it was added, however it does so I can't use it. Any other solution?
We use that function successfully. I loop through PROB_AFTER() to find the PRID for a problem matching in description and ICD10 code and then pass it mel_remove.
That's probably a bit more programming than I know, can you share anything to try?
Basic example where name is passed as the description of the problem and the reason is passed as a valid reason for removing problems (See reason list for removing problems in the GUI)
{fn Remove_Problem(name,reason){
local hold = getfield(prob_after("delimited"),"|","")
local temp
for i = 1, i 0 then
return MEL_Remove_Problem(temp[9],str(._todaysdate),false,reason)
endif
endfor
return rslt
}
}
yea, see, I would never have known. I don't get the "for i = 1, i 0" part, where does that come from? Mind you the last time I programmed was C++ in high school and I'll be damned if I can remember any of that from nearly 20 years ago.
No idea.. It should say this, when I try to edit the post it still doesn't save right -
for i = 1, i <= size(hold), i = i + 1 do
temp = getfield(hold[i],"^","")
if match(toupper(name),toupper(temp[2]))>0 then
return MEL_Remove_Problem(temp[9],str(._todaysdate),false,reason)
endif
endfor
could I write this?
{
!if OBSNOW("PREGNANT") == "No"
THEN
Remove_Problem("Pregnant State, incidental", resolved)
local hold = getfield(prob_after("delimited"),"|","")
local temp
for i = 1, i <= size(hold), i = i + 1 do
temp = getfield(hold[i],"^","")
if match(toupper(name),toupper(temp[2]))>0 then
return MEL_Remove_Problem(temp[9],str(._todaysdate),false, resolved)
endif
endfor
return rslt
}
{ !if OBSNOW("PREGNANT") == "No" and match(PROB_AFTER("delimited"),"Pregnant State, incidental")>0 THEN
Remove_Problem("Pregnant State, incidental", "resolved")
else "" endif}
{!fn Remove_Problem(name,reason){
local hold = getfield(prob_after("delimited"),"|","")
local temp
for i = 1, i <= size(hold), i = i + 1 do
temp = getfield(hold[i],"^","")
if match(toupper(name),toupper(temp[2]))>0 then
return MEL_Remove_Problem(temp[9],str(._todaysdate),false, resolved)
endif
endfor
return rslt }}
Michael,
thank you so very much, this was extremely helpful. I need to use this for several different items. I appreciate your time. Programming this was/is still way over my head at this point.