MAGJVAPI ;WOIFO/MAT VistARad RPCs for ViX ; 28-Oct-2010 9:09pm
;;3.0;IMAGING;**90,115**;Mar 19, 2002;Build 1912;Dec 17, 2010
;; 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. |
;; +---------------------------------------------------------------+
;;
Q
;
;***** Log ViX-enabled Remote Image Access Events
; RPC: MAGJ VIX LOG REMOTE IMG ACCESS
;
; External Calls: ENTRY^MAGLOG() ; Upd8 IMAGE ACCESS LOG (#2006.95).
; ACTION^MAGGTAU() ; Upd8 IMAGING WINDOWS SESS'NS (#2006.82)
;
; Internal Calls: LOGRIA01() ; Validate input, process, return error.
;
; .MAGJRY -- Reference to a local variable name for the return value.
;
; DATA -- ^01: ACTION ... "VR-RV"_ subset member from ACTION+1^MAGGTAU.
; ^02: RADFN .... IEN of PATIENT file (#2)
; ^03: MAGIEN ... IEN of IMAGE file (#2005)
; ^04: NIMGS .... VRad Image Count
; ^05: REMOTE ... VRad Remote Read Flag
; ^06: MAGJVRV .. VRad Version
; ^07: USERCLS .. VRad User Class
; ^08: VIXTXID .. VRad VIX Transaction ID
; Returns ...
; ===========
; ______ON_ERROR_______ ___EXPECTED___
; MAGJRY ^01: 0 1
; ^02: Error message
;
; Notes
; =====
;
; DUZ on the remote VistA is initialized during ViX authentication.
; "VRad Patient Count" is static at 1 in this context.
;
LOGRIA(MAGJRY,DATA) ;
;
;--- Main.
N MAGJVERR S MAGJRY="1"
S MAGJVERR=$$LOGRIA01() I +MAGJVERR S MAGJRY="0^"_$P(MAGJVERR,"^",2)
Q MAGJRY
;
;
LOGRIA01() ;
N TAGG S TAGG="LOGRIA01"
N MAGIEN,RADFN
;
;--- Validate RADFN, MAGIEN. On error, set MAGJVERR="1^"_errmsg.
S MAGJVERR=0 D
. S RADFN=$P(DATA,U,2) I RADFN="" S MAGJVERR="1^"_TAGG_": NULL (RADFN)." Q
. S MAGIEN=$P(DATA,U,3) I MAGIEN="" S MAGJVERR="1^"_TAGG_": NULL (MAGIEN)." Q
. I '$D(^MAG(2005,MAGIEN)) S MAGJVERR="1^"_TAGG_": UNDEFINED SUBSCRIPT ^MAG(2005,"_MAGIEN_"," Q
. I RADFN'=$P($G(^MAG(2005,MAGIEN,0)),U,7) S MAGJVERR="1^"_TAGG_": INPUT POINTERS UNRELATED ON SYSTEM." Q
;
;--- Proceed iff no error.
I MAGJVERR=0 D
. N ACTION,MAGJTXT,NIMGS,PTCT,REMOTE,USERCLS,VIXTXID,VRADVER,YNRIST
. S ACTION=$P(DATA,U,1) S:ACTION="" ACTION="Unspecified"
. S REMOTE=$P(DATA,U,5) S:REMOTE="" REMOTE="Unspecified"
. S NIMGS=$P(DATA,U,4),VRADVER=$P(DATA,U,6),VIXTXID=$P(DATA,U,8)
. S USERCLS=$P(DATA,U,7),YNRIST=$S(+USERCLS:1,1:0)
. ;
. ;--- Initialize PatientCount.
. S PTCT=RADFN'=$G(MAGJOB("LASTPT",ACTION))
. I PTCT S MAGJOB("LASTPT",ACTION)=RADFN
. S $P(MAGJTXT,U,1)=ACTION ; "VR-RVDODVA" or "VR-RVVAVA"
. S $P(MAGJTXT,U,2)=RADFN ; IEN of PATIENT file (#2)
. S $P(MAGJTXT,U,3)=MAGIEN ; IEN of ^MAG(2005,
. S $P(MAGJTXT,U,6)=NIMGS ; Image Count
. S $P(MAGJTXT,U,7)=PTCT ; Patient Count
. S $P(MAGJTXT,U,8)=YNRIST ; Radiologist? (0/1)
. S $P(MAGJTXT,U,9)=REMOTE ; Remote Read? (0/1)
. ;
. ;--- Update the IMAGING WINDOWS SESSIONS file (#2006.82).
. D ACTION^MAGGTAU(MAGJTXT,1)
. ;
. N MAGPACK S MAGPACK="VRAD:"_VRADVER
. S:REMOTE ACTION=ACTION_"/REM"
. ;
. ;--- Update the IMAGE ACCESS LOG file (#2006.95).
. I VIXTXID'="" D ENTRY^MAGLOG(ACTION,DUZ,MAGIEN,MAGPACK,RADFN,NIMGS,VIXTXID) Q
. D ENTRY^MAGLOG(ACTION,DUZ,MAGIEN,MAGPACK,RADFN,NIMGS)
Q MAGJVERR
;
; MAGJVAPI
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGJVAPI 4247 printed Dec 13, 2024@02:07:05 Page 2
MAGJVAPI ;WOIFO/MAT VistARad RPCs for ViX ; 28-Oct-2010 9:09pm
+1 ;;3.0;IMAGING;**90,115**;Mar 19, 2002;Build 1912;Dec 17, 2010
+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 QUIT
+18 ;
+19 ;***** Log ViX-enabled Remote Image Access Events
+20 ; RPC: MAGJ VIX LOG REMOTE IMG ACCESS
+21 ;
+22 ; External Calls: ENTRY^MAGLOG() ; Upd8 IMAGE ACCESS LOG (#2006.95).
+23 ; ACTION^MAGGTAU() ; Upd8 IMAGING WINDOWS SESS'NS (#2006.82)
+24 ;
+25 ; Internal Calls: LOGRIA01() ; Validate input, process, return error.
+26 ;
+27 ; .MAGJRY -- Reference to a local variable name for the return value.
+28 ;
+29 ; DATA -- ^01: ACTION ... "VR-RV"_ subset member from ACTION+1^MAGGTAU.
+30 ; ^02: RADFN .... IEN of PATIENT file (#2)
+31 ; ^03: MAGIEN ... IEN of IMAGE file (#2005)
+32 ; ^04: NIMGS .... VRad Image Count
+33 ; ^05: REMOTE ... VRad Remote Read Flag
+34 ; ^06: MAGJVRV .. VRad Version
+35 ; ^07: USERCLS .. VRad User Class
+36 ; ^08: VIXTXID .. VRad VIX Transaction ID
+37 ; Returns ...
+38 ; ===========
+39 ; ______ON_ERROR_______ ___EXPECTED___
+40 ; MAGJRY ^01: 0 1
+41 ; ^02: Error message
+42 ;
+43 ; Notes
+44 ; =====
+45 ;
+46 ; DUZ on the remote VistA is initialized during ViX authentication.
+47 ; "VRad Patient Count" is static at 1 in this context.
+48 ;
LOGRIA(MAGJRY,DATA) ;
+1 ;
+2 ;--- Main.
+3 NEW MAGJVERR
SET MAGJRY="1"
+4 SET MAGJVERR=$$LOGRIA01()
IF +MAGJVERR
SET MAGJRY="0^"_$PIECE(MAGJVERR,"^",2)
+5 QUIT MAGJRY
+6 ;
+7 ;
LOGRIA01() ;
+1 NEW TAGG
SET TAGG="LOGRIA01"
+2 NEW MAGIEN,RADFN
+3 ;
+4 ;--- Validate RADFN, MAGIEN. On error, set MAGJVERR="1^"_errmsg.
+5 SET MAGJVERR=0
Begin DoDot:1
+6 SET RADFN=$PIECE(DATA,U,2)
IF RADFN=""
SET MAGJVERR="1^"_TAGG_": NULL (RADFN)."
QUIT
+7 SET MAGIEN=$PIECE(DATA,U,3)
IF MAGIEN=""
SET MAGJVERR="1^"_TAGG_": NULL (MAGIEN)."
QUIT
+8 IF '$DATA(^MAG(2005,MAGIEN))
SET MAGJVERR="1^"_TAGG_": UNDEFINED SUBSCRIPT ^MAG(2005,"_MAGIEN_","
QUIT
+9 IF RADFN'=$PIECE($GET(^MAG(2005,MAGIEN,0)),U,7)
SET MAGJVERR="1^"_TAGG_": INPUT POINTERS UNRELATED ON SYSTEM."
QUIT
End DoDot:1
+10 ;
+11 ;--- Proceed iff no error.
+12 IF MAGJVERR=0
Begin DoDot:1
+13 NEW ACTION,MAGJTXT,NIMGS,PTCT,REMOTE,USERCLS,VIXTXID,VRADVER,YNRIST
+14 SET ACTION=$PIECE(DATA,U,1)
if ACTION=""
SET ACTION="Unspecified"
+15 SET REMOTE=$PIECE(DATA,U,5)
if REMOTE=""
SET REMOTE="Unspecified"
+16 SET NIMGS=$PIECE(DATA,U,4)
SET VRADVER=$PIECE(DATA,U,6)
SET VIXTXID=$PIECE(DATA,U,8)
+17 SET USERCLS=$PIECE(DATA,U,7)
SET YNRIST=$SELECT(+USERCLS:1,1:0)
+18 ;
+19 ;--- Initialize PatientCount.
+20 SET PTCT=RADFN'=$GET(MAGJOB("LASTPT",ACTION))
+21 IF PTCT
SET MAGJOB("LASTPT",ACTION)=RADFN
+22 ; "VR-RVDODVA" or "VR-RVVAVA"
SET $PIECE(MAGJTXT,U,1)=ACTION
+23 ; IEN of PATIENT file (#2)
SET $PIECE(MAGJTXT,U,2)=RADFN
+24 ; IEN of ^MAG(2005,
SET $PIECE(MAGJTXT,U,3)=MAGIEN
+25 ; Image Count
SET $PIECE(MAGJTXT,U,6)=NIMGS
+26 ; Patient Count
SET $PIECE(MAGJTXT,U,7)=PTCT
+27 ; Radiologist? (0/1)
SET $PIECE(MAGJTXT,U,8)=YNRIST
+28 ; Remote Read? (0/1)
SET $PIECE(MAGJTXT,U,9)=REMOTE
+29 ;
+30 ;--- Update the IMAGING WINDOWS SESSIONS file (#2006.82).
+31 DO ACTION^MAGGTAU(MAGJTXT,1)
+32 ;
+33 NEW MAGPACK
SET MAGPACK="VRAD:"_VRADVER
+34 if REMOTE
SET ACTION=ACTION_"/REM"
+35 ;
+36 ;--- Update the IMAGE ACCESS LOG file (#2006.95).
+37 IF VIXTXID'=""
DO ENTRY^MAGLOG(ACTION,DUZ,MAGIEN,MAGPACK,RADFN,NIMGS,VIXTXID)
QUIT
+38 DO ENTRY^MAGLOG(ACTION,DUZ,MAGIEN,MAGPACK,RADFN,NIMGS)
End DoDot:1
+39 QUIT MAGJVERR
+40 ;
+41 ; MAGJVAPI