- 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
- ;
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDES2GETSTORDPAT 860 printed Mar 13, 2025@21:59:19 Page 2
- 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
- +2 ;;Per VHA Directive 6402, this routine should not be modified
- +3 QUIT
- +4 ;
- GETSTOREDPATIENT(JSON,SDCONTEXT,SDPARAM) ;
- +1 ;input parameter SDPARAM is not currently in use,
- +2 ; kept to prevent need of new RPC version.
- +3 NEW RETURN,DFN,ERRORS,PATIENTLIST,VALRETURN,SDDUZ
- +4 ;
- +5 DO VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
- +6 IF $DATA(ERRORS)
- SET RETURN("Patient",1)=""
- MERGE RETURN=ERRORS
- DO BUILDJSON^SDES2JSON(.JSON,.RETURN)
- QUIT
- +7 ;
- +8 SET SDDUZ=$SELECT($GET(SDCONTEXT("USER DUZ"))'="":SDCONTEXT("USER DUZ"),1:DUZ)
- +9 SET DFN=$GET(^DISV(SDDUZ,"^DPT("))
- +10 IF '$GET(DFN)
- SET RETURN("Patient",1)=""
- DO BUILDJSON^SDES2JSON(.JSON,.RETURN)
- QUIT
- +11 DO POPULATE^SDES2PATSEARCH(.PATIENTLIST,DFN,SDDUZ,1)
- +12 ;
- +13 MERGE RETURN=PATIENTLIST
- DO BUILDJSON^SDES2JSON(.JSON,.RETURN)
- +14 QUIT
- +15 ;