SDECVVC ;ALB/WTC - VISTA SCHEDULING RPCS ;JUN 12, 2020@10:15
;;5.3;Scheduling;**756**;Aug 13, 1993;Build 43
;;Per VHA Directive 2004-038, this routine should not be modified
;
Q ;
;
VVCAPPT(SDECY,SDECAPPT) ;
;
; SDEC VVC_APPT RPC
;
; Returns VVC Web app URL if appointment is for VVC clinic or null if not.
;
; SDECAPPT = Appointment (pointer to #409.84)
;
S SDECY="^TMP(""SDECSTNG"","_$J_",""VVC_APPT"")" ;
K @SDECY ;
;
S @SDECY@(0)="T01000URL"_$C(30) ;
;
I +$G(SDECAPPT)=0 S @SDECY@(1)=$C(30)_$C(31) Q ;
I '$D(^SDEC(409.84,SDECAPPT)) S @SDECY@(1)=$C(30)_$C(31) Q ;
;
N SDECRES,SDEC44,SDECSTOP,SDECREDT ;
;
; Appointment's resource
;
S SDECRES=$P($G(^SDEC(409.84,SDECAPPT,0)),U,7) I 'SDECRES S @SDECY@(1)=$C(30)_$C(31) Q ;
;
; Resource's clinic
;
S SDEC44=$P($G(^SDEC(409.831,SDECRES,0)),U,4) I 'SDEC44 S @SDECY@(1)=$C(30)_$C(31) Q ;
;
; Clinic's stop code and credit stop code.
;
S SDECSTOP=$P($G(^SC(SDEC44,0)),U,7),SDECREDT=$P(^(0),U,18) ;
I SDECSTOP S SDECSTOP=$P($G(^DIC(40.7,SDECSTOP,0)),U,2) ;
I SDECREDT S SDECREDT=$P($G(^DIC(40.7,SDECREDT,0)),U,2) ;
;
I 'SDECSTOP,'SDECREDT S @SDECY@(1)=$C(30)_$C(31) Q ; No stop codes so no URL.
;
; If clinic's stop code or credit stop code is for VVC, return URL for VVC Web app
;
I SDECSTOP'="",$O(^SDEC(409.98,1,3,"B",SDECSTOP,0))>0 S @SDECY@(1)=$G(^SDEC(409.98,1,2))_$C(30)_$C(31) Q ;
I SDECREDT'="",$O(^SDEC(409.98,1,3,"B",SDECREDT,0))>0 S @SDECY@(1)=$G(^SDEC(409.98,1,2))_$C(30)_$C(31) Q ;
;
; Not a VVC clinic.
;
S @SDECY@(1)=$C(30)_$C(31) Q ;
;
Q ;
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDECVVC 1623 printed Nov 22, 2024@18:02:56 Page 2
SDECVVC ;ALB/WTC - VISTA SCHEDULING RPCS ;JUN 12, 2020@10:15
+1 ;;5.3;Scheduling;**756**;Aug 13, 1993;Build 43
+2 ;;Per VHA Directive 2004-038, this routine should not be modified
+3 ;
+4 ;
QUIT
+5 ;
VVCAPPT(SDECY,SDECAPPT) ;
+1 ;
+2 ; SDEC VVC_APPT RPC
+3 ;
+4 ; Returns VVC Web app URL if appointment is for VVC clinic or null if not.
+5 ;
+6 ; SDECAPPT = Appointment (pointer to #409.84)
+7 ;
+8 ;
SET SDECY="^TMP(""SDECSTNG"","_$JOB_",""VVC_APPT"")"
+9 ;
KILL @SDECY
+10 ;
+11 ;
SET @SDECY@(0)="T01000URL"_$CHAR(30)
+12 ;
+13 ;
IF +$GET(SDECAPPT)=0
SET @SDECY@(1)=$CHAR(30)_$CHAR(31)
QUIT
+14 ;
IF '$DATA(^SDEC(409.84,SDECAPPT))
SET @SDECY@(1)=$CHAR(30)_$CHAR(31)
QUIT
+15 ;
+16 ;
NEW SDECRES,SDEC44,SDECSTOP,SDECREDT
+17 ;
+18 ; Appointment's resource
+19 ;
+20 ;
SET SDECRES=$PIECE($GET(^SDEC(409.84,SDECAPPT,0)),U,7)
IF 'SDECRES
SET @SDECY@(1)=$CHAR(30)_$CHAR(31)
QUIT
+21 ;
+22 ; Resource's clinic
+23 ;
+24 ;
SET SDEC44=$PIECE($GET(^SDEC(409.831,SDECRES,0)),U,4)
IF 'SDEC44
SET @SDECY@(1)=$CHAR(30)_$CHAR(31)
QUIT
+25 ;
+26 ; Clinic's stop code and credit stop code.
+27 ;
+28 ;
SET SDECSTOP=$PIECE($GET(^SC(SDEC44,0)),U,7)
SET SDECREDT=$PIECE(^(0),U,18)
+29 ;
IF SDECSTOP
SET SDECSTOP=$PIECE($GET(^DIC(40.7,SDECSTOP,0)),U,2)
+30 ;
IF SDECREDT
SET SDECREDT=$PIECE($GET(^DIC(40.7,SDECREDT,0)),U,2)
+31 ;
+32 ; No stop codes so no URL.
IF 'SDECSTOP
IF 'SDECREDT
SET @SDECY@(1)=$CHAR(30)_$CHAR(31)
QUIT
+33 ;
+34 ; If clinic's stop code or credit stop code is for VVC, return URL for VVC Web app
+35 ;
+36 ;
IF SDECSTOP'=""
IF $ORDER(^SDEC(409.98,1,3,"B",SDECSTOP,0))>0
SET @SDECY@(1)=$GET(^SDEC(409.98,1,2))_$CHAR(30)_$CHAR(31)
QUIT
+37 ;
IF SDECREDT'=""
IF $ORDER(^SDEC(409.98,1,3,"B",SDECREDT,0))>0
SET @SDECY@(1)=$GET(^SDEC(409.98,1,2))_$CHAR(30)_$CHAR(31)
QUIT
+38 ;
+39 ; Not a VVC clinic.
+40 ;
+41 ;
SET @SDECY@(1)=$CHAR(30)_$CHAR(31)
QUIT
+42 ;
+43 ;
QUIT
+44 ;