Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: MAGGTSY1

MAGGTSY1.m

Go to the documentation of this file.
  1. MAGGTSY1 ;WOIFO/GEK - Imaging Session Utilities ; [ 06/20/2001 08:57 ]
  1. ;;3.0;IMAGING;**7**;Jul 12, 2002
  1. ;; +---------------------------------------------------------------+
  1. ;; | Property of the US Government. |
  1. ;; | No permission to copy or redistribute this software is given. |
  1. ;; | Use of unreleased versions of this software requires the user |
  1. ;; | to execute a written test agreement with the VistA Imaging |
  1. ;; | Development Office of the Department of Veterans Affairs, |
  1. ;; | telephone (301) 734-0100. |
  1. ;; | |
  1. ;; | The Food and Drug Administration classifies this software as |
  1. ;; | a medical device. As such, it may not be changed in any way. |
  1. ;; | Modifications to this software may result in an adulterated |
  1. ;; | medical device under 21CFR820, the use of which is considered |
  1. ;; | to be a violation of US Federal Statutes. |
  1. ;; +---------------------------------------------------------------+
  1. ;;
  1. Q
  1. SESSION(MAGRY,DATA) ;RPC Call for MAGSYS utility.
  1. ; List of Sessions for a Workstation.
  1. ; DATA is '^' delimited string
  1. ; IEN Workstatin File ^ From Date ^ To Date
  1. ;
  1. N I,J,I1,CT,X,Y,Z,MAGX,MAGWIEN,MAGTIEN
  1. N DTFR,DTTO
  1. S ^TMP("MAGGTSY1","DATA")=DATA
  1. S MAGWIEN=$P(DATA,U,1)
  1. S MAGRY=$NA(^TMP($J,"MAGWSESS"))
  1. K ^TMP($J,"MAGWSESS")
  1. S CT=1
  1. S DTFR=$P(DATA,U,2),DTTO=$P(DATA,U,3)
  1. I DTFR>DTTO S X=DTFR,DTFR=DTTO,DTTO=X
  1. I DTTO=0 S DTTO=9999999
  1. S DTTO=DTTO_".9999"
  1. S ACI="L"_DTTO
  1. F S ACI=$O(^MAG(2006.82,"ACWRK",MAGWIEN,ACI),-1) S I1=$E(ACI,2,99) Q:I1<DTFR D
  1. . S I="" F S I=$O(^MAG(2006.82,"ACWRK",MAGWIEN,ACI,I),-1) Q:'I D
  1. . . ;S I=$O(^MAG(2006.82,"ACWRK",MAGWIEN,ACI,""))
  1. . . D INFO(I,.Y) S CT=CT+1,@MAGRY@(CT)=Y
  1. I CT=1 S @MAGRY@(0)="0^No Sessions in Date Range." Q
  1. S @MAGRY@(0)=(CT-1)_"^"_$P(^MAG(2006.81,MAGWIEN,0),U,1)_" Workstation sessions "
  1. S @MAGRY@(1)="User^Service/Section^Last Logon^Logoff^Pat ct^Image ct^Cap ct^Actions^Error^TrkID"
  1. ;S @MAGRY@(1)="User^Workstation^Service/Section^Last Logon^Logoff^Pat ct^Image ct^Cap ct^Actions^Error"
  1. Q
  1. INFO(I,Y) ;
  1. N N1,N0,MDUZ,Z
  1. S N0=^MAG(2006.82,I,0) ; Imaging Windows Session file
  1. ; THIS WON'T BE NEEDED,I '$P(M,U,8) D SERV(I)
  1. S Y=$P(N0,U,1) ; User Name
  1. ;S Y=Y_$P(^MAG(2006.81,$P(M,U,5),0),U,1) ; Workstation Name
  1. S X=""
  1. I $P(N0,U,8) D
  1. . D GETS^DIQ(49,$P(N0,U,8)_",",".01","E","Z","")
  1. . S X=Z(49,$P(N0,U,8)_",",".01","E")
  1. S Y=Y_U_X
  1. S Y=Y_U_$$OUTDT^MAGGTSY($P(N0,U,3)) ;Date of Last Logon, by a user.
  1. S Y=Y_U_$$OUTDT^MAGGTSY($P(N0,U,4)) ;Date/Time of Last Logoff.
  1. ;
  1. S N1=$G(^MAG(2006.82,I,1))
  1. ;
  1. S Y=Y_U_$P(N1,U,1) ; patients viewed this session
  1. S Y=Y_U_$P(N1,U,2) ; images viewed this session.
  1. S Y=Y_U_$P(N1,U,3) ; Images captured this session
  1. S Y=Y_U_$P($G(^MAG(2006.82,I,"ACT",0)),U,3) ; action count
  1. S Y=Y_U_$P($G(^MAG(2006.82,I,"ERR",0)),U,3) ; error count
  1. S Y=Y_U_$P(N0,U,9)
  1. S Y=Y_U_I ; session ien
  1. Q
  1. DISPLAY(MAGRY,MAGSIEN) ; RPC Call for MAGSYS utility.
  1. ; Returns a display of this sessions info.
  1. ;
  1. N CT,I,ECT,ACT
  1. S MAGRY=$NA(^TMP($J,"MAGSDISP"))
  1. K ^TMP($J,"MAGSDISP")
  1. S CT=0,I=0,ACT=0
  1. F S I=$O(^MAG(2006.82,MAGSIEN,"ACT",I)) Q:'I D
  1. . S CT=CT+1,ACT=ACT+1
  1. . S @MAGRY@(CT)=^MAG(2006.82,MAGSIEN,"ACT",I,0)
  1. S I=0,ECT=0
  1. I $D(^MAG(2006.82,MAGSIEN,"ERR")) D
  1. . S CT=CT+1
  1. . S @MAGRY@(CT)="[ERRORS]"
  1. . F S I=$O(^MAG(2006.82,MAGSIEN,"ERR",I)) Q:'I D
  1. . . S CT=CT+1,ECT=ECT+1
  1. . . S @MAGRY@(CT)=^MAG(2006.82,MAGSIEN,"ERR",I,0)
  1. S @MAGRY@(0)=(CT)_"^"_ACT_" Actions. "_ECT_" Errors."
  1. Q
  1. SERV(I) ;
  1. ; FILE THE SERVICE/SECTION INTO THE SESSION FILE
  1. N N,MAGGFDA,MDUZ
  1. S N=^MAG(2006.82,I,0)
  1. S MDUZ=$P(N,U,2)_","
  1. D GETS^DIQ(200,MDUZ,"29","I","Z","") ; service/section
  1. S MAGGFDA(2006.82,I_",",7)=Z(200,MDUZ,29,"I")
  1. D UPDATE^DIE("","MAGGFDA","","")
  1. Q