source: FOIAVistA/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAPROD2.m@ 1757

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

initial load of FOIAVistA 6/30/08 version

File size: 4.4 KB
Line 
1RAPROD2 ;HIRMFO/GJC-Display Med & Radiopharm values for exams ;12/12/96 13:35
2 ;;5.0;Radiology/Nuclear Medicine;**45**;Mar 16, 1998
3 ;
4PHARM(RADA) ; Display Pharmaceutical default data for Exam displays
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,RAHDR,RAPHARM,RASUB S RA1="",RASUB=70.15,RAXIT=0
9 D GETS^DIQ(70.03,RADA,"200*","NE","RAPHARM") Q:'$D(RAPHARM)
10 S RAHDR=$$CJ^XLFSTR("Medications",IOM,"-")
11 I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() Q:RAXIT W @IOF
12 W !,RAHDR,!
13 F S RA1=$O(RAPHARM(RASUB,RA1)) Q:RA1']"" D Q:RAXIT
14 . S RACNT=0
15 . I $G(RAPHARM(RASUB,RA1,.01,"E"))]"" D
16 .. W "Med: ",$E($G(RAPHARM(RASUB,RA1,.01,"E")),1,32)
17 .. S RACNT=RACNT+1
18 .. Q
19 . I $G(RAPHARM(RASUB,RA1,2,"E"))]"" D
20 .. N RAX S RAX="""Dose Adm'd: "",$E($G(RAPHARM(RASUB,RA1,2,""E"")),1,32)"
21 .. S RACNT=RACNT+1 W:RACNT=1 @RAX W:RACNT=2 ?39,@RAX
22 .. Q
23 . I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() Q:RAXIT D HDR
24 . I RACNT=2 W ! S RACNT=0
25 . I $G(RAPHARM(RASUB,RA1,4,"E"))]"" D
26 .. N RAX S RAX="""Adm'd By: "",$E($G(RAPHARM(RASUB,RA1,4,""E"")),1,28)"
27 .. S RACNT=RACNT+1 W:RACNT=1 @RAX W:RACNT=2 ?39,@RAX
28 .. Q
29 . I RACNT=2 W ! S RACNT=0
30 . I $G(RAPHARM(RASUB,RA1,3,"E"))]"" D
31 .. N RAX S RAX="""Date Adm'd: "",$E($G(RAPHARM(RASUB,RA1,3,""E"")),1,30)"
32 .. S RACNT=RACNT+1 W:RACNT=1 @RAX W:RACNT=2 ?39,@RAX
33 .. Q
34 . W:$O(RAPHARM(RASUB,RA1)) !!
35 . Q
36 Q
37RDIO(RADA) ; Display Radiopharmaceutical default data for Exam displays
38 ; Input: RADA -> ien of the Nuc Med Exam Data record (file 70.2)
39 ; *** Called only if $P(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0),U,28)>0 ***
40 N RACNT,RADARY,RAFLDS,RAHDR,RAIENS,RAOPUT,X,Y
41 S RAIENS="",RAXIT=0 D GETS^DIQ(70.2,RADA_",","**","NE","RADARY")
42 Q:'$D(RADARY) S RAHDR=$$CJ^XLFSTR("Radiopharmaceuticals",IOM,"-")
43 I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() Q:RAXIT W @IOF
44 W !,RAHDR,!
45 F S RAIENS=$O(RADARY(70.21,RAIENS)) Q:RAIENS="" D Q:RAXIT
46 . S (RACNT,RAFLDS)=0
47 . F S RAFLDS=$O(RADARY(70.21,RAIENS,RAFLDS)) Q:RAFLDS'>0 D Q:RAXIT
48 .. Q:$G(RADARY(70.21,RAIENS,RAFLDS,"E"))']""
49 .. I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() Q:RAXIT D HDR
50 .. S RAOPUT=$$TRN1(RAFLDS)_$G(RADARY(70.21,RAIENS,RAFLDS,"E"))_$S(RAFLDS=2:" mCi",RAFLDS=4:" mCi",RAFLDS=7:" mCi",1:""),RACNT=RACNT+1
51 .. W:RACNT=1 $E(RAOPUT,1,38) W:RACNT=2 ?39,$E(RAOPUT,1,39)
52 .. W:RACNT=2 ! S:RACNT=2 RACNT=0
53 .. Q
54 . W:$O(RADARY(70.21,RAIENS)) !!
55 . Q
56 Q
57TRN1(X) ; Translate Radiopharmaceutical field name to a shorter length.
58 Q:X=.01 "Rpharm: " Q:X=2 "Dose (MD Override): " Q:X=3 "Prescriber: "
59 Q:X=4 "Activity Drawn: " Q:X=5 "Drawn: " Q:X=6 "Measured By: "
60 Q:X=7 "Dose Adm'd: " Q:X=8 "Date Adm'd: " Q:X=9 "Adm'd By: "
61 Q:X=10 "Witness: " Q:X=11 "Route: " Q:X=12 "Site: "
62 Q:X=12.5 "Site Text: " Q:X=13 "Lot #: " Q:X=14 "Volume: "
63 Q:X=15 "Form: "
64HDR ; Pharmaceutical/Radiopharmaceutical Header
65 W @IOF,!,RAHDR,! S RACNT=0
66 Q
67 ;
68CMHIST(RADFN,RADTI,RACNI) ;main body
69 ;input: RADFN=DFN of the Rad/Nuc Med patient (file 2)
70 ; RADTI=exam date/time (inverse)
71 ; RACNI=ien of exam record (examinations sub-file 70.03)
72 ;
73 N X S RAHD="Contrast Media Edit History"
74 S $P(RALINE,"-",(IOM+1))=""
75 S RAPG=0 W:$E(IOST,1,2)="C-" @IOF ;clear screen
76 D CMHDR S (RACMDT,RAXIT)=0
77 ;$O down 'B' xref in ascending chronological order
78 F S RACMDT=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"AUD","B",RACMDT)) Q:'RACMDT D Q:RAXIT
79 .S RAIEN=+$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"AUD","B",RACMDT,0))
80 .;get_changed date/time, get_previous CM value, get_user
81 .S RAY(0)=$G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"AUD",RAIEN,0))
82 .S RAADT=$$FMTE^XLFDT($P(RAY(0),U),"1P"),RACMU=$P(RAY(0),U,2)
83 .S:+$P(RAY(0),U,3) RAAU=$$GET1^DIQ(200,$P(RAY(0),U,3)_",",.01)
84 .S X=$S($L(RACMU):$$CONTRAST^RACMHIS(RACMU),1:"")
85 .I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() Q:RAXIT D CMHDR
86 .W !,RAADT,?40,$E($G(RAAU),1,35) W:X="" !
87 .I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() Q:RAXIT D CMHDR
88 .I X'="" D D ^DIWW K ^UTILITY($J,"W")
89 ..S DIWL=3,DIWR=70,DIWF="W" D ^DIWP
90 ..Q
91 .Q
92EXIT ;clean up symbol table, message to user
93 ;if there are no records to print, alert user
94 W:'$D(RAY(0))#2 !,$$CJ^XLFSTR("*** No Records To Print ***",IOM)
95 K RAADT,RAAU,RACH2,RACHNG2,RACMU,RAHD,RAIEN,RALINE,RAPG
96 K RACMDT,RAY
97 Q
98 ;
99CMHDR ; print header
100 W:RAPG @IOF S RAPG=RAPG+1
101 W !,$$CJ^XLFSTR(RAHD,IOM)
102 W !,"Date/Time Changed",?40,"User",!?2,"Contrast Media"
103 W !,$$CJ^XLFSTR(RALINE,IOM)
104 Q
105 ;
Note: See TracBrowser for help on using the repository browser.