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