GEC29TR ;WIOFO/BGJ-POST INIT FOR GEC*2*29 ;03/05/02
;;2.0;GCS;**29**;Mar 14, 1995
;
;This routine is called as a post init in patch GEC*2*29.
;It creates the entry "TR:FMS" in file 2101.2.
;It also requeues any "TR" document in file 2100.1 to FMS
;that does not have a status of Accepted or Transmitted.
;
Q
;
START N ABORT,GECDA,GECDOCID,GECER,GECSEG,GECSTAT,FDA
;
CREATE ;Create the TR:FMS entry in 2101.2.
S ABORT=0
S GECSEG="TR:FMS"
W:$G(IOF)'="" @IOF
W !,"Creating entry TR:FMS in file 2101.2..."
I $D(^GECS(2101.2,"B",GECSEG)) D Q
. W !!,"Entry TR:FMS already exists in file 2101.2",!
S FDA(2101.2,"?+1,",.01)=GECSEG
S FDA(2101.2,"?+1,",.7)="FINANCIAL MANAGEMENT"
S FDA(2101.2,"?+1,",1)="Y"
S FDA(2101.2,"?+1,",2)="FMS Transfer Document"
D UPDATE^DIE("E","FDA",,"GECER")
I $D(GECER) D Q:ABORT
. S ABORT=1
. W $C(7)
. W:$G(IOF)'="" @IOF
. W !!,"An ERROR has occured",!
. W $P(GECER("DIERR",1),"^")," - "
. W $P(GECER("DIERR",1,"TEXT",1),"^")
W !!,"Entry TR:FMS created in file 2101.2"
;
REQUEUE ;Requeue "TR" entries in 2100.1 that do not have a status
;of "A" or "T".
W !!!,"Requeueing entries in file 2100.1...",!
S GECDOCID=""
F S GECDOCID=$O(^GECS(2100.1,"B",GECDOCID)) Q:GECDOCID="" D
. Q:$P(GECDOCID,"-")'="TR"
. S GECDA=0
. F S GECDA=$O(^GECS(2100.1,"B",GECDOCID,GECDA)) Q:GECDA="" D
. . Q:'($D(^GECS(2100.1,GECDA,0))#10)
. . S GECSTAT=$P(^GECS(2100.1,GECDA,0),"^",4)
. . Q:GECSTAT="T"!(GECSTAT="A")
. . D SETSTAT^GECSSTAA(GECDA,"Q")
. . W !,$P(^GECS(2100.1,GECDA,0),"^")," ","Queued"
W !!,"Done",!
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGEC29TR 1611 printed Dec 13, 2024@01:56:01 Page 2
GEC29TR ;WIOFO/BGJ-POST INIT FOR GEC*2*29 ;03/05/02
+1 ;;2.0;GCS;**29**;Mar 14, 1995
+2 ;
+3 ;This routine is called as a post init in patch GEC*2*29.
+4 ;It creates the entry "TR:FMS" in file 2101.2.
+5 ;It also requeues any "TR" document in file 2100.1 to FMS
+6 ;that does not have a status of Accepted or Transmitted.
+7 ;
+8 QUIT
+9 ;
START NEW ABORT,GECDA,GECDOCID,GECER,GECSEG,GECSTAT,FDA
+1 ;
CREATE ;Create the TR:FMS entry in 2101.2.
+1 SET ABORT=0
+2 SET GECSEG="TR:FMS"
+3 if $GET(IOF)'=""
WRITE @IOF
+4 WRITE !,"Creating entry TR:FMS in file 2101.2..."
+5 IF $DATA(^GECS(2101.2,"B",GECSEG))
Begin DoDot:1
+6 WRITE !!,"Entry TR:FMS already exists in file 2101.2",!
End DoDot:1
QUIT
+7 SET FDA(2101.2,"?+1,",.01)=GECSEG
+8 SET FDA(2101.2,"?+1,",.7)="FINANCIAL MANAGEMENT"
+9 SET FDA(2101.2,"?+1,",1)="Y"
+10 SET FDA(2101.2,"?+1,",2)="FMS Transfer Document"
+11 DO UPDATE^DIE("E","FDA",,"GECER")
+12 IF $DATA(GECER)
Begin DoDot:1
+13 SET ABORT=1
+14 WRITE $CHAR(7)
+15 if $GET(IOF)'=""
WRITE @IOF
+16 WRITE !!,"An ERROR has occured",!
+17 WRITE $PIECE(GECER("DIERR",1),"^")," - "
+18 WRITE $PIECE(GECER("DIERR",1,"TEXT",1),"^")
End DoDot:1
if ABORT
QUIT
+19 WRITE !!,"Entry TR:FMS created in file 2101.2"
+20 ;
REQUEUE ;Requeue "TR" entries in 2100.1 that do not have a status
+1 ;of "A" or "T".
+2 WRITE !!!,"Requeueing entries in file 2100.1...",!
+3 SET GECDOCID=""
+4 FOR
SET GECDOCID=$ORDER(^GECS(2100.1,"B",GECDOCID))
if GECDOCID=""
QUIT
Begin DoDot:1
+5 if $PIECE(GECDOCID,"-")'="TR"
QUIT
+6 SET GECDA=0
+7 FOR
SET GECDA=$ORDER(^GECS(2100.1,"B",GECDOCID,GECDA))
if GECDA=""
QUIT
Begin DoDot:2
+8 if '($DATA(^GECS(2100.1,GECDA,0))#10)
QUIT
+9 SET GECSTAT=$PIECE(^GECS(2100.1,GECDA,0),"^",4)
+10 if GECSTAT="T"!(GECSTAT="A")
QUIT
+11 DO SETSTAT^GECSSTAA(GECDA,"Q")
+12 WRITE !,$PIECE(^GECS(2100.1,GECDA,0),"^")," ","Queued"
End DoDot:2
End DoDot:1
+13 WRITE !!,"Done",!
+14 QUIT