okay, after toying with this for hours I figured I should just ask because I'm probably missing something ridiculous or this is just one of those complicated things I can't do in the first place. So, I have a data display and I want to use:
ORD_WITH_DIAG()
in the help menu it says it will bring it in in list form, however, it's not doing that. Instead I'm getting:
CBC with Differential[CPT-85025] SEIZURE ICD-780.39 (little box)MRI, Brain [CPT-70551] SEIZURE ICD-780.39 (little box)
So I looked it up again in help and tried ORD_WITH_DIAG("list"). Same thing... no list and still little boxes. I continue to play with it, trying out different {, sentence formatting, etc.
I decided to try:
ORDERS_PRIOR("list") just to test if this would actually make a list. It's not really the one I want to use (I need the diagnosis). Anyway then I get it how I want it:
CBC with Differential [CPT-85025]
MRI, Brain [CPT-70551]
Honestly I was avoiding trying to come up with any crazy functions as I'm a novice at programming and our programming intern decided to get his master's and leave us 🙂 . Anyway, so any help would be appreciated!
You are going to have to take one of the MEL Order Data Symbols that takes the "delimited" list type parameter and put the results into an array. Then pull the fields you want out of the array you create. Haven't found a good easy example yet though.
ORDERS_PRIOR does take the delimited parameter. Look at the help again for it. Fields 6 and 7 are Diagnosis Description and Diagnosis Code.
Yeah, that's what I was trying to avoid. I'll see if I can play with it... otherwise they'll just have to deal until we get the new intern
Thanks though!
DavidShower, I'm guessing something like this is what you meant? : Data field: {orders_diag()} White board: {! fn orders_diag() { local orders=getfield(ORDERS_NEW("delimited"),"|","") local str="" FOR s=1, s<=size(orders), s=s+1 DO single=getfield(orders[s],"^","") if (single[6]<>"") then str = str + single[1] +" ["+ single[3] +"] "+ single[6] +" "+ single[7]+HRET else "" endif ENDFOR return str } } Luckily found it in one of our other forms. I added the CPT code since it was in ORD_WITH_DIAG(). So, yay it works
Great! Glad you discovered that. Same code should work with the other Orders MEL that take a delimited. Think they all have the same field layout.