Has anyone tried and was able to pull an insurance to the patient banner in the EHR based on the prefix of the insurance carrier name? For example, want to show on patient banner if insurance begins with 'BH - '.
Thank you.
I have not tried to do this, but it sounds fairly simple. if you are looking for a specific string that is always at the beginning, such as "BH -", then you should use the MEL code sub(string). here is an example
{if sub(INS_NAME("P"),1,4) == "BH -" then INS_NAME("P") else "" endif}
please let me know if you need further details.
Thank you,
Daniel Carpenter
Daniel's answer is correct, but I would throw in a couple of other lines, just to ensure that MEL doesn't run into any errors...I've noticed when using some functions that if a string is NULL, the MEL function can throw an error, resulting in MEL vomit (which users might not want to see in the banner).
{
cond
case INS_NAME("P") == "": ""
case size(INS_NAME("P")) < 4: ""
case sub(INS_NAME("P"),1,4) == "BH -": INS_NAME("P")
else: ""
endcond
}
Thank you. These have been very helpful. I knew I was missing something in the code I was doing.