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

MAGQE5.m

Go to the documentation of this file.
  1. MAGQE5 ;WOIFO/RMP - Support for MAG Enterprise ; 08/29/2006 09:48
  1. ;;3.0;IMAGING;**27,29,8,30,20,46,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. ISU2 ;
  1. ; Workstation Session and Patient counts
  1. N CCNT,D0,DATE,ICNT,M1,M2,PCNT,RES,SCNAD,SCNMN,SCNT,TD,TD1,UNSCN,VD,VI,X1,X2,YR,AI,DUP,IQ,TIOP,TGPP,TIEDP
  1. N GRPPRNT,IMAGE,DELETED
  1. S (SCNT,PCNT,ICNT,CCNT,DUP,TIOP,TGPP,TIEDP,GRPPRNT,IMAGE,DELETED)=0
  1. S (VD,VI)=""
  1. I '$$CONSOLID() D
  1. . S DATE="L"_START
  1. . F S DATE=$O(^MAG(2006.82,"AC",DATE)) Q:DATE="" Q:$P(DATE,"L",2)\1>STOP D
  1. . . S D0=0 F S D0=$O(^MAG(2006.82,"AC",DATE,D0)) Q:'D0 D
  1. . . . Q:'$D(^MAG(2006.82,D0,1))
  1. . . . S SCNT=SCNT+1
  1. . . . S PCNT=PCNT+$P($G(^MAG(2006.82,D0,1)),"^",1)
  1. . . . D ACT^MAGQE3(D0,.ICNT,.CCNT,.VD,.VI,.RES)
  1. . . . Q
  1. . . Q
  1. . Q
  1. E D
  1. . S DATE=START
  1. . F S DATE=$O(^MAG(2006.82,"APL",PLACE,DATE)) Q:DATE="" Q:DATE\1>STOP D
  1. . . S D0=0 F S D0=$O(^MAG(2006.82,"APL",PLACE,DATE,D0)) Q:D0'?1.N D
  1. . . . Q:'$D(^MAG(2006.82,D0,1))
  1. . . . S SCNT=SCNT+1
  1. . . . S PCNT=PCNT+$P($G(^MAG(2006.82,D0,1)),"^",1)
  1. . . . D ACT^MAGQE3(D0,.ICNT,.CCNT,.VD,.VI,.RES)
  1. . . . Q
  1. . . Q
  1. . Q
  1. S X1=START,X2=STOP D ^%DTC S X=$TR(X,"-")+1_" day "
  1. D MSG^MAGQE2(X_"Image Workstation Sessions: "_SCNT)
  1. D MSG^MAGQE2(X_"Image Workstation Patients: "_PCNT)
  1. D MSG^MAGQE2(X_"Image Workstation Images: "_ICNT)
  1. D MSG^MAGQE2(X_"Image Workstation Captures: "_CCNT)
  1. D MSG^MAGQE2(X_"VistaRad WS Display: "_VD)
  1. D MSG^MAGQE2(X_"VistaRad WS Interpretations: "_VI)
  1. K VD,VI
  1. I $T(AVERAGE^MAGBRTLD)'="" D
  1. . D MSG^MAGQE2(X_"average daily routed images: "_$$AVERAGE^MAGBRTLD())
  1. . Q
  1. D BPV^MAGQE1(PLACE)
  1. D MSG^MAGQE2("Vista Image Version/Build: "_$$VSTAV^MAGQE1())
  1. D DICOMV^MAGQE1()
  1. D MSG^MAGQE2("Image file namespace(s): "_$$SNS^MAGQE1(PLACE))
  1. S I="" F S I=$O(RES(I)) Q:I="" D
  1. . S RES="" F S RES=$O(RES(I,RES)) Q:RES="" D
  1. . . S X=$TR(I,"^")_"^"_RES S $P(X,"^",6)=RES(I,RES)
  1. . . D MSG^MAGQE2(" RESOLUTION: "_X)
  1. . . Q
  1. . Q
  1. K RES
  1. ;
  1. S AI=$$GETAI(PLACE)
  1. D COUNT^MAGQE3(START,STOP,INST,AI,.IQ,.DUP,.TIOP,.TGPP,.TIEDP,.GRPPRNT,.IMAGE,.DELETED)
  1. D MSG^MAGQE2("Total Image Objects for Place: "_TIOP)
  1. D MSG^MAGQE2("Total Group Parents for Place: "_TGPP)
  1. D MSG^MAGQE2("Total Image Entry Deletes for Place: "_TIEDP)
  1. D MSG^MAGQE2("Image file group parents: "_GRPPRNT)
  1. D MSG^MAGQE2("Image file objects: "_IMAGE)
  1. D MSG^MAGQE2("Image file deletes: "_DELETED)
  1. ;
  1. S (I,D0)=0 F S D0=$O(^TMP($J,"MAGQ","ACQPAT",D0)) Q:D0="" S I=I+1
  1. D MSG^MAGQE2("Unique Image patients captured: "_I)
  1. K ^TMP($J,"MAGQ","ACQPAT")
  1. S (I,D0)=0 F S D0=$O(^TMP($J,"MAGQ","DISPAT",D0)) Q:D0="" S I=I+1
  1. D MSG^MAGQE2("Unique Image patients display: "_I)
  1. K ^TMP($J,"MAGQ","DISPAT")
  1. S (I,D0)=0 F S D0=$O(^TMP($J,"MAGQ","ALLPAT",D0)) Q:D0="" S I=I+1
  1. D MSG^MAGQE2("Unique Image patients All: "_I)
  1. K ^TMP($J,"MAGQ","ALLPAT")
  1. D MSG^MAGQE2("Total Non-Verified Images for Place: "_$P(IQ,U,1))
  1. D MSG^MAGQE2("Total Verified Images for Place: "_$P(IQ,U,2))
  1. D MSG^MAGQE2("Total Integrity Issues for Place: "_$P(IQ,U,3))
  1. D MSG^MAGQE2("Total Duplicate Images for Place: "_DUP)
  1. D START^MAGQE6(START,STOP,INST,"TLR")
  1. D ADCNT^MAGQE3(START,STOP,INST,AI)
  1. D GPACHX^MAGQE3()
  1. D GS1^MAGQE5() ;Get Share data
  1. D AI1^MAGQE5() ;Get Associated Institutions
  1. D GATH^MAGQE6(START,STOP,INST) ;Gather remote va/dod views
  1. Q
  1. ;
  1. AHOPT ;
  1. N %DT,START,STOP,X,Y
  1. S STOP=$$FMADD^XLFDT($$NOW^XLFDT()\100_"01",-1)
  1. S START=STOP\100_"01"
  1. S Y=START D DD^%DT S %DT("B")=Y
  1. S %DT="AEXP",%DT("A")="Enter starting Date: "
  1. D ^%DT I ((X="")!(X="^")!($D(DTOUT))) K %DT(0),DTOUT Q
  1. S START=Y
  1. S Y=STOP D DD^%DT S %DT("B")=Y
  1. S %DT="AEXP",%DT("A")="Enter ending Date: "
  1. D ^%DT I ((X="")!(X="^")!($D(DTOUT))) K %DT(0),DTOUT Q
  1. S STOP=Y
  1. W !!,"Creating ad-hoc report over the period "
  1. W $$DT(START)," until ",$$DT(STOP),".",!
  1. D AHISU^MAGQE2(START,STOP)
  1. Q
  1. ;
  1. DT(X) ;
  1. Q (X\1#100)_"-"_$P("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"," ",X\100#100)_"-"_(X\10000+1700)
  1. ;
  1. LLOAD(AR,LBL) ;
  1. N I
  1. S I="" F S I=$O(AR(I)) Q:I="" D MSG^MAGQE2(" "_LBL_" "_I_"^"_AR(I))
  1. Q
  1. ;
  1. GETPLACE(PLACE) ; Validate place
  1. S PLACE=$S($$CONSOLID():$G(PLACE),1:+$O(^MAG(2006.1," "),-1)) Q:'PLACE 0
  1. S:$P($G(^MAG(2006.1,PLACE,0)),"^",1)="" PLACE=0
  1. Q PLACE
  1. ;
  1. CONSOLID() ;
  1. ; Return value: 0 = site not consolidated,
  1. ; 1 = site is consolidated
  1. N FLDNFO
  1. D FIELD^DID(2006.1,.01,"","SPECIFIER","FLDNFO")
  1. I $G(FLDNFO("SPECIFIER"))["P" Q 1
  1. Q 0
  1. ;
  1. PLACE(INST) ;
  1. Q:'$$CONSOLID() +$O(^MAG(2006.1," "),-1)
  1. Q $$GETPLACE(+$O(^MAG(2006.1,"B",INST,"")))
  1. ;
  1. QCNT(READY,PLACE) ;
  1. N D0,FAILED,NEXT,TYPE
  1. S (READY,FAILED)=0
  1. I $$CONSOLID() D
  1. . S TYPE="" F S TYPE=$O(^MAGQUEUE(2006.031,"C",PLACE,TYPE)) Q:TYPE="" D
  1. . . S NEXT=+$O(^MAGQUEUE(2006.031,"C",PLACE,TYPE,""))
  1. . . S NEXT=+$P($G(^MAGQUEUE(2006.031,NEXT,0)),"^",2)
  1. . . S D0=0 F S D0=$O(^MAGQUEUE(2006.03,"C",PLACE,TYPE,D0)) Q:'D0 D
  1. . . . I D0<NEXT S FAILED=FAILED+1
  1. . . . E S READY=READY+1
  1. . . . Q
  1. . . Q
  1. E D
  1. . S TYPE="" F S TYPE=$O(^MAGQUEUE(2006.031,"B",TYPE)) Q:TYPE="" D
  1. . . S NEXT=+$O(^MAGQUEUE(2006.031,"B",TYPE,""))
  1. . . S NEXT=+$P($G(^MAGQUEUE(2006.031,NEXT,0)),"^",2)
  1. . . S D0=0 F S D0=$O(^MAGQUEUE(2006.03,"B",TYPE,D0)) Q:'D0 D
  1. . . . I D0<NEXT S FAILED=FAILED+1
  1. . . . E S READY=READY+1
  1. . . . Q
  1. . . Q
  1. . Q
  1. Q READY+FAILED
  1. ;
  1. WSP(PLACE) ; Imaging workstations per place
  1. N COUNT,D0,RD
  1. S RD=$$FMADD^XLFDT($$NOW^XLFDT,-180,"","","")
  1. S (D0,COUNT)=0 F S D0=$O(^MAG(2006.81,"C",PLACE,D0)) Q:'D0 D
  1. . S:$P(^MAG(2006.81,D0,0),"^",3)'<RD COUNT=COUNT+1
  1. . Q
  1. Q COUNT
  1. ;
  1. MAGDUZ2() Q $G(DUZ(2),$$KSP^XUPARAM("INST"))
  1. ;
  1. GS1() ; Get local Network location share data
  1. N I,L,M,MSG,RESULT,TAR
  1. S RESULT(0)="NETWORK LOCATION^PHYSICAL REFERENCE^TOTAL SPACE^FREE SPACE^OPERATIONAL STATUS^READ ONLY^STORAGE TYPE^HASH^ROUTER"
  1. D LIST^DIC(2005.2,"","@;.01;1;2;4;5;5.5;6;7;26","","","","","","I $P(^(0),U,10)=PLACE","","TAR","MSG")
  1. Q:$D(MSG("DIERR"))
  1. S L=0 F S L=$O(TAR("DILIST","ID",L)) Q:'L D
  1. . S RESULT(L)=$P(TAR("DILIST","ID",L,.01),U,1)
  1. . F M=1,2,4,5,5.5,6,7,26 S RESULT(L)=RESULT(L)_U_$P(TAR("DILIST","ID",L,M),U,1)
  1. . Q
  1. S I="" F S I=$O(RESULT(I)) Q:I="" D
  1. . D MSG^MAGQE2("LOCAL NETWORK LOCATIONS: "_I_"^"_RESULT(I))
  1. . Q
  1. K TAR,MSG,RESULT
  1. Q
  1. AI1() ; get Associated Institutions list per place
  1. N I,L,M,MSG,RESULT,TAR
  1. S RESULT(0)="Associated Institutions"
  1. D LIST^DIC(2006.12,","_PLACE_",","@;.01","","","","","","","","TAR","MSG")
  1. Q:$D(MSG("DIERR"))
  1. S L=0 F S L=$O(TAR("DILIST","ID",L)) Q:'L D
  1. . S RESULT(L)=$P(TAR("DILIST","ID",L,.01),U,1)
  1. . Q
  1. S I="" F S I=$O(RESULT(I)) Q:I="" D
  1. . D MSG^MAGQE2("ASSOCIATED INSTITUTIONS: "_I_"^"_RESULT(I))
  1. . Q
  1. K TAR,MSG,RESULT
  1. Q
  1. GETAI(PLACE,PARAM) ;
  1. N I,J
  1. S PARAM=$S('$D(PARAM):U,PARAM="":U,1:PARAM)
  1. S I="",J=PARAM
  1. F S I=$O(^MAG(2006.1,PLACE,"INSTS","B",I)) Q:I="" S J=J_I_PARAM
  1. Q J
  1. ;