MAGDRPC0 ;WOIFO/EdM - Convert RPC response to MUMPS ; Mar 19, 2020@14:50:13
;;3.0;IMAGING;**11,51,50,49,123,110,231**;Mar 19, 2002;Build 9;Aug 30, 2013
;; Per VHA Directive 2004-038, this routine should not be modified.
;; +---------------------------------------------------------------+
;; | Property of the US Government. |
;; | No permission to copy or redistribute this software is given. |
;; | Use of unreleased versions of this software requires the user |
;; | to execute a written test agreement with the VistA Imaging |
;; | Development Office of the Department of Veterans Affairs, |
;; | telephone (301) 734-0100. |
;; | The Food and Drug Administration classifies this software as |
;; | a medical device. As such, it may not be changed in any way. |
;; | Modifications to this software may result in an adulterated |
;; | medical device under 21CFR820, the use of which is considered |
;; | to be a violation of US Federal Statutes. |
;; +---------------------------------------------------------------+
;;
;
; Notice: This routine is on both VistA and the DICOM Gateway
;
Q
;
VADPT(IN) N I,N,S,X
; The RPC delivered its message in array IN
; The output arrays are conform the VADPT API documentation
K VA,VADM,VAPA,VAIN,VASD,VAICN
F I=1:1:11 S (VADM(I),VAIN(I),VAPA(I))=""
S VADM(12)=""
S I="" F S I=$O(IN(I)) Q:I="" D
. S X=IN(I),N=$P(X,"^",1),S=$P(X,"^",2),X=$P(X,"^",3,$L(X)+2)
. Q:S="" ;P123 avoid null but allow letters or numbers
. S:N="DEM" @("VADM("_S_")")=X
. S:N="ADD" @("VAPA("_S_")")=X
. S:N="INP" @("VAIN("_S_")")=X
. S:N="SDA" @("VASD("_S_")")=X
. S:N="ID" @("VA("""_S_""")")=X ;P123 patient ID
. S:N="ICN" VAICN=X
. S:N="Site-DFN" SITEDFN=X
. Q
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGDRPC0 1881 printed Dec 13, 2024@02:01:20 Page 2
MAGDRPC0 ;WOIFO/EdM - Convert RPC response to MUMPS ; Mar 19, 2020@14:50:13
+1 ;;3.0;IMAGING;**11,51,50,49,123,110,231**;Mar 19, 2002;Build 9;Aug 30, 2013
+2 ;; Per VHA Directive 2004-038, this routine should not be modified.
+3 ;; +---------------------------------------------------------------+
+4 ;; | Property of the US Government. |
+5 ;; | No permission to copy or redistribute this software is given. |
+6 ;; | Use of unreleased versions of this software requires the user |
+7 ;; | to execute a written test agreement with the VistA Imaging |
+8 ;; | Development Office of the Department of Veterans Affairs, |
+9 ;; | telephone (301) 734-0100. |
+10 ;; | The Food and Drug Administration classifies this software as |
+11 ;; | a medical device. As such, it may not be changed in any way. |
+12 ;; | Modifications to this software may result in an adulterated |
+13 ;; | medical device under 21CFR820, the use of which is considered |
+14 ;; | to be a violation of US Federal Statutes. |
+15 ;; +---------------------------------------------------------------+
+16 ;;
+17 ;
+18 ; Notice: This routine is on both VistA and the DICOM Gateway
+19 ;
+20 QUIT
+21 ;
VADPT(IN) NEW I,N,S,X
+1 ; The RPC delivered its message in array IN
+2 ; The output arrays are conform the VADPT API documentation
+3 KILL VA,VADM,VAPA,VAIN,VASD,VAICN
+4 FOR I=1:1:11
SET (VADM(I),VAIN(I),VAPA(I))=""
+5 SET VADM(12)=""
+6 SET I=""
FOR
SET I=$ORDER(IN(I))
if I=""
QUIT
Begin DoDot:1
+7 SET X=IN(I)
SET N=$PIECE(X,"^",1)
SET S=$PIECE(X,"^",2)
SET X=$PIECE(X,"^",3,$LENGTH(X)+2)
+8 ;P123 avoid null but allow letters or numbers
if S=""
QUIT
+9 if N="DEM"
SET @("VADM("_S_")")=X
+10 if N="ADD"
SET @("VAPA("_S_")")=X
+11 if N="INP"
SET @("VAIN("_S_")")=X
+12 if N="SDA"
SET @("VASD("_S_")")=X
+13 ;P123 patient ID
if N="ID"
SET @("VA("""_S_""")")=X
+14 if N="ICN"
SET VAICN=X
+15 if N="Site-DFN"
SET SITEDFN=X
+16 QUIT
End DoDot:1
+17 QUIT