GECSUSEL ;WISC/RFJ-utility selection ;01 Nov 93
;;2.0;GCS;**2**;MAR 14, 1995
Q
;
;
CODESHET(BATCH) ; select an existing code sheet
; batch = only select code sheets for batch
N %,%Y,DIC,GECSBADA,GECSSUPR,X,Y
I $L(BATCH) S GECSBADA=+$O(^GECS(2101.1,"B",BATCH,0)) I 'GECSBADA W !,"BATCH ",BATCH," CANNOT BE FOUND IN FILE 2101.1." Q 0
W !!,$S($D(^XUSEC("GECS SUPER EDITOR",+$G(DUZ))):"-- You can select all code sheets created for this batch type --",1:"-- You may only select code sheets which you have created --")
I $D(^XUSEC("GECS SUPER EDITOR",DUZ)) S GECSSUPR=1
S DIC("S")="I $P(^(0),U,4)=""""!($P(^(0),U,4)="_DUZ_")!($G(GECSSUPR))"
I $G(GECSBADA) S DIC("S")=DIC("S")_",$P(^(0),U,3)="_GECSBADA
S DIC="^GECS(2100,",DIC(0)="QEAM",DIC("A")="Select CODE SHEET ID Number: " D ^DIC
I Y'>0 Q 0
Q +Y
;
;
BATTYPE(DEFAULT,DONTASK) ; select batch type parameters
; default set to batch default in lookup, if set to '- GECO' it
; will ask to select a batch name containing '- GECO'
; dontask set to lookup on batch without asking
; return gecs("batch")=batch name
; gecs("batda")=batch da number
; gecs("sysid")=system identidier (ams, etc)
N %,%Y,DIC,X,Y
;
K GECS("BATCH"),GECS("BATDA"),GECS("SYSID")
S DIC="^GECS(2101.1,"
;
; default is set (not null), lookup batch type, do not ask
I $G(DONTASK),$L(DEFAULT),DEFAULT'="- GECO" D Q
. S DIC(0)="MNZ",X=DEFAULT D ^DIC I Y'>0 Q
. D BATCHECK
. I '$G(GECS("BATDA")) K GECS("BATDA"),GECS("BATCH"),GECS("SYSID") Q
. W !,"Batch Type: ",GECS("BATCH")
;
; ask batch type
I DEFAULT="- GECO" S DIC("S")="I $P(^(0),U)[""- GECO""",DEFAULT=""
I $L(DEFAULT) S DIC("B")=DEFAULT
S DIC(0)="AEQMZ" D ^DIC I Y'>0 Q
D BATCHECK
I '$G(GECS("BATDA")) K GECS("BATDA"),GECS("BATCH"),GECS("SYSID") Q
W !,"Batch Type: ",GECS("BATCH")
Q
;
;
BATNOFMS ; select batch except for fms
N DONTASK
K GECS("BATCH"),GECS("BATDA"),GECS("SYSID")
I $L($G(GECSSYS)) S DONTASK=1
F W ! D BATTYPE($G(GECSSYS),$G(DONTASK)) Q:'$G(GECS("BATDA")) D Q:$G(GECS("BATDA"))
. I GECS("SYSID")="FMS" W !,"*** FMS DOCUMENTS CANNOT BE SELECTED ***" K GECS("BATDA")
I '$G(GECS("BATDA")) K GECS("BATCH"),GECS("BATDA"),GECS("SYSID")
Q
;
;
BATCHECK ; check selected batch and set up variables
; y=selected batch; y(0)=data for selected batch
I $P(Y(0),"^",4)="" W !,"SYSTEM ID FOR BATCH TYPE ",$P(Y,"^",2)," HAS NOT BEEN ENTERED." Q
S GECS("BATDA")=+Y,GECS("BATCH")=$P(Y,"^",2),GECS("SYSID")=$P(Y(0),"^",4)
Q
;
;
TRANTYPE(DEFAULT,DONTASK) ; ask transaction type-segment
; default set to segment default in lookup
; dontask set to lookup on segment without asking
; gecs("batda")=batch da (from file 2101.1)
; gecs("sysid")=system id (AMS)
; return gecs("tt")=segment name
; gecs("ttda")=segment da number
; gecs("edit")=edit template name
; gecsflag=1 to exit application
N %,%Y,DIC,X,Y
;
K GECS("TT"),GECS("TTDA"),GECS("EDIT"),GECSFLAG
S DIC="^GECS(2101.2,",DIC("S")="I $P(^(0),U,4)="_GECS("BATDA")
;
; segment defined, look it up and quit
I $G(DONTASK),$L(DEFAULT) D Q
. S DIC(0)="MNZ",X=DEFAULT D ^DIC I Y'>0 S GECSFLAG=1 Q
. D TTCHECK
. I '$G(GECS("SEGDA")) S GECSFLAG=1
;
; ask for segment entry
I $L($G(SEGMENT)),$G(GECS("SYSID"))="AMS" S DIC("B")=DEFAULT
S DIC(0)="AEQMZ" D ^DIC I Y'>0 S GECSFLAG=1 Q
D TTCHECK
Q
;
;
TTCHECK ; check selected transaction type and set up variables
; y=selected entry; y(0)=data for selected entry
I $P(Y(0),"^",3)=""!($P(Y(0),"^",5)'="Y") W !,"THIS TRANSACTION TYPE ",$P(Y,"^",2)," IS NOT YET ",$S($P(Y(0),"^",5)'="Y":"ACTIVATED",1:"AVAILABLE") Q
I $P(Y(0),"^",4)="" W !,"THE BATCH TYPE FOR THIS TRANSACTION TYPE ",$P(Y,"^",2)," HAS NOT BEEN ENTERED." Q
I $P(Y(0),"^",2)="" W !,"THE INPUT TEMPLATE FOR THIS TRANSACTION TYPE ",$P(Y,"^",2)," IS MISSING." Q
S GECS("TTDA")=+Y,GECS("TT")=$P(Y,"^",2),GECS("EDIT")=$P(Y(0),"^",3)
Q
;
;
BATCHSEL(GECSDICS) ; select batch number from file 2101.3
; gecsdics=screen
N %,%Y,DIC,X,Y
S DIC="^GECS(2101.3,",DIC(0)="QEAM",DIC("A")="Select BATCH NUMBER: "
I GECSDICS'="" S DIC("S")=GECSDICS
W ! D ^DIC I Y'>0 Q 0
Q +Y
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGECSUSEL 4302 printed Dec 13, 2024@01:56:37 Page 2
GECSUSEL ;WISC/RFJ-utility selection ;01 Nov 93
+1 ;;2.0;GCS;**2**;MAR 14, 1995
+2 QUIT
+3 ;
+4 ;
CODESHET(BATCH) ; select an existing code sheet
+1 ; batch = only select code sheets for batch
+2 NEW %,%Y,DIC,GECSBADA,GECSSUPR,X,Y
+3 IF $LENGTH(BATCH)
SET GECSBADA=+$ORDER(^GECS(2101.1,"B",BATCH,0))
IF 'GECSBADA
WRITE !,"BATCH ",BATCH," CANNOT BE FOUND IN FILE 2101.1."
QUIT 0
+4 WRITE !!,$SELECT($DATA(^XUSEC("GECS SUPER EDITOR",+$GET(DUZ))):"-- You can select all code sheets created for this batch type --",1:"-- You may only select code sheets which you have created --")
+5 IF $DATA(^XUSEC("GECS SUPER EDITOR",DUZ))
SET GECSSUPR=1
+6 SET DIC("S")="I $P(^(0),U,4)=""""!($P(^(0),U,4)="_DUZ_")!($G(GECSSUPR))"
+7 IF $GET(GECSBADA)
SET DIC("S")=DIC("S")_",$P(^(0),U,3)="_GECSBADA
+8 SET DIC="^GECS(2100,"
SET DIC(0)="QEAM"
SET DIC("A")="Select CODE SHEET ID Number: "
DO ^DIC
+9 IF Y'>0
QUIT 0
+10 QUIT +Y
+11 ;
+12 ;
BATTYPE(DEFAULT,DONTASK) ; select batch type parameters
+1 ; default set to batch default in lookup, if set to '- GECO' it
+2 ; will ask to select a batch name containing '- GECO'
+3 ; dontask set to lookup on batch without asking
+4 ; return gecs("batch")=batch name
+5 ; gecs("batda")=batch da number
+6 ; gecs("sysid")=system identidier (ams, etc)
+7 NEW %,%Y,DIC,X,Y
+8 ;
+9 KILL GECS("BATCH"),GECS("BATDA"),GECS("SYSID")
+10 SET DIC="^GECS(2101.1,"
+11 ;
+12 ; default is set (not null), lookup batch type, do not ask
+13 IF $GET(DONTASK)
IF $LENGTH(DEFAULT)
IF DEFAULT'="- GECO"
Begin DoDot:1
+14 SET DIC(0)="MNZ"
SET X=DEFAULT
DO ^DIC
IF Y'>0
QUIT
+15 DO BATCHECK
+16 IF '$GET(GECS("BATDA"))
KILL GECS("BATDA"),GECS("BATCH"),GECS("SYSID")
QUIT
+17 WRITE !,"Batch Type: ",GECS("BATCH")
End DoDot:1
QUIT
+18 ;
+19 ; ask batch type
+20 IF DEFAULT="- GECO"
SET DIC("S")="I $P(^(0),U)[""- GECO"""
SET DEFAULT=""
+21 IF $LENGTH(DEFAULT)
SET DIC("B")=DEFAULT
+22 SET DIC(0)="AEQMZ"
DO ^DIC
IF Y'>0
QUIT
+23 DO BATCHECK
+24 IF '$GET(GECS("BATDA"))
KILL GECS("BATDA"),GECS("BATCH"),GECS("SYSID")
QUIT
+25 WRITE !,"Batch Type: ",GECS("BATCH")
+26 QUIT
+27 ;
+28 ;
BATNOFMS ; select batch except for fms
+1 NEW DONTASK
+2 KILL GECS("BATCH"),GECS("BATDA"),GECS("SYSID")
+3 IF $LENGTH($GET(GECSSYS))
SET DONTASK=1
+4 FOR
WRITE !
DO BATTYPE($GET(GECSSYS),$GET(DONTASK))
if '$GET(GECS("BATDA"))
QUIT
Begin DoDot:1
+5 IF GECS("SYSID")="FMS"
WRITE !,"*** FMS DOCUMENTS CANNOT BE SELECTED ***"
KILL GECS("BATDA")
End DoDot:1
if $GET(GECS("BATDA"))
QUIT
+6 IF '$GET(GECS("BATDA"))
KILL GECS("BATCH"),GECS("BATDA"),GECS("SYSID")
+7 QUIT
+8 ;
+9 ;
BATCHECK ; check selected batch and set up variables
+1 ; y=selected batch; y(0)=data for selected batch
+2 IF $PIECE(Y(0),"^",4)=""
WRITE !,"SYSTEM ID FOR BATCH TYPE ",$PIECE(Y,"^",2)," HAS NOT BEEN ENTERED."
QUIT
+3 SET GECS("BATDA")=+Y
SET GECS("BATCH")=$PIECE(Y,"^",2)
SET GECS("SYSID")=$PIECE(Y(0),"^",4)
+4 QUIT
+5 ;
+6 ;
TRANTYPE(DEFAULT,DONTASK) ; ask transaction type-segment
+1 ; default set to segment default in lookup
+2 ; dontask set to lookup on segment without asking
+3 ; gecs("batda")=batch da (from file 2101.1)
+4 ; gecs("sysid")=system id (AMS)
+5 ; return gecs("tt")=segment name
+6 ; gecs("ttda")=segment da number
+7 ; gecs("edit")=edit template name
+8 ; gecsflag=1 to exit application
+9 NEW %,%Y,DIC,X,Y
+10 ;
+11 KILL GECS("TT"),GECS("TTDA"),GECS("EDIT"),GECSFLAG
+12 SET DIC="^GECS(2101.2,"
SET DIC("S")="I $P(^(0),U,4)="_GECS("BATDA")
+13 ;
+14 ; segment defined, look it up and quit
+15 IF $GET(DONTASK)
IF $LENGTH(DEFAULT)
Begin DoDot:1
+16 SET DIC(0)="MNZ"
SET X=DEFAULT
DO ^DIC
IF Y'>0
SET GECSFLAG=1
QUIT
+17 DO TTCHECK
+18 IF '$GET(GECS("SEGDA"))
SET GECSFLAG=1
End DoDot:1
QUIT
+19 ;
+20 ; ask for segment entry
+21 IF $LENGTH($GET(SEGMENT))
IF $GET(GECS("SYSID"))="AMS"
SET DIC("B")=DEFAULT
+22 SET DIC(0)="AEQMZ"
DO ^DIC
IF Y'>0
SET GECSFLAG=1
QUIT
+23 DO TTCHECK
+24 QUIT
+25 ;
+26 ;
TTCHECK ; check selected transaction type and set up variables
+1 ; y=selected entry; y(0)=data for selected entry
+2 IF $PIECE(Y(0),"^",3)=""!($PIECE(Y(0),"^",5)'="Y")
WRITE !,"THIS TRANSACTION TYPE ",$PIECE(Y,"^",2)," IS NOT YET ",$SELECT($PIECE(Y(0),"^",5)'="Y":"ACTIVATED",1:"AVAILABLE")
QUIT
+3 IF $PIECE(Y(0),"^",4)=""
WRITE !,"THE BATCH TYPE FOR THIS TRANSACTION TYPE ",$PIECE(Y,"^",2)," HAS NOT BEEN ENTERED."
QUIT
+4 IF $PIECE(Y(0),"^",2)=""
WRITE !,"THE INPUT TEMPLATE FOR THIS TRANSACTION TYPE ",$PIECE(Y,"^",2)," IS MISSING."
QUIT
+5 SET GECS("TTDA")=+Y
SET GECS("TT")=$PIECE(Y,"^",2)
SET GECS("EDIT")=$PIECE(Y(0),"^",3)
+6 QUIT
+7 ;
+8 ;
BATCHSEL(GECSDICS) ; select batch number from file 2101.3
+1 ; gecsdics=screen
+2 NEW %,%Y,DIC,X,Y
+3 SET DIC="^GECS(2101.3,"
SET DIC(0)="QEAM"
SET DIC("A")="Select BATCH NUMBER: "
+4 IF GECSDICS'=""
SET DIC("S")=GECSDICS
+5 WRITE !
DO ^DIC
IF Y'>0
QUIT 0
+6 QUIT +Y