Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DBTSVID

DBTSVID.m

Go to the documentation of this file.
  1. DBTSVID ;routine to send the visit id SQL for diabetes [ 11/16/1999 6:34 PM ]
  1. ; when the rpmsid is sent to me
  1. ;
  1. ;
  1. VID(DBTSGBL,DBTSRID) ;
  1. TEST ;
  1. K ^DBTSTEMP(1)
  1. S DBTSGBL="^DBTSTEMP("_1_")"
  1. S ARRAY=0
  1. ;S DBTSRID="404510|9000010.08|36309" ;uncomment if want to test with call to TEST directly
  1. ;
  1. D ^XBKVAR
  1. I DUZ(2)=4526 S DUZ(2)=2348
  1. S DBTS("LOC")=$P($G(^AUTTLOC(DUZ(2),0)),"^",10)
  1. ;I DBTS("LOC")="" S DBTSRET(1)="-1" S ^DBTSTEMP(1,1)="-1"_$C(13)_$C(10) Q
  1. ; dmh take of cr/lf per keith 11-16-99
  1. ;
  1. I DBTS("LOC")="" S DBTSRET(1)="-1" S ^DBTSTEMP(1,1)="-1"
  1. S DBTS("FILE")=$P(DBTSRID,"|",2)
  1. S DBTS("DFN")=$P(DBTSRID,"|",3)
  1. S GLOBAL=$G(^DIC(DBTS("FILE"),0,"GL"))
  1. I GLOBAL="" S ^DBTSTEMP(1,1)="-1" Q
  1. S GLOB=GLOBAL_DBTS("DFN")_",0)"
  1. S DBTS("VDFN")=$P(@GLOB,"^",3)
  1. I DBTS("VDFN")="" S ^DBTSTEMP(1,1)="-2" Q
  1. S VID=DBTS("LOC")_"|9000010|"_DBTS("VDFN")
  1. S ^DBTSTEMP(1,1)=VID
  1. Q