DDE ;SPFO/RAM,MKB - Entity Main Driver ;AUG 1,2018 12:37
;;22.2;VA FileMan;**9**;Jan 05, 2016;Build 73
;;Per VA Directive 6402, this routine should not be modified.
;
Q
;
GET1(RESOURCE,ID,QUERY,MTYPE,ERROR) ; -- GET an item
;
N RESULT,RESULT1,I,C
S RESOURCE=$G(RESOURCE),ID=$G(ID),MTYPE=$G(MTYPE)
;
D EN^DDEGET(RESOURCE,ID,.QUERY,,MTYPE,.RESULT,.ERROR)
; ID can return multiple items, if a set or panel
;
S (C,RESULT1)=""
I $D(RESULT) S I=0 F S I=$O(@RESULT@(I)) Q:'I D
. S RESULT1=RESULT1_C_$G(@RESULT@(I))
. S:'MTYPE C=", " ;JSON
;
Q RESULT1
;
GET(RESOURCE,ID,QUERY,MTYPE,MAX,RESULT,ERROR) ; -- GET an item/collection
;
S RESOURCE=$G(RESOURCE),ID=$G(ID),MTYPE=$G(MTYPE)
D EN^DDEGET(RESOURCE,ID,.QUERY,.MAX,MTYPE,.RESULT,.ERROR)
; return array of items in @RESULT@(#), and/or ERROR(#)
;
Q
;
PUT(RESOURCE,ID,BODY,MTYPE) ; -- PUT an item [not in use]
;
N RESULT,RESULT1,C
S RESOURCE=$G(RESOURCE),BODY=$G(BODY),ID=$G(ID),MTYPE=$G(MTYPE)
;
;D:MTYPE MAIN^DDEPXML(.RESULT,RESOURCE,BODY,ID,,"PUT")
;D:'MTYPE MAIN^DDEPJSON(.RESULT,RESOURCE,BODY,ID,,"PUT")
;
S (RESULT1,C)=""
I $D(RESULT) S I=0 F S I=$O(@RESULT@(I)) Q:'I D
. S RESULT1=RESULT1_C_$G(@RESULT@(I))
. S:'MTYPE C=", " ;JSON
;
Q RESULT1
;
POST(RESOURCE,ID,BODY,MTYPE) ; -- POST an item [not in use]
;
N RESULT,RESULT1,C
S RESOURCE=$G(RESOURCE),BODY=$G(BODY),ID=$G(ID),MTYPE=$G(MTYPE)
;
;D:MTYPE MAIN^DDEPXML(.RESULT,RESOURCE,BODY,ID,,"POST")
;D:'MTYPE MAIN^DDEPJSON(.RESULT,RESOURCE,BODY,ID,,"POST")
;
S (RESULT1,C)=""
I $D(RESULT) S I=0 F S I=$O(@RESULT@(I)) Q:'I D
. S RESULT1=RESULT1_C_$G(@RESULT@(I))
. S:'MTYPE C=", " ;JSON
;
Q RESULT1
;
DEL(RESOURCE,ID,MTYPE) ; -- DELETE an item [not in use]
;
N RESULT,RESULT1,C
S RESOURCE=$G(RESOURCE),ID=$G(ID),MTYPE=$G(MTYPE)
;
;D:MTYPE XML^DDEDEL(.RESULT,RESOURCE,ID)
;D:'MTYPE JSON^DDEDEL(.RESULT,RESOURCE,ID)
;
S (RESULT1,C)=""
I $D(RESULT) S I=0 F S I=$O(@RESULT@(I)) Q:'I D
. S RESULT1=RESULT1_C_$G(@RESULT@(I))
. S:'MTYPE C=", " ;JSON
;
Q RESULT1
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDDE 2099 printed Oct 16, 2024@18:42:34 Page 2
DDE ;SPFO/RAM,MKB - Entity Main Driver ;AUG 1,2018 12:37
+1 ;;22.2;VA FileMan;**9**;Jan 05, 2016;Build 73
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;
GET1(RESOURCE,ID,QUERY,MTYPE,ERROR) ; -- GET an item
+1 ;
+2 NEW RESULT,RESULT1,I,C
+3 SET RESOURCE=$GET(RESOURCE)
SET ID=$GET(ID)
SET MTYPE=$GET(MTYPE)
+4 ;
+5 DO EN^DDEGET(RESOURCE,ID,.QUERY,,MTYPE,.RESULT,.ERROR)
+6 ; ID can return multiple items, if a set or panel
+7 ;
+8 SET (C,RESULT1)=""
+9 IF $DATA(RESULT)
SET I=0
FOR
SET I=$ORDER(@RESULT@(I))
if 'I
QUIT
Begin DoDot:1
+10 SET RESULT1=RESULT1_C_$GET(@RESULT@(I))
+11 ;JSON
if 'MTYPE
SET C=", "
End DoDot:1
+12 ;
+13 QUIT RESULT1
+14 ;
GET(RESOURCE,ID,QUERY,MTYPE,MAX,RESULT,ERROR) ; -- GET an item/collection
+1 ;
+2 SET RESOURCE=$GET(RESOURCE)
SET ID=$GET(ID)
SET MTYPE=$GET(MTYPE)
+3 DO EN^DDEGET(RESOURCE,ID,.QUERY,.MAX,MTYPE,.RESULT,.ERROR)
+4 ; return array of items in @RESULT@(#), and/or ERROR(#)
+5 ;
+6 QUIT
+7 ;
PUT(RESOURCE,ID,BODY,MTYPE) ; -- PUT an item [not in use]
+1 ;
+2 NEW RESULT,RESULT1,C
+3 SET RESOURCE=$GET(RESOURCE)
SET BODY=$GET(BODY)
SET ID=$GET(ID)
SET MTYPE=$GET(MTYPE)
+4 ;
+5 ;D:MTYPE MAIN^DDEPXML(.RESULT,RESOURCE,BODY,ID,,"PUT")
+6 ;D:'MTYPE MAIN^DDEPJSON(.RESULT,RESOURCE,BODY,ID,,"PUT")
+7 ;
+8 SET (RESULT1,C)=""
+9 IF $DATA(RESULT)
SET I=0
FOR
SET I=$ORDER(@RESULT@(I))
if 'I
QUIT
Begin DoDot:1
+10 SET RESULT1=RESULT1_C_$GET(@RESULT@(I))
+11 ;JSON
if 'MTYPE
SET C=", "
End DoDot:1
+12 ;
+13 QUIT RESULT1
+14 ;
POST(RESOURCE,ID,BODY,MTYPE) ; -- POST an item [not in use]
+1 ;
+2 NEW RESULT,RESULT1,C
+3 SET RESOURCE=$GET(RESOURCE)
SET BODY=$GET(BODY)
SET ID=$GET(ID)
SET MTYPE=$GET(MTYPE)
+4 ;
+5 ;D:MTYPE MAIN^DDEPXML(.RESULT,RESOURCE,BODY,ID,,"POST")
+6 ;D:'MTYPE MAIN^DDEPJSON(.RESULT,RESOURCE,BODY,ID,,"POST")
+7 ;
+8 SET (RESULT1,C)=""
+9 IF $DATA(RESULT)
SET I=0
FOR
SET I=$ORDER(@RESULT@(I))
if 'I
QUIT
Begin DoDot:1
+10 SET RESULT1=RESULT1_C_$GET(@RESULT@(I))
+11 ;JSON
if 'MTYPE
SET C=", "
End DoDot:1
+12 ;
+13 QUIT RESULT1
+14 ;
DEL(RESOURCE,ID,MTYPE) ; -- DELETE an item [not in use]
+1 ;
+2 NEW RESULT,RESULT1,C
+3 SET RESOURCE=$GET(RESOURCE)
SET ID=$GET(ID)
SET MTYPE=$GET(MTYPE)
+4 ;
+5 ;D:MTYPE XML^DDEDEL(.RESULT,RESOURCE,ID)
+6 ;D:'MTYPE JSON^DDEDEL(.RESULT,RESOURCE,ID)
+7 ;
+8 SET (RESULT1,C)=""
+9 IF $DATA(RESULT)
SET I=0
FOR
SET I=$ORDER(@RESULT@(I))
if 'I
QUIT
Begin DoDot:1
+10 SET RESULT1=RESULT1_C_$GET(@RESULT@(I))
+11 ;JSON
if 'MTYPE
SET C=", "
End DoDot:1
+12 ;
+13 QUIT RESULT1