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

SDESSTOREPATIENT.m

Go to the documentation of this file.
SDESSTOREPATIENT  ;ALB/BLB - SDES STORE LAST SELECTED PAT; Apr 04, 2023@09:00
 ;;5.3;Scheduling;**846**;Aug 13, 1993;Build 12
 ;;Per VHA Directive 6402, this routine should not be modified
 Q
 ;
STORE(JSON,DFN,USERID) ;
 N ERRORS,RETURN
 ;
 D VALIDATEDFN(.ERRORS,$G(DFN))
 D VALIDATEUSERID(.ERRORS,$G(USERID))
 I $D(ERRORS) M RETURN=ERRORS D BUILDJSON(.JSON,.RETURN) Q
 ;
 D RECALL^DILFD(2,DFN_",",USERID)
 S RETURN("PatientRecordCreated",1)=1
 D BUILDJSON(.JSON,.RETURN) Q
 Q
 ;
VALIDATEDFN(ERRORS,DFN) ;
 I DFN="" D ERRLOG^SDESJSON(.ERRORS,1) Q 0
 I DFN'="",'$D(^DPT(DFN,0)) D ERRLOG^SDESJSON(.ERRORS,2) Q
 Q
 ;
VALIDATEUSERID(ERRORS,USERID) ;
 I $G(USERID)="" D ERRLOG^SDESJSON(.ERRORS,441)
 I $G(USERID)'="",'$D(^VA(200,$G(USERID),0)) D ERRLOG^SDESJSON(.ERRORS,442)
 Q
 ;
BUILDJSON(JSONRETURN,RETURN) ;
 N JSONERROR
 D ENCODE^XLFJSON("RETURN","JSONRETURN","JSONERR")
 Q
 ;