I'm just beginning to look into create some custom forms and know very little about MEL (although I'm proficient in some other programming languages). Does anyone know about tutorial or guide for getting started with MEL?
Thanks!
I feel your pain. 3 years ago I joined the company I work for and was lost with MEL is odd and different from any other language. Here's my old text file notes for pieces of code (functions,strings,etc..) MEL Code most of these notes are from forms off here. Simply searching post and finding forms, downloading them, and opening them up to see how they worked. This was my best resources for help and understanding MEL. Utilizing the help in Centricity on how to use data symbols is also a good place. I found myself looking at each command and what it did in my down time. Hope this helps!
Adam - thank you for sharing your MEL link. I have also struggled to understand it. I cannot wait to look through what you have shared.
I would be happy to present a Webinar for interested individuals on VFE programming. I have painfully extensive experience with MEL. The tutorials would be tailored to meet your needs. Please contact me at [email protected].
Hope you can find some nuggets in there. I'll post it here, my favorite piece and most versatile code I use and variants littered through most of my forms:
{!fn fnDisplayImmunHx() {
local hold = getfield(IMMUN_GETLIST("", "last"), "|", "")
local temp
local rslt = ""
for i = 1, i <= size(hold), i = i + 1 do
temp = getfield(hold[i], "^", "")
if (rslt <> "") then
rslt = rslt
endif
rslt = rslt + temp[3] + " Vaccine" + " - " + temp[30] + if temp[18] <> "" then " - " else "" endif + temp[18] + " " + temp [19] + " - " + if temp[7] == "Y" then "was given" else if temp[7] == "N" then "declined" else if temp[7] == "U" then "Undetermined" else "" endif endif endif + if temp[8] <> "" then " - " else "" endif + temp[8] + "
"
endfor
return rslt
}}
Swapping the:
local hold = getfield(IMMUN_GETLIST("", "last"), "|", "")
Will allow you to grab just about anything, for example we have pop ups that fire if they meet certain criteria:
{!fn PullColonProbs() {
local temp = getfield(PROB_PRIOR("delimited"), "|", "")
local hold
local rslt =""
for i=1, i<=size(temp),i=i+1 do
hold = getfield(temp[i],"^","")
if hold[8] == "ICD10-D36.9" or hold[8] == "ICD10-D12.6" or hold[8] == "ICD10-K57.32" or hold[8] == "ICD10-K57.92" then
if rslt <> "" then
rslt = rslt + hret
endif
rslt = rslt + hold[8]
endif
endfor
return rslt
}}
{!if colon_5_pop_up() <> "" and pull_colon_normal() <> "" and colon_pop_up() == "" and PullColonProbs() == "" and document.stoppopup7 <> "true" then
userok("Reminder for:
FIT occult due.
")
document.stoppopup7 = "true"
else ""
endif}
If used in handouts use global:
{fn PullNep(){
global temp = getfield(PROB_PRIOR("delimited"), "|", "")
global hold
global nephro =""
for i=1, i<=size(temp),i=i+1 do
hold = getfield(temp[i],"^","")
if hold[8] == "ICD10-N28.9" then
if nephro <> "" then
nephro = nephro + hret
endif
nephro = nephro + hold[8]
endif
endfor
return nephro}}
Using {MEDS_AFTER("delimited")} and commands like it, you get the raw data as I call it, allowing you to grab any field off a clinical list item. Like the PullNep function above I added the diagnosis to a test chart used a quicktext of {PROB_AFTER("delimited")} to show me what field the ICD code was in, there's probably a easy way to do this but it works for me. Once you are able to pull whatever you need you can plug the fn into other pieces and evaluate all kinds of things with multiple other functions.
MEL is a challenging, but, in my opinion, (mostly) fun language to work with. It comprises mostly of basic syntax such as if-then-else statements, cond-case statements, for loops, while loops, and a slew of data symbols (GE defined functions).
On the GE Support Portal, under your EMR version (CPS or C-EMR), there is a link to Access Documentation. On that page, near the bottom, you will find a link for 'Creating Clinical Content'. This is the last 'MEL reference file created by GE and combines two older files that are no longer accessible. Note that this file references the now sunset Encounter Form Editor (EFE), so you will want to ignore any references to it in the text, but the MEL stuff is still very much current.
In addition, the 'EMR' Help File contains a section called 'Using Data Symbols'. This is the defacto reference for all data symbols 'certified' for use by developers (there are others that exist, but they are not for end user utilization and subject to change based on GE's internal needs - use them as you discover them at your own risk!). The help file explains what each data symbols does and how it is to be used - mostly - some are defined better than others and some examples are simply incorrect (it is better than it used to be).
With both of these references, if read front to back, you should be on the path to managing most tasks with minimal assistance from others - but know that with MEL, there are times where experience only can inform you of what may be causing you headaches. The good news is, for most, the elation of discovering how it should be done vs. how it was suggested it be done etches the lesson in your memory permanently and when shared, makes the 'guru of the day'. 🙂
Thanks everyone for the hints and direction. I'll start digging in and hopefully become somewhat proficient.
Thanks!
You may not need to learn MEL if you are doing HTML Encounter Form development with open source $mdObject See: https://github.com/mdObject/GECentricity
The $mdObject is wrapped all MEL calls into JavaScript native objects. So your HTML form will have no reference to any MEL call and could be easily converted to North Star project forms (when they will become available)
PS. $mdObject is released under the Microsoft Public License (MS-PL) http://opensource.org/licenses/MS-PL . So, you may use it for commercial applications.