ECSUM ;BIR/JLP,RHK-Category and Procedure Summary ;9/27/17 11:22
;;2.0;EVENT CAPTURE;**4,19,33,47,95,119,122,126,131,139**;8 May 96;Build 7
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 ECSCN
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 ECS=+$P(^ECD(ECD,0),"^",2),ECJLP=+$P(^(0),"^",11)
S ECSN=$S($P($G(^DIC(49,ECS,0)),"^")]"":$P(^(0),"^"),1:"UNKNOWN")
SEL ;
I 'ECJLP S ECC=0,ECCN="None" G ECSCN
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 ECSCN
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)
ECSCN ;Event Codes Screens to display, ALB/JAM-10/16/01
K DIR
S DIR(0)="SO^A:Active Event Code Screens;I:Inactive Event Code Screens"
S DIR(0)=DIR(0)_";B:Both",DIR("B")="A"
S DIR("A")="Event Code Screen to display"
S DIR("?",1)="Enter an A for Active Event Code Screens, I for Inactive "
S DIR("?",1)=DIR("?",1)_"Code Screens,"
S DIR("?")="B for a consolidated report of all Event Code Screens, or "
S DIR("?")=DIR("?")_"^ to quit."
S DIR("??")="ECSUM^"
D ^DIR K DIR I $D(DIRUT) G END
S ECSCN=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^ECSUM",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 ;122 Subscript for export
S CNT=1 ;139
S ^TMP($J,"ECRPT",CNT)="EC SCREEN STATUS^LOCATION^SERVICE^DSS UNIT^DSS UNIT IEN^DSS DEPT^SEND STATUS^DSS UNIT INACTIVE^CATEGORY^" ;139
S ^TMP($J,"ECRPT",CNT)=^TMP($J,"ECRPT",CNT)_"CPT CODE^PROCEDURE CODE^PROCEDURE NAME^SYNONYM^CLINIC IEN^CLINIC^STOP CODE^CREDIT STOP CODE^CHAR4 CODE^MCA LABOR CODE" ;139
S %H=$H D YX^%DTC S ECRDT=Y
S ECOUT=0,ECPG=1
S ECI=0
F S ECI=$O(ECLOC(ECI)) Q:'ECI D
. S ECL=$P(ECLOC(ECI),U),ECLN=$P(ECLOC(ECI),U,2)
. I ECALL D ^ECSUM1 Q ;122
. D SUM2^ECSUM1 ;122 Selected DSS units
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 EC4,ECD,ECDN,ECC,ECCN,ECP,ECPN,ECSY,ECSYN,NATN,ECS,ECSN,ECFILE,ECSCN
K EC4,ECD,ECDN,ECC,ECCN,ECP,ECPN,ECSY,ECSYN,NATN,ECS,ECSN,ECFILE,ECSCN
I EC1 G LOC
END ;
D ^ECKILL Q:$D(ECGUI)!($G(ECPTYP)="E") W @IOF D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@" ;119
Q
SAVE ;
S (ZTSAVE("ECA*"),ZTSAVE("ECJLP"),ZTSAVE("ECC*"),ZTSAVE("ECD*"),ZTSAVE("ECL*"),ZTSAVE("ECM*"),ZTSAVE("ECP*"),ZTSAVE("ECS*"),ZTSAVE("EC4"))=""
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HECSUM 3650 printed Dec 13, 2024@01:58:53 Page 2
ECSUM ;BIR/JLP,RHK-Category and Procedure Summary ;9/27/17 11:22
+1 ;;2.0;EVENT CAPTURE;**4,19,33,47,95,119,122,126,131,139**;8 May 96;Build 7
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 ECSCN
+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 ECS=+$PIECE(^ECD(ECD,0),"^",2)
SET ECJLP=+$PIECE(^(0),"^",11)
+13 SET ECSN=$SELECT($PIECE($GET(^DIC(49,ECS,0)),"^")]"":$PIECE(^(0),"^"),1:"UNKNOWN")
SEL ;
+1 IF 'ECJLP
SET ECC=0
SET ECCN="None"
GOTO ECSCN
+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 ECSCN
+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)
ECSCN ;Event Codes Screens to display, ALB/JAM-10/16/01
+1 KILL DIR
+2 SET DIR(0)="SO^A:Active Event Code Screens;I:Inactive Event Code Screens"
+3 SET DIR(0)=DIR(0)_";B:Both"
SET DIR("B")="A"
+4 SET DIR("A")="Event Code Screen to display"
+5 SET DIR("?",1)="Enter an A for Active Event Code Screens, I for Inactive "
+6 SET DIR("?",1)=DIR("?",1)_"Code Screens,"
+7 SET DIR("?")="B for a consolidated report of all Event Code Screens, or "
+8 SET DIR("?")=DIR("?")_"^ to quit."
+9 SET DIR("??")="ECSUM^"
+10 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
GOTO END
+11 SET ECSCN=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^ECSUM"
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 ;122 Subscript for export
NEW CNT
+5 ;139
SET CNT=1
+6 ;139
SET ^TMP($JOB,"ECRPT",CNT)="EC SCREEN STATUS^LOCATION^SERVICE^DSS UNIT^DSS UNIT IEN^DSS DEPT^SEND STATUS^DSS UNIT INACTIVE^CATEGORY^"
+7 ;139
SET ^TMP($JOB,"ECRPT",CNT)=^TMP($JOB,"ECRPT",CNT)_"CPT CODE^PROCEDURE CODE^PROCEDURE NAME^SYNONYM^CLINIC IEN^CLINIC^STOP CODE^CREDIT STOP CODE^CHAR4 CODE^MCA LABOR CODE"
+8 SET %H=$HOROLOG
DO YX^%DTC
SET ECRDT=Y
+9 SET ECOUT=0
SET ECPG=1
+10 SET ECI=0
+11 FOR
SET ECI=$ORDER(ECLOC(ECI))
if 'ECI
QUIT
Begin DoDot:1
+12 SET ECL=$PIECE(ECLOC(ECI),U)
SET ECLN=$PIECE(ECLOC(ECI),U,2)
+13 ;122
IF ECALL
DO ^ECSUM1
QUIT
+14 ;122 Selected DSS units
DO SUM2^ECSUM1
End DoDot:1
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 EC4,ECD,ECDN,ECC,ECCN,ECP,ECPN,ECSY,ECSYN,NATN,ECS,ECSN,ECFILE,ECSCN
End DoDot:1
GOTO UNIT
+7 KILL EC4,ECD,ECDN,ECC,ECCN,ECP,ECPN,ECSY,ECSYN,NATN,ECS,ECSN,ECFILE,ECSCN
+8 IF EC1
GOTO LOC
END ;
+1 ;119
DO ^ECKILL
if $DATA(ECGUI)!($GET(ECPTYP)="E")
QUIT
WRITE @IOF
DO ^%ZISC
if $DATA(ZTQUEUED)
SET ZTREQ="@"
+2 QUIT
SAVE ;
+1 SET (ZTSAVE("ECA*"),ZTSAVE("ECJLP"),ZTSAVE("ECC*"),ZTSAVE("ECD*"),ZTSAVE("ECL*"),ZTSAVE("ECM*"),ZTSAVE("ECP*"),ZTSAVE("ECS*"),ZTSAVE("EC4"))=""
+2 QUIT