source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RARTUTL.m@ 1800

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

initial load of WorldVistAEHR

File size: 5.7 KB
Line 
1RARTUTL ;HIRMFO/GJC-Utility to display Pharm & Radiopharm data ;11/18/97 13:33
2 ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
3 ;
4PHARM(RADA) ; Display Pharmaceutical default data
5 ; Input: RADA -> ien for the Examinations (50) multiple.
6 ; in the following format: RACNI_","_RADTI_","_RADFN_","
7 ; *** Called only if $O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"RX",0)) ***
8 N RA1,RACNT,RAPHARM,RASUB,X,Y S RA1="",RASUB=70.15
9 D GETS^DIQ(70.03,RADA,"200*","NE","RAPHARM") Q:'$D(RAPHARM)
10 I '$D(RAUTOE),($Y>(IOSL-4)) D HANG^RARTR2 Q:$D(RAOOUT) D HD^RARTR
11 F S RA1=$O(RAPHARM(RASUB,RA1)) Q:RA1']"" D Q:$D(RAOOUT)
12 . S RACNT=0
13 . I $G(RAPHARM(RASUB,RA1,.01,"E"))]"" D
14 .. N RADOSE S RADOSE=$S($G(RAPHARM(RASUB,RA1,2,"E"))]"":", "_$G(RAPHARM(RASUB,RA1,2,"E")),1:"")
15 .. W:'$D(RAUTOE) !," Pharmaceutical: ",$E($G(RAPHARM(RASUB,RA1,.01,"E")),1,40)_RADOSE
16 .. S:$D(RAUTOE) ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=" Pharmaceutical: "_$E($G(RAPHARM(RASUB,RA1,.01,"E")),1,40)_RADOSE
17 .. Q
18 . I '$D(RAUTOE),($Y>(IOSL-4)) D HANG^RARTR2 Q:$D(RAOOUT) D HD^RARTR
19 . W:'$D(RAUTOE)&(($G(RAPHARM(RASUB,RA1,3,"E"))]"")!($G(RAPHARM(RASUB,RA1,4,"E"))]"")) !
20 . I $G(RAPHARM(RASUB,RA1,3,"E"))]"" D
21 .. S RACNT=RACNT+1
22 .. I '$D(RAUTOE) D
23 ... W " Adm'd on "_$E($G(RAPHARM(RASUB,RA1,3,"E")),1,21)
24 ... Q
25 .. E D
26 ... S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=" Adm'd on "_$E($G(RAPHARM(RASUB,RA1,3,"E")),1,21)
27 ... Q
28 .. Q
29 . I $G(RAPHARM(RASUB,RA1,4,"E"))]"" D
30 .. S RACNT=RACNT+1
31 .. I '$D(RAUTOE) D
32 ... N RAX S RAX="""by "",$E($G(RAPHARM(RASUB,RA1,4,""E"")),1,30)"
33 ... W:RACNT=1 " ",@RAX W:RACNT=2 " ",@RAX
34 ... Q
35 .. E D
36 ... S:RACNT=2 ^TMP($J,"RA AUTOE",RAACNT)=^TMP($J,"RA AUTOE",RAACNT)_" by "_$E($G(RAPHARM(RASUB,RA1,4,"E")),1,30)
37 ... S:RACNT=1 ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=" by "_$E($G(RAPHARM(RASUB,RA1,4,"E")),1,30)
38 ... Q
39 .. Q
40 . Q
41 Q
42RDIO(RADA) ; Display Radiopharmaceutical default data for Report displays
43 ; Input: RADA -> ien of the Nuc Med Exam Data record (file 70.2)
44 ; *** Called only if $P(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0),U,28)>0 ***
45 N RADARY,X,Y
46 D GETS^DIQ(70.2,RADA_",","**","NE","RADARY") Q:'$D(RADARY)
47 I '$D(RAUTOE),($Y>(IOSL-4)) D HANG^RARTR2 Q:$D(RAOOUT) D HD^RARTR
48 N RAIENS S RAIENS=""
49 F S RAIENS=$O(RADARY(70.21,RAIENS)) Q:RAIENS="" D Q:$D(RAOOUT)
50 . N RADOSE S RADOSE=$S($G(RADARY(70.21,RAIENS,7,"E"))]"":", "_$G(RADARY(70.21,RAIENS,7,"E"))_" mCi",1:"")
51 . I '$D(RAUTOE),($Y>(IOSL-4)) D HANG^RARTR2 Q:$D(RAOOUT) D HD^RARTR
52 . I '$D(RAUTOE) D
53 .. W !," Radiopharmaceutical: "_$G(RADARY(70.21,RAIENS,.01,"E"))_RADOSE
54 .. Q
55 . E D
56 .. S ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=" Radiopharmaceutical: "_$G(RADARY(70.21,RAIENS,.01,"E"))_RADOSE
57 .. Q
58 . Q:$G(RADARY(70.21,RAIENS,8,"E"))=""&($G(RADARY(70.21,RAIENS,9,"E"))="")&($G(RADARY(70.21,RAIENS,11,"E"))="")&($G(RADARY(70.21,RAIENS,12,"E"))="")
59 . N RACNT,RALNGTH S RACNT=0
60 . F RADFLDS=8,9,11,12 D Q:'$D(RAUTOE)&($D(RAOOUT))
61 .. W:'RACNT&(RADFLDS=8)&('$D(RAUTOE)) ! ; initial line feed, spacing
62 .. S:'RACNT&(RADFLDS=8)&($D(RAUTOE)) ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=""
63 .. I $G(RADARY(70.21,RAIENS,RADFLDS,"E"))]"" D
64 ... W:RACNT=2 ! S:RACNT=2 RACNT=0 ; NEW LINE
65 ... S RACNT=RACNT+1
66 ... I '$D(RAUTOE) D
67 .... I $Y>(IOSL-4) D HANG^RARTR2 Q:$D(RAOOUT) D HD^RARTR W !
68 .... W:RADFLDS=8 $S(RACNT=2:" Adm'd on ",1:" Adm'd on ")
69 .... W:RADFLDS=9 $S(RACNT=2:" by ",1:" by ")
70 .... W:RADFLDS=11 $S(RACNT=2:" Route ",1:" Route ")
71 .... W:RADFLDS=12 $S(RACNT=2:" Site ",1:" Site ")
72 .... S RALNGTH=$G(RADARY(70.21,RAIENS,RADFLDS,"E"))
73 .... I RACNT=2,((RALNGTH+$X)>IOM) D
74 ..... W $E($G(RADARY(70.21,RAIENS,RADFLDS,"E")),1,(IOM-($X-1)))
75 ..... Q
76 .... E W $G(RADARY(70.21,RAIENS,RADFLDS,"E"))
77 .... I $Y>(IOSL-4) D HANG^RARTR2 Q:$D(RAOOUT) D HD^RARTR W !
78 .... Q
79 ... E D
80 .... S:RADFLDS=8 ^TMP($J,"RA AUTOE",RAACNT)=^TMP($J,"RA AUTOE",RAACNT)_$S(RACNT=2:" Adm'd on ",1:" Adm'd on ")
81 .... S:RADFLDS=9 ^TMP($J,"RA AUTOE",RAACNT)=^TMP($J,"RA AUTOE",RAACNT)_$S(RACNT=2:" by ",1:" by ")
82 .... S:RADFLDS=11 ^TMP($J,"RA AUTOE",RAACNT)=^TMP($J,"RA AUTOE",RAACNT)_$S(RACNT=2:" Route ",1:" Route ")
83 .... S:RADFLDS=12 ^TMP($J,"RA AUTOE",RAACNT)=^TMP($J,"RA AUTOE",RAACNT)_$S(RACNT=2:" Site ",1:" Site ")
84 .... S ^TMP($J,"RA AUTOE",RAACNT)=^TMP($J,"RA AUTOE",RAACNT)_$G(RADARY(70.21,RAIENS,RADFLDS,"E"))
85 .... S:RACNT=2 ^TMP($J,"RA AUTOE",$$INCR^RAUTL4(RAACNT))=""
86 .... S:RACNT=2 RACNT=0
87 .... Q
88 ... Q
89 .. Q
90 . Q
91 Q
92PHARM1(RADA) ; Display Pharmaceutical default data
93 ; Input: RADA -> ien for the Examinations (50) multiple.
94 ; in the following format: RACNI_","_RADTI_","_RADFN_","
95 ; Output: 'X' -> $S(X'="":'abnormal exit',1:'full display')
96 ; *** Called only if $O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"RX",0)) ***
97 N RA1,RACNT,RAPHARM,RASUB,RAXIT,Y S (RA1,X)="",RASUB=70.15,RAXIT=0
98 D GETS^DIQ(70.03,RADA,"200*","NE","RAPHARM") Q:'$D(RAPHARM) ""
99 D WAIT^RART1:($Y+6)>IOSL&('$D(RARTVERF)) Q:X="T"!(X="P")!(X="^") X
100 I X="C" W @IOF S X=""
101 F S RA1=$O(RAPHARM(RASUB,RA1)) Q:RA1']"" D Q:RAXIT
102 . S RACNT=0
103 . I $G(RAPHARM(RASUB,RA1,.01,"E"))]"" D
104 .. N RADOSE S RADOSE=$S($G(RAPHARM(RASUB,RA1,2,"E"))]"":", "_$G(RAPHARM(RASUB,RA1,2,"E")),1:"")
105 .. W !," Pharmaceutical: ",$E($G(RAPHARM(RASUB,RA1,.01,"E")),1,40)_RADOSE
106 .. Q
107 . D WAIT^RART1:($Y+6)>IOSL&('$D(RARTVERF)) S:X="T"!(X="P")!(X="^") RAXIT=1
108 . Q:RAXIT
109 . I X="C" W @IOF S X=""
110 . W:$G(RAPHARM(RASUB,RA1,3,"E"))]""!($G(RAPHARM(RASUB,RA1,4,"E"))]"") !
111 . I $G(RAPHARM(RASUB,RA1,3,"E"))]"" D
112 .. S RACNT=RACNT+1
113 .. W " Adm'd "_$E($G(RAPHARM(RASUB,RA1,3,"E")),1,21)
114 .. Q
115 . I $G(RAPHARM(RASUB,RA1,4,"E"))]"" D
116 .. S RACNT=RACNT+1
117 .. N RAX S RAX="""by "",$E($G(RAPHARM(RASUB,RA1,4,""E"")),1,30)"
118 .. W:RACNT=1 " ",@RAX W:RACNT=2 " ",@RAX
119 .. Q
120 . Q
121 Q $G(X)
Note: See TracBrowser for help on using the repository browser.