I'm working on a medication reconciliation form for the MAs do to at the start of an encounter. I want it set up like a chart so it lists all of the medications on their med lists and they can note whether the person is compliant or not and add comments. Ideally the names of the meds would autofill starting at 1, 2, 3 etc. so they would not have to click through them. I've got the function working well I'm just trying to figure out how to "set the values." Any ideas would be appreciated.
I'd also like to set up a chart in either handouts or a history view that lists each medication on a separate row in a table so the list can be printed for patients so nurses can do education.
Here's a copy of my in progress form. Any help would be appreciated!
Thanks!
As you loop through the MedArray, you could set document.med1 = MedArray[1][1]
Thanks for the tip! I've got it to work for some patients, but not others. It either works perfectly or it only displays the first letter of the med name for meds 2+. I've tried setting the values outside of the loop with and without using variables. I've attached the .dlg with the function that works for some patients, but not others. Also, I've attached screenshots of what is happening in the update.
When I run a Mel Trace it's pulling the medications correctly but only grabbing a piece of the string in the Meds_After position.
Am I missing something obvious? Or going about this in the entirely wrong way?
Any help is appreciated.
Have a great weekend!
Thanks,
Natalie
Med Rec 6.2.17
you are setting document.med1 in the for loop and then you set document.med1 again. Is there a reason you do this?
It was the only way I could get it to populate it. When I deleted either, the field stayed blank.
I would recommend MEL trace as you load the form.
I am trying to recreate it in my demo but everything looks file. The only issue I have is if the instruction has a comma.
Also can you send a picture of the dropdown list.
So I think I fixed the comma issue, but I still can't get the document variables to populate properly. Some patients it works perfectly and others does not. When I ran the MEL trace it was pulling the medication properly but returning one character for the medication name and one for the instruction. I couldn't even figure out what character it was spitting out for the instruction. I've attached the updated file and screenshot of the drop down.
I was able to recreate the issue in my demo and i noticed 2 things
if you look at mel trace you are calling fnMedList(strList) multiple times, ones for each drop down. you can have a declare strFormattedList as global which will act dropdown list for everything.
second thing mel trace showed was med2 and med were not being evaluated properly in the for loop. try something like below.
for i = 1, i <= size(MedArray), i = i + 1 do
MedArray[i] = getfield(MedArray[i], "^", "")
strMed = str(i) + ". " + MedArray[i][1] + " (Instructions: " + MedArray[i][7] + ")"
strMed = ReplaceStr(strMed,","," ")
strFormattedList= strFormattedList + strMed + ","
if i == 1 then
document.med1 = strMed
else if i==2 then
document.med2 = strMed
endif endif
endfor
I got it! Thank you so much for your help! I really appreciate it. The MAs, nurses and providers at the health center thank you too 🙂
I've attached the .dlg and handout code in case anyone else wants to use it!
Have a great week!
Natalie