source: FOIAVistA/tag/r/SURGERY-SR/SROACC0.m@ 1154

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

initial load of FOIAVistA 6/30/08 version

File size: 4.5 KB
Line 
1SROACC0 ;BIR/MAM - CPT ACCURACY SORT BY SPECIALTY ;05/13/99 2:33 PM
2 ;;3.0; Surgery ;**50,88,142**;24 Jun 93
3DEV W !!,"This report is designed to use a 132 column format.",!!
4 K IOP,%ZIS,POP,IO("Q") S %ZIS("A")="Select Device: ",%ZIS="QM" D ^%ZIS I POP S SRSOUT=1 G END
5 I $D(IO("Q")) K IO("Q") S ZTRTN="EN^SROACC0",(ZTSAVE("SRSS"),ZTSAVE("SDATE*"),ZTSAVE("EDATE*"),ZTSAVE("SRCPT"),ZTSAVE("SRFLG"),ZTSAVE("SRSITE*"))="",ZTDESC="REPORT TO CHECK CPT CODING ACCURACY" D ^%ZTLOAD G END
6EN ; entry when queued
7 K ^TMP("SR",$J) U IO S SRSOUT=0,SRPAGE=1,SRINST=SRSITE("SITE")
8 N SRFRTO S Y=SDATE X ^DD("DD") S SRFRTO="FROM: "_Y_" TO: " S Y=EDATE X ^DD("DD") S SRFRTO=SRFRTO_Y
9 I SRCPT="ALL",SRSS="ALL" D ^SROACC1 G END
10 I SRCPT="ALL",SRSS D ^SROACC2 G END
11 I SRCPT,SRSS="ALL" D ^SROACC3 G END
12 D ^SROACC4
13END W:$E(IOST)="P" @IOF I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP) S ZTREQ="@" Q
14 I 'SRSOUT,$E(IOST)'="P" W !!,"Press RETURN to continue " R X:DTIME
15 D ^%ZISC W @IOF K SRTN D ^SRSKILL
16 Q
17HDR ; print heading
18 I SRHDR,$E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
19 W:$Y @IOF W !,?(132-$L(SRINST)\2),SRINST,?126,"PAGE",!,?58,"SURGICAL SERVICE",?126,$J(SRPAGE,4),!,?51,"REPORT OF CPT CODING ACCURACY",?100,"REVIEWED BY:"
20 W ! W:SRSS'="" ?(132-$L("FOR "_SRSS)\2),"FOR "_SRSS W ?100,"DATE REVIEWED:"
21 W !,?(132-$L(SRFRTO)\2),SRFRTO
22 W !,$S(SRFLG=1:"O.R. SURGICAL PROCEDURES",SRFLG=2:"NON-O.R. PROCEDURES",1:"O.R. SURGICAL PROCEDURES AND NON-O.R. PROCEDURES")
23 W !!,?1,"PROCEDURE DATE",?20,"PATIENT",?60,"PROCEDURES",?111,"SURGEON/PROVIDER",!,?3,"CASE #",?22,"ID#",?111,"ATTEND SURG/PROV"
24 S SRHDR=1,SRPAGE=SRPAGE+1 Q
25SPEC W !!!,"Do you want to print the Report to Check Coding Accuracy for all",!,"Surgical Specialties ? YES// " R SRYN:DTIME I '$T!(SRYN["^") S SRSOUT=1 G END
26 S SRYN=$E(SRYN) S:SRYN="" SRYN="Y"
27 I "YyNn"'[SRYN W !!,"Enter RETURN if you want to print the report for all specialties, or 'NO'",!,"to select a specific Surgical Specialty.",!!,"Press RETURN to continue " R X:DTIME G SPEC
28 S SRSS="ALL" I "Nn"[SRYN W !! K DIC S DIC("S")="I '$P(^(0),""^"",3)",DIC=137.45,DIC(0)="QEAMZ",DIC("A")="Print the Coding Accuracy Report for which Surgical Specialty ? " D ^DIC S:Y<0 SRSOUT=1 G:Y<0 END S SRSS=+Y
29 D DEV Q
30MSP I SRFLG=3 S SRSS="ALL" G DEV
31 W !!!,"Do you want to print the Report to Check Coding Accuracy for all",!,"Medical Specialties ? YES// " R SRYN:DTIME I '$T!(SRYN["^") S SRSOUT=1 G END
32 S SRYN=$E(SRYN) S:SRYN="" SRYN="Y"
33 I "YyNn"'[SRYN W !!,"Enter RETURN if you want to print the report for all specialties, or 'NO'",!,"to select a specific Medical Specialty.",!!,"Press RETURN to continue " R X:DTIME G MSP
34 S SRSS="ALL" I "Nn"[SRYN W !! K DIC S DIC=723,DIC(0)="QEAMZ",DIC("A")="Print the Coding Accuracy Report for which Medical Specialty ? " D ^DIC S:Y<0 SRSOUT=1 G:Y<0 END S SRSS=+Y
35 D DEV
36 Q
37OPER N CPT,SRCPT K SROPERS,SRCPTT S SRX=^SRF(SRTN,"OP"),SROPER=$P(SRX,"^")
38 I $O(^SRF(SRTN,13,0)) S SROPER=SROPER_", OTHER OPERATIONS: " S OTH=0 F S OTH=$O(^SRF(SRTN,13,OTH)) Q:'OTH D OTHER
39OPERT ; patch SR*3*142 changes
40 S CPT=$P($G(^SRO(136,SRTN,0)),"^",2),SRCPT=$S(CPT:$P($$CPT^ICPTCOD(CPT),"^",2),1:"CPT NOT ENTERED") S SRCPTT="CPT Codes: "_SRCPT I CPT D PMOD
41 I $O(^SRO(136,SRTN,3,0)) S OTH=0 F S OTH=$O(^SRO(136,SRTN,3,OTH)) Q:'OTH D OTHERT
42 Q
43OTHER ; other procedures
44 S SRLONG=1,SROPERS=$P(^SRF(SRTN,13,OTH,0),"^")
45 I $L(SROPER)+$L(SROPERS)>250 S SROPER=SROPER_" ...",OTH=999 Q
46 S SROPER=SROPER_$S(OTH=1:" ",1:", ")_SROPERS
47 Q
48OTHERT ; other procedures - file #136
49 S SRLONG=1,CPT=$P($G(^SRO(136,SRTN,3,OTH,0)),"^"),SRCPT=$S(CPT:$P($$CPT^ICPTCOD(CPT),"^",2),1:"CPT NOT ENTERED") I CPT S SRCPTT=SRCPTT_", "_SRCPT D OMOD
50 Q
51OMOD ; Other procedure CPT modifiers - file #136
52 N SRCMOD,SRCOMMA,X I $O(^SRO(136,SRTN,3,OTH,1,0)) D
53 .S (SRCOMMA,SRI)=0,SRCMOD="",SRCPTT=SRCPTT_"-" F S SRI=$O(^SRO(136,SRTN,3,OTH,1,SRI)) Q:'SRI D
54 ..S SRM=$P(^SRO(136,SRTN,3,OTH,1,SRI,0),"^"),SRCMOD=$P($$MOD^ICPTMOD(SRM,"I"),"^",2)
55 ..S SRCPTT=SRCPTT_$S(SRCOMMA:",",1:"")_SRCMOD,SRCOMMA=1
56 Q
57PMOD ; principle procedure CPT modifiers - file #136
58 N SRCMOD,SRCOMMA,X I $O(^SRO(136,SRTN,1,0)) D
59 .S (SRCOMMA,SRI)=0,SRCMOD="",SRCPTT=SRCPTT_"-" F S SRI=$O(^SRO(136,SRTN,1,SRI)) Q:'SRI D
60 ..S SRM=$P(^SRO(136,SRTN,1,SRI,0),"^"),SRCMOD=$P($$MOD^ICPTMOD(SRM,"I"),"^",2)
61 ..S SRCPTT=SRCPTT_$S(SRCOMMA:",",1:"")_SRCMOD,SRCOMMA=1
62 Q
63LOOP ; break CPT line greater than 50 characters
64 S SROPT(M)="" F LOOP=1:1 S MM=$P(SRCPTT," "),MMM=$P(SRCPTT," ",2,200) Q:MMM="" Q:$L(SROPT(M))+$L(MM)'<50 S SROPT(M)=SROPT(M)_MM_" ",SRCPTT=MMM
65 Q
Note: See TracBrowser for help on using the repository browser.