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

SDESGETSTOREDPAT.m

Go to the documentation of this file.
SDESGETSTOREDPAT  ;ALB/BLB - SDES GET 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
 ;
GETSTOREDPATIENT(JSON,USERID) ;
 N RETURN,DFN,ERRORS
 ;
 I '$$VALIDATEUSERID(.ERRORS,$G(USERID)) M RETURN=ERRORS D BUILDJSON(.JSON,.RETURN) Q
 ;
 S DFN=$G(^DISV($G(USERID),"^DPT("))
 S RETURN("PatientIEN")=DFN
 S RETURN("PatientName")=$$GET1^DIQ(2,DFN,.01,"E")
 D BUILDJSON(.JSON,.RETURN) Q
 Q
 ;
VALIDATEUSERID(ERRORS,USERID) ;
 I $G(USERID)="" D ERRLOG^SDESJSON(.ERRORS,441) Q 0
 I $G(USERID)'="",'$D(^VA(200,$G(USERID),0)) D ERRLOG^SDESJSON(.ERRORS,442) Q 0
 Q 1
 ;
BUILDJSON(JSONRETURN,RETURN) ;
 N JSONERROR
 D ENCODE^XLFJSON("RETURN","JSONRETURN","JSONERR")
 Q
 ;