I am inserting mel expressions in our forms to create the order for the snomed codes. I found the mel comment in another post here on CHUG - thank you all by the way for helping us all out. Big Kudos to everyone for the assists.
How do I correctly program for the multiple selections for "colonoscopy"? If the OBSNOW selections are just one choice =="Done" then I am good to go and orders create. I can't get the multiple options to work. I am stumped. Thanks in advance everyone! - Vicki
{IF OBSNOW("COLONOSCOPY")== "Normal, Abnormal, Adenomatous Polyp, Villoadenmomatous Polyp, CIS, Adenocarcinoma, Diverticulosis,Angiodysplasia, AVM, Ulceration, Unknown" then if Match(ORDERS_NEW("delim","S"),"SCT-73761001")=="" then MEL_ADD_ORDER("S","PQRI","SNOMED-CT:773761001 Procedure, Performed: Colonoscopy","","", "","","1","N","","") else "" endif endif}
If you are trying to say if the colonoscopy is one of those values then add the order you should match obsnow() on an array containing those values, like this -
{if match(array(“Normal", "Abnormal", "Adenomatous Polyp", "Villoadenmomatous Polyp", "CIS", "Adenocarcinoma", "Diverticulosis","Angiodysplasia", "AVM", "Ulceration", "Unknown”),obsnow("COLONOSCOPY"))>0 then ...
It will return the position of the observation in the array, or 0 if it is not a match.
I have updated my comment as below. I am getting a -3 value in my data field on the form. I also have this programmed in the options tab of the form component. I don't know if that matters or not. I do not want the orders "documentation" to appear within the note or while they are charting. Thank you in advance.
{if match(array("Normal", "Abnormal", "Adenomatous Polyp", "Villoadenomatous Polyp", "CIS", "Adenocarcinoma", "Diverticulosis","Angiodysplasia", "AVM", "Ulceration", "Unknown"),obsnow("COLONOSCOPY"))>0 then if Match(ORDERS_NEW("delim","S"),"SCT-73761001")== "" then MEL_ADD_ORDER("S","PQRI","SNOMED-CT:73761001 Procedure, Performed: Colonoscopy","","", "","","1","N","","") else "" endif endif}
Try adding this at the beginning of the if statement. if obsnow("COLONOSCOPY")<>"" AND ....
-3 is the invalid description code for Mel Add Order, make sure the description "SNOMED-CT:73761001 Procedure, Performed: Colonoscopy" is the exact description in the PQRI service order category. If you dont want the text to display after you are done testing just add to empty quotes after the last 'endif'.
{If obsnow ("COLONOSCOPY") <> “” then if Match(ORDERS_NEW("delim","S"),"SCT-73761001")=="" then MEL_ADD_ORDER("S","PQRI","SNOMED-CT:73761001 Procedure, Performed: Colonoscopy","","", "","","1","N","","") else "" endif endif}
I tried this first off thinking it might work. Here is the statement that I used. Maybe I am missing a character in the mel. When inserted into the system the data field reports "FALSE" when I open the form and the obs term is empty, and "-3" when you enter a value in the field. No order created.
The explanation for the error -3 made me double check my entry for the snomed code. It was entered as a service under "CQMs" vs PQRI. Guess it helps to know what everything means as you are sending it! Thank you to everyone for helping. For those of you that are struggling through this Meaningful use and build your own forms. Here is working mel statement.
{if match(array(“Normal", "Abnormal", "Adenomatous Polyp", "Villoadenomatous Polyp", "CIS", "Adenocarcinoma", "Diverticulosis","Angiodysplasia", "AVM", "Ulceration", "Unknown”),obsnow("COLONOSCOPY"))>0 then if Match(ORDERS_NEW("delim","S"),"SCT-73761001")=="" then MEL_ADD_ORDER("S","CQMs","SNOMED-CT:73761001 Procedure, Performed: Colonoscopy","","", "","","1","N","","") else "" endif endif}
My snomed code is as I said under services, and then the heading CQMs. Everyone have a GREAT weekend.
You are probably getting the FALSE because you have 2 if statements and only one else.
Change your first line to be:
{If obsnow ("COLONOSCOPY") “” AND Match(
And get rid of your send endif.
I agree with rwilliams. Too many "if" statements
try it using his suggested syntax
something similar to what you are trying to do
VAL(DOCUMENT.BODY_MASS_IN) >= 27.0 and VAL(DOCUMENT.BODY_MASS_IN) < 28 and match(PROB_AFTER("list"),"BMI 27.0-27.9,adult")==0
MEL_ADD_PROBLEM("dx of", "BMI 27.0-27.9,adult", "ICD-V85.23", str(._TODAYSDATE), "", "")
Got it! No false now - just places the order.
{if match(array("Normal", "Complete", "Done", "Abnormal", "Adenomatous Polyp", "Villoadenomatous Polyp", "CIS", "Adenocarcinoma", "Diverticulosis","Angiodysplasia", "AVM", "Ulceration", "Unknown"),obsnow("COLONOSCOPY"))>0 and Match(ORDERS_NEW("delim","S"),"SCT-73761001")=="" then MEL_ADD_ORDER("S","CQMs","SNOMED-CT:73761001 Procedure, Performed: Colonoscopy","","", "","","1","N","","") else "" endif}
Thanks so much guys. I only program once in a blue moon, so I have to re-remember what little I know. If it weren't for the generosity and knowledge of others - I wouldn't be able to get these specialty statements to work.
its like tuning a carburetor... its a bit finicky and depending on the day it might just blow up in your face but in the end you may not win any races but it will get you home...