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

MAGQE2.m

Go to the documentation of this file.
  1. MAGQE2 ;WOIFO/RMP - Support for MAG Enterprise ; 08/22/2003 13:44
  1. ;;3.0;IMAGING;**27,29,20,39**;Mar 19, 2002;Build 2010;Mar 08, 2011
  1. ;; Per VHA Directive 2004-038, this routine should not be modified.
  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. ;; | 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. ;
  1. AHISU(START,STOP) ;
  1. N ADHOC
  1. S ADHOC=1
  1. ;
  1. ISU ;IMAGING SITE USAGE - SERVER
  1. N INST,LOC,PLACE,TMP
  1. I $$CONSOLID^MAGQE5() D
  1. . S INST="" F S INST=$O(^MAG(2006.1,"B",INST)) Q:INST="" D
  1. . . S PLACE=$O(^MAG(2006.1,"B",INST,"")) Q:'PLACE
  1. . . Q:($P($G(^MAG(2006.1,PLACE,0)),U)'=INST) ;Screen Associated Institutions
  1. . . D ISU1(PLACE,INST)
  1. . . Q
  1. . Q
  1. E D ISU1($O(^MAG(2006.1," "),-1),$$KSP^XUPARAM("INST"))
  1. D:'$G(ADHOC) TASK^MAGQE4
  1. K ^TMP($J,"MAGQ")
  1. Q
  1. ;
  1. ISU1(PLACE,INST) ;
  1. I '$G(ADHOC) D TASK Q ; We are already in a TaskMan task...
  1. ;
  1. S ZTDTH=$$NOW^XLFDT()
  1. S ZTRTN="TASK^"_$T(+0)
  1. S ZTDESC="Ad-Hoc Imaging Usage Report ("_$$FMTE^XLFDT(START\1)_" - "_$$FMTE^XLFDT(STOP\1)_")"
  1. S ZTIO=""
  1. S ZTSAVE("START")=START
  1. S ZTSAVE("STOP")=STOP
  1. S ZTSAVE("PLACE")=PLACE
  1. S ZTSAVE("INST")=INST
  1. S:$G(ADHOC) ZTSAVE("ADHOC")=1
  1. S:$D(MAGDUZ) ZTSAVE("MAGDUZ")=MAGDUZ
  1. D ^%ZTLOAD
  1. K ZTDTH,ZTRTN,ZTDESC,ZTIO,ZTSAVE
  1. Q
  1. ;
  1. MSG(TXT) N I
  1. S I=$O(^TMP($J,"MAGQ",PLACE,"SITE_REPORT"," "),-1)+1
  1. S ^TMP($J,"MAGQ",PLACE,"SITE_REPORT",I)=TXT
  1. Q
  1. ;
  1. TASK N DM,I,LOC,OCONS,PCNT,REC,VR,XMSUB,Y,X
  1. S:'$D(INST) INST=$$KSP^XUPARAM("INST")
  1. K ^TMP($J,"MAGQ")
  1. I '$G(START)!'$G(STOP) D
  1. . S STOP=$$FMADD^XLFDT($$NOW^XLFDT()\100_"01",-1)
  1. . S START=STOP\100_"01"
  1. . Q
  1. S Y=$$NOW^XLFDT,Y=$$FMTE^XLFDT(Y)
  1. S U="^",LOC=$$GET1^DIQ(4,INST,.01)_"^"_INST
  1. D MSG(" SITE: "_LOC)
  1. D MSG("Reporting Period: "_$$FMTE^XLFDT(START\1)_" - "_$$FMTE^XLFDT(STOP\1))
  1. D MSG(" DATE: "_Y_" "_$G(^XMB("TIMEZONE")))
  1. D MSG(" DOMAIN: "_$$KSP^XUPARAM("WHERE"))
  1. D MSG(" 2005 ENTRIES: "_$P($G(^MAG(2005,0)),"^",4))
  1. D MSG(" 2006.81 ENTRIES: "_$$WSP^MAGQE5(PLACE))
  1. D MSG(" Production Account: "_$$PROD^XUPROD("1"))
  1. ; Distribute an array each of the capture and display versions
  1. D IWSV^MAGQE1(PLACE)
  1. ; VistaRad version
  1. S VR=$$VERSION^XPDUTL("MAGJ RADIOLOGY") D:VR'="" MSG("VistaRad Version: "_VR)
  1. I $D(^MAGD(2006.599,0)) D MSG("DICOM Error Log:"_+$P(^MAGD(2006.599,0),"^",4))
  1. I $D(^MAGD(2006.575,0)) D MSG("DICOM FAILED IMAGES:"_+$P(^MAGD(2006.575,0),"^",4))
  1. ; Queue File count & Unprocessed Queue entries
  1. D MSG("Queue File count: "_$$QCNT^MAGQE5(.PCNT,PLACE))
  1. D MSG("Unprocessed Queue entries: "_PCNT)
  1. D ISU2^MAGQE5
  1. S X=""
  1. S:'$G(ADHOC) X=" ("_$P("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"," ",START\100#100)_" "_(START\10000+1700)_")"
  1. S XMSUB=$S($G(ADHOC):"Ad Hoc",1:"Monthly")_" Image Site Usage: "_LOC_X
  1. D MAILSHR^MAGQBUT1(PLACE,"SITE_REPORT",XMSUB)
  1. Q
  1. ;