source: FOIAVistA/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACPT1.m@ 1803

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

initial load of FOIAVistA 6/30/08 version

File size: 4.5 KB
Line 
1RACPT1 ;HISC/GJC,FPT-Procedure/CPT Stats Report ;12/29/00 11:28
2 ;;5.0;Radiology/Nuclear Medicine;**26,69**;Mar 16, 1998
3 ;01/19/2006 KAM/BAY Remedy Call 97373 CPT Code Display Problem
4CHK ;
5 I $O(RACCESS(DUZ,""))="" D SETVARS^RAPSET1(0) S RAPSTX=""
6 I $O(RACCESS(DUZ,""))="" D ACCVIO^RAUTL19 S RAQUIT=1 Q
7 D ASK1^RAWKL ;ask if want separate CPT mods
8 I $$DIVLOC^RAUTL7() D S RAQUIT=1 Q
9 . I $O(^TMP($J,"RA D-TYPE",""))="" W !!?5,"No divisions selected." Q
10 . I $O(^TMP($J,"RA I-TYPE",""))="" W !!?5,"No imaging types selected."
11 . Q
12 W ! S RACAN=$$YESNO()
13 ; RACAN=0: cancelled exams excluded, RACAN=1: cancelled exams
14 ; are included, RACAN=-1: exit option
15 S:RACAN<0 RAQUIT=1 Q:$G(RAQUIT)
16 K DIR S DIR(0)="Y",DIR("B")="Yes"
17 S DIR("A")="Do you wish to include all Procedures"
18 S DIR("?",1)="Enter 'Yes' to select all entries in the file."
19 S DIR("?")="Enter 'No' to select a subset of entries in the file."
20 W ! D ^DIR K DIR I $D(DIRUT) S RAQUIT=1 Q
21 S RAINPUT=+Y
22 I RAINPUT=0 D Q:$G(RAQUIT)
23 . K RADIC
24 . S RADIC="^RAMIS(71,",RADIC(0)="EMQZ",RADIC("A")="Select PROCEDURE: "
25 . S RAUTIL="RA P-TYPE" D EN1^RASELCT(.RADIC,RAUTIL,"",RAINPUT)
26 . I $O(^TMP($J,"RA P-TYPE",""))=""!$G(RAQUIT) W !!?5,"No procedures selected." S RAQUIT=1
27 . Q
28 S RANUMPRC=$$PROCNUM()
29DATE D DATE^RAUTL Q:RAPOP
30 ;S Z=9999999.9999, WHY IS THIS NEEDED?
31 S RABEG=BEGDATE,RAEND=ENDDATE+.9
32 S DIR(0)="S^I:INPATIENT;O:OUTPATIENT;B:BOTH;",DIR("B")="BOTH",DIR("?",1)="This CPT Workload Report can be broken",DIR("?")="out by Inpatient, Outpatient or Both.",DIR("A")="Report to include"
33 D ^DIR S RASORT=Y I $D(DIRUT) S RAQUIT=1 Q
34 K DIR,X,Y
35 S ZTRTN="START^RACPT"
36 F RASV="RACAN","RANUMPRC","BEGDATE","ENDDATE","RABEG","RAEND","RASORT","RAINPUT","RACMLIST" S ZTSAVE(RASV)=""
37 F RASV="D","I","P" S ZTSAVE("^TMP($J,""RA "_RASV_"-TYPE"",")=""
38 W ! D ZIS^RAUTL
39 Q
40PRINT ; Output data
41 ; 01/19/2006 KAM/BAY Changed next line to utilize $$NAMCODE^RACPTMSC
42 I '$G(RACMLIST) W !,$P($$NAMCODE^RACPTMSC(CPT,""),U),?7,$S($D(^RAMIS(71,J,0)):$E($P(^(0),"^"),1,38),1:"UNKNOWN") S RATOT(1)=+$P(^(0),U,10) ;cost per unit
43 ; 01/19/2006 KAM/BAY Changed next line to utilize $$NAMCODE^RACPTMSC
44 I $G(RACMLIST) W !,$P($$NAMCODE^RACPTMSC(CPT,""),U),?15,$S($D(^RAMIS(71,J,0)):$E($P(^(0),"^"),1,30),1:"UNKNOWN") S RATOT(1)=+$P(^(0),U,10) ;cost per unit
45 S RATOT(2)=RATOT*RATOT(1) ;occurrence * cost per unit
46 S RATOT(4)=$G(^TMP($J,"RA",RAI,RADIV,RAIMAG(1),"DONE"))
47 S RATOT(5)=$G(^TMP($J,"RA",RAI,RADIV,RAIMAG(1),"COST"))
48 W ?45,$J(RATOT,5),?52,$S(RATOT(4)=0:$J(0,3,0),1:$J(RATOT/RATOT(4)*100,3,0))
49 W ?56,$J(RATOT(1),8,2)
50 W ?65,$J(RATOT(2),10,2),?77,$S(RATOT(5)=0:$J(0,3,0),1:$J(RATOT(2)/RATOT(5)*100,3,0))
51 I $E(IOST,1,2)="C-",$Y+4>IOSL D HANG1,HED:'RAEXIT
52 Q
53HED ; Issue header
54 W:($E(IOST)="C")!(PAGE>1) @IOF
55 N RA S RA=">>>>> PROCEDURE/CPT STATISTICS REPORT "
56 S RA=RA_$S(RAI="I":"(INPATIENT)",RAI="O":"(OUTPATIENT)",1:"")_" <<<<<"
57 W !?78-$L(RA)\2,RA,?70,"Page: ",PAGE S PAGE=PAGE+1
58 W !!," Division: ",$S(RADIV="":"Unknown",$D(^DIC(4,RADIV,0)):$P(^(0),U),1:"Unknown")
59 W !,"Imaging Type: ",RAIMAG(0)
60 W ?52,"For period: ",BEGDATE(0)," to"
61 W !," Run Date: ",RARUNDTE,?64,ENDDATE(0)
62 W !," # of Procedures selected: ",$S(RAINPUT:"All",1:RANUMPRC)
63 W ?52,"Cancelled Exams: "_$S(RACAN:"in",1:"ex")_"cluded"
64 W:'$G(RACMLIST) !!,"CPT",?7,"PROCEDURE"
65 W:$G(RACMLIST) !!,"CPT (* : >3 CPT mods)",?25,"PROCEDURE"
66 W ?44,"# DONE",?52,"(%)",?59,"$UNIT",?69,"$TOTAL",?77,"(%)",!,QQ
67 Q
68HANG ; get to the EOP
69 Q:$E(IOST,1,2)'="C-"
70 F Z=1:1:(IOSL-($Y+4)) W !
71HANG1 ; Issue EOP prompt
72 R !!,"Press RETURN to continue or an '^' to stop ",X:DTIME
73 S RAEXIT=(X=U)
74 Q
75SRTPA(RA) ; Check on the sort parameters. If inpatient and outpatient,
76 ; issue a EOP prompt when the sort parameter changes.
77 ; '1' implies that we are sorting by both inpatient/outpatient and
78 ; are on the second parameter, '0' implies that we fail the above
79 ; conditions.
80 I ($L(RASORT,",")#2)=0,(RA>1),('+$G(RAEOPFLG)) Q 1
81 Q 0
82PROCNUM() ; Determine the number of procedures a user has chosen.
83 N X,Y S X="",Y=0
84 F S X=$O(^TMP($J,"RA P-TYPE",X)) Q:X']"" S Y=Y+1
85 Q Y
86YESNO() ; Pass back the user's response to the 'Yes/No' question
87 ; returns: 0=user answers No, 1=user answers Yes, -1='^' or timeout
88 N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y S DIR(0)="Y",DIR("B")="Yes"
89 S DIR("A")="Do you wish to include cancelled cases"
90 S DIR("?",1)="Enter 'Yes' if exams with an examination status of Cancelled"
91 S DIR("?",2)="are to be included on the report. Enter 'No' if cancelled exams"
92 S DIR("?")="are to be excluded from the report." D ^DIR
93 S:$D(DIRUT) Y=-1
94 Q Y
Note: See TracBrowser for help on using the repository browser.