Ignore:
Timestamp:
Dec 4, 2009, 12:11:15 AM (14 years ago)
Author:
George Lilly
Message:

revised back to 6/30/08 version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAWKLU.m

    r613 r623  
    1 RAWKLU  ;HISC/GJC-physician workload statistics by wRVU or CPT ;10/26/05  14:57
    2         ;;5.0;Radiology/Nuclear Medicine;**64,77,91**;Mar 16, 1998;Build 1
    3         ;01/23/08 BAY/KAM Remedy Call 227583 Patch *91 Change RVU Reports to
    4         ;         use Report End Date instead of Current date when setting
    5         ;         the flag to determine if necessary to use last year's RVU
    6         ;         data and retrieve RVU data by Verified date instead of
    7         ;         Exam date
    8         ;09/25/06 KAM/BAY Remedy Call 154793 PATCH *77 RVU with 0 value
    9         ;         and changed CPT calls from ^ICPTCOD to ^RACPTMSC
    10         ;         eliminating the need for IA's 1995 amd 1996
    11         ;03/28/07 KAM/BAY Remedy Call 179232 Patch RA*5*77
    12         ;         Add check to see if current RVU data is available and if
    13         ;         not use previous year RVU data
    14         ;
    15         ;DBIA#:4799 ($$RVU^FBRVU) return wRVU value for CPT, CPT Mod, & exam
    16         ;      date/time
    17         ;DBIA#:10060 EN1^RASELCT enacts 10060 which allows lookups on the NEW
    18         ;            PERSON (#200) file
    19         ;DBIA#:10063 ($$S^%ZTLOAD)
    20         ;DBIA#:10103 ($$FMTE^XLFDT) & ($$NOW^XLFDT)
    21         ;DBIA#:10104 ($$CJ^XLFSTR)
    22         ;DBIA#:1519  ($$EN^XUTMDEVQ)
    23         ;
    24 EN(RARPTYP,RASCLD)      ;Identifies the option that the user wishes to execute.
    25         ;input: RARPTYP="CPT" for the CPT workload report -or- "RVU" for
    26         ;       wRVU workload report. Exit if the value is neither 'CPT'
    27         ;       or 'RVU'.
    28         ;       RASCLD=null for the CPT report, zero for non-scaled wRVU, & one
    29         ;       for the scaled wRVU report.
    30         ;
    31         I RARPTYP'="CPT",(RARPTYP'="RVU") Q
    32         I RARPTYP="CPT",(RASCLD'="") Q
    33         K ^TMP($J,"RA STFPHYS"),^TMP("RA STFPHYS-IEN",$J)
    34         I RARPTYP="RVU" W !!,"Please note that this report is best suited for display on a 132 column device."
    35         ;
    36 PHYST   ;allow the user to select one/many/all physicians
    37         ;(w/ staff classification) ;DBIA#: 10060
    38         S RADIC="^VA(200,",RADIC(0)="QEAMZ",RAUTIL="RA STFPHYS"
    39         S RADIC("A")="Select Physician: ",RADIC("B")="All"
    40         S RADIC("S")="I $D(^VA(200,""ARC"",""S"",+Y))\10"
    41         W !! D EN1^RASELCT(.RADIC,RAUTIL) K %W,%Y1,DIC,RADIC,RAQUIT,RAUTIL,X,Y
    42         ;did the user select physicians to compile data on? if not, quit
    43         I $O(^TMP($J,"RA STFPHYS",""))="" D  Q
    44         .W !!?3,$C(7),"Staff Physician data was not selected."
    45         .Q
    46         ;
    47         ;build a new staff physician array (the other array is subscripted by
    48         ;physician name then IEN) subscripting by staff physician IEN this
    49         ;allows us to check the IEN of the staff physician selected by the
    50         ;user against the IEN of the staff physician on the exam record
    51         S X="" F  S X=$O(^TMP($J,"RA STFPHYS",X)) Q:X=""  D
    52         .S Y=0
    53         .F  S Y=$O(^TMP($J,"RA STFPHYS",X,Y)) Q:'Y  S ^TMP("RA STFPHYS-IEN",$J,Y)=""
    54         .Q
    55         ;
    56         K ^TMP($J,"RA STFPHYS") S RADATE=$$FMTE^XLFDT($$NOW^XLFDT\1,1)
    57         ;
    58 STRTDT  ;Prompt the user for a starting date (VERIFIED DATE)
    59         S RASTART=$$STRTDT^RAWKLU1(RADATE,2110101)
    60         I RASTART=-1 D XIT Q
    61         S RABGDTI=$P(RASTART,U),RABGDTX=$P(RASTART,U,2),RAMBGDT=RABGDTI-.0001
    62         ;need inv. verified date to search ^RARPT("AA",
    63         S RAMBGDT=9999999.9999-RAMBGDT
    64         K RASTART
    65         ;
    66 ENDDT   ;Prompt the user for an ending date (VERIFIED DATE)
    67         S RAEND=$$ENDDT^RAWKLU1(RABGDTI,RABGDTX)
    68         I RAEND=-1 D XIT Q
    69         S RAENDTI=$P(RAEND,U),RAENDTX=$P(RAEND,U,2),RAMENDT=RAENDTI+.9999
    70         ;need inv. verified date to search ^RARPT("AA",
    71         S RAMENDT=9999999.9999-RAMENDT
    72         K RAEND
    73         ;
    74         F I="RARPTYP","^TMP(""RA STFPHYS-IEN"",$J,","RADATE","RAB*","RAM*","RAE*","RASCLD" S ZTSAVE(I)=""
    75         S I="RA print "_$S(RARPTYP="CPT":"CPTs",1:"wRVUs")_" totals for physicians within imaging type"
    76         D EN^XUTMDEVQ("START^RAWKLU",I,.ZTSAVE,,1)
    77         I +$G(ZTSK)>0 W !!,"Task Number: "_ZTSK,!
    78         K I,ZTSAVE,ZTSK
    79         Q
    80         ;
    81 START   ;check exams based on criteria input by user; physician & exam D/T
    82         ;eliminate the exam record is one of the following conditions is true:
    83         ;1-the status of the exam is 'Cancelled'
    84         ;2-the physician(s) selected are not the primary staff for the exam
    85         ;
    86         ;03/28/07 KAM/BAY Remedy Call 179232 Added next line
    87         S RACYFLG=0
    88         ;03/28/07 KAM/BAY RA*5*77/179232 Added Fee Basis Data Check
    89         D CHKCY^RAWKLU2
    90         S:$D(ZTQUEUED)#2 ZTREQ="@"
    91         K ^TMP($J,"RA BY STFPHYS"),^TMP($J,"RA BY I-TYPE")
    92         S ^TMP($J,"RA BY I-TYPE")="0^0^0^0^0^0^0^0^0",CNT=0
    93         ;define where the totals for imaging type will reside on the globals
    94         F RAI="RAD","MRI","CT","US","NM","VAS","ANI","CARD","MAM" S CNT=CNT+1,RAIAB(RAI)=CNT
    95         K RAI,CNT S RARPTVDT=RAMBGDT,(RACNT,RAXIT)=0
    96         F  S RARPTVDT=$O(^RARPT("AA",RARPTVDT),-1) Q:'RARPTVDT!(RARPTVDT<RAMENDT)  D  Q:RAXIT
    97         .S RARPTIEN=0
    98         .F  S RARPTIEN=$O(^RARPT("AA",RARPTVDT,RARPTIEN)) Q:'RARPTIEN  D  Q:RAXIT
    99         ..S RARPT=$G(^RARPT(RARPTIEN,0)),RADFN=+$P(RARPT,U,2),RADTE=+$P(RARPT,U,3)
    100         ..S RADTI=9999999.9999-RADTE,RA7002=$G(^RADPT(RADFN,"DT",RADTI,0))
    101         ..Q:$P(RA7002,U,2)=""  ;no imaging type defined
    102         ..S RAITYP=$P($G(^RA(79.2,$P(RA7002,U,2),0)),U,3) ;abbreviation
    103         ..Q:'($D(RAIAB(RAITYP))#2)
    104         ..S RACNI=0
    105         ..F  S RACNI=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI)) Q:'RACNI  D  Q:RAXIT
    106         ...S RA7003=$G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)) Q:RA7003=""  ;missing exam node
    107         ...Q:$P(RA7003,U,17)'=RARPTIEN  ;exam references a different report!
    108         ...S RACNT=RACNT+1
    109         ...;
    110         ...;did the user stop the task? Check every five hundred records...
    111         ...S:RACNT#500=0 (RAXIT,ZTSTOP)=$$S^%ZTLOAD() Q:RAXIT
    112         ...;
    113         ...;1-begin exam status check
    114         ...Q:$P($G(^RA(72,+$P(RA7003,U,3),0)),U,3)=0  ;cancelled...
    115         ...;end exam status check
    116         ...;
    117         ...;2-begin physician check
    118         ...Q:'$P(RA7003,U,15)  ;no physician, quit check
    119         ...Q:'$D(^TMP("RA STFPHYS-IEN",$J,$P(RA7003,U,15)))#2
    120         ...;end physician check
    121         ...;
    122         ...S RASTAFF=$$EXTERNAL^DILFD(70.03,15,,$P(RA7003,U,15))
    123         ...I RARPTYP="CPT" D  Q
    124         ....;Total the # of CPTs performed by a physician within an i-type;
    125         ....;the # on CPTs performed within i-type; the # of procedures
    126         ....;performed by physician. all exams are either detailed or series
    127         ....;(CPT codes defined) types of procedures.
    128         ....D ARY(1)
    129         ....Q
    130         ...D RVU
    131         ...Q
    132         ..Q
    133         .Q
    134         D EN^RAWKLU1 ;output the report
    135         D XIT
    136         Q
    137         ;
    138 ARY(Y)  ;increment the array by one in the case of CPT or by the wRVU
    139         ;value
    140         ;input: Y=either one when adding the number of CPTs performed by a
    141         ;         physician, within an i-type or by physician within i-type
    142         ;    -or- the WRVU value when totaling for the aforementioned criteria
    143         ;
    144         S $P(^TMP($J,"RA BY STFPHYS",RASTAFF),U,RAIAB(RAITYP))=+$P($G(^TMP($J,"RA BY STFPHYS",RASTAFF)),U,RAIAB(RAITYP))+Y
    145         S $P(^TMP($J,"RA BY I-TYPE"),U,RAIAB(RAITYP))=$P(^TMP($J,"RA BY I-TYPE"),U,RAIAB(RAITYP))+Y
    146         Q
    147         ;
    148 RVU     ;Total the # of wRVUs performed by a physician within an i-type; all
    149         ;exams are either detailed or series types of procedures. By definition
    150         ;these procedure types MUST have CPT code defined.
    151         ;Pass the exam date, CPT, & CPT modifiers into the FEE BASIS function
    152         ;to derive the wRVU
    153         ;
    154         ;get exam date/time
    155         N RAXAMDT S RAXAMDT=$P(RA7002,U)
    156         ;get the CPT code value
    157         S RACPT=$P($G(^RAMIS(71,+$P(RA7003,U,2),0)),U,9) ;pointer to file #81
    158         ; 09/27/2006 KAM/BAY Patch RA*5*77 Changed next line to use ^RACPTMSC
    159         S RACPT=$P($$NAMCODE^RACPTMSC(RACPT,RAXAMDT),U,1) ;CPT code is 1st pc
    160         ;
    161         ;get CPT code modifier string
    162         S RACPTMOD="",RABILAT=0
    163         I $O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CMOD",0))>0 S RAI=0 D
    164         .F  S RAI=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CMOD",RAI)) Q:'RAI  D
    165         ..S RACPTMOD(0)=+$G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CMOD",RAI,0))
    166         ..;09/27/2006 KAM/BAY RA*5*77 Changed next line to use ^RACPTMSC
    167         ..S RA813(0)=$$BASICMOD^RACPTMSC(RACPTMOD(0),RAXAMDT)
    168         ..I 'RABILAT,$P(RA813(0),U,2)=50 S RABILAT=1 ;bilateral multiplier=2
    169         ..S RACPTMOD=RACPTMOD_$P(RA813(0),U,2)_","
    170         ..Q
    171         .Q
    172         ;get wRVU value from FEE BASIS; returns a string: status^value^message
    173         ;where status'=1 means "in error". All exams prior to 1/1/1999 will
    174         ;use 1999 wRVU values for their calculations.
    175         ;03/28/2007 KAM/BAY Rem Call 179232 Added RACYFLG to $S in next line
    176         ;01/23/2008 KAM/BAY RA*5*91 Remedy Call 227583 Changed the next line
    177         ;                   to use the Verified date of the exam date
    178         S RAWRVU=$$RVU^FBRVU(RACPT,RACPTMOD,$S((9999999.9999-RARPTVDT)<2990101:2990101,RACYFLG:(9999999.9999-RARPTVDT)-10000,1:(9999999.9999-RARPTVDT)))
    179         ; 09/25/2006 KAM/BAY Remedy Call 154793 Correct 0 RVUs
    180         I $P(RAWRVU,U,2)=0,RACPTMOD="" D
    181         . ;01/23/2008 KAM/BAY RA*5*91 Remedy Call 227583 Changed the next lin
    182         . ;                   to use the Verified date of the exam date
    183         . S RAWRVU=$$RVU^FBRVU(RACPT,26,$S((9999999.9999-RARPTVDT)<2990101:2990101,RACYFLG:(9999999.9999-RARPTVDT)-10000,1:(9999999.9999-RARPTVDT)))
    184         ;
    185         I $P(RAWRVU,U)=1 D
    186         .;apply bilateral multiplier if appropriate
    187         .S:RABILAT RAWRVU=$P(RAWRVU,U,2)*2
    188         .;or not...
    189         .S:'RABILAT RAWRVU=$P(RAWRVU,U,2)
    190         .I RASCLD S RAWRVU=RAWRVU*$$SFCTR^RAWRVUP($P(RA7002,U,2),RAXAMDT)
    191         .Q
    192         ;
    193         E  S RAWRVU=0 ;status some other value than 1; "in error"
    194         S:RAWRVU>0 RAWRVU=$J(RAWRVU,1,2) ;do not round the value...
    195         D ARY(RAWRVU)
    196         K RA813,RABILAT,RACPT,RACPTMOD,RAI,RAWRVU
    197         Q
    198         ;
    199 XIT     ;kill variables and exit
    200         W:$G(ZTSTOP)=1 !,$$CJ^XLFSTR("USER STOPPED PROCESS THROUGH TASKMAN",IOM)
    201         K DIRUT,DTOUT,DUOUT,RA7002,RA7003,RABGDTI,RABGDTX,RACNI,RADATE
    202         K RADFN,RADTE,RADTI,RAENDTI,RAENDTX,RAIAB,RAITYP,RAMBGDT,RAMENDT
    203         K RARPT,RARPTIEN,RARPTVDT,RASTAFF,RAXIT,X,Y,^TMP("RA STFPHYS-IEN",$J)
    204         K ^TMP($J,"RA BY STFPHYS"),^TMP($J,"RA BY I-TYPE"),RACYFLG
    205         Q
     1RAWKLU ;HISC/GJC-physician workload statistics by wRVU or CPT ;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 ;
     19EN(RARPTYP,RASCLD) ;Identifies the option that the user wishes to execute.
     20 ;input: RARPTYP="CPT" for the CPT workload report -or- "RVU" for
     21 ;       wRVU workload report. Exit if the value is neither 'CPT'
     22 ;       or 'RVU'.
     23 ;       RASCLD=null for the CPT report, zero for non-scaled wRVU, & one
     24 ;       for the scaled wRVU report.
     25 ;
     26 I RARPTYP'="CPT",(RARPTYP'="RVU") Q
     27 I RARPTYP="CPT",(RASCLD'="") Q
     28 K ^TMP($J,"RA STFPHYS"),^TMP("RA STFPHYS-IEN",$J)
     29 I RARPTYP="RVU" W !!,"Please note that this report is best suited for display on a 132 column device."
     30 ;
     31PHYST ;allow the user to select one/many/all physicians
     32 ;(w/ staff classification) ;DBIA#: 10060
     33 S RADIC="^VA(200,",RADIC(0)="QEAMZ",RAUTIL="RA STFPHYS"
     34 S RADIC("A")="Select Physician: ",RADIC("B")="All"
     35 S RADIC("S")="I $D(^VA(200,""ARC"",""S"",+Y))\10"
     36 W !! D EN1^RASELCT(.RADIC,RAUTIL) K %W,%Y1,DIC,RADIC,RAQUIT,RAUTIL,X,Y
     37 ;did the user select physicians to compile data on? if not, quit
     38 I $O(^TMP($J,"RA STFPHYS",""))="" D  Q
     39 .W !!?3,$C(7),"Staff Physician data was not selected."
     40 .Q
     41 ;
     42 ;build a new staff physician array (the other array is subscripted by
     43 ;physician name then IEN) subscripting by staff physician IEN this
     44 ;allows us to check the IEN of the staff physician selected by the
     45 ;user against the IEN of the staff physician on the exam record
     46 S X="" F  S X=$O(^TMP($J,"RA STFPHYS",X)) Q:X=""  D
     47 .S Y=0
     48 .F  S Y=$O(^TMP($J,"RA STFPHYS",X,Y)) Q:'Y  S ^TMP("RA STFPHYS-IEN",$J,Y)=""
     49 .Q
     50 ;
     51 K ^TMP($J,"RA STFPHYS") S RADATE=$$FMTE^XLFDT($$NOW^XLFDT\1,1)
     52 ;
     53STRTDT ;Prompt the user for a starting date (VERIFIED DATE)
     54 S RASTART=$$STRTDT^RAWKLU1(RADATE,2110101)
     55 I RASTART=-1 D XIT Q
     56 S RABGDTI=$P(RASTART,U),RABGDTX=$P(RASTART,U,2),RAMBGDT=RABGDTI-.0001
     57 ;need inv. verified date to search ^RARPT("AA",
     58 S RAMBGDT=9999999.9999-RAMBGDT
     59 K RASTART
     60 ;
     61ENDDT ;Prompt the user for an ending date (VERIFIED DATE)
     62 S RAEND=$$ENDDT^RAWKLU1(RABGDTI,RABGDTX)
     63 I RAEND=-1 D XIT Q
     64 S RAENDTI=$P(RAEND,U),RAENDTX=$P(RAEND,U,2),RAMENDT=RAENDTI+.9999
     65 ;need inv. verified date to search ^RARPT("AA",
     66 S RAMENDT=9999999.9999-RAMENDT
     67 K RAEND
     68 ;
     69 F I="RARPTYP","^TMP(""RA STFPHYS-IEN"",$J,","RADATE","RAB*","RAM*","RAE*","RASCLD" S ZTSAVE(I)=""
     70 S I="RA print "_$S(RARPTYP="CPT":"CPTs",1:"wRVUs")_" totals for physicians within imaging type"
     71 D EN^XUTMDEVQ("START^RAWKLU",I,.ZTSAVE,,1)
     72 I +$G(ZTSK)>0 W !!,"Task Number: "_ZTSK,!
     73 K I,ZTSAVE,ZTSK
     74 Q
     75 ;
     76START ;check exams based on criteria input by user; physician & exam D/T
     77 ;eliminate the exam record is one of the following conditions is true:
     78 ;1-the status of the exam is 'Cancelled'
     79 ;2-the physician(s) selected are not the primary staff for the exam
     80 ;
     81 ;03/28/07 KAM/BAY Remedy Call 179232 Added next line
     82 S RACYFLG=0
     83 ;03/28/07 KAM/BAY RA*5*77/179232 Added Fee Basis Data Check
     84 D CHKCY^RAWKLU2
     85 S:$D(ZTQUEUED)#2 ZTREQ="@"
     86 K ^TMP($J,"RA BY STFPHYS"),^TMP($J,"RA BY I-TYPE")
     87 S ^TMP($J,"RA BY I-TYPE")="0^0^0^0^0^0^0^0^0",CNT=0
     88 ;define where the totals for imaging type will reside on the globals
     89 F RAI="RAD","MRI","CT","US","NM","VAS","ANI","CARD","MAM" S CNT=CNT+1,RAIAB(RAI)=CNT
     90 K RAI,CNT S RARPTVDT=RAMBGDT,(RACNT,RAXIT)=0
     91 F  S RARPTVDT=$O(^RARPT("AA",RARPTVDT),-1) Q:'RARPTVDT!(RARPTVDT<RAMENDT)  D  Q:RAXIT
     92 .S RARPTIEN=0
     93 .F  S RARPTIEN=$O(^RARPT("AA",RARPTVDT,RARPTIEN)) Q:'RARPTIEN  D  Q:RAXIT
     94 ..S RARPT=$G(^RARPT(RARPTIEN,0)),RADFN=+$P(RARPT,U,2),RADTE=+$P(RARPT,U,3)
     95 ..S RADTI=9999999.9999-RADTE,RA7002=$G(^RADPT(RADFN,"DT",RADTI,0))
     96 ..Q:$P(RA7002,U,2)=""  ;no imaging type defined
     97 ..S RAITYP=$P($G(^RA(79.2,$P(RA7002,U,2),0)),U,3) ;abbreviation
     98 ..Q:'($D(RAIAB(RAITYP))#2)
     99 ..S RACNI=0
     100 ..F  S RACNI=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI)) Q:'RACNI  D  Q:RAXIT
     101 ...S RA7003=$G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)) Q:RA7003=""  ;missing exam node
     102 ...Q:$P(RA7003,U,17)'=RARPTIEN  ;exam references a different report!
     103 ...S RACNT=RACNT+1
     104 ...;
     105 ...;did the user stop the task? Check every five hundred records...
     106 ...S:RACNT#500=0 (RAXIT,ZTSTOP)=$$S^%ZTLOAD() Q:RAXIT
     107 ...;
     108 ...;1-begin exam status check
     109 ...Q:$P($G(^RA(72,+$P(RA7003,U,3),0)),U,3)=0  ;cancelled...
     110 ...;end exam status check
     111 ...;
     112 ...;2-begin physician check
     113 ...Q:'$P(RA7003,U,15)  ;no physician, quit check
     114 ...Q:'$D(^TMP("RA STFPHYS-IEN",$J,$P(RA7003,U,15)))#2
     115 ...;end physician check
     116 ...;
     117 ...S RASTAFF=$$EXTERNAL^DILFD(70.03,15,,$P(RA7003,U,15))
     118 ...I RARPTYP="CPT" D  Q
     119 ....;Total the # of CPTs performed by a physician within an i-type;
     120 ....;the # on CPTs performed within i-type; the # of procedures
     121 ....;performed by physician. all exams are either detailed or series
     122 ....;(CPT codes defined) types of procedures.
     123 ....D ARY(1)
     124 ....Q
     125 ...D RVU
     126 ...Q
     127 ..Q
     128 .Q
     129 D EN^RAWKLU1 ;output the report
     130 D XIT
     131 Q
     132 ;
     133ARY(Y) ;increment the array by one in the case of CPT or by the wRVU
     134 ;value
     135 ;input: Y=either one when adding the number of CPTs performed by a
     136 ;         physician, within an i-type or by physician within i-type
     137 ;    -or- the WRVU value when totaling for the aforementioned criteria
     138 ;
     139 S $P(^TMP($J,"RA BY STFPHYS",RASTAFF),U,RAIAB(RAITYP))=+$P($G(^TMP($J,"RA BY STFPHYS",RASTAFF)),U,RAIAB(RAITYP))+Y
     140 S $P(^TMP($J,"RA BY I-TYPE"),U,RAIAB(RAITYP))=$P(^TMP($J,"RA BY I-TYPE"),U,RAIAB(RAITYP))+Y
     141 Q
     142 ;
     143RVU ;Total the # of wRVUs performed by a physician within an i-type; all
     144 ;exams are either detailed or series types of procedures. By definition
     145 ;these procedure types MUST have CPT code defined.
     146 ;Pass the exam date, CPT, & CPT modifiers into the FEE BASIS function
     147 ;to derive the wRVU
     148 ;
     149 ;get exam date/time
     150 N RAXAMDT S RAXAMDT=$P(RA7002,U)
     151 ;get the CPT code value
     152 S RACPT=$P($G(^RAMIS(71,+$P(RA7003,U,2),0)),U,9) ;pointer to file #81
     153 ; 09/27/2006 KAM/BAY Patch RA*5*77 Changed next line to use ^RACPTMSC
     154 S RACPT=$P($$NAMCODE^RACPTMSC(RACPT,RAXAMDT),U,1) ;CPT code is 1st pc
     155 ;
     156 ;get CPT code modifier string
     157 S RACPTMOD="",RABILAT=0
     158 I $O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CMOD",0))>0 S RAI=0 D
     159 .F  S RAI=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CMOD",RAI)) Q:'RAI  D
     160 ..S RACPTMOD(0)=+$G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CMOD",RAI,0))
     161 ..;09/27/2006 KAM/BAY RA*5*77 Changed next line to use ^RACPTMSC
     162 ..S RA813(0)=$$BASICMOD^RACPTMSC(RACPTMOD(0),RAXAMDT)
     163 ..I 'RABILAT,$P(RA813(0),U,2)=50 S RABILAT=1 ;bilateral multiplier=2
     164 ..S RACPTMOD=RACPTMOD_$P(RA813(0),U,2)_","
     165 ..Q
     166 .Q
     167 ;get wRVU value from FEE BASIS; returns a string: status^value^message
     168 ;where status'=1 means "in error". All exams prior to 1/1/1999 will
     169 ;use 1999 wRVU values for their calculations.
     170 ;03/28/2007 KAM/BAY Rem Call 179232 Added RACYFLG to $S in next line
     171 S RAWRVU=$$RVU^FBRVU(RACPT,RACPTMOD,$S(RAXAMDT<2990101:2990101,RACYFLG:RAXAMDT-10000,1:RAXAMDT))
     172 ; 09/25/2006 KAM/BAY Remedy Call 154793 Correct 0 RVUs
     173 I $P(RAWRVU,U,2)=0,RACPTMOD="" D
     174 . S RAWRVU=$$RVU^FBRVU(RACPT,26,$S(RAXAMDT<2990101:2990101,RACYFLG:RAXAMDT-10000,1:RAXAMDT))
     175 ;
     176 I $P(RAWRVU,U)=1 D
     177 .;apply bilateral multiplier if appropriate
     178 .S:RABILAT RAWRVU=$P(RAWRVU,U,2)*2
     179 .;or not...
     180 .S:'RABILAT RAWRVU=$P(RAWRVU,U,2)
     181 .I RASCLD S RAWRVU=RAWRVU*$$SFCTR^RAWRVUP($P(RA7002,U,2),RAXAMDT)
     182 .Q
     183 ;
     184 E  S RAWRVU=0 ;status some other value than 1; "in error"
     185 S:RAWRVU>0 RAWRVU=$J(RAWRVU,1,2) ;do not round the value...
     186 D ARY(RAWRVU)
     187 K RA813,RABILAT,RACPT,RACPTMOD,RAI,RAWRVU
     188 Q
     189 ;
     190XIT ;kill variables and exit
     191 W:$G(ZTSTOP)=1 !,$$CJ^XLFSTR("USER STOPPED PROCESS THROUGH TASKMAN",IOM)
     192 K DIRUT,DTOUT,DUOUT,RA7002,RA7003,RABGDTI,RABGDTX,RACNI,RADATE
     193 K RADFN,RADTE,RADTI,RAENDTI,RAENDTX,RAIAB,RAITYP,RAMBGDT,RAMENDT
     194 K RARPT,RARPTIEN,RARPTVDT,RASTAFF,RAXIT,X,Y,^TMP("RA STFPHYS-IEN",$J)
     195 K ^TMP($J,"RA BY STFPHYS"),^TMP($J,"RA BY I-TYPE"),RACYFLG
     196 Q
Note: See TracChangeset for help on using the changeset viewer.