I need an MELCODING to pull only the diagnoses linked to a specific order to put in a letter template. Need to create a "letter" as a lab prescription.
While you say OBS, I will assume you mean MEL coding to do this. I have done something similar to pull info for Colonoscopy orders and embed in a letter.
I have this at the top of the letter - the programming to find fields related to one of three orders.
{!fn FindOrderTest() {
local FindX
local Cnt
local Row
local OL
local OA
local Osz
local RM1
local RM2
local RM3
local RD
FindX =""
OL = ORDERS_ALL('DELIMITED','T')
OA = getfield(OL,"|","")
Osz = size(OA)
for Cnt=1, Cnt<=Osz, Cnt=Cnt+1 do
Row = getfield(OA[Cnt],"^","")
RM1 = match(Row[1],"Colonoscopy")
RM2 = match(Row[1],"Sigmoidoscopy")
RM3 = match(Row[1],"EGD")
RD = val(DURATIONDAYS(str(._TODAYSDATE),ROW[4]))
If ((RM1+RM2+RM3)>0) and (RD>-7)
then FindX = FindX + str(Row[4] + " " + Row[1]+" ["+ROW[3] + "] for " + ROW[26] + " signed by " + ROW[21] + HRET + ROW[8] + HRET + HRET)
Else ""
Endif
Endfor
If FindX = ""
Then FindX = "None"
Else ""
Endif
Return FindX
}}
And then in my letter, I have
{FindOrderTest()}
Which puts the result into my ordering letter. I am only taking in a few of the fields related to the order.
04/03/2019 Colonoscopy [CPT-45378] for ICD10-Z12.11 signed by John Doe, MD
Colonoscopy Patient Instructions (check applicable):
DUE 12/2019
Desired Physician: ___________
___ Medication/Condition Instructions: NONE
___ Require Pre-Procedure Clearance from Ctr for Preop Assessment: no
___ Special Notes: (document below): NONE
Thanks!
I'll try it
and yes, I meant MEL coding 🙂