Hi. I've been asked to see if there is an easy way in handouts and/or letters to suppress the display of patient problems, but include the respective ICD-9 codes. We have a form used to document labs ordered, with a linked handout. Including a reason (a dx to validate the lab work) is required on the form, but we have a clinic that only wants the associated ICD-9 of that problem to appear on the handout. So if a lab is ordered and justified by a dx of DIABETES MELLITUS TYPE II, the clinic wants only "ICD-250.00" to show up on the handout.
Thanks for your help, Mary
Perhaps better ways, but...
It assumes that the ICD is the only think in (); I have seen some people create custom problems putting a date or something else in () and you would get that rather than the ICD code. If this is an issue, then could
search for ICD at the 'icddlm' line for a match; extract the string from that starting point to a variable; and then match for 'icddlm2' and the ) based on that sub-string of the original line.
One other thing to consider is my use of PROB_AFTER - might be better with PROB_ACTIVE. Was not sure which made better sense.
{global prbl = getfield(PROB_AFTER("list"),"\r","")
global probsize = size(prbl)
global probicd = ""
for cnt = 1, cnt < probsize, cnt = cnt + 1
do
icddlm =match(prbl[cnt],"(")
icddlm2 =match(prbl[cnt],")")
if icddlm > 0 then
icdlen = icddlm2 - icddlm - 1
prb_d = sub(prbl[cnt],icddlm+1,icdlen)
probicd = probicd + prb_d + str(HRET)
endif
endfor
probicd
}
Thank you!