I would like to add a field on the patient banner to include an indication that a patient, at one time, has accessed their medical record via the patient portal. I am looking to grab the MUActivityLogTypeId field from the MUActivityLogID Table. I have created the following definition within the mldefs3 file :
//
//MU Event ID
//
Object: _MUEVENTIDTYPE Table: MUActivityLogId
Refresh: RBook
Property: Snapshot
Property: AutoGet
Field: MUActivityLogTypeId Type: String Length: 4
Filter: PatientFilter, PatientProfileId = Patient.PatientProfileId Hidden
I have also declared a global MEL object within the mellib file
global _MELMUEventID = __MUEVENTIDTYPE
Lastly, I have added the following to my patient banner:
{! fn MU_ID() {
local a = getrow("_MELMUEventID",0,"MUActivityLogTypeId")
return a }}{MU_ID()}
Nothing appears on the Banner. Looking for advise.
I am intrigued by your question. Are you sure it is possible to add tables to the mldefs files? I was unaware that you could do that. I also have never heard of the function getrow(). I have always used find() to get items out of the mldefs files. I do not see any documentation of getrow() in the help file.
If you have any documentation on any of this please let me know.
First and foremost, I stress not to test this in a live environment where the client machine is shared between users because an error in one of these files will make it to where the users on that client machine cannot login. Keep a backup of the mldef3 file handy in case you need to revert back to the original.
You'll need to switch your table to be MUActivityLog instead of MUActivityLogId.
Also, the filter doesn't work like that. It looks like you are trying to do a join, but Patient.PatientProfileId doesn't exist and PatientProfileId isn't in MUActivityLog. When using a filter, you'll need a variable to compare with. I haven't tried using this outside of a form update, but it may work. "pidVar" is already defined within the Mldef files, and I use it frequently within chart updates. PID is the patient identifier used for MUActivityLog. Try:
Filter: pidFilter, PID = pidVar Hidden
MUActivityLogTypeId isn't a string but a number. I would switch the field to be:
Field: MUActivityLogTypeId Type: ID Hidden
It could also be a DOUBLE, but that ends up making it look like 510.00 which is no fun. Keep in mind that after making changes to mldefs, you have to log ALL the way out (clicking "Exit" on the log-in window). Once you log in again, it will reload all the mldefs, usr files, CCC files, etc.