SDES2STOREPAT ;ALB/TJB,JAS,AGW - SDES2 STORE LAST SELECTED PAT; Aug 28, 2024@10:30
;;5.3;Scheduling;**864,877,909**;Aug 13, 1993;Build 12
;;Per VHA Directive 6402, this routine should not be modified
; Reference to SETLOG1^DGSEC is supported by IA #7467
; Reference to DUZ^XUP is supported by IA #7487
;
;INPUT -
; SDCONTEXT("ACHERON AUDIT ID") = Up to 40 Character unique ID number. Ex: 11d9dcc6-c6a2-4785-8031-8261576fca37
; SDCONTEXT("PATIENT DFN") = The DFN/IEN of the target patient from the calling application.
; SDCONTEXT("PATIENT ICN") = The ICN of the target patient from the calling application.
; SDCONTEXT("USER DUZ") = The DUZ of the user taking action in the calling application.
; SDCONTEXT("USER SECID") = The SECID of the user taking action in the calling application.
;
; SDPARAM("DFN")=DFN Patient IEN to be stored for the space bar recall (required)
;
;RETURN PARMETER:
; Status
Q
;
STORE(JSON,SDCONTEXT,SDPARAM) ;
N ERRORS,RETURN,VALRETURN,SENSITIVE
;
D VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
I $D(ERRORS) S ERRORS("PatientRecordCreated",1)="" D BUILDJSON^SDES2JSON(.JSON,.ERRORS) Q
I $G(SDCONTEXT("USER DUZ"))'="" N DUZ D DUZ^XUP(SDCONTEXT("USER DUZ")) ;IA #7487
D VALPATDFN^SDES2VAL2(.ERRORS,$G(SDPARAM("DFN")),1,0)
I $D(ERRORS) S ERRORS("PatientRecordCreated",1)="" D BUILDJSON^SDES2JSON(.JSON,.ERRORS) Q
;
D RECALL^DILFD(2,SDPARAM("DFN")_",",DUZ)
;
;check for sensitive patient for auditing
N SENSITIVE
D SENSITIVE^SDES2UTIL(.SENSITIVE,SDPARAM("DFN"),DUZ)
I SENSITIVE(1) D SETLOG1^DGSEC(SDPARAM("DFN"),DUZ,"","SDESRPC^CLINICAL SCHEDULING PROCEDURE CALLS")
;
S RETURN("PatientRecordCreated",1)=1
D BUILDJSON^SDES2JSON(.JSON,.RETURN)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDES2STOREPAT 1752 printed Apr 22, 2026@14:52:30 Page 2
SDES2STOREPAT ;ALB/TJB,JAS,AGW - SDES2 STORE LAST SELECTED PAT; Aug 28, 2024@10:30
+1 ;;5.3;Scheduling;**864,877,909**;Aug 13, 1993;Build 12
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 ; Reference to SETLOG1^DGSEC is supported by IA #7467
+4 ; Reference to DUZ^XUP is supported by IA #7487
+5 ;
+6 ;INPUT -
+7 ; SDCONTEXT("ACHERON AUDIT ID") = Up to 40 Character unique ID number. Ex: 11d9dcc6-c6a2-4785-8031-8261576fca37
+8 ; SDCONTEXT("PATIENT DFN") = The DFN/IEN of the target patient from the calling application.
+9 ; SDCONTEXT("PATIENT ICN") = The ICN of the target patient from the calling application.
+10 ; SDCONTEXT("USER DUZ") = The DUZ of the user taking action in the calling application.
+11 ; SDCONTEXT("USER SECID") = The SECID of the user taking action in the calling application.
+12 ;
+13 ; SDPARAM("DFN")=DFN Patient IEN to be stored for the space bar recall (required)
+14 ;
+15 ;RETURN PARMETER:
+16 ; Status
+17 QUIT
+18 ;
STORE(JSON,SDCONTEXT,SDPARAM) ;
+1 NEW ERRORS,RETURN,VALRETURN,SENSITIVE
+2 ;
+3 DO VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
+4 IF $DATA(ERRORS)
SET ERRORS("PatientRecordCreated",1)=""
DO BUILDJSON^SDES2JSON(.JSON,.ERRORS)
QUIT
+5 ;IA #7487
IF $GET(SDCONTEXT("USER DUZ"))'=""
NEW DUZ
DO DUZ^XUP(SDCONTEXT("USER DUZ"))
+6 DO VALPATDFN^SDES2VAL2(.ERRORS,$GET(SDPARAM("DFN")),1,0)
+7 IF $DATA(ERRORS)
SET ERRORS("PatientRecordCreated",1)=""
DO BUILDJSON^SDES2JSON(.JSON,.ERRORS)
QUIT
+8 ;
+9 DO RECALL^DILFD(2,SDPARAM("DFN")_",",DUZ)
+10 ;
+11 ;check for sensitive patient for auditing
+12 NEW SENSITIVE
+13 DO SENSITIVE^SDES2UTIL(.SENSITIVE,SDPARAM("DFN"),DUZ)
+14 IF SENSITIVE(1)
DO SETLOG1^DGSEC(SDPARAM("DFN"),DUZ,"","SDESRPC^CLINICAL SCHEDULING PROCEDURE CALLS")
+15 ;
+16 SET RETURN("PatientRecordCreated",1)=1
+17 DO BUILDJSON^SDES2JSON(.JSON,.RETURN)
+18 QUIT
+19 ;