source: FOIAVistA/trunk/r/IMAGING-MAG-ZMAG/MAGDCTP.m@ 1154

Last change on this file since 1154 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.3 KB
Line 
1MAGDCTP ;WIRMFO/JHC CT-PARAMETERS RPC ; 27 July 2006 10:05 AM
2 ;;3.0;IMAGING;**65**;Jul 27, 2006;Build 28
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;; +---------------------------------------------------------------+
5 ;; | Property of the US Government. |
6 ;; | No permission to copy or redistribute this software is given. |
7 ;; | Use of unreleased versions of this software requires the user |
8 ;; | to execute a written test agreement with the VistA Imaging |
9 ;; | Development Office of the Department of Veterans Affairs, |
10 ;; | telephone (301) 734-0100. |
11 ;; | |
12 ;; | The Food and Drug Administration classifies this software as |
13 ;; | a medical device. As such, it may not be changed in any way. |
14 ;; | Modifications to this software may result in an adulterated |
15 ;; | medical device under 21CFR820, the use of which is considered |
16 ;; | to be a violation of US Federal Statutes. |
17 ;; +---------------------------------------------------------------+
18 ;;
19 Q
20ERR N ERR S ERR=$$EC^%ZOSV S @MAGGRY@(0)="0^4~"_ERR
21 D @^%ZOSF("ERRTN")
22 Q:$Q 1 Q
23 ;
24RPCIN(MAGGRY,PARAMS) ; RPC: MAGD CT PARAMS
25 ;PARAMS: SLOC--Location code of interest
26 ;
27 N $ETRAP,$ESTACK S $ETRAP="D ERR^MAGDCTP"
28 N DATE,DATIEN,DIQUIET,GLOC,LOCIEN,MAGLST,MANIEN,MANUF,MODEL,MODIEN,REC,REPLY,SLOC
29 S SLOC=$P(PARAMS,U)
30 S MAGLST="MAGDRPC" K MAGGRY S MAGGRY=$NA(^TMP($J,MAGLST)) K @MAGGRY
31 N CT S CT=0
32 S DIQUIET=1 D DT^DICRW
33 I 'SLOC S REPLY="Invalid parameter passed to MAGD CT PARAMS call ("_SLOC_")." G RPCINZ
34 S LOCIEN=$O(^MAG(2006.621,"B",SLOC,""))
35 I 'LOCIEN S REPLY="No Location data defined in CT Parameter file ("_SLOC_")." G RPCINZ
36 S GLOC=$NA(^MAG(2006.621,LOCIEN)),MANIEN=0
37 F S MANIEN=$O(@GLOC@(1,MANIEN)) Q:'MANIEN S MANUF=^(MANIEN,0),MODIEN=0 D
38 . F S MODIEN=$O(@GLOC@(1,MANIEN,1,MODIEN)) Q:'MODIEN S MODEL=^(MODIEN,0),DATE=0 D
39 . . F S DATE=$O(@GLOC@(1,MANIEN,1,MODIEN,1,"B",DATE)) Q:'DATE S DATIEN=$O(^(DATE,"")) D
40 . . . S X=$G(@GLOC@(1,MANIEN,1,MODIEN,1,DATIEN,0)) Q:X=""
41 . . . S REC=SLOC_"|"_MANUF_"|"_MODEL_"|"_$$DATE(DATE)_"|"_$P(X,U,2)
42 . . . S CT=CT+1,@MAGGRY@(CT)=REC
43 S REPLY=CT_" records returned"
44 ;
45RPCINZ S @MAGGRY@(0)=CT_U_REPLY
46 Q
47 ;
48DATE(X) ; convert Fman date to DD-mon-YYYY format
49 N Y,M,D,T S T=""
50 I X?7N,("123"[$E(X)) D
51 . S Y=$E(X),Y=$S(Y=3:20,Y=2:19,1:18)_$E(X,2,3)
52 . S M=+$E(X,4,5),M=$P("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,M)
53 . I '(M?3U) Q
54 . S D=+$E(X,6,7) I 'D Q
55 . S T=D_"-"_M_"-"_Y,X=T
56 Q:$Q T Q
57 ;
58EECT ;
59 W @IOF,!!?10,"** Enter/Edit MAG CT PARAMETER data **",!!
60 N MAGIEN
61 K DIC S (DIC,DLAYGO)=2006.621,DIC(0)="ALMEQN"
62 D ^DIC I Y=-1 K DIC,DIE,DR,DLAYGO Q
63 S DIE=2006.621,DA=+Y
64 S DR=".01;1;",DR(2,2006.6211)=".01;1;",DR(3,2006.62111)=".01;1;",DR(4,2006.621111)=".01;1;"
65 S MAGIEN=DA
66 D ^DIE I '$D(DA) G EECT
67 G EECT
68 Q
69 ;
70INCT ;
71 W @IOF,!!?10,"** Inquire MAG CT PARAMETER data **",!!
72 N BY,FR,TO,LOC,II,T
73 S DIC=2006.621,DIC(0)="AMEQ"
74 D ^DIC I Y=-1 K DIC Q
75 S DA=+Y,(FR,TO)=$P(Y,U,2),L=0
76 S LOC=$P(Y,U,2)
77 W ! D RPCIN^MAGDCTP(.T,LOC)
78 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) " | "
79 R !!,"Enter RETURN to continue: ",X:DTIME W !
80 G INCT
81 Q
82 ;
83 ;
84END ;
Note: See TracBrowser for help on using the repository browser.