source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RASTREQN.m@ 699

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

revised back to 6/30/08 version

File size: 7.3 KB
Line 
1RASTREQN ;HIRMFO/GJC-Status Requirement check for Radiopharms ;11/18/97 15:13
2 ;;5.0;Radiology/Nuclear Medicine;**40**;Mar 16, 1998
3 ;
4 ; *** 'RASTREQN' is called from routine: 'RASTREQ' ***
5EN1(RADIO,RAJ) ; Check if all the required radiopharmaceutical data has
6 ; been entered for this particular Examination Status.
7 ; *=*=*= Kills 'X' if the status cannot be updated =*=*=*
8 ; Input: 'RADIO' -> .5 node of the examination status (Radiopharms req)
9 ; 'RAJ' -> 0 node of the examination
10 ;
11 ; NOTE: RAMES1 is set in RASTREQ^RASTREQ subroutine. Only the 'Status
12 ; Tracking Of Exams' option displays which required fields are not
13 ; populated for the next available Exam Status.
14 ;
15 ;----------------------------------------------------------------------
16 ; Determine if 'Radiopharmaceutical' is required
17 ; RAPRI defined in [RA STATUS CHANGE] & [RA EXAM EDIT]
18 ;
19 Q:"N"[$P(RADIO,"^") ; Rpharms & Dosages NOT Req'd (either 'no' or null)
20 N RAPROC S RAPROC(0)=$G(^RAMIS(71,+$P(RAJ,"^",2),0))
21 Q:$P(RAPROC(0),"^",2)=1 ; Never ask Rpharms & Dosages
22 ;----------------------------------------------------------------------
23 N RA702 S RA702=+$P(RAJ,"^",28) ; ien in NUC MED EXAM DATA (70.2) file
24 N RA7021,RACNT,RAI,RAMES2,RAREQ,RAZ S RAI=0 W:'$D(ZTQUEUED)#2 !
25 I 'RA702,($P(RADIO,"^")="Y") D Q
26 . K X S RAZ="Radiopharmaceutical" X:$D(RAMES1) RAMES1
27 . Q
28 F S RAI=$O(^RADPTN(RA702,"NUC",RAI)) Q:RAI'>0 D
29 . S RA7021=$G(^RADPTN(RA702,"NUC",RAI,0)),RACNT=0
30 . S RAMES2="W:$G(K)=$P($G(^RA(72,+$G(RANXT72),0)),U,3)&('$D(ZTQUEUED)#2) !,""Radiopharmaceutical: "",$$GET1^DIQ(50,+$P(RA7021,""^"")_"","",.01)"
31 . I $P(RADIO,"^")="Y",($P(RA7021,"^")=""!($P(RA7021,"^",7)="")) D
32 .. K X S RACNT=RACNT+1 X:$D(RAMES1)&(RACNT=1) RAMES2
33 .. I $P(RA7021,"^")="" S RAZ="Radiopharmaceutical" X:$D(RAMES1) RAMES1
34 .. I $P(RA7021,"^",7)="" S RAZ="Dosage" X:$D(RAMES1) RAMES1
35 .. Q
36 . I $P(RADIO,"^",3)="Y",($P(RA7021,"^",4)="") D
37 .. S RACNT=RACNT+1 X:$D(RAMES1)&(RACNT=1) RAMES2
38 .. S RAZ="Activity Drawn" X:$D(RAMES1) RAMES1 K X
39 .. Q
40 . I $P(RADIO,"^",4)="Y",($P(RA7021,"^",5)=""!($P(RA7021,"^",6)="")) D
41 .. K X S RACNT=RACNT+1 X:$D(RAMES1)&(RACNT=1) RAMES2
42 .. I $P(RA7021,"^",5)="" S RAZ="Date/Time Drawn" X:$D(RAMES1) RAMES1
43 .. I $P(RA7021,"^",6)="" S RAZ="Person Who Measured Dose" X:$D(RAMES1) RAMES1
44 .. Q
45 . I $P(RADIO,"^",5)="Y",($P(RA7021,"^",8)=""!($P(RA7021,"^",9)="")) D
46 .. K X S RACNT=RACNT+1 X:$D(RAMES1)&(RACNT=1) RAMES2
47 .. I $P(RA7021,"^",8)="" S RAZ="Date/Time Dose Administered" X:$D(RAMES1) RAMES1
48 .. I $P(RA7021,"^",9)="" S RAZ="Person Who Administered Dose" X:$D(RAMES1) RAMES1
49 .. Q
50 . I $P(RADIO,"^",7)="Y",($P(RA7021,"^",11)=""!($P(RA7021,"^",12)="")) D
51 .. K X S RACNT=RACNT+1 X:$D(RAMES1)&(RACNT=1) RAMES2
52 .. I $P(RA7021,"^",11)="" S RAZ="Route Of Administration" X:$D(RAMES1) RAMES1
53 .. I $P(RA7021,"^",12)="" S RAZ="Site Of Administration" X:$D(RAMES1) RAMES1
54 .. Q
55 . I $P(RADIO,"^",8)="Y",($P(RA7021,"^",13)="") D
56 .. S RACNT=RACNT+1 X:$D(RAMES1)&(RACNT=1) RAMES2
57 .. S RAZ="Lot No." X:$D(RAMES1) RAMES1 K X
58 .. Q
59 . I $P(RADIO,"^",9)="Y",($P(RA7021,"^",14)=""!($P(RA7021,"^",15)="")) D
60 .. K X S RACNT=RACNT+1 X:$D(RAMES1)&(RACNT=1) RAMES2
61 .. I $P(RA7021,"^",14)="" S RAZ="Volume" X:$D(RAMES1) RAMES1
62 .. I $P(RA7021,"^",15)="" S RAZ="Form" X:$D(RAMES1) RAMES1
63 .. Q
64 . W:'$D(ZTQUEUED)#2 ! ; spacing
65 . Q
66 Q
67NORADIO(RAPRI,RANXT72) ; This function will determine if Rpharm
68 ; fields from the 'Nuc Med Exam Data' file [ ^RADPTN( ] will be asked.
69 ; Input : 'RANXT72' -> .6 node of the 'Next' Exam Status
70 ; : 'RAPRI' -> IEN of the procedure for this exam
71 ; Output: '1' bypass Rpharm questions, else (0) ask
72 Q:$TR($$UP^XLFSTR(RANXT72(.6)),"^","")="" 1 ; null or '^'s
73 ; ------------------- Variable Definitions ----------------------------
74 ; 'RAPROC(2)': ask Rpharm & Dosages parameter for this procedure
75 ;----------------------------------------------------------------------
76 N RAPROC S RAPROC(2)=$P($G(^RAMIS(71,RAPRI,0)),"^",2)
77 ;----------------------------------------------------------------------
78 ; * following conditions apply for descendants exams & single exams *
79 ; * Number 1: Suppress Rpharm = 1 even if 'Rpharms/Dose' Req'd *
80 ; * Number 2: Suppress Rpharm = null or 0, 'Rpharm/Dose' not req'd *
81 Q:RAPROC(2)=1 1
82 Q:"N"[$P(RANXT72(.6),"^") 1
83 ;----------------------------------------------------------------------
84 Q 0 ; ask Rpharm & Dosage fields
85DISDEF(RADA) ; Display Radiopharmaceutical default data
86 ; Input: RADA -> ien of the Nuc Med Exam Data record
87 Q:'$O(^RADPTN(RADA,"NUC",0)) ; Radiopharms missing, no data
88 N RADARY,RADEUC,RAFLDS,RAIENS,RAOPUT,X,Y W !
89 S RAIENS="" D GETS^DIQ(70.2,RADA_",","**","NE","RADARY")
90 F S RAIENS=$O(RADARY(70.21,RAIENS)) Q:RAIENS="" D
91 . Q:$P(RAIENS,",",2)="" ; top-level of the file
92 . S (RADEUC,RAFLDS)=0
93 . F S RAFLDS=$O(RADARY(70.21,RAIENS,RAFLDS)) Q:RAFLDS'>0 D Q:$D(DIRUT)
94 .. I RAFLDS=.01 D
95 ... S RADEUC=0 W !,$G(RADARY(70.21,RAIENS,RAFLDS,"E"))
96 ... W !,$$REPEAT^XLFSTR("-",$L($G(RADARY(70.21,RAIENS,RAFLDS,"E")))),!
97 ... Q
98 .. E D
99 ... S RADEUC=RADEUC+1
100 ... S RAOPUT=$$TRAN(RAFLDS)_$G(RADARY(70.21,RAIENS,RAFLDS,"E"))_$S(RAFLDS=2:" mCi",RAFLDS=4:" mCi",RAFLDS=7:" mCi",1:"")
101 ... W:RADEUC=1 $E(RAOPUT,1,38) W:RADEUC=2 ?39,$E(RAOPUT,1,39)
102 ... Q
103 .. W:RADEUC'=2&($O(RADARY(70.21,RAIENS,RAFLDS))="") !
104 .. W:RADEUC=2 ! S:RADEUC=2 RADEUC=0
105 .. Q
106 . Q
107 Q
108TRAN(X) ; Translate field name to a shorter length.
109 Q:X=2 "Dose (MD Override): " Q:X=3 "Prescriber: "
110 Q:X=4 "Activity Drawn: " Q:X=5 "Drawn: " Q:X=6 "Measured By: "
111 Q:X=7 "Dose Adm'd: " Q:X=8 "Date Adm'd: " Q:X=9 "Adm'd By: "
112 Q:X=10 "Witness: " Q:X=11 "Route: " Q:X=12 "Site: "
113 Q:X=12.5 "Site Text: " Q:X=13 "Lot #: " Q:X=14 "Volume: "
114 Q:X=15 "Form: "
115VALDOS(RALOW,RAHI,X,RABACKTO,RAGOTO,RALASTAG,RAWARN) ;validate drawn/dose
116 ; Called from [RA STATUS CHANGE] and [RA EXAM EDIT] input templates.
117 ; Validate the value for either :
118 ; ACTIVITY DRAWN (fld 4, DD: 70.21)
119 ; DOSE (fld 7, DD: 70.21)
120 ; If there are limits on the Dosage, validate.
121 ; If validate fails, ask user if the invalid value is to be accepted.
122 ; If yes, proceed.
123 ; If no, re-ask DOSE.
124 ; Input: RAHI = Upper limit on dosage
125 ; RALOW = Lower limit on dosage
126 ; X = Value user input
127 ; RABACKTO = Previous Line tag to loop back to if need re-ask
128 ; RAGOTO = Default linetag to proceed to if within range
129 ; RALASTAG = Last linetag in this edit template if early out
130 ; RAWARN = display/not the warning msg -- 0=no, 1=yes
131 ;
132 ; Output: RAY = linetag to proceed to after exiting this check
133 ;
134 N RAY,RAYN S RAY="" I X']"" S RAY=RAGOTO G KVAL
135 S:RALOW=""&(RAHI="") RAY=RAGOTO
136 S:RALOW]""&(RAHI="")&(X'<RALOW) RAY=RAGOTO
137 S:RALOW=""&(RAHI]"")&(X'>RAHI) RAY=RAGOTO
138 S:RALOW]""&(RAHI]"")&(X'<RALOW)&(X'>RAHI) RAY=RAGOTO
139 I RAY="" D
140 . F D Q:RAY]""
141 .. I $O(^RA(79,RAMDIV,"RWARN",0)) D:RAWARN
142 ... N I S I=0
143 ... F S I=$O(^RA(79,RAMDIV,"RWARN",I)) Q:I'>0 W !,$G(^(I,0))
144 ... Q
145 .. E D:RAWARN
146 ... W !,"This dose requires a written, dated and signed directive by"
147 ... W !,"a physician."
148 ... Q
149 .. W !!?3,"Are you sure (Y/N)?: N//" R RAYN:DTIME
150 .. I '$T!(RAYN["^") S RAY=RALASTAG Q
151 .. S RAYN=$S(RAYN']"":"N",1:$$UP^XLFSTR($E(RAYN)))
152 .. S RAY=$S(RAYN="N":RABACKTO,RAYN="Y":RAGOTO,1:"")
153 .. I RAY="" W !!?3,"Enter 'Yes' if this value is acceptable, or 'No' if this field is to be",!?3,"re-edited.",$C(7)
154 .. Q
155 . Q
156KVAL K RABACKTO,RAGOTO,RALASTAG,RAWARN
157 Q RAY
Note: See TracBrowser for help on using the repository browser.