Is there anyway to pull something from the database to display in the patient banner if there is no symbol or variable available?
Please email me at [email protected]
Id be interested as well.
Yes! I've done it a number of times. (I'll email this to you as well.)
We wanted to pull a few fields off the PatientProfile table. These are calculated fields that I added myself, so don't be confused when you don't recognize them. The first thing to do is to create a data object in one of the mldefs files. We use mldefs3.txt. The object looks like this:
///////////////////////////////////// //NEW / ESTABLISHED PATIENT ///////////////////////////////////// Object: _EstablishedPatient Table: PATIENTPROFILE Refresh: RBook Property: Snapshot Property: Prepare Field: NewEstPatient Type: String Length: 25 Field: ContactByMId Type: Long Field: PioneerACO Type: String Length: 20 Field: FinancialClass Type: String Length: 50 Filter: PatientFilter, PatientProfileId = Patient.PatientProfileId Hidden
It's called that because we originally created it solely to bring in new/established patient status, but as you can see we've added a few other things since then.
Truth be told, I don't know what Refresh and Property are for. I simply copied them from another pre-existing data object and they worked. I also mimicked the format of the Field and Filter entries. This lets me grab any field I want from the PatientProfile table.
Next we added this declaration to mellib.txt:
global _MELNewEstPatient = _EstablishedPatient
That declares the data object and gives CPS access to it by the name _MELNewEstPatient. If you're in a Citrix environment, make sure you update these two files on each server. Same goes for any local installs.
Finally, we added this to our patient banner:
{! fn NEW_ESTABLISHED(){ local a = getRow("_MELNewEstPatient",0,"NewEstPatient") return a }}{NEW_ESTABLISHED()}
And that did the trick. And now that I've explained it here, I'm thinking this would be a perfect topic for a blog post! 🙂 (shameless plug: http://www.the-mosi.net/geblog)