source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAWKLU2.m@ 701

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

revised back to 6/30/08 version

File size: 7.8 KB
Line 
1RAWKLU2 ;HISC/GJC-physician wRVU (scaled too) by procedure ;10/26/05 14:57
2 ;;5.0;Radiology/Nuclear Medicine;**64,77**;Mar 16, 1998;Build 7
3 ;09/25/06 KAM/BAY Remedy Call 154793 PATCH *77 RVU with 0 value
4 ; and changed CPT calls from ^ICPTCOD to ^RACPTMSC
5 ; eliminating the need for IA's 1995 amd 1996
6 ;03/28/07 KAM/BAY Remedy Call 179232 Patch RA*5*77
7 ; Add check to see if current RVU data is available and if
8 ; not use previous year RVU data
9 ;
10 ;DBIA#:4799 ($$RVU^FBRVU) return wRVU value for CPT, CPT Mod, & exam
11 ; date/time
12 ;DBIA#:10060 EN1^RASELCT enacts 10060 which allows lookups on the NEW
13 ; PERSON (#200) file
14 ;DBIA#:10063 ($$S^%ZTLOAD)
15 ;DBIA#:10103 ($$FMTE^XLFDT) & ($$NOW^XLFDT)
16 ;DBIA#:10104 ($$CJ^XLFSTR)
17 ;DBIA#:1519 ($$EN^XUTMDEVQ)
18 ;DBIA#:4432 (LASTCY^FBAAFSR) return last calendar year file
19 ; 162.99 was updated
20 ;
21EN(RASCLD) ;Identifies the option that the user wishes to execute.
22 ;input: RASCLD=zero for non-scaled wRVU, & one for the scaled wRVU
23 ; report.
24 ;
25 K ^TMP($J,"RA STFPHYS"),^TMP("RA STFPHYS-IEN",$J)
26 ;
27PHYST ;allow the user to select one/many/all physicians
28 ;(w/ staff classification) ;DBIA#: 10060
29 S RADIC="^VA(200,",RADIC(0)="QEAMZ",RAUTIL="RA STFPHYS"
30 S RADIC("A")="Select Physician: ",RADIC("B")="All"
31 S RADIC("S")="I $D(^VA(200,""ARC"",""S"",+Y))\10"
32 W !! D EN1^RASELCT(.RADIC,RAUTIL) K %W,%Y1,DIC,RADIC,RAUTIL,X,Y
33 ;did the user select physicians to compile data on? if not, quit
34 I $O(^TMP($J,"RA STFPHYS",""))="" D Q
35 .W !!?3,$C(7),"Staff Physician data was not selected."
36 .Q
37 ;
38 ;build a new staff physician array (the other array is subscripted by
39 ;physician name then IEN) subscripting by staff physician IEN this
40 ;allows us to check the IEN of the staff physician selected by the
41 ;user against the IEN of the staff physician on the exam record
42 S X="" F S X=$O(^TMP($J,"RA STFPHYS",X)) Q:X="" D
43 .S Y=0
44 .F S Y=$O(^TMP($J,"RA STFPHYS",X,Y)) Q:'Y S ^TMP("RA STFPHYS-IEN",$J,Y)=""
45 .Q
46 ;
47 K ^TMP($J,"RA STFPHYS") S RADATE=$$FMTE^XLFDT($$NOW^XLFDT\1,1)
48 ;
49STRTDT ;Prompt the user for the starting verified date
50 S RASTART=$$STRTDT^RAWKLU1(RADATE,2110101)
51 I RASTART=-1 D XIT Q
52 S RABGDTI=$P(RASTART,U),RABGDTX=$P(RASTART,U,2),RAMBGDT=RABGDTI-.0001
53 ;need inv. verified date to search ^RARPT("AA",
54 S RAMBGDT=9999999.9999-RABGDTI
55 K RASTART
56 ;
57ENDDT ;Prompt the user for the ending verified date
58 S RAEND=$$ENDDT^RAWKLU1(RABGDTI,RABGDTX)
59 I RAEND=-1 D XIT Q
60 S RAENDTI=$P(RAEND,U),RAENDTX=$P(RAEND,U,2),RAMENDT=RAENDTI+.9999
61 ;need inv. verified date to search ^RARPT("AA",
62 S RAMENDT=9999999.9999-RAMENDT
63 K RAEND
64 ;
65 F I="^TMP(""RA STFPHYS-IEN"",$J,","RADATE","RAB*","RAM*","RAE*","RASCLD" S ZTSAVE(I)=""
66 S I="RA print procedures, wRVUs, and their totals for a physician"
67 D EN^XUTMDEVQ("START^RAWKLU2",I,.ZTSAVE,,1)
68 I +$G(ZTSK)>0 W !!,"Task Number: "_ZTSK,!
69 K I,ZTSAVE,ZTSK
70 Q
71 ;
72START ;check exams based on criteria input by user; physician & exam D/T
73 ;eliminate the exam record is one of the following conditions is true:
74 ;1-the status of the exam is 'Cancelled'
75 ;2-the physician(s) selected are not the primary staff for the exam
76 ;
77 S:$D(ZTQUEUED)#2 ZTREQ="@"
78 K ^TMP($J,"RA BY STFPHYS")
79 ;03/28/07 KAM/BAY Remedy Call 179232 Added RACYFLG to next line
80 S RARPTVDT=RAMBGDT,(RACNT,RAXIT,RACYFLG)=0
81 ;03/28/07 KAM/BAY RA*5*77/179232 Added Fee Basis Data Check
82 D CHKCY
83 F S RARPTVDT=$O(^RARPT("AA",RARPTVDT),-1) Q:'RARPTVDT!(RARPTVDT<RAMENDT) D Q:RAXIT
84 .S RARPTIEN=0
85 .F S RARPTIEN=$O(^RARPT("AA",RARPTVDT,RARPTIEN)) Q:'RARPTIEN D Q:RAXIT
86 ..S RARPT=$G(^RARPT(RARPTIEN,0)),RADFN=+$P(RARPT,U,2),RADTE=+$P(RARPT,U,3)
87 ..S RADTI=9999999.9999-RADTE,RA7002=$G(^RADPT(RADFN,"DT",RADTI,0))
88 ..S RAXAMDT=+$P(RA7002,U) Q:'RAXAMDT
89 ..;must check every exam registered for this exam date/time; we might have a printset
90 ..S RACNI=0 F S RACNI=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI)) Q:'RACNI D XAM
91 ..Q
92 .Q
93 D EN^RAWKLU3 ;output the report
94 D XIT
95 Q
96 ;
97XAM ; get exam information; procedure name, exam status order #, int. staff phys...
98 S RA7003=$G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)) Q:'RA7003
99 Q:$P(RA7003,U,17)'=RARPTIEN ;exam references a different report!
100 S RAPRCIEN=+$P(RA7003,U,2) Q:'RAPRCIEN
101 S RAPRCIEN(0)=$P($G(^RAMIS(71,RAPRCIEN,0)),U) Q:RAPRCIEN(0)=""
102 S RACNT=RACNT+1
103 ;
104 ;did the user stop the task? Check every five hundred records...
105 S:RACNT#500=0 (RAXIT,ZTSTOP)=$$S^%ZTLOAD() Q:RAXIT
106 ;
107 ;1-begin exam status check
108 Q:$P($G(^RA(72,+$P(RA7003,U,3),0)),U,3)=0 ;cancelled...
109 ;end exam status check
110 ;
111 ;2-begin physician check
112 Q:'$P(RA7003,U,15) ;no physician, quit check
113 Q:'$D(^TMP("RA STFPHYS-IEN",$J,$P(RA7003,U,15)))#2
114 ;end physician check
115 ;
116 S RACPT=$P($G(^RAMIS(71,+$P(RA7003,U,2),0)),U,9) Q:'RACPT ;ptr to file #81
117 ;
118 ; 09/27/2006 KAM/BAY Patch RA*5*77 Changed next line to use ^RACPTMSC
119 S RACPT=$P($$NAMCODE^RACPTMSC(RACPT,RAXAMDT),U,1) ;CPT code is 1st pc
120 ;
121 S RASTF=$$EXTERNAL^DILFD(70.03,15,,$P(RA7003,U,15))
122 D SETARRY K RA7003,RACPT,RAPRCIEN,RASTF
123 Q
124 ;
125SETARRY ;find the wRVU value (either un-scaled or scaled) for a particular CPT
126 ;or CPT code/CPT modifier combination. The case identifiers, CPT code
127 ;(RACPT), & exam date (RAXAMDT) are known.
128 ;
129 ;get CPT code modifier string
130 S RACPTMOD="",RABILAT=0
131 I $O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CMOD",0))>0 S RAI=0 D
132 .F S RAI=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CMOD",RAI)) Q:'RAI D
133 ..S RACPTMOD(0)=+$G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CMOD",RAI,0))
134 ..;09/27/2006 KAM/BAY RA*5*77 Changed next line to use ^RACPTMSC
135 ..S RA813(0)=$$BASICMOD^RACPTMSC(RACPTMOD(0),RAXAMDT)
136 ..I 'RABILAT,$P(RA813(0),U,2)=50 S RABILAT=1 ;bilateral multiplier=2
137 ..S RACPTMOD=RACPTMOD_$P(RA813(0),U,2)_","
138 ..Q
139 .Q
140 ;get wRVU value from FEE BASIS; returns a string: status^value^message
141 ;where status'=1 means "in error". All exams prior to 1/1/1999 will use
142 ;1999 wRVU values for their calculations.
143 ;03/28/2007 KAM/BAY Rem Call 179232 Added RACYFLG to $S in next line
144 S RAWRVU=$$RVU^FBRVU(RACPT,RACPTMOD,$S(RAXAMDT<2990101:2990101,RACYFLG:RAXAMDT-10000,1:RAXAMDT))
145 ;09/27/2006 KAM/BAY RA*5*77 Remedy Call 154793
146 I $P(RAWRVU,U,2)=0,RACPTMOD="" D
147 . S RAWRVU=$$RVU^FBRVU(RACPT,26,$S(RAXAMDT<2990101:2990101,RACYFLG:RAXAMDT-10000,1:RAXAMDT))
148 I $P(RAWRVU,U)=1 D
149 .;apply bilateral multiplier if appropriate
150 .S:RABILAT RAWRVU=$P(RAWRVU,U,2)*2
151 .;or not...
152 .S:'RABILAT RAWRVU=$P(RAWRVU,U,2)
153 .I RASCLD S RAWRVU=RAWRVU*$$SFCTR^RAWRVUP($P(RA7002,U,2),RAXAMDT)
154 .Q
155 ;
156 E S RAWRVU=0 ;status some other value than 1; "in error"
157 S:RAWRVU>0 RAWRVU=$J(RAWRVU,1,2) ;do not round the value...
158 ;
159 ;^TMP($J,"RA BY STFPHYS",RASTF)=total # procedures^wRVU total(all proc)
160 ;^TMP($J,"RA BY STFPHYS",RASTF,RACPT,RAWRVU,RAPRCIEN(0))=^total # RACPT^
161 ; total # RAWRVU
162 ;
163 S:'$D(^TMP($J,"RA BY STFPHYS",RASTF))#2 ^(RASTF)="0^0"
164 S $P(^TMP($J,"RA BY STFPHYS",RASTF),U)=$P(^TMP($J,"RA BY STFPHYS",RASTF),U)+1
165 S $P(^TMP($J,"RA BY STFPHYS",RASTF),U,2)=$P(^TMP($J,"RA BY STFPHYS",RASTF),U,2)+RAWRVU
166 S:'$D(^TMP($J,"RA BY STFPHYS",RASTF,RACPT,RAWRVU,RAPRCIEN(0)))#2 ^(RAPRCIEN(0))="^0^0"
167 S $P(^TMP($J,"RA BY STFPHYS",RASTF,RACPT,RAWRVU,RAPRCIEN(0)),U,2)=+$P($G(^TMP($J,"RA BY STFPHYS",RASTF,RACPT,RAWRVU,RAPRCIEN(0))),U,2)+1
168 S $P(^TMP($J,"RA BY STFPHYS",RASTF,RACPT,RAWRVU,RAPRCIEN(0)),U,3)=RAWRVU*(+$P(^TMP($J,"RA BY STFPHYS",RASTF,RACPT,RAWRVU,RAPRCIEN(0)),U,2))
169 ;
170 K RA813,RABILAT,RACPTMOD,RAI,RAWRVU
171 Q
172 ;
173XIT ;kill variables and exit
174 W:$G(ZTSTOP)=1 !,$$CJ^XLFSTR("USER STOPPED PROCESS THROUGH TASKMAN",IOM)
175 K DIR,DIROUT,DIRUT,DTOUT,DUOUT,RA7002,RABGDTI,RABGDTX,RACNI,RACNT,RADATE
176 K RADFN,RADTE,RADTI,RAENDTI,RAENDTX,RAMBGDT,RAMENDT,RAQUIT,RARPT,RARPTIEN
177 K RARPTVDT,RAXAMDT,RAXIT,X,Y,RACYFLG
178 K ^TMP("RA STFPHYS-IEN",$J),^TMP($J,"RA BY STFPHYS")
179 Q
180 ;
181CHKCY ;03/28/2007 KAM/BAY RA*5*77 Remedy Call 179232 Check for latest RVU
182 ;data from Fee Basis
183 ;
184 S RACYFLG=0,Y=$G(DT) D DD^%DT
185 I $$LASTCY^FBAAFSR()<$P(Y," ",3) S RACYFLG=1
186 Q
Note: See TracBrowser for help on using the repository browser.