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

DBTSUPCH.m

Go to the documentation of this file.
  1. DBTSUPCH ;BAO/DMH call from SQL to change date on log [ 02/04/1999 2:19 PM ]
  1. ; for Keith to test update mode of data coming to him
  1. ;
  1. ;
  1. ; this program is called from the DBTS CHANGE LOG remote proc.
  1. ; call sends patient id saying that load to SQL was complete.
  1. ; so remove the temporary global on the patient log before
  1. ; the load started
  1. ;
  1. ;
  1. START ;
  1. ;
  1. CHG(DBTSRET,DBTSP) ;dbtsret is return value, dbtsp input value of patient ien
  1. ;
  1. ;
  1. TEST ;
  1. S ARRAY=0
  1. S OK="N"
  1. ;S DBTSP=13052 ;uncomment if want to test with call to TEST directly
  1. ;
  1. S DBTSRET(1)="-1" ; -1 if no data in file
  1. Q:'$D(^DBTSPAT(DBTSP))
  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")_"|1419200CHG|"_DBTSP
  1. F NODE="ALB","AMP","BP","BRE","CHO","CRE","DEN","EDU","EKG","EYE" D SET
  1. F NODE="FAM","FTC","FTE","HAC","HDL","HT","IMM","LDL","MED","PEL" D SET
  1. F NODE="PPD","REC","TRI","WT","LIP","REN" D SET
  1. I OK="N" S DBTSRET(1)=-2 Q ;no changes to data log
  1. S DBTSRET(1)=DBTS("ID")_U_DBTS("LOC")_U_DBTSP_U_"CHANGED"
  1. Q
  1. SET ;
  1. I $D(^DBTSPAT(DBTSP,NODE)) S $P(^DBTSPAT(DBTSP,NODE),"^",2)=2980301 S OK="Y"
  1. Q