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

MAGGTU4.m

Go to the documentation of this file.
  1. MAGGTU4 ;WOIFO/GEK/SG/NST - VERSION CHECKS FOR IMAGING CLIENTS ; 21 Jun, 2023@13:44:31
  1. ;;3.0;IMAGING;**8,48,63,45,46,59,96,95,72,93,94,356**;Mar 19, 2002;Build 8
  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. ;***** SETS ABSTRACT AND/OR JUKEBOX QUEUES
  1. ; RPC: MAG ABSJB
  1. ;
  1. ; .MAGRES Reference to a local variable where the result is
  1. ; returned to.
  1. ;
  1. ; .MAGIN IENs of images to be processed
  1. ; ^01: IEN of the image that needs an abstract
  1. ; created
  1. ; ^02: IEN of the image that needs to be copied
  1. ; to the jukebox
  1. ;
  1. ; Return Values
  1. ; =============
  1. ;
  1. ; Result code and corresponding message are returned in the MAGRES
  1. ; parameter:
  1. ;
  1. ; MAGRES Result descriptor
  1. ; ^01: Result code:
  1. ; 0 Error
  1. ; 1 Success
  1. ; ^02: Message
  1. ;
  1. ABSJB(MAGRES,MAGIN) ;RPC [MAG ABSJB]
  1. D ABSJB^MAGGTU71(.MAGRES,.MAGIN)
  1. Q
  1. ;
  1. ;***** CLIENT/SERVER VERSION CHECKS
  1. ; RPC: MAG4 VERSION CHECK
  1. ;
  1. ; .MAGRES Reference to a local array where results are
  1. ; returned to.
  1. ;
  1. ; CLVER Client application descriptor
  1. ; |01: Version (Major.Minor.Patch.Build)
  1. ; |02: empty or "RIV" for remote image view clients
  1. ; |03: Client name ("CAPTURE", "CLUTILS", "DISPLAY",
  1. ; "TELEREADER", or "VISTARAD")
  1. ;
  1. ; For example, the Clinical Display client Version
  1. ; 3.0 Patch 8 Build (test version) 21 will pass
  1. ; "3.0.8.21||DISPLAY" as the value of this parameter.
  1. ;
  1. ; Input Variables
  1. ; ===============
  1. ; MAGJOB
  1. ;
  1. ; Output Variables
  1. ; ================
  1. ; MAGJOB
  1. ;
  1. ; Return Values
  1. ; =============
  1. ;
  1. ; Result code and message are returned into the MAGRES(0).
  1. ; The subsequent nodes may contain additional lines of the
  1. ; message text.
  1. ;
  1. ; MAGRES(0) Result descriptor
  1. ; ^01: Result code:
  1. ; 0 The client will display the
  1. ; message and continue.
  1. ; 1 The client will continue without
  1. ; displaying any message.
  1. ; 2 The client will display the
  1. ; message and then terminate.
  1. ; ^02: Message
  1. ;
  1. ; MAGRES(i) Additional line of the message text
  1. ;
  1. ; Notes
  1. ; =====
  1. ;
  1. ; Ver 2.5P9 (2.5.24.1) is the first GUI client (Delphi) that makes
  1. ; this call.
  1. ;
  1. CHKVER(MAGRES,CLVER) ;RPC [MAG4 VERSION CHECK]
  1. N MAGVCD ; Version control data
  1. ;
  1. N CLNAME,CVRC,RC
  1. S (CVRC,RC)=0
  1. D
  1. . N I,N,TMP
  1. . ;--- Parse the client application descriptor
  1. . S N=$L(CLVER,"|"),CLNAME=$P(CLVER,"|",3)
  1. . F I=2:1:N S TMP=$P(CLVER,"|",I) S:TMP'="" MAGJOB(TMP)=1
  1. . S CLVER=$P(CLVER,"|")
  1. . I CLNAME="" D Q:RC<0
  1. . . ;--- Only the client version was sent before the MAG*3.0*59
  1. . . I CLVER'["|" S CLNAME="DISPLAY" Q
  1. . . ;--- Currently, the client application name must be provided
  1. . . S RC=$$ERROR^MAGUERR(-24,,CLNAME)
  1. . . Q
  1. . ; If client states it is TeleReader then record this - P356 CD 06/21/2023
  1. . I CLNAME="TELEREADER" S ^TMP($J,"MAGTELER")=1
  1. . ;
  1. . ;--- Check the client version
  1. . S CVRC=$$CHKVER1^MAGGTU41(.MAGVCD,CLNAME,.CLVER)
  1. . I CVRC<0 S RC=CVRC Q
  1. . ;
  1. . ;--- Load and format the message
  1. . S RC=$$MESSAGE(CLNAME,CLVER,CVRC)
  1. . Q
  1. ;---
  1. I RC<0 D ERROR^MAGGTU41(.MAGRES,RC) Q
  1. D WARNING^MAGGTU41(.MAGRES,CLNAME,CLVER,CVRC)
  1. Q
  1. ;
  1. ;+++++ LOADS AND FORMATS THE MESSAGE IN THE MAGRES ARRAY
  1. ;
  1. ; CLNAME Client name
  1. ;
  1. ; CLVER Client application version (Major.Minor.Patch.Build)
  1. ;
  1. ; CVRC Version check code returned by the $$CHKVER1^MAGGTU41
  1. ;
  1. ; Input Variables
  1. ; ===============
  1. ; DUZ, MAGVCD
  1. ;
  1. ; Output Variables
  1. ; ================
  1. ; MAGRES
  1. ;
  1. ; Return Values
  1. ; =============
  1. ; <0 Error descriptor (see $$ERROR^MAGUERR)
  1. ; 0 The client will display a warning and continue
  1. ; 1 The client will continue
  1. ; 2 The client will display a warning and terminate
  1. ;
  1. MESSAGE(CLNAME,CLVER,CVRC) ;
  1. N BETA,CV,DLG,DLG1,MAGPRMS,PLC,RC,SVSTAT,TMP
  1. K MAGRES
  1. ;
  1. ;--- If this is a remote connection, allow it.
  1. I $D(MAGJOB("RIV")) D Q 1
  1. . S MAGRES(0)="1^"_$$EZBLD^DIALOG(20050005.013)
  1. . Q
  1. ;
  1. ;--- Get IEN of the Imaging site parameters
  1. Q:'$G(DUZ(2)) $$ERROR^MAGUERR(-26,,"DUZ(2)")
  1. S PLC=$$PLACE^MAGBAPI(DUZ(2))
  1. I 'PLC D Q $$ERROR^MAGUERR(-27,,TMP)
  1. . S TMP=$P($G(^DIC(4,DUZ(2),0)),U)_" ["_DUZ(2)_"]"
  1. . Q
  1. ;
  1. ;--- Quit if the site has VERSION CHECKING=0 (OFF) in
  1. ;--- the IMAGING SITE PARAMETERS file (#2006.1)
  1. ; Patch 94 - don't check for VERSION CHECKING
  1. ;I '$$VERCHKON(PLC) D Q 1
  1. ;. S MAGRES(0)="1^"_$$EZBLD^DIALOG(20050005.014)
  1. ;. Q
  1. ;
  1. ;--- Is this server version alpha/beta or released?
  1. D VERSTAT(.SVSTAT,MAGVCD(CLNAME,"SV"))
  1. I '$G(SVSTAT) S MAGRES(0)="2^"_$P(SVSTAT,U,2) Q 2
  1. S BETA=(+SVSTAT=2)
  1. ;
  1. ;--- Initilize message parameters
  1. S (MAGPRMS("CV"),CV)=$P(CLVER,".",1,3) ; Client Major.Minor.Patch
  1. S MAGPRMS("CP")=$P(CLVER,".",3) ; Client patch number
  1. S MAGPRMS("CST")=$G(MAGVCD(CLNAME,"ST",CV)) ; Supported client build
  1. S MAGPRMS("CT")=$P(CLVER,".",4) ; Client build number
  1. S MAGPRMS("ST")=MAGVCD(CLNAME,"ST") ; Server build number
  1. S MAGPRMS("SV")=MAGVCD(CLNAME,"SV") ; Server Major.Minor.Patch
  1. S MAGPRMS("SVSTAT")=$P(SVSTAT,U,2) ; Server version status
  1. ;
  1. S DLG=20050005.001,RC=1
  1. D:CVRC
  1. . ;--- Latest version but old build (T-version)
  1. . I CVRC=1 D Q
  1. . . S RC=0,DLG=$S(BETA:20050005.008,1:20050005.007)
  1. . . Q
  1. . ;--- Supported version
  1. . I CVRC=2 D Q
  1. . . S RC=$S(BETA:1,1:0),DLG=$S(BETA:20050005.012,1:20050005.011)
  1. . . S:$P(CV,".")=2 DLG1=20050005.005
  1. . . Q
  1. . ;--- Supported version but old build (T-version)
  1. . I CVRC=3 D Q
  1. . . S RC=$S(BETA:0,1:2),DLG=$S(BETA:20050005.01,1:20050005.009)
  1. . . Q
  1. . ;--- Client is not supported
  1. . I CVRC=4 D Q
  1. . . S RC=$S(BETA:0,1:2),DLG=$S(BETA:20050005.004,1:20050005.003)
  1. . . S:$P(CV,".")=2 DLG1=20050005.006
  1. . . Q
  1. ;
  1. ;--- Load and format the message
  1. D BLD^DIALOG(DLG,.MAGPRMS,,"MAGRES")
  1. ; check for "version nag message" only if the server is not in alpha/beta
  1. I 'BETA D
  1. . I RC'=0 Q ; the application will terminate or will not show the nag message
  1. . I '$$NAGMSGON(PLC) S RC=1 ; do not show the nag message
  1. . Q
  1. S MAGRES(0)=RC_U_$G(MAGRES(1)) K MAGRES(1)
  1. D:$G(DLG1)&(RC'=1) BLD^DIALOG(DLG1,,,"MAGRES")
  1. ;---
  1. Q RC
  1. ;
  1. ;+++++ RETURNS STATUS OF THE VERSION CHECKING FOR THE SITE
  1. ;
  1. ; PLC IEN of the Imaging site parameters (file #2006.1)
  1. ;
  1. ; Return Values
  1. ; =============
  1. ; 0 No version checking
  1. ; 1 Version checking is enabled
  1. ;
  1. VERCHKON(PLC) ;
  1. Q +$P(^MAG(2006.1,PLC,"KEYS"),U,5)
  1. ;
  1. ;+++++ RETURNS STATUS OF THE VERSION NAG MESSAGE FOR THE SITE
  1. ;
  1. ; PLC IEN of the Imaging site parameters (file #2006.1)
  1. ;
  1. ; Return Values
  1. ; =============
  1. ; 0 No nag message
  1. ; 1 Display nag message
  1. ;
  1. NAGMSGON(PLC) ;
  1. Q +$$GET1^DIQ(2006.1,PLC,132,"I")
  1. ;
  1. ;***** RETURNS THE STATUS OF IMAGING VERSION
  1. ; RPC: MAG4 VERSION STATUS
  1. ;
  1. ; .MAGRES Reference to a local variable where the result is
  1. ; returned to.
  1. ;
  1. ; MAGVER Version number (e.g. MAG*3.0*59 or 3.0.59)
  1. ;
  1. ; Return Values
  1. ; =============
  1. ;
  1. ; Status code and description are returned into the variable
  1. ; referenced by the MAGRES parameter. Below is the list of
  1. ; possible values:
  1. ;
  1. ; 0^There is no KIDS Install Record.
  1. ; 1^Unknown Release Status.
  1. ; 2^Alpha/Beta Version.
  1. ; 3^Released Version.
  1. ;
  1. VERSTAT(MAGRES,MAGVER) ;RPC [MAG4 VERSION STATUS]
  1. N TVER,MAGERR,VERI
  1. S:+MAGVER MAGVER="MAG*"_$P(MAGVER,".",1,2)_"*"_$P(MAGVER,".",3)
  1. ;--- Search for the installation record
  1. S VERI=$$FIND1^DIC(9.6,,"MO",MAGVER,,,"MAGERR")
  1. I 'VERI D Q
  1. . S MAGRES="0^There is no KIDS Install Record for """_MAGVER_"""."
  1. ;--- Check the alpha/beta testing status
  1. S TVER=$$GET1^DIQ(9.6,VERI_",","ALPHA/BETA TESTING",,,"MAGERR")
  1. I TVER="YES" S MAGRES="2^Alpha/Beta Version." Q
  1. I TVER="NO" S MAGRES="3^Released Version." Q
  1. S MAGRES="1^Unknown Release Status."
  1. Q
  1. ;
  1. ;***** IMPLEMENATION OF THE 'MAG CLIENT VERSION REPORT' OPTION
  1. WSCVCROP ;
  1. N DA,DIR,DIRUT,DTOUT,DUOUT,MAGSORT,X,Y
  1. N MAGLLGDT ; Workstation Last Login date
  1. N MAGWNMB ; Workstation name contains
  1. N MAGALLW ; Include all workstations in the report
  1. ;
  1. ; Get Last login date
  1. K DIR
  1. S DIR(0)="N^1:9999:0"
  1. S DIR("A")="Last login date is within this many days"
  1. S DIR("?")="Enter the number of days prior to today"
  1. S DIR("B")=30
  1. D ^DIR Q:$G(DIRUT)!($G(Y)="")
  1. S MAGLLGDT=$P($$FMADD^XLFDT($$NOW^XLFDT,-Y),".") ; just get the date
  1. ;
  1. ; Get Workstation start with
  1. K DIR
  1. S DIR(0)="FO^"
  1. S DIR("A")="Workstation name contains text"
  1. S DIR("?")="Enter text that the workstation name must contain to be included in the search."
  1. D ^DIR Q:$G(Y)="^"
  1. S MAGWNMB=Y
  1. ;
  1. ;--- Include all workstations in the report
  1. K DIR
  1. S DIR(0)="Y^"
  1. S DIR("A")="Include all workstations in the report"
  1. S DIR("B")="N"
  1. D ^DIR Q:$G(DIRUT)!($G(Y)="")
  1. S MAGALLW=Y
  1. ;
  1. ;--- Let the user select the report sort mode
  1. K DIR
  1. S DIR(0)="SO^"
  1. S DIR(0)=DIR(0)_"V:Site-Client-Version-Workstation Name;"
  1. S DIR(0)=DIR(0)_"W:Site-Workstation Name-Client;"
  1. S DIR("A")="Report Sort Mode"
  1. S DIR("B")="W"
  1. D ^DIR Q:$G(DIRUT)!($G(Y)="")
  1. S MAGSORT=Y
  1. ;
  1. ;--- Let the user select the device and queue the report
  1. W ! S %ZIS="Q" D ^%ZIS Q:$G(POP)
  1. I $D(IO("Q")) D K IO("Q")
  1. . N ZTCPU,ZTDESC,ZTDTH,ZTIO,ZTKIL,ZTPRI
  1. . N ZTRTN,ZTSAVE,ZTSK,ZTSYNC,ZTUCI
  1. . S ZTRTN="WSCVCRPT^MAGGTU42"
  1. . S ZTDESC="Imaging Workstations and Clients Report"
  1. . S ZTSAVE("MAGSORT")=MAGSORT
  1. . S ZTSAVE("MAGWNMB")=MAGWNMB
  1. . S ZTSAVE("MAGLLGDT")=MAGLLGDT
  1. . S ZTSAVE("MAGALLW")=MAGALLW
  1. . D ^%ZTLOAD,HOME^%ZIS
  1. . Q
  1. E U IO D WSCVCRPT^MAGGTU42
  1. ;---
  1. Q