ECSCPT ;ALB/JAM - Event Code Screen With CPT Codes ;9/6/18 14:31
;;2.0;EVENT CAPTURE;**72,92,95,119,139,145**;8 May 96;Build 6
LOC K ECL S EC1=0 D ^ECL S:$D(LOC(2)) EC1=1 K LOC I '$D(ECL) S ECOUT=1 G END
UNIT ;set var and sel dss unit
S ECJLP=0
S (ECOUT,ECALL)=0,ECPG=1
W @IOF F Q=0:0 D Q:%
.W !!,"Do you want to list all DSS Units for "_ECLN S %=1 D YN^DICN Q:%
.W !!?5,"Enter <RET> to list all your DSS Units for this location, or"
.W !?11,"NO to select a specific DSS Unit"
G:%<0 END I %=1 S ECALL=1 G ECCPT
W @IOF,! K DIC S DIC=724,DIC(0)="QEAMZ",DIC("A")="Select DSS Unit: "
S:ECL DIC("S")="I $D(^ECJ(""AP"",ECL,+Y))"
D ^DIC K DIC G:Y<0 END S ECD=+Y,ECDN=$P(Y,"^",2)
S ECDN=ECDN_$S($P($G(^ECD(+ECD,0)),"^",6):" **Inactive**",1:"")
S ECJLP=+$P(^ECD(ECD,0),"^",11)
SEL ;
I 'ECJLP S ECC=0,ECCN="None" G ECCPT
W @IOF F Q=0:0 D Q:%
.W !!,"Do you want to list all categories for "_ECDN S %=1 D YN^DICN Q:%
.W !!,"Enter <RET> if you would like to list all categories for this "
.W "DSS Unit,",!," or NO to select a specific category"
G:%<0 END I %=1 S ECC="ALL" G ECCPT
W @IOF,! K DIC S DIC=726,DIC(0)="QEAMZ",DIC("A")="Select Category for "
S DIC("A")=DIC("A")_ECDN_" DSS Unit: "
S:ECD DIC("S")="I $D(^ECJ(""AP"",ECL,ECD,+Y))"
D ^DIC K DIC G:Y<0 END S ECC=+Y,ECCN=$P(Y,"^",2)
ECCPT ;CPT Codes to display
K DIR
S DIR(0)="SO^A:Active CPT Codes;I:Inactive CPT Codes;B:Both"
S DIR("B")="I",DIR("A")="CPT Codes to display"
S DIR("?",1)="Enter an A for Event Code screens with Active CPT Codes,"
S DIR("?",1)=DIR("?",1)_" I for Inactive Codes,"
S DIR("?")="B for a consolidated report of CPT codes, or ^ to quit."
S DIR("??")="ECSCPT^"
D ^DIR K DIR I $D(DIRUT) G END
S ECCPT=Y
DEV W !! K IOP,POP,IO("Q"),%ZIS,ZTSK
S %ZIS="QM",%ZIS("A")="Select Device: " D ^%ZIS I POP S ECOUT=1 G END
I $D(IO("Q")) K IO("Q") D G END
.S ZTDESC="CATEGORY AND PROCEDURE SUMMARY",ZTRTN="START^ECSCPT",ZTIO=ION
.D SAVE,^%ZTLOAD,HOME^%ZIS K ZTSK
U IO
START ;
N ECI ;generic index
N ECL ;location IEN
N ECLN ;location name
N CNT ;119 Subscript for exported data
N ECAC ;139 Associated Clinic name
N ECACIEN ;139 Associated Clinic IEN
N ECMCA ;139 MCA Labor Code
N ECSC,ECCSC,ECCHAR,NODE ;145 Stop code, credit stop code, 4char code, zero node of 728.44
S %H=$H D YX^%DTC S ECRDT=Y
S ECOUT=0,ECPG=1
I $G(ECPTYP)="E" S CNT=1 S ^TMP($J,"ECRPT",CNT)="LOCATION^DSS UNIT^CATEGORY^CPT CODE^PROCEDURE CODE^PROCEDURE NAME^SYNONYM^ASSOCIATED CLINIC^STOP CODE^CREDIT STOP^CHAR4^MCA LABOR CODE" ;119,139,145
S ECI=0
F S ECI=$O(ECLOC(ECI)) Q:'ECI D
. S ECL=$P(ECLOC(ECI),U),ECLN=$P(ECLOC(ECI),U,2)
. D ^ECSCPT1
I $G(ECPTYP)="E" D ^ECKILL Q ;119 Nothing to write if exporting
CLEAR I $E(IOST,1,2)'="C-" G END
G:ECOUT END
I ECPG W !!!!!,"Press <RET> to continue " R X:DTIME I '$T!(X="^") S ECOUT=1 G END
G:ECALL END
ASK ;
W @IOF F Q=0:0 D I % Q
.W !!,"Would you like to list another DSS Unit for this Location"
.S %=2 D YN^DICN I % Q
.W !!,"Enter YES to list another DSS Unit or <RET> to continue"
G:%<0 END I %=1 D G UNIT
.K ECD,ECDN,ECC,ECCN,ECP,ECPN,NATN,ECFILE,ECCPT
K ECD,ECDN,ECC,ECCN,ECP,ECPN,NATN,ECFILE,ECCPT
I EC1 G LOC
END ;
D ^ECKILL Q:$D(ECGUI) W @IOF D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
Q
SAVE ;
S (ZTSAVE("ECALL"),ZTSAVE("ECJLP"),ZTSAVE("ECC*"),ZTSAVE("ECD*"),ZTSAVE("ECL*"),ZTSAVE("ECP*"))=""
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HECSCPT 3427 printed Dec 13, 2024@01:58:48 Page 2
ECSCPT ;ALB/JAM - Event Code Screen With CPT Codes ;9/6/18 14:31
+1 ;;2.0;EVENT CAPTURE;**72,92,95,119,139,145**;8 May 96;Build 6
LOC KILL ECL
SET EC1=0
DO ^ECL
if $DATA(LOC(2))
SET EC1=1
KILL LOC
IF '$DATA(ECL)
SET ECOUT=1
GOTO END
UNIT ;set var and sel dss unit
+1 SET ECJLP=0
+2 SET (ECOUT,ECALL)=0
SET ECPG=1
+3 WRITE @IOF
FOR Q=0:0
Begin DoDot:1
+4 WRITE !!,"Do you want to list all DSS Units for "_ECLN
SET %=1
DO YN^DICN
if %
QUIT
+5 WRITE !!?5,"Enter <RET> to list all your DSS Units for this location, or"
+6 WRITE !?11,"NO to select a specific DSS Unit"
End DoDot:1
if %
QUIT
+7 if %<0
GOTO END
IF %=1
SET ECALL=1
GOTO ECCPT
+8 WRITE @IOF,!
KILL DIC
SET DIC=724
SET DIC(0)="QEAMZ"
SET DIC("A")="Select DSS Unit: "
+9 if ECL
SET DIC("S")="I $D(^ECJ(""AP"",ECL,+Y))"
+10 DO ^DIC
KILL DIC
if Y<0
GOTO END
SET ECD=+Y
SET ECDN=$PIECE(Y,"^",2)
+11 SET ECDN=ECDN_$SELECT($PIECE($GET(^ECD(+ECD,0)),"^",6):" **Inactive**",1:"")
+12 SET ECJLP=+$PIECE(^ECD(ECD,0),"^",11)
SEL ;
+1 IF 'ECJLP
SET ECC=0
SET ECCN="None"
GOTO ECCPT
+2 WRITE @IOF
FOR Q=0:0
Begin DoDot:1
+3 WRITE !!,"Do you want to list all categories for "_ECDN
SET %=1
DO YN^DICN
if %
QUIT
+4 WRITE !!,"Enter <RET> if you would like to list all categories for this "
+5 WRITE "DSS Unit,",!," or NO to select a specific category"
End DoDot:1
if %
QUIT
+6 if %<0
GOTO END
IF %=1
SET ECC="ALL"
GOTO ECCPT
+7 WRITE @IOF,!
KILL DIC
SET DIC=726
SET DIC(0)="QEAMZ"
SET DIC("A")="Select Category for "
+8 SET DIC("A")=DIC("A")_ECDN_" DSS Unit: "
+9 if ECD
SET DIC("S")="I $D(^ECJ(""AP"",ECL,ECD,+Y))"
+10 DO ^DIC
KILL DIC
if Y<0
GOTO END
SET ECC=+Y
SET ECCN=$PIECE(Y,"^",2)
ECCPT ;CPT Codes to display
+1 KILL DIR
+2 SET DIR(0)="SO^A:Active CPT Codes;I:Inactive CPT Codes;B:Both"
+3 SET DIR("B")="I"
SET DIR("A")="CPT Codes to display"
+4 SET DIR("?",1)="Enter an A for Event Code screens with Active CPT Codes,"
+5 SET DIR("?",1)=DIR("?",1)_" I for Inactive Codes,"
+6 SET DIR("?")="B for a consolidated report of CPT codes, or ^ to quit."
+7 SET DIR("??")="ECSCPT^"
+8 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
GOTO END
+9 SET ECCPT=Y
DEV WRITE !!
KILL IOP,POP,IO("Q"),%ZIS,ZTSK
+1 SET %ZIS="QM"
SET %ZIS("A")="Select Device: "
DO ^%ZIS
IF POP
SET ECOUT=1
GOTO END
+2 IF $DATA(IO("Q"))
KILL IO("Q")
Begin DoDot:1
+3 SET ZTDESC="CATEGORY AND PROCEDURE SUMMARY"
SET ZTRTN="START^ECSCPT"
SET ZTIO=ION
+4 DO SAVE
DO ^%ZTLOAD
DO HOME^%ZIS
KILL ZTSK
End DoDot:1
GOTO END
+5 USE IO
START ;
+1 ;generic index
NEW ECI
+2 ;location IEN
NEW ECL
+3 ;location name
NEW ECLN
+4 ;119 Subscript for exported data
NEW CNT
+5 ;139 Associated Clinic name
NEW ECAC
+6 ;139 Associated Clinic IEN
NEW ECACIEN
+7 ;139 MCA Labor Code
NEW ECMCA
+8 ;145 Stop code, credit stop code, 4char code, zero node of 728.44
NEW ECSC,ECCSC,ECCHAR,NODE
+9 SET %H=$HOROLOG
DO YX^%DTC
SET ECRDT=Y
+10 SET ECOUT=0
SET ECPG=1
+11 ;119,139,145
IF $GET(ECPTYP)="E"
SET CNT=1
SET ^TMP($JOB,"ECRPT",CNT)="LOCATION^DSS UNIT^CATEGORY^CPT CODE^PROCEDURE CODE^PROCEDURE NAME^SYNONYM^ASSOCIATED CLINIC^STOP CODE^CREDIT STOP^CHAR4^MCA LABOR CODE"
+12 SET ECI=0
+13 FOR
SET ECI=$ORDER(ECLOC(ECI))
if 'ECI
QUIT
Begin DoDot:1
+14 SET ECL=$PIECE(ECLOC(ECI),U)
SET ECLN=$PIECE(ECLOC(ECI),U,2)
+15 DO ^ECSCPT1
End DoDot:1
+16 ;119 Nothing to write if exporting
IF $GET(ECPTYP)="E"
DO ^ECKILL
QUIT
CLEAR IF $EXTRACT(IOST,1,2)'="C-"
GOTO END
+1 if ECOUT
GOTO END
+2 IF ECPG
WRITE !!!!!,"Press <RET> to continue "
READ X:DTIME
IF '$TEST!(X="^")
SET ECOUT=1
GOTO END
+3 if ECALL
GOTO END
ASK ;
+1 WRITE @IOF
FOR Q=0:0
Begin DoDot:1
+2 WRITE !!,"Would you like to list another DSS Unit for this Location"
+3 SET %=2
DO YN^DICN
IF %
QUIT
+4 WRITE !!,"Enter YES to list another DSS Unit or <RET> to continue"
End DoDot:1
IF %
QUIT
+5 if %<0
GOTO END
IF %=1
Begin DoDot:1
+6 KILL ECD,ECDN,ECC,ECCN,ECP,ECPN,NATN,ECFILE,ECCPT
End DoDot:1
GOTO UNIT
+7 KILL ECD,ECDN,ECC,ECCN,ECP,ECPN,NATN,ECFILE,ECCPT
+8 IF EC1
GOTO LOC
END ;
+1 DO ^ECKILL
if $DATA(ECGUI)
QUIT
WRITE @IOF
DO ^%ZISC
if $DATA(ZTQUEUED)
SET ZTREQ="@"
+2 QUIT
SAVE ;
+1 SET (ZTSAVE("ECALL"),ZTSAVE("ECJLP"),ZTSAVE("ECC*"),ZTSAVE("ECD*"),ZTSAVE("ECL*"),ZTSAVE("ECP*"))=""
+2 QUIT