Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SDES2VALCONTEXT

SDES2VALCONTEXT.m

Go to the documentation of this file.
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
 ;