SDES2VALCONTEXT ;ALB/MGD,LAB - ACHERON CONTEXT VALIDATION UTILITIES ;SEP 01,2023
;;5.3;Scheduling;**853,860**;Aug 13, 1993;Build 12
;;Per VHA Directive 6402, this routine should not be modified
;
Q
;
VALCONTEXT(SDERRORS,SDCONTEXT) ; Validate SDCONTEXT Array
; Required Input Variables
D VALACHERONID(.SDERRORS,$G(SDCONTEXT("ACHERON AUDIT ID")))
; Optional Input Variables
I $G(SDCONTEXT("PATIENT DFN"))'="" D VALPATDFN^SDES2VAL2(.SDERRORS,SDCONTEXT("PATIENT DFN"))
I $G(SDCONTEXT("PATIENT ICN"))'="" D VALPATICN^SDES2VAL2(.SDERRORS,SDCONTEXT("PATIENT ICN"))
I $G(SDCONTEXT("USER DUZ"))'="" D VALUSERDUZ^SDES2VAL200(.SDERRORS,SDCONTEXT("USER DUZ"))
I $G(SDCONTEXT("USER SECID"))'="" D VALSECID^SDES2VAL200(.SDERRORS,SDCONTEXT("USER SECID"))
I '$D(SDERRORS) D
. D DUZSECIDMATCH(.SDERRORS,$G(SDCONTEXT("USER DUZ")),$G(SDCONTEXT("USER SECID")))
. D DFNICNMATCH(.SDERRORS,$G(SDCONTEXT("PATIENT DFN")),$G(SDCONTEXT("PATIENT ICN")))
Q
;
VALACHERONID(SDERRORS,SDACHERONID) ; Validate Acheron EAS ID
I SDACHERONID="" D ERRLOG^SDES2JSON(.SDERRORS,474) Q
I $$VALACHERONID^SDES2UTIL(SDACHERONID)=-1 D ERRLOG^SDES2JSON(.SDERRORS,475)
Q
;
DUZSECIDMATCH(SDERRORS,USERDUZ,USERSECID) ;verify that sent in values are for same user
N SECIDDUZ
I (USERDUZ'="")&(USERSECID'="") D
. S SECIDDUZ=$$FIND1^DIC(200,,"X",USERSECID,"ASECID",,"SCERR")
. I SECIDDUZ'=USERDUZ D ERRLOG^SDES2JSON(.SDERRORS,517)
Q
;
DFNICNMATCH(SDERRORS,PATDFN,PATICN) ;verify that sent in values are same for patient
I (PATDFN'="")&(PATICN'="") D
. I $O(^DPT("AICN",PATICN,""))'=PATDFN D ERRLOG^SDES2JSON(.SDERRORS,516)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDES2VALCONTEXT 1640 printed Oct 16, 2024@18:55:20 Page 2
SDES2VALCONTEXT ;ALB/MGD,LAB - ACHERON CONTEXT VALIDATION UTILITIES ;SEP 01,2023
+1 ;;5.3;Scheduling;**853,860**;Aug 13, 1993;Build 12
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 ;
+4 QUIT
+5 ;
VALCONTEXT(SDERRORS,SDCONTEXT) ; Validate SDCONTEXT Array
+1 ; Required Input Variables
+2 DO VALACHERONID(.SDERRORS,$GET(SDCONTEXT("ACHERON AUDIT ID")))
+3 ; Optional Input Variables
+4 IF $GET(SDCONTEXT("PATIENT DFN"))'=""
DO VALPATDFN^SDES2VAL2(.SDERRORS,SDCONTEXT("PATIENT DFN"))
+5 IF $GET(SDCONTEXT("PATIENT ICN"))'=""
DO VALPATICN^SDES2VAL2(.SDERRORS,SDCONTEXT("PATIENT ICN"))
+6 IF $GET(SDCONTEXT("USER DUZ"))'=""
DO VALUSERDUZ^SDES2VAL200(.SDERRORS,SDCONTEXT("USER DUZ"))
+7 IF $GET(SDCONTEXT("USER SECID"))'=""
DO VALSECID^SDES2VAL200(.SDERRORS,SDCONTEXT("USER SECID"))
+8 IF '$DATA(SDERRORS)
Begin DoDot:1
+9 DO DUZSECIDMATCH(.SDERRORS,$GET(SDCONTEXT("USER DUZ")),$GET(SDCONTEXT("USER SECID")))
+10 DO DFNICNMATCH(.SDERRORS,$GET(SDCONTEXT("PATIENT DFN")),$GET(SDCONTEXT("PATIENT ICN")))
End DoDot:1
+11 QUIT
+12 ;
VALACHERONID(SDERRORS,SDACHERONID) ; Validate Acheron EAS ID
+1 IF SDACHERONID=""
DO ERRLOG^SDES2JSON(.SDERRORS,474)
QUIT
+2 IF $$VALACHERONID^SDES2UTIL(SDACHERONID)=-1
DO ERRLOG^SDES2JSON(.SDERRORS,475)
+3 QUIT
+4 ;
DUZSECIDMATCH(SDERRORS,USERDUZ,USERSECID) ;verify that sent in values are for same user
+1 NEW SECIDDUZ
+2 IF (USERDUZ'="")&(USERSECID'="")
Begin DoDot:1
+3 SET SECIDDUZ=$$FIND1^DIC(200,,"X",USERSECID,"ASECID",,"SCERR")
+4 IF SECIDDUZ'=USERDUZ
DO ERRLOG^SDES2JSON(.SDERRORS,517)
End DoDot:1
+5 QUIT
+6 ;
DFNICNMATCH(SDERRORS,PATDFN,PATICN) ;verify that sent in values are same for patient
+1 IF (PATDFN'="")&(PATICN'="")
Begin DoDot:1
+2 IF $ORDER(^DPT("AICN",PATICN,""))'=PATDFN
DO ERRLOG^SDES2JSON(.SDERRORS,516)
End DoDot:1
+3 QUIT
+4 ;