SDEC59 ;ALB/SAT - VISTA SCHEDULING RPCS ;APR 08, 2016
;;5.3;Scheduling;**642**;Aug 13, 1993;Build 23
;
Q
;
GETSITES(SDECY) ;GET active National VA site names and station numbers
N IEN,IEN,NM,SDECI,STN
S SDECY="^TMP(""SDEC59"","_$J_",""GETSTNS"")"
K @SDECY
S SDECI=0
S @SDECY@(SDECI)="T00050NAME^T00010STATION_NUMBER"_$C(30)
S NM="" F S NM=$O(^DIC(4,"B",NM)) Q:NM="" D
.S IEN=$O(^DIC(4,"B",NM,""))
.Q:($P(^DIC(4,IEN,0),U,11)'="N") ;national entries only
.Q:$P($G(^DIC(4,IEN,99)),U,4) ;skip inactive
.S STN=$P($G(^DIC(4,IEN,99)),U) ;get station number
.Q:STN']"" ;skip sites with no station number
.S SDECI=SDECI+1
.S @SDECY@(SDECI)=NM_U_STN_$C(30)
S @SDECY@(SDECI)=@SDECY@(SDECI)_$C(31)
Q
;
NETLOC(SDECY,LOCATION) ;GET data from the NETWORK LOCATION file 2005.2
;INPUT:
; LOCATION - (optional) name for ID pointer to NETWORK LOCATION file 2005.2
; null will default to VISTASITESERVICE
;RETURN:
; 1. LOCATION_IEN - pointer to NETWORK LOCATION file 2005.2
; 2. LOCATION_NAME - name from NETWORK LOCATION file
; 3. PHYSICAL_REF - PHYCICAL REFERENCE field (free-text)
N SD,SDECI
N IEN,NAME,REF
S SDECI=0
S SDECY="^TMP(""SDEC59"","_$J_",""NETLOC"")"
K @SDECY
S @SDECY@(SDECI)="T00030LOCATION_IEN^T00030LOCATION_NAME^T00030PHYSICAL_REF"_$C(30)
S LOCATION=$G(LOCATION)
I LOCATION="" S LOCATION="VISTASITESERVICE"
I LOCATION'="" D
.D FIND^DIC(2005.2,,"1","MO",LOCATION,,,,,"SD")
.S IEN=$G(SD("DILIST",2,1))
.S NAME=$G(SD("DILIST",1,1))
.S REF=$G(SD("DILIST","ID",1,1))
.S SDECI=SDECI+1 S @SDECY@(SDECI)=IEN_U_NAME_U_REF_$C(30)
S @SDECY@(SDECI)=@SDECY@(SDECI)_$C(31)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDEC59 1679 printed Dec 13, 2024@02:50:59 Page 2
SDEC59 ;ALB/SAT - VISTA SCHEDULING RPCS ;APR 08, 2016
+1 ;;5.3;Scheduling;**642**;Aug 13, 1993;Build 23
+2 ;
+3 QUIT
+4 ;
GETSITES(SDECY) ;GET active National VA site names and station numbers
+1 NEW IEN,IEN,NM,SDECI,STN
+2 SET SDECY="^TMP(""SDEC59"","_$JOB_",""GETSTNS"")"
+3 KILL @SDECY
+4 SET SDECI=0
+5 SET @SDECY@(SDECI)="T00050NAME^T00010STATION_NUMBER"_$CHAR(30)
+6 SET NM=""
FOR
SET NM=$ORDER(^DIC(4,"B",NM))
if NM=""
QUIT
Begin DoDot:1
+7 SET IEN=$ORDER(^DIC(4,"B",NM,""))
+8 ;national entries only
if ($PIECE(^DIC(4,IEN,0),U,11)'="N")
QUIT
+9 ;skip inactive
if $PIECE($GET(^DIC(4,IEN,99)),U,4)
QUIT
+10 ;get station number
SET STN=$PIECE($GET(^DIC(4,IEN,99)),U)
+11 ;skip sites with no station number
if STN']""
QUIT
+12 SET SDECI=SDECI+1
+13 SET @SDECY@(SDECI)=NM_U_STN_$CHAR(30)
End DoDot:1
+14 SET @SDECY@(SDECI)=@SDECY@(SDECI)_$CHAR(31)
+15 QUIT
+16 ;
NETLOC(SDECY,LOCATION) ;GET data from the NETWORK LOCATION file 2005.2
+1 ;INPUT:
+2 ; LOCATION - (optional) name for ID pointer to NETWORK LOCATION file 2005.2
+3 ; null will default to VISTASITESERVICE
+4 ;RETURN:
+5 ; 1. LOCATION_IEN - pointer to NETWORK LOCATION file 2005.2
+6 ; 2. LOCATION_NAME - name from NETWORK LOCATION file
+7 ; 3. PHYSICAL_REF - PHYCICAL REFERENCE field (free-text)
+8 NEW SD,SDECI
+9 NEW IEN,NAME,REF
+10 SET SDECI=0
+11 SET SDECY="^TMP(""SDEC59"","_$JOB_",""NETLOC"")"
+12 KILL @SDECY
+13 SET @SDECY@(SDECI)="T00030LOCATION_IEN^T00030LOCATION_NAME^T00030PHYSICAL_REF"_$CHAR(30)
+14 SET LOCATION=$GET(LOCATION)
+15 IF LOCATION=""
SET LOCATION="VISTASITESERVICE"
+16 IF LOCATION'=""
Begin DoDot:1
+17 DO FIND^DIC(2005.2,,"1","MO",LOCATION,,,,,"SD")
+18 SET IEN=$GET(SD("DILIST",2,1))
+19 SET NAME=$GET(SD("DILIST",1,1))
+20 SET REF=$GET(SD("DILIST","ID",1,1))
+21 SET SDECI=SDECI+1
SET @SDECY@(SDECI)=IEN_U_NAME_U_REF_$CHAR(30)
End DoDot:1
+22 SET @SDECY@(SDECI)=@SDECY@(SDECI)_$CHAR(31)
+23 QUIT