MAGVAG03 ;WOIFO/NST - Write Location calls ; 20 Aug 2015 4:23 PM
;;3.0;IMAGING;**118,142,162**;Mar 19, 2002;Build 22;Aug 25, 2015
;; Per VHA Directive 2004-038, this routine should not be modified.
;; +---------------------------------------------------------------+
;; | Property of the US Government. |
;; | No permission to copy or redistribute this software is given. |
;; | Use of unreleased versions of this software requires the user |
;; | to execute a written test agreement with the VistA Imaging |
;; | Development Office of the Department of Veterans Affairs, |
;; | telephone (301) 734-0100. |
;; | The Food and Drug Administration classifies this software as |
;; | a medical device. As such, it may not be changed in any way. |
;; | Modifications to this software may result in an adulterated |
;; | medical device under 21CFR820, the use of which is considered |
;; | to be a violation of US Federal Statutes. |
;; +---------------------------------------------------------------+
;;
Q
;***** Returns Current Write Location by Station number or Institution IEN
;
; RPC: MAGVA GET CWL
;
; Input Parameters
; ================
;
; MAGPARAM("STATION NUMBER") = STATION NUMBER field (#4,99) in INSTITUTION file (#4)
; or
; MAGPARAM("INSTITUTION IEN") = IEN in INSTITUTION file (#4)
;
; Return Values
; =============
;
; if error found during execution
; MAGRY(0) = Failure status ^ Error message
; if success
; MAGRY(0) = Success status ^^1
; MAGRY(1) = NETWORK LOCATION IEN ^ PHYSICAL REFERENCE ^ USER NAME ^ PASSWORD ^ PLACE
; MAGRY(2) = IEN in NETWORK LOCATION file (#2005.2) ^ PHYSICAL REFERENCE (WRITE LOCATION) (#2005.2,1)
; ^ USER NAME (#2005.2,15) ^ PASSWORD (#2005.2,16) ^ IEN in IMAGING SITE PARAMETERS file (#2006.1)
;
GETCWL(MAGRY,MAGPARAM) ; RPC [MAGVA GET CWL]
N PLACE ; IEN in INSTITUTION FILE (#4)
N MAGREF,IENS,FILE,OUT,ERR
N RESDEL
N MAGPLC
K MAGRY
S RESDEL=$$RESDEL^MAGVAF02() ; Result delimiter
S PLACE=0
I $G(MAGPARAM("INSTITUTION IEN"))'="" D Q:'PLACE ; Error - MAGRY(0) is already set
. S PLACE=MAGPARAM("INSTITUTION IEN") ; P142 DAC
. I 'PLACE D
. . N MSG
. . S MSG="Invalid INSTITUTION IEN"
. . S MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
. . Q
. Q
I ((PLACE)&($$STA^XUAF4(PLACE)=""))!(PLACE'=+PLACE) S MAGPARAM("STATION NUMBER")=$G(MAGPARAM("INSTITUTION IEN")) ; P142 DAC
I $G(MAGPARAM("STATION NUMBER"))'="" D Q:'PLACE ; Error - MAGRY(0) is already set
. S PLACE=$$IEN^XUAF4(MAGPARAM("STATION NUMBER")) ; IA # 2171 find the Institution IEN
. I 'PLACE D
. . N MSG
. . S MSG="Invalid STATION NUMBER: "_MAGPARAM("STATION NUMBER")
. . I $G(MAGPARAM("INSTITUTION IEN"))'="" S MSG="Invalid INSTITUTION IEN: "_MAGPARAM("INSTITUTION IEN") ; P142 DAC
. . S MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
. . Q
. Q
I 'PLACE D Q ; Error - MAGRY(0) is already set
. N MSG
. S MSG="STATION NUMBER or INSTITUTION IEN is required"
. S MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
. Q
;
S MAGPLC=$$PLACE^MAGBAPI(PLACE) ; Get IEN of a record in IMAGING SITE PARAMETERS file (#2006.1)
S MAGREF=$$GET1^DIQ(2006.1,MAGPLC,.03,"I") ; IMAGE NETWORK WRITE LOCATION
I 'MAGREF D Q
. N MSG
. S MSG="Need WRITE LOCATION in IMAGING SITE PARAMETERS file (#2006.1). Call IRM."
. S MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
. Q
;
I '$$GET1^DIQ(2005.2,MAGREF,5,"I") D Q ; Operational status
. N MSG
. S MSG="The Server that you are writing to is off-line. Call IRM"
. S MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
. Q
;
S IENS=MAGREF_","
S FILE=2005.2
D GETS^DIQ(FILE,IENS,"1;15;16","I","OUT","ERR")
I $D(ERR("DIERR")) D Q
. D MSG^DIALOG("A",.MAGRESA,245,5,"ERR")
. S MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_"Error getting values: "_MAGRESA(1) Q ; Error getting the values
. Q
;
S MAGRY(0)=$$OK^MAGVAF02()_RESDEL_RESDEL_1
S MAGRY(1)="NETWORK LOCATION IEN"_RESDEL_"PHYSICAL REFERENCE"
S MAGRY(1)=MAGRY(1)_RESDEL_"USER NAME"_RESDEL_"PASSWORD"_RESDEL_"PLACE"
S MAGRY(2)=MAGREF_RESDEL_OUT(FILE,IENS,1,"I")
S MAGRY(2)=MAGRY(2)_RESDEL_OUT(FILE,IENS,15,"I")_RESDEL_OUT(FILE,IENS,16,"I")_RESDEL_MAGPLC
Q
;
;***** Returns Jukebox Write Location by Station number or Institution IEN
;
; RPC: MAGVA GET JUKEBOX WL
;
; Input Parameters
; ================
;
; MAGPARAM("STATION NUMBER") = STATION NUMBER field (#4,99) in INSTITUTION file (#4)
; or
; MAGPARAM("INSTITUTION IEN") = IEN in INSTITUTION file (#4)
;
; Return Values
; =============
;
; if error found during execution
; MAGRY(0) = Failure status ^ Error message
; if success
; MAGRY(0) = Success status ^^1
; MAGRY(1) = NETWORK LOCATION IEN ^ PHYSICAL REFERENCE ^ USER NAME ^ PASSWORD ^ PLACE
; MAGRY(2) = IEN in NETWORK LOCATION file (#2005.2) ^ PHYSICAL REFERENCE (WRITE LOCATION) (#2005.2,1)
; ^ USER NAME (#2005.2,15) ^ PASSWORD (#2005.2,16) ^ IEN in IMAGING SITE PARAMETERS file (#2006.1)
;
GETJBXWL(MAGRY,MAGPARAM) ; RPC [MAGVA GET JUKEBOX WL]
N PLACE ; IEN in INSTITUTION FILE (#4)
N MAGREF,IENS,FILE,OUT,ERR
N RESDEL
N MAGPLC
K MAGRY
S RESDEL=$$RESDEL^MAGVAF02() ; Result delimiter
S PLACE=0
I $G(MAGPARAM("INSTITUTION IEN"))'="" D Q:'PLACE ; Error - MAGRY(0) is already set
. S PLACE=+MAGPARAM("INSTITUTION IEN")
. I 'PLACE D
. . N MSG
. . S MSG="Invalid INSTITUTION IEN"
. . S MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
. . Q
. Q
I $G(MAGPARAM("STATION NUMBER"))'="" D Q:'PLACE ; Error - MAGRY(0) is already set
. S PLACE=$$IEN^XUAF4(MAGPARAM("STATION NUMBER")) ; IA # 2171 find the Institution IEN
. I 'PLACE D
. . N MSG
. . S MSG="Invalid STATION NUMBER: "_MAGPARAM("STATION NUMBER")
. . S MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
. . Q
. Q
I 'PLACE D Q ; Error - MAGRY(0) is already set
. N MSG
. S MSG="STATION NUMBER or INSTITUTION IEN is required"
. S MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
. Q
;
S MAGPLC=$$PLACE^MAGBAPI(PLACE) ; Get IEN in IMAGING SITE PARAMETERS file (#2006.1)
S MAGREF=$$GET1^DIQ(2006.1,MAGPLC,2.01,"I") ; JUKEBOX WRITE LOCATION
I 'MAGREF D Q
. N MSG
. S MSG="Need WRITE LOCATION in IMAGING SITE PARAMETERS file (#2006.1). Call IRM."
. S MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
. Q
;
I '$$GET1^DIQ(2005.2,MAGREF,5,"I") D Q ; Operational status
. N MSG
. S MSG="The Server that you are writing to is off-line. Call IRM"
. S MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
. Q
;
S IENS=MAGREF_","
S FILE=2005.2
D GETS^DIQ(FILE,IENS,"1;15;16","I","OUT","ERR") I $D(ERR("DIERR")) D Q
. D MSG^DIALOG("A",.MAGRESA,245,5,"ERR")
. S MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_"Error getting values: "_MAGRESA(1) Q ; Error getting the values
. Q
;
S MAGRY(0)=$$OK^MAGVAF02()_RESDEL_RESDEL_1
S MAGRY(1)="NETWORK LOCATION IEN"_RESDEL_"PHYSICAL REFERENCE"
S MAGRY(1)=MAGRY(1)_RESDEL_"USER NAME"_RESDEL_"PASSWORD"_RESDEL_"PLACE"
S MAGRY(2)=MAGREF_RESDEL_OUT(FILE,IENS,1,"I")
S MAGRY(2)=MAGRY(2)_RESDEL_OUT(FILE,IENS,15,"I")_RESDEL_OUT(FILE,IENS,16,"I")_RESDEL_MAGPLC
Q
;
;***** Returns PHYSICAL REFERENCE (WRITE LOCATION)
; USER NAME, PASSWORD, OPERATIONAL STATUS and PLACE
; by IEN in NETWORK LOCATION file (#2005.2)
;
; RPC: MAGVA GET NET LOC DETAILS
;
; Input Parameters
; ================
;
; NLOCIEN = IEN in NETWORK LOCATION file (#2005.2)
;
; Return Values
; =============
;
; if error found during execution
; MAGRY(0) = Failure status ^ Error message
; if success
; MAGRY(0) = Success status ^^1
; MAGRY(1) = PHYSICAL REFERENCE ^ USER NAME ^ PASSWORD ^ OPERATIONAL STATUS ^ PLACE
; MAGRY(2) = PHYSICAL REFERENCE (WRITE LOCATION) (#2005.2,1)
; ^ USER NAME (#2005.2,15) ^ PASSWORD (#2005.2,16)
; ^ OPERATIONAL STATUS (#2005.2,5) ^ PLACE (#2005.2,.04)
;
GETNLOCD(MAGRY,NLOCIEN) ; RPC [MAGVA GET NET LOC DETAILS]
N RESDEL
N IENS,FILE,OUT,ERR,MAGRESA
K MAGRY
S RESDEL=$$RESDEL^MAGVAF02() ; Result delimiter
I 'NLOCIEN D Q
. N MSG
. S MSG="NETWORK LOCATION IEN is required."
. S MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
. Q
;
S IENS=NLOCIEN_","
S FILE=2005.2
D GETS^DIQ(FILE,IENS,"1;15;16;5;.04","I","OUT","ERR")
I $D(ERR("DIERR")) D Q
. D MSG^DIALOG("A",.MAGRESA,245,5,"ERR")
. S MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_"Error getting values: "_MAGRESA(1) Q ; Error getting the values
. Q
;
S MAGRY(0)=$$OK^MAGVAF02()_RESDEL_RESDEL_1
S MAGRY(1)="PHYSICAL REFERENCE"_RESDEL_"USER NAME"_RESDEL_"PASSWORD"_RESDEL_"OPERATIONAL STATUS"_RESDEL_"PLACE"
S MAGRY(2)=OUT(FILE,IENS,1,"I")_RESDEL_OUT(FILE,IENS,15,"I")_RESDEL_OUT(FILE,IENS,16,"I")
S MAGRY(2)=MAGRY(2)_RESDEL_OUT(FILE,IENS,5,"I")_RESDEL_OUT(FILE,IENS,.04,"I")
Q
;
;***** Returns information from IMAGING SITE PARAMETERS file (#2006.1)
;
; RPC: MAGVA GET ALL SITE PARAM IDS
;
; Return Values
; =============
;
; if error found during execution
; MAGRY(0) = Failure status ^ Error message
; if success
; MAGRY(0) = Success status ^^#CNT - where #CNT is a number of records returned
; MAGRY(1) = PK^Site IEN^Site Number^Site Name^Net UserName^Net Password
; MAGRY(2) = IEN ^ Site IEN ^ Site Number ^ Site Name ^ Net UserName ^ Net Password
;
GALLISP(MAGRY) ; RPC [MAGVA GET ALL SITE PARAM IDS]
N X,CNT,I,FILE,IENS,FIELDS,INSTIEN
N OUT,ERR,MAGRESA
N RESDEL
K MAGRY
S RESDEL=$$RESDEL^MAGVAF02() ; Result delimiter
S FILE=2006.1
S FIELDS=".01;50;51" ; INSTITUTION NAME; NET USER; NET PASSWORD
S IENS=""
; Index "B" is mixed with index "C" - get data from global
S I=0
S CNT=1
F S I=$O(^MAG(FILE,I)) Q:(+I)'>0 D
. S IENS=I_","
. K OUT,ERR
. D GETS^DIQ(FILE,IENS,FIELDS,"I","OUT","ERR")
. I $D(ERR("DIERR")) D Q
. . D MSG^DIALOG("A",.MAGRESA,245,5,"ERR")
. . S MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_"Error getting values: "_MAGRESA(1) Q ; Error getting the values
. . Q
. S INSTIEN=OUT(FILE,IENS,.01,"I")
. S X=$$NS^XUAF4(INSTIEN) ; IA # 2171 Institution Name and Station Number
. S CNT=CNT+1
. S MAGRY(CNT)=I_RESDEL_INSTIEN_RESDEL_$P(X,U,2)_RESDEL_$P(X,U,1)
. S MAGRY(CNT)=MAGRY(CNT)_RESDEL_OUT(FILE,IENS,50,"I")_RESDEL_OUT(FILE,IENS,51,"I")
. Q
;
S X="IEN^Site IEN^Site Number^Site Name^Net UserName^Net Password"
F I=1:1:$L(X,"^") S $P(MAGRY(1),RESDEL,I)=$P(X,"^",I)
S MAGRY(0)=$$OK^MAGVAF02()_RESDEL_RESDEL_(CNT-1)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGVAG03 10633 printed Dec 13, 2024@02:09:23 Page 2
MAGVAG03 ;WOIFO/NST - Write Location calls ; 20 Aug 2015 4:23 PM
+1 ;;3.0;IMAGING;**118,142,162**;Mar 19, 2002;Build 22;Aug 25, 2015
+2 ;; Per VHA Directive 2004-038, this routine should not be modified.
+3 ;; +---------------------------------------------------------------+
+4 ;; | Property of the US Government. |
+5 ;; | No permission to copy or redistribute this software is given. |
+6 ;; | Use of unreleased versions of this software requires the user |
+7 ;; | to execute a written test agreement with the VistA Imaging |
+8 ;; | Development Office of the Department of Veterans Affairs, |
+9 ;; | telephone (301) 734-0100. |
+10 ;; | The Food and Drug Administration classifies this software as |
+11 ;; | a medical device. As such, it may not be changed in any way. |
+12 ;; | Modifications to this software may result in an adulterated |
+13 ;; | medical device under 21CFR820, the use of which is considered |
+14 ;; | to be a violation of US Federal Statutes. |
+15 ;; +---------------------------------------------------------------+
+16 ;;
+17 QUIT
+18 ;***** Returns Current Write Location by Station number or Institution IEN
+19 ;
+20 ; RPC: MAGVA GET CWL
+21 ;
+22 ; Input Parameters
+23 ; ================
+24 ;
+25 ; MAGPARAM("STATION NUMBER") = STATION NUMBER field (#4,99) in INSTITUTION file (#4)
+26 ; or
+27 ; MAGPARAM("INSTITUTION IEN") = IEN in INSTITUTION file (#4)
+28 ;
+29 ; Return Values
+30 ; =============
+31 ;
+32 ; if error found during execution
+33 ; MAGRY(0) = Failure status ^ Error message
+34 ; if success
+35 ; MAGRY(0) = Success status ^^1
+36 ; MAGRY(1) = NETWORK LOCATION IEN ^ PHYSICAL REFERENCE ^ USER NAME ^ PASSWORD ^ PLACE
+37 ; MAGRY(2) = IEN in NETWORK LOCATION file (#2005.2) ^ PHYSICAL REFERENCE (WRITE LOCATION) (#2005.2,1)
+38 ; ^ USER NAME (#2005.2,15) ^ PASSWORD (#2005.2,16) ^ IEN in IMAGING SITE PARAMETERS file (#2006.1)
+39 ;
GETCWL(MAGRY,MAGPARAM) ; RPC [MAGVA GET CWL]
+1 ; IEN in INSTITUTION FILE (#4)
NEW PLACE
+2 NEW MAGREF,IENS,FILE,OUT,ERR
+3 NEW RESDEL
+4 NEW MAGPLC
+5 KILL MAGRY
+6 ; Result delimiter
SET RESDEL=$$RESDEL^MAGVAF02()
+7 SET PLACE=0
+8 ; Error - MAGRY(0) is already set
IF $GET(MAGPARAM("INSTITUTION IEN"))'=""
Begin DoDot:1
+9 ; P142 DAC
SET PLACE=MAGPARAM("INSTITUTION IEN")
+10 IF 'PLACE
Begin DoDot:2
+11 NEW MSG
+12 SET MSG="Invalid INSTITUTION IEN"
+13 SET MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
+14 QUIT
End DoDot:2
+15 QUIT
End DoDot:1
if 'PLACE
QUIT
+16 ; P142 DAC
IF ((PLACE)&($$STA^XUAF4(PLACE)=""))!(PLACE'=+PLACE)
SET MAGPARAM("STATION NUMBER")=$GET(MAGPARAM("INSTITUTION IEN"))
+17 ; Error - MAGRY(0) is already set
IF $GET(MAGPARAM("STATION NUMBER"))'=""
Begin DoDot:1
+18 ; IA # 2171 find the Institution IEN
SET PLACE=$$IEN^XUAF4(MAGPARAM("STATION NUMBER"))
+19 IF 'PLACE
Begin DoDot:2
+20 NEW MSG
+21 SET MSG="Invalid STATION NUMBER: "_MAGPARAM("STATION NUMBER")
+22 ; P142 DAC
IF $GET(MAGPARAM("INSTITUTION IEN"))'=""
SET MSG="Invalid INSTITUTION IEN: "_MAGPARAM("INSTITUTION IEN")
+23 SET MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
+24 QUIT
End DoDot:2
+25 QUIT
End DoDot:1
if 'PLACE
QUIT
+26 ; Error - MAGRY(0) is already set
IF 'PLACE
Begin DoDot:1
+27 NEW MSG
+28 SET MSG="STATION NUMBER or INSTITUTION IEN is required"
+29 SET MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
+30 QUIT
End DoDot:1
QUIT
+31 ;
+32 ; Get IEN of a record in IMAGING SITE PARAMETERS file (#2006.1)
SET MAGPLC=$$PLACE^MAGBAPI(PLACE)
+33 ; IMAGE NETWORK WRITE LOCATION
SET MAGREF=$$GET1^DIQ(2006.1,MAGPLC,.03,"I")
+34 IF 'MAGREF
Begin DoDot:1
+35 NEW MSG
+36 SET MSG="Need WRITE LOCATION in IMAGING SITE PARAMETERS file (#2006.1). Call IRM."
+37 SET MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
+38 QUIT
End DoDot:1
QUIT
+39 ;
+40 ; Operational status
IF '$$GET1^DIQ(2005.2,MAGREF,5,"I")
Begin DoDot:1
+41 NEW MSG
+42 SET MSG="The Server that you are writing to is off-line. Call IRM"
+43 SET MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
+44 QUIT
End DoDot:1
QUIT
+45 ;
+46 SET IENS=MAGREF_","
+47 SET FILE=2005.2
+48 DO GETS^DIQ(FILE,IENS,"1;15;16","I","OUT","ERR")
+49 IF $DATA(ERR("DIERR"))
Begin DoDot:1
+50 DO MSG^DIALOG("A",.MAGRESA,245,5,"ERR")
+51 ; Error getting the values
SET MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_"Error getting values: "_MAGRESA(1)
QUIT
+52 QUIT
End DoDot:1
QUIT
+53 ;
+54 SET MAGRY(0)=$$OK^MAGVAF02()_RESDEL_RESDEL_1
+55 SET MAGRY(1)="NETWORK LOCATION IEN"_RESDEL_"PHYSICAL REFERENCE"
+56 SET MAGRY(1)=MAGRY(1)_RESDEL_"USER NAME"_RESDEL_"PASSWORD"_RESDEL_"PLACE"
+57 SET MAGRY(2)=MAGREF_RESDEL_OUT(FILE,IENS,1,"I")
+58 SET MAGRY(2)=MAGRY(2)_RESDEL_OUT(FILE,IENS,15,"I")_RESDEL_OUT(FILE,IENS,16,"I")_RESDEL_MAGPLC
+59 QUIT
+60 ;
+61 ;***** Returns Jukebox Write Location by Station number or Institution IEN
+62 ;
+63 ; RPC: MAGVA GET JUKEBOX WL
+64 ;
+65 ; Input Parameters
+66 ; ================
+67 ;
+68 ; MAGPARAM("STATION NUMBER") = STATION NUMBER field (#4,99) in INSTITUTION file (#4)
+69 ; or
+70 ; MAGPARAM("INSTITUTION IEN") = IEN in INSTITUTION file (#4)
+71 ;
+72 ; Return Values
+73 ; =============
+74 ;
+75 ; if error found during execution
+76 ; MAGRY(0) = Failure status ^ Error message
+77 ; if success
+78 ; MAGRY(0) = Success status ^^1
+79 ; MAGRY(1) = NETWORK LOCATION IEN ^ PHYSICAL REFERENCE ^ USER NAME ^ PASSWORD ^ PLACE
+80 ; MAGRY(2) = IEN in NETWORK LOCATION file (#2005.2) ^ PHYSICAL REFERENCE (WRITE LOCATION) (#2005.2,1)
+81 ; ^ USER NAME (#2005.2,15) ^ PASSWORD (#2005.2,16) ^ IEN in IMAGING SITE PARAMETERS file (#2006.1)
+82 ;
GETJBXWL(MAGRY,MAGPARAM) ; RPC [MAGVA GET JUKEBOX WL]
+1 ; IEN in INSTITUTION FILE (#4)
NEW PLACE
+2 NEW MAGREF,IENS,FILE,OUT,ERR
+3 NEW RESDEL
+4 NEW MAGPLC
+5 KILL MAGRY
+6 ; Result delimiter
SET RESDEL=$$RESDEL^MAGVAF02()
+7 SET PLACE=0
+8 ; Error - MAGRY(0) is already set
IF $GET(MAGPARAM("INSTITUTION IEN"))'=""
Begin DoDot:1
+9 SET PLACE=+MAGPARAM("INSTITUTION IEN")
+10 IF 'PLACE
Begin DoDot:2
+11 NEW MSG
+12 SET MSG="Invalid INSTITUTION IEN"
+13 SET MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
+14 QUIT
End DoDot:2
+15 QUIT
End DoDot:1
if 'PLACE
QUIT
+16 ; Error - MAGRY(0) is already set
IF $GET(MAGPARAM("STATION NUMBER"))'=""
Begin DoDot:1
+17 ; IA # 2171 find the Institution IEN
SET PLACE=$$IEN^XUAF4(MAGPARAM("STATION NUMBER"))
+18 IF 'PLACE
Begin DoDot:2
+19 NEW MSG
+20 SET MSG="Invalid STATION NUMBER: "_MAGPARAM("STATION NUMBER")
+21 SET MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
+22 QUIT
End DoDot:2
+23 QUIT
End DoDot:1
if 'PLACE
QUIT
+24 ; Error - MAGRY(0) is already set
IF 'PLACE
Begin DoDot:1
+25 NEW MSG
+26 SET MSG="STATION NUMBER or INSTITUTION IEN is required"
+27 SET MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
+28 QUIT
End DoDot:1
QUIT
+29 ;
+30 ; Get IEN in IMAGING SITE PARAMETERS file (#2006.1)
SET MAGPLC=$$PLACE^MAGBAPI(PLACE)
+31 ; JUKEBOX WRITE LOCATION
SET MAGREF=$$GET1^DIQ(2006.1,MAGPLC,2.01,"I")
+32 IF 'MAGREF
Begin DoDot:1
+33 NEW MSG
+34 SET MSG="Need WRITE LOCATION in IMAGING SITE PARAMETERS file (#2006.1). Call IRM."
+35 SET MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
+36 QUIT
End DoDot:1
QUIT
+37 ;
+38 ; Operational status
IF '$$GET1^DIQ(2005.2,MAGREF,5,"I")
Begin DoDot:1
+39 NEW MSG
+40 SET MSG="The Server that you are writing to is off-line. Call IRM"
+41 SET MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
+42 QUIT
End DoDot:1
QUIT
+43 ;
+44 SET IENS=MAGREF_","
+45 SET FILE=2005.2
+46 DO GETS^DIQ(FILE,IENS,"1;15;16","I","OUT","ERR")
IF $DATA(ERR("DIERR"))
Begin DoDot:1
+47 DO MSG^DIALOG("A",.MAGRESA,245,5,"ERR")
+48 ; Error getting the values
SET MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_"Error getting values: "_MAGRESA(1)
QUIT
+49 QUIT
End DoDot:1
QUIT
+50 ;
+51 SET MAGRY(0)=$$OK^MAGVAF02()_RESDEL_RESDEL_1
+52 SET MAGRY(1)="NETWORK LOCATION IEN"_RESDEL_"PHYSICAL REFERENCE"
+53 SET MAGRY(1)=MAGRY(1)_RESDEL_"USER NAME"_RESDEL_"PASSWORD"_RESDEL_"PLACE"
+54 SET MAGRY(2)=MAGREF_RESDEL_OUT(FILE,IENS,1,"I")
+55 SET MAGRY(2)=MAGRY(2)_RESDEL_OUT(FILE,IENS,15,"I")_RESDEL_OUT(FILE,IENS,16,"I")_RESDEL_MAGPLC
+56 QUIT
+57 ;
+58 ;***** Returns PHYSICAL REFERENCE (WRITE LOCATION)
+59 ; USER NAME, PASSWORD, OPERATIONAL STATUS and PLACE
+60 ; by IEN in NETWORK LOCATION file (#2005.2)
+61 ;
+62 ; RPC: MAGVA GET NET LOC DETAILS
+63 ;
+64 ; Input Parameters
+65 ; ================
+66 ;
+67 ; NLOCIEN = IEN in NETWORK LOCATION file (#2005.2)
+68 ;
+69 ; Return Values
+70 ; =============
+71 ;
+72 ; if error found during execution
+73 ; MAGRY(0) = Failure status ^ Error message
+74 ; if success
+75 ; MAGRY(0) = Success status ^^1
+76 ; MAGRY(1) = PHYSICAL REFERENCE ^ USER NAME ^ PASSWORD ^ OPERATIONAL STATUS ^ PLACE
+77 ; MAGRY(2) = PHYSICAL REFERENCE (WRITE LOCATION) (#2005.2,1)
+78 ; ^ USER NAME (#2005.2,15) ^ PASSWORD (#2005.2,16)
+79 ; ^ OPERATIONAL STATUS (#2005.2,5) ^ PLACE (#2005.2,.04)
+80 ;
GETNLOCD(MAGRY,NLOCIEN) ; RPC [MAGVA GET NET LOC DETAILS]
+1 NEW RESDEL
+2 NEW IENS,FILE,OUT,ERR,MAGRESA
+3 KILL MAGRY
+4 ; Result delimiter
SET RESDEL=$$RESDEL^MAGVAF02()
+5 IF 'NLOCIEN
Begin DoDot:1
+6 NEW MSG
+7 SET MSG="NETWORK LOCATION IEN is required."
+8 SET MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_MSG
+9 QUIT
End DoDot:1
QUIT
+10 ;
+11 SET IENS=NLOCIEN_","
+12 SET FILE=2005.2
+13 DO GETS^DIQ(FILE,IENS,"1;15;16;5;.04","I","OUT","ERR")
+14 IF $DATA(ERR("DIERR"))
Begin DoDot:1
+15 DO MSG^DIALOG("A",.MAGRESA,245,5,"ERR")
+16 ; Error getting the values
SET MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_"Error getting values: "_MAGRESA(1)
QUIT
+17 QUIT
End DoDot:1
QUIT
+18 ;
+19 SET MAGRY(0)=$$OK^MAGVAF02()_RESDEL_RESDEL_1
+20 SET MAGRY(1)="PHYSICAL REFERENCE"_RESDEL_"USER NAME"_RESDEL_"PASSWORD"_RESDEL_"OPERATIONAL STATUS"_RESDEL_"PLACE"
+21 SET MAGRY(2)=OUT(FILE,IENS,1,"I")_RESDEL_OUT(FILE,IENS,15,"I")_RESDEL_OUT(FILE,IENS,16,"I")
+22 SET MAGRY(2)=MAGRY(2)_RESDEL_OUT(FILE,IENS,5,"I")_RESDEL_OUT(FILE,IENS,.04,"I")
+23 QUIT
+24 ;
+25 ;***** Returns information from IMAGING SITE PARAMETERS file (#2006.1)
+26 ;
+27 ; RPC: MAGVA GET ALL SITE PARAM IDS
+28 ;
+29 ; Return Values
+30 ; =============
+31 ;
+32 ; if error found during execution
+33 ; MAGRY(0) = Failure status ^ Error message
+34 ; if success
+35 ; MAGRY(0) = Success status ^^#CNT - where #CNT is a number of records returned
+36 ; MAGRY(1) = PK^Site IEN^Site Number^Site Name^Net UserName^Net Password
+37 ; MAGRY(2) = IEN ^ Site IEN ^ Site Number ^ Site Name ^ Net UserName ^ Net Password
+38 ;
GALLISP(MAGRY) ; RPC [MAGVA GET ALL SITE PARAM IDS]
+1 NEW X,CNT,I,FILE,IENS,FIELDS,INSTIEN
+2 NEW OUT,ERR,MAGRESA
+3 NEW RESDEL
+4 KILL MAGRY
+5 ; Result delimiter
SET RESDEL=$$RESDEL^MAGVAF02()
+6 SET FILE=2006.1
+7 ; INSTITUTION NAME; NET USER; NET PASSWORD
SET FIELDS=".01;50;51"
+8 SET IENS=""
+9 ; Index "B" is mixed with index "C" - get data from global
+10 SET I=0
+11 SET CNT=1
+12 FOR
SET I=$ORDER(^MAG(FILE,I))
if (+I)'>0
QUIT
Begin DoDot:1
+13 SET IENS=I_","
+14 KILL OUT,ERR
+15 DO GETS^DIQ(FILE,IENS,FIELDS,"I","OUT","ERR")
+16 IF $DATA(ERR("DIERR"))
Begin DoDot:2
+17 DO MSG^DIALOG("A",.MAGRESA,245,5,"ERR")
+18 ; Error getting the values
SET MAGRY(0)=$$FAILED^MAGVAF02()_RESDEL_"Error getting values: "_MAGRESA(1)
QUIT
+19 QUIT
End DoDot:2
QUIT
+20 SET INSTIEN=OUT(FILE,IENS,.01,"I")
+21 ; IA # 2171 Institution Name and Station Number
SET X=$$NS^XUAF4(INSTIEN)
+22 SET CNT=CNT+1
+23 SET MAGRY(CNT)=I_RESDEL_INSTIEN_RESDEL_$PIECE(X,U,2)_RESDEL_$PIECE(X,U,1)
+24 SET MAGRY(CNT)=MAGRY(CNT)_RESDEL_OUT(FILE,IENS,50,"I")_RESDEL_OUT(FILE,IENS,51,"I")
+25 QUIT
End DoDot:1
+26 ;
+27 SET X="IEN^Site IEN^Site Number^Site Name^Net UserName^Net Password"
+28 FOR I=1:1:$LENGTH(X,"^")
SET $PIECE(MAGRY(1),RESDEL,I)=$PIECE(X,"^",I)
+29 SET MAGRY(0)=$$OK^MAGVAF02()_RESDEL_RESDEL_(CNT-1)
+30 QUIT