MAGDCTP ;WIRMFO/JHC CT-PARAMETERS RPC ; 27 July 2006 10:05 AM
;;3.0;IMAGING;**65**;Jul 27, 2006;Build 28
;;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
ERR N ERR S ERR=$$EC^%ZOSV S @MAGGRY@(0)="0^4~"_ERR
D @^%ZOSF("ERRTN")
Q:$Q 1 Q
;
RPCIN(MAGGRY,PARAMS) ; RPC: MAGD CT PARAMS
;PARAMS: SLOC--Location code of interest
;
N $ETRAP,$ESTACK S $ETRAP="D ERR^MAGDCTP"
N DATE,DATIEN,DIQUIET,GLOC,LOCIEN,MAGLST,MANIEN,MANUF,MODEL,MODIEN,REC,REPLY,SLOC
S SLOC=$P(PARAMS,U)
S MAGLST="MAGDRPC" K MAGGRY S MAGGRY=$NA(^TMP($J,MAGLST)) K @MAGGRY
N CT S CT=0
S DIQUIET=1 D DT^DICRW
I 'SLOC S REPLY="Invalid parameter passed to MAGD CT PARAMS call ("_SLOC_")." G RPCINZ
S LOCIEN=$O(^MAG(2006.621,"B",SLOC,""))
I 'LOCIEN S REPLY="No Location data defined in CT Parameter file ("_SLOC_")." G RPCINZ
S GLOC=$NA(^MAG(2006.621,LOCIEN)),MANIEN=0
F S MANIEN=$O(@GLOC@(1,MANIEN)) Q:'MANIEN S MANUF=^(MANIEN,0),MODIEN=0 D
. F S MODIEN=$O(@GLOC@(1,MANIEN,1,MODIEN)) Q:'MODIEN S MODEL=^(MODIEN,0),DATE=0 D
. . F S DATE=$O(@GLOC@(1,MANIEN,1,MODIEN,1,"B",DATE)) Q:'DATE S DATIEN=$O(^(DATE,"")) D
. . . S X=$G(@GLOC@(1,MANIEN,1,MODIEN,1,DATIEN,0)) Q:X=""
. . . S REC=SLOC_"|"_MANUF_"|"_MODEL_"|"_$$DATE(DATE)_"|"_$P(X,U,2)
. . . S CT=CT+1,@MAGGRY@(CT)=REC
S REPLY=CT_" records returned"
;
RPCINZ S @MAGGRY@(0)=CT_U_REPLY
Q
;
DATE(X) ; convert Fman date to DD-mon-YYYY format
N Y,M,D,T S T=""
I X?7N,("123"[$E(X)) D
. S Y=$E(X),Y=$S(Y=3:20,Y=2:19,1:18)_$E(X,2,3)
. S M=+$E(X,4,5),M=$P("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,M)
. I '(M?3U) Q
. S D=+$E(X,6,7) I 'D Q
. S T=D_"-"_M_"-"_Y,X=T
Q:$Q T Q
;
EECT ;
W @IOF,!!?10,"** Enter/Edit MAG CT PARAMETER data **",!!
N MAGIEN
K DIC S (DIC,DLAYGO)=2006.621,DIC(0)="ALMEQN"
D ^DIC I Y=-1 K DIC,DIE,DR,DLAYGO Q
S DIE=2006.621,DA=+Y
S DR=".01;1;",DR(2,2006.6211)=".01;1;",DR(3,2006.62111)=".01;1;",DR(4,2006.621111)=".01;1;"
S MAGIEN=DA
D ^DIE I '$D(DA) G EECT
G EECT
Q
;
INCT ;
W @IOF,!!?10,"** Inquire MAG CT PARAMETER data **",!!
N BY,FR,TO,LOC,II,T
S DIC=2006.621,DIC(0)="AMEQ"
D ^DIC I Y=-1 K DIC Q
S DA=+Y,(FR,TO)=$P(Y,U,2),L=0
S LOC=$P(Y,U,2)
W ! D RPCIN^MAGDCTP(.T,LOC)
F I=1:1:$G(^TMP($J,"MAGDRPC",0)) S X=^(I) W ! S T=$L(X,"|") F II=1:1:T W $P(X,"|",II) W:(II'=T) " | "
R !!,"Enter RETURN to continue: ",X:DTIME W !
G INCT
Q
;
;
END ;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGDCTP 3429 printed Dec 13, 2024@01:59:50 Page 2
MAGDCTP ;WIRMFO/JHC CT-PARAMETERS RPC ; 27 July 2006 10:05 AM
+1 ;;3.0;IMAGING;**65**;Jul 27, 2006;Build 28
+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 ;; | |
+11 ;; | The Food and Drug Administration classifies this software as |
+12 ;; | a medical device. As such, it may not be changed in any way. |
+13 ;; | Modifications to this software may result in an adulterated |
+14 ;; | medical device under 21CFR820, the use of which is considered |
+15 ;; | to be a violation of US Federal Statutes. |
+16 ;; +---------------------------------------------------------------+
+17 ;;
+18 QUIT
ERR NEW ERR
SET ERR=$$EC^%ZOSV
SET @MAGGRY@(0)="0^4~"_ERR
+1 DO @^%ZOSF("ERRTN")
+2 if $QUIT
QUIT 1
QUIT
+3 ;
RPCIN(MAGGRY,PARAMS) ; RPC: MAGD CT PARAMS
+1 ;PARAMS: SLOC--Location code of interest
+2 ;
+3 NEW $ETRAP,$ESTACK
SET $ETRAP="D ERR^MAGDCTP"
+4 NEW DATE,DATIEN,DIQUIET,GLOC,LOCIEN,MAGLST,MANIEN,MANUF,MODEL,MODIEN,REC,REPLY,SLOC
+5 SET SLOC=$PIECE(PARAMS,U)
+6 SET MAGLST="MAGDRPC"
KILL MAGGRY
SET MAGGRY=$NAME(^TMP($JOB,MAGLST))
KILL @MAGGRY
+7 NEW CT
SET CT=0
+8 SET DIQUIET=1
DO DT^DICRW
+9 IF 'SLOC
SET REPLY="Invalid parameter passed to MAGD CT PARAMS call ("_SLOC_")."
GOTO RPCINZ
+10 SET LOCIEN=$ORDER(^MAG(2006.621,"B",SLOC,""))
+11 IF 'LOCIEN
SET REPLY="No Location data defined in CT Parameter file ("_SLOC_")."
GOTO RPCINZ
+12 SET GLOC=$NAME(^MAG(2006.621,LOCIEN))
SET MANIEN=0
+13 FOR
SET MANIEN=$ORDER(@GLOC@(1,MANIEN))
if 'MANIEN
QUIT
SET MANUF=^(MANIEN,0)
SET MODIEN=0
Begin DoDot:1
+14 FOR
SET MODIEN=$ORDER(@GLOC@(1,MANIEN,1,MODIEN))
if 'MODIEN
QUIT
SET MODEL=^(MODIEN,0)
SET DATE=0
Begin DoDot:2
+15 FOR
SET DATE=$ORDER(@GLOC@(1,MANIEN,1,MODIEN,1,"B",DATE))
if 'DATE
QUIT
SET DATIEN=$ORDER(^(DATE,""))
Begin DoDot:3
+16 SET X=$GET(@GLOC@(1,MANIEN,1,MODIEN,1,DATIEN,0))
if X=""
QUIT
+17 SET REC=SLOC_"|"_MANUF_"|"_MODEL_"|"_$$DATE(DATE)_"|"_$PIECE(X,U,2)
+18 SET CT=CT+1
SET @MAGGRY@(CT)=REC
End DoDot:3
End DoDot:2
End DoDot:1
+19 SET REPLY=CT_" records returned"
+20 ;
RPCINZ SET @MAGGRY@(0)=CT_U_REPLY
+1 QUIT
+2 ;
DATE(X) ; convert Fman date to DD-mon-YYYY format
+1 NEW Y,M,D,T
SET T=""
+2 IF X?7N
IF ("123"[$EXTRACT(X))
Begin DoDot:1
+3 SET Y=$EXTRACT(X)
SET Y=$SELECT(Y=3:20,Y=2:19,1:18)_$EXTRACT(X,2,3)
+4 SET M=+$EXTRACT(X,4,5)
SET M=$PIECE("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,M)
+5 IF '(M?3U)
QUIT
+6 SET D=+$EXTRACT(X,6,7)
IF 'D
QUIT
+7 SET T=D_"-"_M_"-"_Y
SET X=T
End DoDot:1
+8 if $QUIT
QUIT T
QUIT
+9 ;
EECT ;
+1 WRITE @IOF,!!?10,"** Enter/Edit MAG CT PARAMETER data **",!!
+2 NEW MAGIEN
+3 KILL DIC
SET (DIC,DLAYGO)=2006.621
SET DIC(0)="ALMEQN"
+4 DO ^DIC
IF Y=-1
KILL DIC,DIE,DR,DLAYGO
QUIT
+5 SET DIE=2006.621
SET DA=+Y
+6 SET DR=".01;1;"
SET DR(2,2006.6211)=".01;1;"
SET DR(3,2006.62111)=".01;1;"
SET DR(4,2006.621111)=".01;1;"
+7 SET MAGIEN=DA
+8 DO ^DIE
IF '$DATA(DA)
GOTO EECT
+9 GOTO EECT
+10 QUIT
+11 ;
INCT ;
+1 WRITE @IOF,!!?10,"** Inquire MAG CT PARAMETER data **",!!
+2 NEW BY,FR,TO,LOC,II,T
+3 SET DIC=2006.621
SET DIC(0)="AMEQ"
+4 DO ^DIC
IF Y=-1
KILL DIC
QUIT
+5 SET DA=+Y
SET (FR,TO)=$PIECE(Y,U,2)
SET L=0
+6 SET LOC=$PIECE(Y,U,2)
+7 WRITE !
DO RPCIN^MAGDCTP(.T,LOC)
+8 FOR I=1:1:$GET(^TMP($JOB,"MAGDRPC",0))
SET X=^(I)
WRITE !
SET T=$LENGTH(X,"|")
FOR II=1:1:T
WRITE $PIECE(X,"|",II)
if (II'=T)
WRITE " | "
+9 READ !!,"Enter RETURN to continue: ",X:DTIME
WRITE !
+10 GOTO INCT
+11 QUIT
+12 ;
+13 ;
END ;