I am using Orders_New, which gives me the order name. However, I need the instructions/comments applied to the order to also translate. I would think that ORD_Comments should work but I don't Know how to pull them together to make it work. Please advise.
This will pull in the orders with comments along with the diagnosis and the date it the order is due.
!fn fnGetOrders(strList)
{
local lCounter
local strOrderList
local nStart
local strBuf
local strFormattedList = ""
strOrderList = getfield(strList, "|", "")for lCounter = 1, lCounter <= size(strOrderList), lCounter = lCounter + 1 do
strOrderList[lCounter] = getfield(strOrderList[lCounter], "^", "")
strFormattedList = strFormattedList + str(lCounter) + "."/* Need to remove commas from problem name */
strBuf = strOrderList[lCounter][1] + " " + "(" +strOrderList[lCounter][3] + ") " + " - " + strOrderList[lCounter][6] + " " + "(" + strOrderList[lCounter][7] + ")" + " " + strOrderList[lCounter][4] + HRET + "Order Comments: " + strOrderList[lCounter][8]
strBuf = ReplaceStr(strBuf, ",", "\,")
strFormattedList = strFormattedList + strBuf + HRET
endforif (lCounter > 1) then
strFormattedList = remove(strFormattedList, size(strFormattedList))
endifreturn strFormattedList
}
And call it with this to print.
{cfmt(fnGetOrders(ORDERS_AFTER("DELIMITED")),"","Orders with comments:
", "b","
")}
Let me know if you have any questions.
Will try this next week, Will it work for handouts?
Tests and Referrals ordered:
{if ORDERS_NEW("List","T") <> "" then ORDERS_NEW('list','T') else if ORDERS_NEW("List","R") <> "" then ORDERS_NEW('list','R') else "<None>" endif endif}
{if ORDERS_NEW('list','R') <> "" and ORDERS_NEW('list','T') <> "" then ORDERS_NEW('list','R') else "" endif}
This is what I have, but need to get the comments that are written on the order to translate to the handout too.
Will try this next week, Will it work for handouts?
Yes it should. Put the function first and then put the call in and it should work.
Or you could put the function intonyour usrlib.txt file and just call the function in the handout.
I need this in a handout as well. The code works great in a form but I can't get it to work in a handout. Were you able to?
jhuckaby45 said:
I need this in a handout as well. The code works great in a form but I can't get it to work in a handout. Were you able to?
How do you have it setup? What is in your handout?
remember that ORDERS_NEW only works for the current update. once signed, it won't work.
I've not gotten around to trying this yet, but I need it to work within the Clinical Visit Summary (CVS) handout which must be generated when the office note is in progress; not signed.
ErnieT said:
jhuckaby45 said:
I need this in a handout as well. The code works great in a form but I can't get it to work in a handout. Were you able to?
How do you have it setup? What is in your handout?
PLEASE PRESENT TO SCHEDULING AND CHECK OUT STAFF
Patient Information:Patient: {PATIENT.LASTNAME}, {PATIENT.FIRSTNAME} DOB:
{PATIENT.DATEOFBIRTH}
Primary Ins: {INS_NAME()}
Patient ID: {PATIENT.PATIENTID}
Provider: {DOCUMENT.PROVIDER}
_____________________________________________________________________________________________________________
Orders:
?
!fn fnGetOrders(strList)
{
local lCounter
local strOrderList
local nStart
local strBuf
local strFormattedList = ""
strOrderList = getfield(strList, "|", "")for lCounter = 1, lCounter <= size(strOrderList), lCounter = lCounter + 1 do
strOrderList[lCounter] = getfield(strOrderList[lCounter], "^", "")
strFormattedList = strFormattedList + str(lCounter) + "."/* Need to remove commas from problem name */
strBuf = strOrderList[lCounter][1] + " " + "(" +strOrderList[lCounter][3] + ") " + " – " + strOrderList[lCounter][6] + " " + "(" + strOrderList[lCounter][7] + ")" + " " + strOrderList[lCounter][4] + HRET + "Order Comments: " + strOrderList[lCounter][8]
strBuf = ReplaceStr(strBuf, ",", "\,")
strFormattedList = strFormattedList + strBuf + HRET
endforif (lCounter > 1) then
strFormattedList = remove(strFormattedList, size(strFormattedList))
endif}
{cfmt(fnGetOrders(ORDERS_AFTER("DELIMITED")),"","Orders with comments:
", "b","
")}
I've never tried to put a function in a handout so I was unsure where to place it.
Put the Function portion at the very top of your handout and then put the call portion wherever you want it to show up in your handout.