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

MAGROI01.m

Go to the documentation of this file.
  1. MAGROI01 ;WOIFO/FG,JSL - Release Of Information(ROI) RPCS ; 11/13/2014 11:37pm
  1. ;;3.0;IMAGING;**138,157**;Mar 19, 2002;Build 16;Nov 13, 2014
  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. ;+++++ GET LIST OF TRANSMIT DESTINATIONS TO QUEUE DICOM IMAGES
  1. ; RPC: MAG GET DICOM QUEUE LIST
  1. ;
  1. ; .MAGRY Reference to a local variable where the results
  1. ; are returned to.
  1. ;
  1. ; Input Parameters
  1. ; ================
  1. ; SITE id File #4
  1. ;
  1. ; Return Values
  1. ; =============
  1. ;
  1. ; If MAGRY(0) 1st '^'-piece is 0, then an error
  1. ; occurred during execution of the procedure: 0^0^ ERROR explanation
  1. ;
  1. ; Otherwise, the output array is as follows:
  1. ;
  1. ; MAGRY(0) Description
  1. ; ^01: 1
  1. ; ^02: Total Number of Lines
  1. ; ^03: "Record Number"
  1. ; ^04: "Service Name"
  1. ; ^05: "IP Address"
  1. ; ^06: "Port Number"
  1. ; ^07: "Gateway Station Number"
  1. ;
  1. ; MAGRY(i) Description
  1. ; ^01: Record Number
  1. ; ^02: Service Name
  1. ; ^03: IP Address
  1. ; ^04: Port Number
  1. ; ^05: Gateway Station Number
  1. ;
  1. GETDCLST(MAGRY,SITE) ; RPC [MAG GET DICOM QUEUE LIST]
  1. K MAGRY
  1. N $ETRAP,$ESTACK S $ETRAP="D ERRA^MAGGTERR"
  1. N FILE,SCREEN,MAGREC,REC,CT,SERVNAME,IPADD,PORTN,LOC
  1. N MAGOUT,MAGERR,MAGPL,LIS,I,TEMP
  1. ;
  1. ; Get local associated sites
  1. S SITE=$G(SITE)
  1. I (SITE'="")!($$STA^XUAF4(SITE)="")!(SITE'=+SITE) D ; P157 - Accept IEN or STATION NUMBER
  1. . N IEN S IEN=$$IEN^XUAF4(SITE) ; Check if is STATION NUMBER
  1. . S:IEN SITE=IEN ; INSTITUTION IEN
  1. . Q
  1. S:SITE<1 SITE=$S($G(DUZ(2)):DUZ(2),1:+$$SITE^VASITE)
  1. S MAGPL=$$PLACE^MAGBAPI(SITE) ; Get 2006.1 place for DUZ(2)
  1. D GETS^DIQ(2006.1,MAGPL,".04*","I","MAGOUT","MAGERR")
  1. I $D(MAGERR) S MAGRY(0)="0^0^Access Error: "_MAGERR("DIERR",1,"TEXT",1) Q
  1. ; Build list of associated sites
  1. S LIS=","_SITE_","
  1. S I=""
  1. F S I=$O(MAGOUT(2006.12,I)) Q:I="" D
  1. . S LIS=LIS_MAGOUT(2006.12,I,.01,"I")_","
  1. ;
  1. ; Get list of queues, filter out WorkList queues and non-associated sites
  1. ;
  1. S FILE=2006.587
  1. K MAGOUT,MAGERR
  1. S SCREEN="I $$UP^XLFSTR($P(^(0),U,6))=""VISTA_SEND_IMAGE""" ; Filter out WorkList queues
  1. S SCREEN=SCREEN_",(LIS[$P(^(0),U,7))" ; Include only sites in LIS
  1. D LIST^DIC(FILE,"",".01;3;4;7I","","","","","",SCREEN,"","MAGOUT","MAGERR")
  1. I $D(MAGERR) S MAGRY(0)="0^0^Access Error: "_MAGERR("DIERR",1,"TEXT",1) Q
  1. S MAGREC=""
  1. F S MAGREC=$O(MAGOUT("DILIST","ID",MAGREC),-1) Q:MAGREC'>0 D
  1. . S LOC=MAGOUT("DILIST","ID",MAGREC,7)
  1. . S LOC=$$STA^XUAF4(LOC) ; Station Number ; Supported IA #2171
  1. . S REC=MAGOUT("DILIST",2,MAGREC) ; Record number in file (#2006.587)
  1. . S SERVNAME=MAGOUT("DILIST","ID",MAGREC,.01) ; Name of queue
  1. . S IPADD=MAGOUT("DILIST","ID",MAGREC,3) ; IP address
  1. . S PORTN=MAGOUT("DILIST","ID",MAGREC,4) ; Port number
  1. . S TEMP(SERVNAME_U_IPADD_U_PORTN_U_LOC)=REC ; Temporary array to sort entries
  1. . Q
  1. ;
  1. ; Eliminate multiple entries: ignore record number
  1. ;
  1. S (CT,I)=0
  1. F S I=$O(TEMP(I)) Q:I="" D
  1. . S CT=CT+1
  1. . S MAGRY(CT)=TEMP(I)_U_I
  1. . Q
  1. S MAGRY(0)="1^"_CT_"^Record Number^Service Name^IP Address^Port Number^Gateway Station Number"
  1. Q ;
  1. ;
  1. ;+++++ QUEUE IMAGE TO A DESTINATION
  1. ; RPC: MAG SEND IMAGE
  1. ;
  1. ; .MAGRY Reference to a local variable where the results
  1. ; are returned to.
  1. ;
  1. ; MAGIEN IEN of the image(s) to send
  1. ;
  1. ; QREC Record number of the destination queue (DOS/DICOM)
  1. ;
  1. ; PRI Priority
  1. ;
  1. ; TYPE Type of image:
  1. ; 1: MS-DOS-Copy
  1. ; 2: DICOM_Send
  1. ;
  1. ; Notes
  1. ; =====
  1. ;
  1. ; The MS-DOS-Copy case is included here for compatibility
  1. ;
  1. ; Return Values
  1. ; =============
  1. ;
  1. ; If MAGRY(0) 1st '^'-piece is 0, then an error
  1. ; occurred during execution of the procedure: 0^0^ ERROR explanation
  1. ;
  1. ; Otherwise, the output array is as follows:
  1. ;
  1. ; MAGRY(0) Description
  1. ; ^01: 1
  1. ; ^02: 0
  1. ; ^03: Image <MAGIEN> routed to queue <Queue Name>
  1. ;
  1. MAGSEND(MAGRY,MAGIEN,QREC,PRI,TYPE) ; RPC [MAG SEND IMAGE]
  1. K MAGRY
  1. N $ETRAP,$ESTACK S $ETRAP="D ERRA^MAGGTERR"
  1. I '$G(MAGIEN) S MAGRY(0)="0^0^No Image IEN" Q
  1. I $$ISDEL^MAGGI11(MAGIEN) S MAGRY(0)="0^0^Deleted Image" Q
  1. N FILE,QUENAM
  1. S FILE=$S(TYPE=1:2005.2,TYPE=2:2006.587,1:"")
  1. I FILE="" S MAGRY(0)="0^0^Type must be 1 (MS-DOS-Copy) or 2 (DICOM_Send)" Q
  1. S QUENAM=$$GET1^DIQ(FILE,$G(QREC),.01)
  1. I QUENAM="" S MAGRY(0)="0^0^Invalid Queue Record" Q
  1. D SEND^MAGBRTUT(MAGIEN,QREC,PRI,TYPE)
  1. S MAGRY(0)="1^0^Image "_MAGIEN_" routed to queue "_QUENAM
  1. Q ;
  1. ;