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.
  1. SDESGETSTOREDPAT ;ALB/BLB - SDES GET LAST SELECTED PAT; Apr 04, 2023@09:00
  1. ;;5.3;Scheduling;**846**;Aug 13, 1993;Build 12
  1. ;;Per VHA Directive 6402, this routine should not be modified
  1. Q
  1. ;
  1. GETSTOREDPATIENT(JSON,USERID) ;
  1. N RETURN,DFN,ERRORS
  1. ;
  1. I '$$VALIDATEUSERID(.ERRORS,$G(USERID)) M RETURN=ERRORS D BUILDJSON(.JSON,.RETURN) Q
  1. ;
  1. S DFN=$G(^DISV($G(USERID),"^DPT("))
  1. S RETURN("PatientIEN")=DFN
  1. S RETURN("PatientName")=$$GET1^DIQ(2,DFN,.01,"E")
  1. D BUILDJSON(.JSON,.RETURN) Q
  1. Q
  1. ;
  1. VALIDATEUSERID(ERRORS,USERID) ;
  1. I $G(USERID)="" D ERRLOG^SDESJSON(.ERRORS,441) Q 0
  1. I $G(USERID)'="",'$D(^VA(200,$G(USERID),0)) D ERRLOG^SDESJSON(.ERRORS,442) Q 0
  1. Q 1
  1. ;
  1. BUILDJSON(JSONRETURN,RETURN) ;
  1. N JSONERROR
  1. D ENCODE^XLFJSON("RETURN","JSONRETURN","JSONERR")
  1. Q
  1. ;