I have some logic in the patient banner that pulls the referring physician contact to the banner if the referring physician is a dentist or an orthodontist. I would like to change it from the specialist actually being listed as a dentist to the specialty contains the word dentist. We have dentist listed various ways, family dentist, pediatric dentist, and would like to keep doing that. I was hoping rather than writing each specialty into the banner code I could switch to the specialty contains dentist.
Here is what I have now and would appreciate any ideas.
Dentist:{IF REGPROVIDER("refphys","dentist") = "" then "None" else local reginfo = getfield(REGPROVIDER("refphys","dentist"),",","") reginfo[1] + " " + reginfo[2] endif}
Thank you in advance for any help.
for clarification, are you wanting the display in the banner to change, or do you want the code that checks if there is a dentist to be able to check all of those different titles.
if you want the Banner to display differently, can you give an example of what it should look like?
Thank you
The banner output is fine. What I really want is the code to check the specialty and if it finds the word dentist anywhere in the specialty to activate the code.
Currently I have it looking just at the specialty of dentist, however we have many specialties that include the word dentist that I would like it to look for also.
If you have any ideas that would be great.
You are looking for the MATCH() Mel code! I use this a ton in my forms to look for partial matches, or key words in long lists of text (like a medication list)
Here is a modified version of your current banner code. I tested it on my own system, so it seems to be functioning correctly.
{IF REGPROVIDER("refphys","","list") == "" then "None"
else
local reginfoArray = getfield(REGPROVIDER("refphys","","delimited"),"|","")
local reginfo = ""
local provTemp = "None"
for c =1, c < size(reginfoArray), c = c+1 do
reginfo = getfield(reginfoArray[c],"^","")
IF MATCH(tolower(reginfo[3]),"dentist") > 0 AND provTemp == "None" then
provTemp = reginfo[1] + " " + reginfo[2]
endif
endfor
provTemp
endif}
This will circle through all of your referring physicians and only return the first dental result. I will have to look into what order it pulls these in, but it can get you started if you are looking for ideas.
Look up the MATCH keyword in the Centricity Help File for the details, and let me know if you have any questions.
Happy new Year!
Thank you dcarpenter!! I don't know how you did it but it appears to work beautifully. Do you have a magic MEL book somewhere?
I am glad it worked! I wish I had a magic MEL book, but sadly, I only have the Centricity Help File, which has most of the code definitions and how to use them.
Hope you have a good year! Keep on CHUGing along! (that really should be this forum's catchphrase.)