Does anyone know how to strip the time from this data symbol?
{LIST_OBS('FOLLOW-UP','update','list','valuedate')}.
Stacey LaGrange
Software Developer/Analyst
St. Mary's Health System
[email protected]
(207) 777-8410
use 'delimited' instead of 'list' and then use the first 2 fields.
Thanks, do you know what format I structure that in? I tried different ways but none are working.
description List all observation values, optionally with the date, of the specified observation term. type Data symbol function syntax LIST_OBS(observation,status,list_type,format) arguments
when to evaluate When Inserted in Note or continuously returns A list of observation values with optional dates for a specified observation term comment You must use the observation term short name. Arguments are not case-sensitive. example 1 {LIST_OBS('Weight','Signed','list',"valuedate")} returns: 122 (04/09/1999 3:14:00 PM) 122 (02/20/1999 10:08:00 AM) 121 (02/13/1999 2:37:00 PM) 121 (02/11/1999 4:23:00 PM) 122 (02/11/1999 9:01:00 AM) example 2 LIST_OBS(‘height’,’signed’,’delimited’,’valuedate’)} 71 (07/11/2003 11:20:00 AM)^07/11/2003^11:20:00 AM^Julius Hibbard^Julius Hibbard^^^^Westside^Office Visit^235|70 (07/11/2003 11:19:30 AM)^07/11/2003^11:19:30 AM^Julius Hibbard^Julius Hibbard^^^^Enterprise Clinic - ALL^Office Visit^234|71.5 (06/09/2003 2:13:50 PM)^06/09/2003^2:13:50 PM^Harry Winston MD^Harry Winston MD^^^^Eastside^Office Visit^89|72 (06/09/2003 2:13:20 PM)^06/09/2003^2:13:20 PM^Harry Winston MD^Harry Winston MD^^^^Westside^Office Visit^88|70 (06/09/2003 2:13:20 PM)^06/09/2003^2:13:20 PM^Harry Winston MD^Harry Winston MD^^^^Westside^Office Visit^87|71 (06/09/2003 2:12:50 PM)^06/09/2003^2:12:50 PM^Harry Winston MD^Harry Winston MD^^^^Enterprise Clinic - ALL^Office Visit^86 where used Encounter Forms, text components, letters, handouts and quick text |
Thanks I had actually found that in help and was able to replicate it but it doesnt say how to pull just the first two fields anywhere? For example like in Java someone may use charAt or other programs may use [1,2].
here's an example:
{fn FillArraysWithObs(ObsTerm, aTypes, aVals, aDates, aDatesConverted)
{
local count
local length
if LIST_OBS(ObsTerm, 'Pencil', 'list', 'valuedate')<>"" then
local obs_array1 = GETFIELD(LIST_OBS(ObsTerm, 'Pencil', 'list', 'valuedate'), hret, "")
length = SIZE(obs_array1)
for count = 1, count <= length, count = count + 1 do
if SIZE(obs_array1[count])>0
and MATCH(obs_array1[count], 1, "(")>0 then
local obs_array2 = GETFIELD(obs_array1[count], "(", "")
if SIZE(obs_array2)>2 then
obs_array2[1] = obs_array2[1] + "(" + obs_array2[2]
obs_array2[2] = obs_array2[3]
endif
INSERT(aTypes, 1, ObsTerm)
INSERT(aVals, 1, Trim(obs_array2[1]))
INSERT(aDates, 1, SUB(obs_array2[2], 1, 10))
INSERT(aDatesConverted, 1, ConvertDate(obs_array2[2]))
endif
endfor
endif
}
}
Great thanks! I will give this a try.
This isn't working for me but I really appreciate that you tried to help.
How are you trying to use/display it? This should get you a simple list of observations and dates
{fn listobsdateonly(obsname){
local obsarray1
local obsarray2
local obsreturn
obsarray1 = getfield(LISTOBS(obsname,'signed','delimited','value'),"|","")
for i = 1, i < size(obsarray1), i=i+1 do
obsarray2 = getfield(obsarray1[i],"^","")
if obsreturn <> "" then
obsreturn = obsreturn + hret
endif
obsreturn = obsreturn + obsarray2[1] + " " + obsarray2[2]
endfor
return obsreturn
}}
In a handout, this was the orginal data symbol that works great in there but I was trying to strip the time from:
{LIST_OBS('FOLLOW-UP','update','list','valuedate')}
Maybe I am not adding the function right to the handout.
Try:
{fn listobsdateonly(obsname){
local obsarray1
local obsarray2
local obsreturn
obsarray1 = getfield(LISTOBS(obsname,'update','delimited','value'),"|","")
for i = 1, i < size(obsarray1), i=i+1 do
obsarray2 = getfield(obsarray1[i],"^","")
if obsreturn <> "" then
obsreturn = obsreturn + hret
endif
obsreturn = obsreturn + obsarray2[1] + " (" + obsarray2[2] + ")"
endfor
return obsreturn
}}
Copy and paste the following into notepad, and then into the handout -
{fn listobsdateonly(obsname){
local obsarray1
local obsarray2
local obsreturn
obsarray1 = getfield(LISTOBS(obsname,'update','delimited','value'),"|","")
for i = 1, i < size(obsarray1), i=i+1 do
obsarray2 = getfield(obsarray1[i],"^","")
if obsreturn <> "" then
obsreturn = obsreturn + hret
endif
obsreturn = obsreturn + obsarray2[1] + " (" + obsarray2[2] + ")"
endfor
return obsreturn
}}{listobsdateonly('FOLLOW-UP')}
I was using almost the same as this {listobsdateonly('FOLLOW-UP')} but with " instead of ' and both work with another function I pasted in there. I can't get this new function to work though for some reason. If it is working for you both maybe I should retype the whole thing. It keeps saying function definition is not executable.
have to copy from here and paste into Notepad to remove any funky characters and then copy from Notepad and paste into your handout. make sure word wrap is not checked in Notepad under Format.
I messed up, it should be LIST_OBS, not LISTOBS, my bad
And also the parameter 'update' will only work in an active chart update, otherwise there is nothing to find and you get a void error, maybe we should replace 'update' with 'pencil' ? That would capture everything...