I have a form that has a date field and multiple document variables. I have tied all the document variables to obs terms, but I cant figure out how to get the obs to record on the date field instead of the date the update is signed. The date field is a document variable that is a string that automatically adds the 1 to each field and inserts the dates for a week. Here is a screen shot:
Date field is the third argument, so like -
{OBSNOW("BG POSTBRKFT",DOCUMENT.BR_A1,DOCUMENT.DATE1)}
Be careful with this method though because 1) you can't undo an observation to a previous date with MEL 2) you would have to enter a date first because of #1 and it will evaluate anytime you change either variable. Usually I either save previous observations with an action button, save a separate observation with the date and tie them later, or include the date as part of the observation value.
How do I include the date as part of the observation value with the form being set up the way it is? I need to keep the workflow the same, but need it all tied to obs because we are going to let patients start sending home sugars in via the patient portal and I need it all to go to the flow sheet. Not sure what I should do??
So the patient sets the date and there is an import function? You could just do
{if document.date1 <> "" then OBSNOW("BG POSTBRKFT",DOCUMENT.BR_A1,DOCUMENT.DATE1) else "" endif} that will require a date first, but you may still have issues if someone changes the date again it will record on both dates...
Well, it will happen 2 ways. The form here is the one the nurse will use to enter sugars that are physically brought in by the patient. The one on the portal will have matching fields that are connected to obs terms that will auto import once the nurse signs the document off. So, the portal one does exactly as it is supposed to do. This form is not cooperating on going in the correct date. Here is how the date field is set:
Field 1:{cfmt(DOCUMENT.DATE_EDIT,"',"","","")}
Field 2: {adddates (str(DOCUMENT.DATE_EDIT),"","","1")}
I sent too early. The dates keep adding a 1 so that the date auto fills a whole week from the date you enter. So if I pick 5/1, it will fill in 5/1- 5/8.
Another question:
How do I separate the values that I have linked to the obs term? Here is my statement,
{OBSNOW("BG AC BKFST",DOCUMENT.BR_B1 + DOCUMENT.BR_B2 + DOCUMENT.BR_B3 + DOCUMENT.BR_B4 + DOCUMENT.BR_B5 + DOCUMENT.BR_B6 + DOCUMENT.BR_B7)}
and here is how it goes in
Added new observation of BG AC BKFST: 111222333444555666777 mg/dL (05/09/2014 8:48)
I can't get it to separate, unless it is because the date isn't working? 5/1/14 = 111 5/2/14 = 222 etc
mbellis said:
I can't get it to separate, unless it is because the date isn't working? 5/1/14 = 111 5/2/14 = 222 etc
So if this is what you are looking for, it needs to be set up more like this I think-
{OBSNOW("BG AC BKFST",DOCUMENT.BR_B1,DOCUMENT.DATE_EDIT)}
{OBSNOW("BG AC BKFST",DOCUMENT.BR_B2,adddates(str(DOCUMENT.DATE_EDIT),"","","1"))}
{OBSNOW("BG AC BKFST",DOCUMENT.BR_B3,adddates(str(DOCUMENT.DATE_EDIT),"","","2"))}
Ok, I will try that. It makes sense. Thank you!
1) you can't undo an observation to a previous date with MEL
Michael - this IS possible, actually. I'm beginning to suspect I'm one of the first people to have figured it out. I'm thinking the community might benefit from a tips & tricks guide to MEL. Do you know if there is any current such effort?
How did you do it? I think I tried OBSNOW("HEIGHT","",document.date) and that didnt work and I was out of ideas...
Im not aware of such an effort, Id be more than happy to contribute to something though...
I'll pass along the MEL Tips and Tricks suggestion to the CHUG Technology committee, which is in charge of the web site. Thanks for the suggestion.
Have them PM me if they're interested, or we could start an open thread on the topic. Let me know if you do; I don't exactly notice everything on this forum. 🙂 A wiki would be a good way for multiple people to contribute, though a wiki can also get out of hand with too much rogue content.
Justin
As a novice MEL writer, I would love to see an open forum where I could look for tips and tricks.... Just my input!