Hello,
I would like to return the last 5 obs values for the same obsterm but each value to show in separate edit fields. I am trying to use this function, which works, but I do not want the date and timestamp to show.
{global obsarray = (LIST_OBS("Weight",
"signed", "list","valuedate"),")","(,")
sub(obsarray,1,3)}
When I change "valuedate" to "value", nothing gets returned.
Any help is appreciated.
Thank you!
the issue is with your definition of obsarray. try this instead;
global obsarray = Listobs("Weight","signed","list","value")
Thanks Ken. This does get rid of the date, but it returns all obs values. When I use sub(obsarray,1,1) it only returns the first character of the first obs value. I would like to return the whole value for the first obs value into and edit field and then the second obs value into another edit field (sub(obsarray,2,2)) and so on and so on for the last 5 obs values.
I think you will need to create a looping array and subarray. I might be able to work on this tomorrow or the following day as I am clinical staff and we have clinic and OR cases
{global obsarray = (Listobs("Weight","signed","list","value")
count = 0
result = ""
for count = 1, count < 5,count = count + 1
do
subarray = getfield(obsarray[count],",","")
result = subarray[1]
document.editfield[count] = result
endfor
}
just off the top of my head
Ken, I am not able to get this to work. I may be using this incorrectly.
Ok i will take a look in the next couple of days and get back with you if I have a chance to work on it
Thank you!