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

DBTSBEGO.m

Go to the documentation of this file.
  1. DBTSBEG ;BAO/DMH begin load of patient to sql call [ 02/04/1999 4:52 PM ]
  1. ;
  1. ;
  1. ; this program is called from the DBTS ADD PATIENT BEGIN remote proc.
  1. ; if it is not already in the
  1. ;
  1. ;
  1. START ;
  1. ;
  1. BEG(DBTSRET,DBTSP) ;dbtsret is return value, dbtsp input value of patient ien
  1. ;
  1. ;
  1. TEST ;
  1. S ARRAY=0
  1. ;S DBTSP=13051 ;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" Q
  1. S DBTS("ID")=DBTS("LOC")_"|1419200BEG|"_DBTSP
  1. I '$D(^DBTSPAT(DBTSP)) D G SET
  1. .K ^DBTSPAT("B",DBTSP)
  1. .S X=DBTSP,DINUM=X,DIC(0)="XNL",DIC="^DBTSPAT(" D FILE^DICN
  1. ; put the patient log information to a temporary holding
  1. I '$D(^DBTSPAT(DBTSP)) S DBTSRET(1)="-1" Q
  1. S NODE=""
  1. F S NODE=$O(^DBTSPAT(DBTSP,NODE)) Q:NODE="" D
  1. .S ^DBTS("TMP",DBTSP,NODE)=^DBTSPAT(DBTSP,NODE)
  1. .Q
  1. S ^DBTS("TMP",DBTSP,"ZZSAVEDON")=DT
  1. SET ;
  1. I '$D(^DBTSPAT(DBTSP)) S DBTSRET(1)="-1" Q
  1. E S DBTSRET(1)=DBTS("ID")_U_DBTS("LOC")_U_DBTSP_U_"BEGIN"
  1. Q