source: FOIAVistA/trunk/r/NATIONAL_DRUG_FILE-PSN/PSNVUID.m

Last change on this file was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.8 KB
Line 
1PSNVUID ;BHM/DB - Populate VUIDs at site; 07/14/05 8:31
2 ;;4.0; NATIONAL DRUG FILE;**101**; 30 Oct 98
3 ;Reference to SETSTAT^HDISVF01 supported by DBIA #4640
4 K ^XTMP($J)
5 F PSNFILE=50.68,50.416,50.605,50.6 S PSN1=0 S PSNRT=$S(PSNFILE=50.68:"^PSNDF",PSNFILE=50.6:"^PSNDF",1:"^PS") D 1
6 G Q
7 ;Move data from PSNFILE, 50.416, 50.605 & 50.6 to transport global
81 S PSN1=$O(@PSNRT@(PSNFILE,PSN1)) Q:PSN1'>0 S PSNSUB="PSN"_PSNFILE_"TRM"
9 S @XPDGREF@(PSNSUB,PSN1)=$G(@PSNRT@(PSNFILE,PSN1,"VUID")),PSN2=0
102 S PSN2=$O(@PSNRT@(PSNFILE,PSN1,"TERMSTATUS",PSN2)) G 1:PSN2'>0
11 S PSNDATA=$G(@PSNRT@(PSNFILE,PSN1,"TERMSTATUS",PSN2,0)) S @XPDGREF@(PSNSUB,PSN1,PSN2)=PSNDATA
12 G 2
13Q K PSN1,PSN2,PSNSUB,PSNDATA,PSNFILE Q
14PSNUNLD ;Unload transport global and set data
15 D SEED F PSNFILE=50.68,50.416,50.605,50.6 S PSN1=0,PSNSUB="PSN"_PSNFILE_"TRM",PSNRT=$S(PSNFILE=50.68:"^PSNDF",PSNFILE=50.6:"^PSNDF",1:"^PS") K @PSNRT@(PSNFILE,"AMASTERVUID"),@PSNRT@(PSNFILE,"AVUID") D UN1
16 G Q
17UN1 S PSN1=$O(@XPDGREF@(PSNSUB,PSN1)) G DONE:PSN1'>0 S PSN2=0
18 S PSNDATA=@XPDGREF@(PSNSUB,PSN1),@PSNRT@(PSNFILE,PSN1,"VUID")=PSNDATA
19 S @PSNRT@(PSNFILE,"AVUID",$P(PSNDATA,"^",1),PSN1)=""
20 S PSNVUID=PSNDATA
21 K @PSNRT@(PSNFILE,PSN1,"TERMSTATUS")
22UN2 S PSN2=$O(@XPDGREF@(PSNSUB,PSN1,PSN2)) G UN1:PSN2'>0 S PSNDATA=$G(@XPDGREF@(PSNSUB,PSN1,PSN2))
23 S @PSNRT@(PSNFILE,PSN1,"TERMSTATUS",PSN2,0)=PSNDATA
24 S @PSNRT@(PSNFILE,"AMASTERVUID",$P(PSNVUID,"^",1),PSN2,PSN1)=""
25 S @PSNRT@(PSNFILE,PSN1,"TERMSTATUS",0)=$S(PSNFILE=50.68:"^50.6899DA^1^1",PSNFILE=50.416:"^50.4169DA^1^1",PSNFILE=50.605:"^50.60509DA^1^1",1:"^50.6009^1^1")
26 S @PSNRT@(PSNFILE,PSN1,"TERMSTATUS","B",$P(PSNDATA,"^",1),PSN2)=""
27 G UN2
28DONE Q
29SEED S X="HDISVF01" X ^%ZOSF("TEST") I D SEED1
30 Q
31SEED1 D SETSTAT^HDISVF01(50.68,.01,6,DT)
32 D SETSTAT^HDISVF01(50.6,.01,6,DT)
33 D SETSTAT^HDISVF01(50.605,.01,6,DT)
34 D SETSTAT^HDISVF01(50.416,.01,6,DT)
35 Q
Note: See TracBrowser for help on using the repository browser.