SDES2VAL200 ;ALB/MGD/BLB - SDES2 NEW PERSON UTILITIES ;July 7, 2023
;;5.3;Scheduling;**853,875**;Aug 13, 1993;Build 25
;;Per VHA Directive 6402, this routine should not be modified
;
; Reference to ^VA(200 in #10060
; Reference to $$FIND1^DIC in ICR #2051
; Reference to $$ACTIVE^XUSER IN ICR #2343
; Reference to $$PROVIDER^XUSER IN ICE #2343
; Reference to $$ACTIVPRV^PXAPI IN ICR #2349
;
Q
;
VALUSERDUZ(SDERRORS,SDUSERDUZ,SDISREQUIRED) ; Validate DUZ
I SDUSERDUZ="",$G(SDISREQUIRED) D ERRLOG^SDES2JSON(.SDERRORS,441) Q
I SDUSERDUZ="" Q
I '$D(^VA(200,SDUSERDUZ,0)) D ERRLOG^SDES2JSON(.SDERRORS,442,""_SDUSERDUZ) Q
I $$GET1^DIQ(200,SDUSERDUZ,.01,"E")="SDESOITEAS,SRV" Q
I '$$ACTIVE^XUSER(SDUSERDUZ) D ERRLOG^SDES2JSON(.SDERRORS,458)
Q
;
VALPROVIDER(SDERRORS,SDPROV,SDISREQUIRED) ; Validate Provider
N SDPROVSTATUS
I SDPROV="",$G(SDISREQUIRED) D ERRLOG^SDES2JSON(.SDERRORS,53) Q
I SDPROV="" Q
I '$D(^VA(200,SDPROV,0)) D ERRLOG^SDES2JSON(.SDERRORS,54) Q
S SDPROVSTATUS=$$PROVIDER^XUSER(SDPROV)
I '+SDPROVSTATUS D
. I $P(SDPROVSTATUS,U,2)="NOT A PROVIDER" D ERRLOG^SDES2JSON(.SDERRORS,52,"User is not a provider."_SDPROV) Q
. I $P(SDPROVSTATUS,U,2)="TERMINATED" D ERRLOG^SDES2JSON(.SDERRORS,460,SDPROV) Q
I '$$ACTIVPRV^PXAPI(SDPROV,DT) D ERRLOG^SDES2JSON(.SDERRORS,460) Q ;DBIA #2349
Q
;
VALACTIVUSER(SDERRORS,SDUSERDUZ) ; Active User
Q '$$ACTIVE^XUSER(SDUSERDUZ)
;
VALSECID(SDERRORS,SDSECID) ;
I SDSECID="" Q
I $L(SDSECID)<3!$L(SDSECID)>40 D ERRLOG^SDES2JSON(.SDERRORS,156) Q
I '$$FIND1^DIC(200,,"X",SDSECID,"ASECID",,"SCERR") D ERRLOG^SDES2JSON(.SDERRORS,156)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDES2VAL200 1638 printed Oct 16, 2024@18:55:17 Page 2
SDES2VAL200 ;ALB/MGD/BLB - SDES2 NEW PERSON UTILITIES ;July 7, 2023
+1 ;;5.3;Scheduling;**853,875**;Aug 13, 1993;Build 25
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 ;
+4 ; Reference to ^VA(200 in #10060
+5 ; Reference to $$FIND1^DIC in ICR #2051
+6 ; Reference to $$ACTIVE^XUSER IN ICR #2343
+7 ; Reference to $$PROVIDER^XUSER IN ICE #2343
+8 ; Reference to $$ACTIVPRV^PXAPI IN ICR #2349
+9 ;
+10 QUIT
+11 ;
VALUSERDUZ(SDERRORS,SDUSERDUZ,SDISREQUIRED) ; Validate DUZ
+1 IF SDUSERDUZ=""
IF $GET(SDISREQUIRED)
DO ERRLOG^SDES2JSON(.SDERRORS,441)
QUIT
+2 IF SDUSERDUZ=""
QUIT
+3 IF '$DATA(^VA(200,SDUSERDUZ,0))
DO ERRLOG^SDES2JSON(.SDERRORS,442,""_SDUSERDUZ)
QUIT
+4 IF $$GET1^DIQ(200,SDUSERDUZ,.01,"E")="SDESOITEAS,SRV"
QUIT
+5 IF '$$ACTIVE^XUSER(SDUSERDUZ)
DO ERRLOG^SDES2JSON(.SDERRORS,458)
+6 QUIT
+7 ;
VALPROVIDER(SDERRORS,SDPROV,SDISREQUIRED) ; Validate Provider
+1 NEW SDPROVSTATUS
+2 IF SDPROV=""
IF $GET(SDISREQUIRED)
DO ERRLOG^SDES2JSON(.SDERRORS,53)
QUIT
+3 IF SDPROV=""
QUIT
+4 IF '$DATA(^VA(200,SDPROV,0))
DO ERRLOG^SDES2JSON(.SDERRORS,54)
QUIT
+5 SET SDPROVSTATUS=$$PROVIDER^XUSER(SDPROV)
+6 IF '+SDPROVSTATUS
Begin DoDot:1
+7 IF $PIECE(SDPROVSTATUS,U,2)="NOT A PROVIDER"
DO ERRLOG^SDES2JSON(.SDERRORS,52,"User is not a provider."_SDPROV)
QUIT
+8 IF $PIECE(SDPROVSTATUS,U,2)="TERMINATED"
DO ERRLOG^SDES2JSON(.SDERRORS,460,SDPROV)
QUIT
End DoDot:1
+9 ;DBIA #2349
IF '$$ACTIVPRV^PXAPI(SDPROV,DT)
DO ERRLOG^SDES2JSON(.SDERRORS,460)
QUIT
+10 QUIT
+11 ;
VALACTIVUSER(SDERRORS,SDUSERDUZ) ; Active User
+1 QUIT '$$ACTIVE^XUSER(SDUSERDUZ)
+2 ;
VALSECID(SDERRORS,SDSECID) ;
+1 IF SDSECID=""
QUIT
+2 IF $LENGTH(SDSECID)<3!$LENGTH(SDSECID)>40
DO ERRLOG^SDES2JSON(.SDERRORS,156)
QUIT
+3 IF '$$FIND1^DIC(200,,"X",SDSECID,"ASECID",,"SCERR")
DO ERRLOG^SDES2JSON(.SDERRORS,156)
+4 QUIT