SDESGETDISPREASN ;ALB/TJB - SDES GET DISPOSITION REASON ;JUNE 5, 2023
;;5.3;Scheduling;**846**;Aug 13, 1993;Build 12
;;Per VHA Directive 6402, this routine should not be modified
;
Q
DISPOSITIONREAS(JSONRETURN,SDCONTEXT) ;
; Any information in SDCONTEXT ARRAY is currently ignored. All entries
; in file 409.853 ui returned
N DATA,INDEX,DCNT,SDARRAY,PACKDATA
K DATA D LIST^DIC(409.853,,,"P",,,,,,,"DATA")
S (INDEX,DCNT)=0
F S INDEX=$O(DATA("DILIST",INDEX)) Q:+INDEX'>0 D
. S DCNT=DCNT+1
. S PACKDATA=$G(DATA("DILIST",INDEX,0)),SDARRAY("Disposition Reasons",DCNT,"IEN")=$P(PACKDATA,U)
. S SDARRAY("Disposition Reasons",DCNT,"Name")=$P(PACKDATA,U,2)
. Q
I '$D(SDARRAY) S SDARRAY("Disposition Reasons",1)=""
D BUILDJSON^SDESBUILDJSON(.JSONRETURN,.SDARRAY)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDESGETDISPREASN 793 printed Dec 13, 2024@02:56:55 Page 2
SDESGETDISPREASN ;ALB/TJB - SDES GET DISPOSITION REASON ;JUNE 5, 2023
+1 ;;5.3;Scheduling;**846**;Aug 13, 1993;Build 12
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 ;
+4 QUIT
DISPOSITIONREAS(JSONRETURN,SDCONTEXT) ;
+1 ; Any information in SDCONTEXT ARRAY is currently ignored. All entries
+2 ; in file 409.853 ui returned
+3 NEW DATA,INDEX,DCNT,SDARRAY,PACKDATA
+4 KILL DATA
DO LIST^DIC(409.853,,,"P",,,,,,,"DATA")
+5 SET (INDEX,DCNT)=0
+6 FOR
SET INDEX=$ORDER(DATA("DILIST",INDEX))
if +INDEX'>0
QUIT
Begin DoDot:1
+7 SET DCNT=DCNT+1
+8 SET PACKDATA=$GET(DATA("DILIST",INDEX,0))
SET SDARRAY("Disposition Reasons",DCNT,"IEN")=$PIECE(PACKDATA,U)
+9 SET SDARRAY("Disposition Reasons",DCNT,"Name")=$PIECE(PACKDATA,U,2)
+10 QUIT
End DoDot:1
+11 IF '$DATA(SDARRAY)
SET SDARRAY("Disposition Reasons",1)=""
+12 DO BUILDJSON^SDESBUILDJSON(.JSONRETURN,.SDARRAY)
+13 QUIT