SROACC ;B'HAM ISC/MAM - CPT ACCURACY ; [ 09/22/98 11:19 AM ]
;;3.0; Surgery ;**77,50,127**;24 Jun 93
BEG S (SRFLG,SRSOUT)=0
W @IOF,!,"Report to Check CPT Coding Accuracy"
START D DATE^SROUTL(.SDATE,.EDATE,.SRSOUT) G:SRSOUT END
S SDATE1=SDATE-.0001,EDATE1=EDATE+.9999
ASK W @IOF,!,"Print the Report of CPT Coding Accuracy for which cases ?",!!,"1. O.R. Surgical Procedures",!,"2. Non-O.R. Procedures",!,"3. Both O.R. Surgical Procedures and Non-O.R. Procedures (All Specialties)"
W !!,"Select Number: 1// " R X:DTIME I '$T!(X["^") G END
S:X="" X=1 I X>3!(X<1)!(X'?.N) D HELP G:SRSOUT END G ASK
S SRFLG=X
ALL W !!,"Do you want to print the Report of CPT Coding Accuracy for all",!,"CPT Codes ? YES// " R SRYN:DTIME I '$T!(SRYN["^") S SRSOUT=1 G END
S SRYN=$E(SRYN) S:SRYN="" SRYN="Y"
I "YyNn"'[SRYN W !!,"Enter RETURN if you want to print the report for all codes, or 'NO'",!,"to select a specific CPT Code.",!!,"Press RETURN to continue " R X:DTIME G ALL
S SRCPT="ALL"
I "Nn"[SRYN W !! K DIC S DIC=81,DIC(0)="QEAMZ",DIC("A")="Print the Coding Accuracy Report for which CPT Code ? ",DIC("S")="I $$CTD^SROACC()" D ^DIC S:Y<0 SRSOUT=1 G:Y<0 END S SRCPT=+Y
I SRFLG=1 G SPEC
I SRFLG=2!(SRFLG=3) G MSP
DEV W !!,"This report is designed to use a 132 column format.",!!
K IOP,%ZIS,POP,IO("Q") S %ZIS("A")="Select Device: ",%ZIS="QM" D ^%ZIS I POP S SRSOUT=1 G END
I $D(IO("Q")) K IO("Q") S ZTRTN="EN^SROACC",(ZTSAVE("SDATE*"),ZTSAVE("EDATE*"),ZTSAVE("SRCPT"),ZTSAVE("SRFLG"),ZTSAVE("SRSITE*"))="",ZTDESC="REPORT TO CHECK CPT CODING ACCURACY" D ^%ZTLOAD G END
EN ; entry when queued
K ^TMP("SR",$J) U IO S SRSOUT=0,SRPAGE=1,SRINST=SRSITE("SITE")
N SRFRTO S Y=SDATE X ^DD("DD") S SRFRTO="FROM: "_Y_" TO: " S Y=EDATE X ^DD("DD") S SRFRTO=SRFRTO_Y
I SRCPT="ALL" D ^SROACC5 G END
D ^SROACC6
END W:$E(IOST)="P" @IOF I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP) S ZTREQ="@" Q
I 'SRSOUT,$E(IOST)'="P" W !!,"Press RETURN to continue " R X:DTIME
D ^%ZISC W @IOF K SRTN D ^SRSKILL
Q
HELP W !!,"Enter '1' or press <RET> to include only OR surgical procedure cases on the",!,"report. Enter '2' to include only non-OR procedure cases on the report."
W !,"Enter '3' to include cases for both OR surgical procedures and non-OR",!,"procedures on the report."
W !!,"Press <RET> to continue, or '^' to quit. " R X:DTIME I '$T!(X["^") S SRSOUT=1
Q
HDR ; print heading
I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
I SRHDR,$E(IOST)'="P" W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
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:"
W !,?(132-$L(SRFRTO)\2),SRFRTO,?100,"DATE REVIEWED:"
W !,$S(SRFLG=1:"O.R. SURGICAL PROCEDURES",SRFLG=2:"NON-O.R. PROCEDURES",1:"O.R. SURGICAL PROCEDURES AND NON-O.R. PROCEDURES")
W !!,?1,"PROCEDURE DATE",?20,"PATIENT",?60,"PROCEDURES",?111,"SURGEON/PROVIDER",!,?3,"CASE #",?22,"ID#",?111,"ATTEND SURG/PROV",!,?20,"SPECIALTY"
S SRHDR=1,SRPAGE=SRPAGE+1 Q
SPEC W @IOF,!,"Do you want to sort the Report of CPT Coding Accuracy by",!,"Surgical Specialty ? YES// " R SRYN:DTIME I '$T!(SRYN["^") S SRSOUT=1 G END
S SRYN=$E(SRYN) S:SRYN="" SRYN="Y"
I "YyNn"'[SRYN W !!,"Enter RETURN if you want to sort the report by specialty, or 'NO'",!,"to sort the report by date only.",!!,"Press RETURN to continue " R X:DTIME G SPEC
I "Yy"[SRYN G SPEC^SROACC0
G DEV
MSP W @IOF,!,"Do you want to sort the Report of CPT Coding Accuracy by",!,$S(SRFLG=2:"Medical",1:"Medical/Surgical")," Specialty ? YES// " R SRYN:DTIME I '$T!(SRYN["^") S SRSOUT=1 G END
S SRYN=$E(SRYN) S:SRYN="" SRYN="Y"
I "YyNn"'[SRYN W !!,"Enter RETURN if you want to sort the report by specialty, or 'NO'",!,"to sort the report by date only.",!!,"Press RETURN to continue " R X:DTIME G MSP
I "Yy"[SRYN G MSP^SROACC0
G DEV
Q
CTD() K ICPTVDT
N SRSDATE S SROK=1,SRSDATE=DT
I (EDATE) S SRSDATE=EDATE
S SROK=$P($$CPT^ICPTCOD(Y,SRSDATE),"^",7),ICPTVDT=SRSDATE
Q SROK
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSROACC 4078 printed Dec 13, 2024@02:39:57 Page 2
SROACC ;B'HAM ISC/MAM - CPT ACCURACY ; [ 09/22/98 11:19 AM ]
+1 ;;3.0; Surgery ;**77,50,127**;24 Jun 93
BEG SET (SRFLG,SRSOUT)=0
+1 WRITE @IOF,!,"Report to Check CPT Coding Accuracy"
START DO DATE^SROUTL(.SDATE,.EDATE,.SRSOUT)
if SRSOUT
GOTO END
+1 SET SDATE1=SDATE-.0001
SET EDATE1=EDATE+.9999
ASK WRITE @IOF,!,"Print the Report of CPT Coding Accuracy for which cases ?",!!,"1. O.R. Surgical Procedures",!,"2. Non-O.R. Procedures",!,"3. Both O.R. Surgical Procedures and Non-O.R. Procedures (All Specialties)"
+1 WRITE !!,"Select Number: 1// "
READ X:DTIME
IF '$TEST!(X["^")
GOTO END
+2 if X=""
SET X=1
IF X>3!(X<1)!(X'?.N)
DO HELP
if SRSOUT
GOTO END
GOTO ASK
+3 SET SRFLG=X
ALL WRITE !!,"Do you want to print the Report of CPT Coding Accuracy for all",!,"CPT Codes ? YES// "
READ SRYN:DTIME
IF '$TEST!(SRYN["^")
SET SRSOUT=1
GOTO END
+1 SET SRYN=$EXTRACT(SRYN)
if SRYN=""
SET SRYN="Y"
+2 IF "YyNn"'[SRYN
WRITE !!,"Enter RETURN if you want to print the report for all codes, or 'NO'",!,"to select a specific CPT Code.",!!,"Press RETURN to continue "
READ X:DTIME
GOTO ALL
+3 SET SRCPT="ALL"
+4 IF "Nn"[SRYN
WRITE !!
KILL DIC
SET DIC=81
SET DIC(0)="QEAMZ"
SET DIC("A")="Print the Coding Accuracy Report for which CPT Code ? "
SET DIC("S")="I $$CTD^SROACC()"
DO ^DIC
if Y<0
SET SRSOUT=1
if Y<0
GOTO END
SET SRCPT=+Y
+5 IF SRFLG=1
GOTO SPEC
+6 IF SRFLG=2!(SRFLG=3)
GOTO MSP
DEV WRITE !!,"This report is designed to use a 132 column format.",!!
+1 KILL IOP,%ZIS,POP,IO("Q")
SET %ZIS("A")="Select Device: "
SET %ZIS="QM"
DO ^%ZIS
IF POP
SET SRSOUT=1
GOTO END
+2 IF $DATA(IO("Q"))
KILL IO("Q")
SET ZTRTN="EN^SROACC"
SET (ZTSAVE("SDATE*"),ZTSAVE("EDATE*"),ZTSAVE("SRCPT"),ZTSAVE("SRFLG"),ZTSAVE("SRSITE*"))=""
SET ZTDESC="REPORT TO CHECK CPT CODING ACCURACY"
DO ^%ZTLOAD
GOTO END
EN ; entry when queued
+1 KILL ^TMP("SR",$JOB)
USE IO
SET SRSOUT=0
SET SRPAGE=1
SET SRINST=SRSITE("SITE")
+2 NEW SRFRTO
SET Y=SDATE
XECUTE ^DD("DD")
SET SRFRTO="FROM: "_Y_" TO: "
SET Y=EDATE
XECUTE ^DD("DD")
SET SRFRTO=SRFRTO_Y
+3 IF SRCPT="ALL"
DO ^SROACC5
GOTO END
+4 DO ^SROACC6
END if $EXTRACT(IOST)="P"
WRITE @IOF
IF $DATA(ZTQUEUED)
KILL ^TMP("SR",$JOB)
if $GET(ZTSTOP)
QUIT
SET ZTREQ="@"
QUIT
+1 IF 'SRSOUT
IF $EXTRACT(IOST)'="P"
WRITE !!,"Press RETURN to continue "
READ X:DTIME
+2 DO ^%ZISC
WRITE @IOF
KILL SRTN
DO ^SRSKILL
+3 QUIT
HELP WRITE !!,"Enter '1' or press <RET> to include only OR surgical procedure cases on the",!,"report. Enter '2' to include only non-OR procedure cases on the report."
+1 WRITE !,"Enter '3' to include cases for both OR surgical procedures and non-OR",!,"procedures on the report."
+2 WRITE !!,"Press <RET> to continue, or '^' to quit. "
READ X:DTIME
IF '$TEST!(X["^")
SET SRSOUT=1
+3 QUIT
HDR ; print heading
+1 IF $DATA(ZTQUEUED)
DO ^SROSTOP
IF SRHALT
SET SRSOUT=1
QUIT
+2 IF SRHDR
IF $EXTRACT(IOST)'="P"
WRITE !!,"Press RETURN to continue, or '^' to quit: "
READ X:DTIME
IF '$TEST!(X["^")
SET SRSOUT=1
QUIT
+3 if $Y
WRITE @IOF
WRITE !,?(132-$LENGTH(SRINST)\2),SRINST,?126,"PAGE",!,?58,"SURGICAL SERVICE",?126,$JUSTIFY(SRPAGE,4),!,?51,"REPORT OF CPT CODING ACCURACY",?100,"REVIEWED BY:"
+4 WRITE !,?(132-$LENGTH(SRFRTO)\2),SRFRTO,?100,"DATE REVIEWED:"
+5 WRITE !,$SELECT(SRFLG=1:"O.R. SURGICAL PROCEDURES",SRFLG=2:"NON-O.R. PROCEDURES",1:"O.R. SURGICAL PROCEDURES AND NON-O.R. PROCEDURES")
+6 WRITE !!,?1,"PROCEDURE DATE",?20,"PATIENT",?60,"PROCEDURES",?111,"SURGEON/PROVIDER",!,?3,"CASE #",?22,"ID#",?111,"ATTEND SURG/PROV",!,?20,"SPECIALTY"
+7 SET SRHDR=1
SET SRPAGE=SRPAGE+1
QUIT
SPEC WRITE @IOF,!,"Do you want to sort the Report of CPT Coding Accuracy by",!,"Surgical Specialty ? YES// "
READ SRYN:DTIME
IF '$TEST!(SRYN["^")
SET SRSOUT=1
GOTO END
+1 SET SRYN=$EXTRACT(SRYN)
if SRYN=""
SET SRYN="Y"
+2 IF "YyNn"'[SRYN
WRITE !!,"Enter RETURN if you want to sort the report by specialty, or 'NO'",!,"to sort the report by date only.",!!,"Press RETURN to continue "
READ X:DTIME
GOTO SPEC
+3 IF "Yy"[SRYN
GOTO SPEC^SROACC0
+4 GOTO DEV
MSP WRITE @IOF,!,"Do you want to sort the Report of CPT Coding Accuracy by",!,$SELECT(SRFLG=2:"Medical",1:"Medical/Surgical")," Specialty ? YES// "
READ SRYN:DTIME
IF '$TEST!(SRYN["^")
SET SRSOUT=1
GOTO END
+1 SET SRYN=$EXTRACT(SRYN)
if SRYN=""
SET SRYN="Y"
+2 IF "YyNn"'[SRYN
WRITE !!,"Enter RETURN if you want to sort the report by specialty, or 'NO'",!,"to sort the report by date only.",!!,"Press RETURN to continue "
READ X:DTIME
GOTO MSP
+3 IF "Yy"[SRYN
GOTO MSP^SROACC0
+4 GOTO DEV
+5 QUIT
CTD() KILL ICPTVDT
+1 NEW SRSDATE
SET SROK=1
SET SRSDATE=DT
+2 IF (EDATE)
SET SRSDATE=EDATE
+3 SET SROK=$PIECE($$CPT^ICPTCOD(Y,SRSDATE),"^",7)
SET ICPTVDT=SRSDATE
+4 QUIT SROK