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

SDES2GETSTORDPAT.m

Go to the documentation of this file.
SDES2GETSTORDPAT  ;ALB/BLB,LAB - SDES2 GET LAST SELECTED PAT; Nov 15, 2023@09:00
 ;;5.3;Scheduling;**861,866**;Aug 13, 1993;Build 22
 ;;Per VHA Directive 6402, this routine should not be modified
 Q
 ;
GETSTOREDPATIENT(JSON,SDCONTEXT,SDPARAM) ;
 ;input parameter SDPARAM is not currently in use,
 ; kept to prevent need of new RPC version.
 N RETURN,DFN,ERRORS,PATIENTLIST,VALRETURN,SDDUZ
 ;
 D VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
 I $D(ERRORS) S RETURN("Patient",1)="" M RETURN=ERRORS D BUILDJSON^SDES2JSON(.JSON,.RETURN) Q
 ;
 S SDDUZ=$S($G(SDCONTEXT("USER DUZ"))'="":SDCONTEXT("USER DUZ"),1:DUZ)
 S DFN=$G(^DISV(SDDUZ,"^DPT("))
 I '$G(DFN) S RETURN("Patient",1)="" D BUILDJSON^SDES2JSON(.JSON,.RETURN) Q
 D POPULATE^SDES2PATSEARCH(.PATIENTLIST,DFN,SDDUZ,1)
 ;
 M RETURN=PATIENTLIST D BUILDJSON^SDES2JSON(.JSON,.RETURN)
 Q
 ;