Looking for a function to pull in patient's contact list. I have looked at a variety of objects in mldefs8.txt, e.g. Contact, PersonalRelation, ProviderRelation without success. Clearly I am missing a concept. Has anybody solved this? Code example as follows:
/*retrieve Contacts*/
{fn Get_Contacts()
{
local strMDs=""
local i=0
local iMax=1
iMax=getRowCount("Contact")
userok(str(iMax))
for i=1,i<=iMax,i=i+1 do
strMDs=strMDs+HRET+getRow("Contact",i,"Name")
endfor
return strMDs
}
}
Just make a call to REGRELATIVE() in the code. You should get a return then.
Closer. This retrieves providers with relationship of type "Other". What I want is relationship type "Referring Provider". Any thoughts.
You'll need to pull in another object (PersonalRelation), this should get your result:
{fn Get_Contacts(){
REGRELATIVE()
local strMDs=""
local strRelation = ""
local strPID = ""
local i=0
local iMax=1
iMax=getRowCount("Contact")
for i=1,i<=iMax,i=i+1 do
strPID = str(getrow("Contact",i, "PID"))
strRelation = find("PersonalRelation","RelationName","PERID",strPID)
if strRelation == "Referring Physician" then
strMDs=strMDs+HRET+getRow("Contact",i,"Name")
else ""
endif
endfor
return strMDs
}}
The "PID" field does not return a value. "PID" is not one of the field names listed in the Contact object. The PatientContacts table is joined to the PatientRelationship table. There is a hidden field "PatientRelationship.PID" is listed, but I cannot access it.
Is there some other function call beside REGRELATIVE() that will filter the table?
Understand if you can't provide any additional help, this is very arcane.
Here are two functions I use to call Providers from patient contacts and pharmacy from patient contacts. I didn't update the comments for the provider one (it is modified from the pharmacy one) so if they don't make sense thats why, but they work for me on CPS 10.1.1.189
{fn fnProvLists(){
local lCounter
local lPharArray
local lStart
local lBuffer
local lFormattedList = ""
local l_FormattedList = ""
local StrList
local Resarray
StrList = str(PATIENT.CONTACTS)
/* Create array of Phar */
lPharArray = getfield(strList, "|", "")
for lCounter = 1, lCounter <= size(lPharArray), lCounter = lCounter + 1 do
/* Create array for each Phar */
lPharArray[lCounter] = getfield(lPharArray[lCounter],"^","")
/* Need to remove commas from Med name */
/*lBuffer = ReplaceStr(lPharArray[lCounter][2], ",", " ")*/
/* Append Med and ICD-9 code to formatted list */
if (match(lPharArray[lCounter],"Provider")>0) then
lFormattedList = lFormattedList + lPharArray[lCounter][1] + ","/* + hret + lPharArray[lCounter][5] + hret + lPharArray[lCounter][7] + ", " + lPharArray[lCounter][8] + " " + lPharArray[lCounter][9]*/
else "" endif
endfor
/* Remove trailing comma */
if (lCounter > 1) then
lFormattedList = remove(lFormattedList, size(lFormattedList))
endif
Resarray = getfield(lFormattedList,",","")
for j = 1, j <= size(Resarray), j = j+2 do
l_FormattedList = l_FormattedList + Resarray[j + 1] + " " + Resarray[j] + ","
endfor
/* Remove trailing comma */
if (lCounter > 1) then
l_FormattedList = remove(l_FormattedList, size(l_FormattedList))
endif
/* Return comma separated list */
return (l_FormattedList)
}}
{fn fnPharLists(){
local lCounter
local lPharArray
local lStart
local lBuffer
local lFormattedList = ""
local StrList
StrList = str(PATIENT.CONTACTS)
/* Create array of Phar */
lPharArray = getfield(strList, "|", "")
for lCounter = 1, lCounter <= size(lPharArray), lCounter = lCounter + 1 do
/* Create array for each Phar */
lPharArray[lCounter] = getfield(lPharArray[lCounter],"^","")
/* Need to remove commas from Med name */
/*lBuffer = ReplaceStr(lPharArray[lCounter][2], ",", " ")*/
/* Append Med and ICD-9 code to formatted list */
if (match(lPharArray[lCounter],"Pharmacy")>0) then
lFormattedList = lFormattedList + lPharArray[lCounter][1] + hret + lPharArray[lCounter][5] + hret + lPharArray[lCounter][7] + ", " + lPharArray[lCounter][8] + " " + lPharArray[lCounter][9]
else "" endif
endfor
/* Remove trailing comma */
if (lCounter > 1) then
lFormattedList = remove(lFormattedList, size(lFormattedList))
endif
/* Return comma separated list */
return (lFormattedList)
}}
Adjust your counter (i) to start at zero rather than 1; it think it is zero based.
Running CPS 11, this code (along with any other use of patient.contacts) seems to lock up the system.
I've asked our GE reps and implementation support staff repeatedly about this but have never gotten a response.
Any help would be appreciated.
Rob
Same issue here, had numerous GE & VAR reps look into it, and they can't seem to figure out what causes the delay (we're talking like a full min and half for it to return info!). GE first told us move JBOSS to a new server; when that didn't work they said it was a SQL login that "some plugin" uses to run that was the issue. We deleted the sql login and re-configured pretty much everything under the sun to no avail.
Finally I gave up and figured out another way for us to get the info we needed. Lots of time wasted and still nothing helpful. Surprising, I know...