source: FOIAVistA/trunk/r/GENERIC_CODE_SHEET-GEC/GECSUFM1.m@ 1015

Last change on this file since 1015 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 4.0 KB
Line 
1GECSUFM1 ;WISC/RFJ/KLD-fms utilities: rebuild rejects ;13 Oct 98
2 ;;2.0;GCS;**4,8,10,19,27,30,31**;MAR 14, 1995
3 Q
4 ;
5 ;
6REBUILD(STACKDA,SYSTEM,SECCODE,FCPFLAG,DESCRIPT) ; rebuild rejected document
7 ; stackda = ien of stack entry to rebuild
8 ; system = "A" for ar, "I" for ifcap, "E" for eng, "C" for create doc
9 ; seccode = security 1 code (usually '10 ')
10 ; fcpflag = Y if transaction has updated ifcap fcp balance
11 ; use only for tran-code RC, CR, IV, MO, SA, ST
12 ; descript = description of event (null entry will not change orig)
13 ; return gecsfms("ctl"), gecsfms("bat"), gecsfms("doc")
14 N %,%H,%I,BATNUMB,DATE,DOCUMENT,FY,SEGMENT,STACK,STATION,TRANCLAS,TRANCODE,X,Y
15 ;
16 K GECSFMS
17 S STACK=$P($G(^GECS(2100.1,+STACKDA,0)),"^") I STACK="" Q
18 ;
19 S SYSTEM=$S($E(SYSTEM)="A":"ARS",$E(SYSTEM)="I":"IFC",$E(SYSTEM)="E":"AMM",1:"CFD")
20 ; stack entry in the form IV-460I12345 -460123
21 ; TT-STA###### -STAbat
22 S TRANCODE=$P(STACK,"-")
23 S STATION=$E($P(STACK,"-",2),1,3)
24 S DOCUMENT=$E($P(STACK,"-",2)_" ",1,11)
25 S BATNUMB=$E($P(STACK,"-",3)_" ",1,6)
26 S SECCODE=$E(SECCODE_" ",1,4)
27 D NOW^%DTC S Y=%,DATE=X D DD^%DT
28 S FY=$S($E(DATE,4,5)<10:$E(DATE,2,3),1:$E(DATE,2,3)+1)
29 S TRANCLAS="DOC" I TRANCODE="VR" S TRANCLAS="VRQ",TRANCODE=" "
30 S GECSFMS("CTL")="CTL^"_SYSTEM_"^FMS^"_$E(STATION,1,3)_"^"_TRANCLAS_"^"_TRANCODE_"^"_SECCODE_"^"_$E(BATNUMB,1,6)_"^"_DOCUMENT_"^"_(17+$E(DATE))_$E(DATE,2,7)_"^"_$$FORMTIME($P(Y,"@",2))_"^001^001^001^"_$C(126)
31 ;
32 ; vendor request, re-add ctl to stack and quit
33 I TRANCLAS="VRQ" D UPDSTACK(STACKDA,GECSFMS("CTL"),"","",DESCRIPT) Q
34 ;
35 ; change segment for specific transaction codes
36 S SEGMENT=TRANCODE
37 I TRANCODE="CF"!(TRANCODE="WR")!(TRANCODE="TR") S SEGMENT="CR"
38 I TRANCODE="DV"!(TRANCODE="ET") S SEGMENT="DD"
39 I TRANCODE="AO"!(TRANCODE="CO")!(TRANCODE="SO")!(TRANCODE="TG")!(TRANCODE="WO") S SEGMENT="MO"
40 I TRANCODE="AV"!(TRANCODE="CT")!(TRANCODE="MV")!(TRANCODE="OP")!(TRANCODE="PS")!(TRANCODE="TD") S SEGMENT="PV"
41 I TRANCODE="AR"!(TRANCODE="RT") S SEGMENT="RC"
42 I TRANCODE="BV" S SEGMENT="SV"
43 I TRANCODE="RO"!(TRANCODE="TZ") S SEGMENT="TO"
44 I TRANCODE="RV"!(TRANCODE="TY") S SEGMENT="TV"
45 ; create bat segment
46 I BATNUMB'=" " S GECSFMS("BAT")="BAT^"_$C(126)_SEGMENT_"0^"_BATNUMB_"^"_$C(126)
47 ; create doc and <tc>1 segments
48 I "RC^CR^TR^IV^MO^SA^ST"[SEGMENT S FCPFLAG=$S(FCPFLAG="Y":"Y",1:"N")_"^"
49 ; security code is not on the sa1,st1 code sheets
50 S SECCODE=SECCODE_"^"
51 I "SA^ST"[SEGMENT S SECCODE=""
52 S GECSFMS("DOC")="DOC^"_$C(126)
53 ; do not create <tc>1 document for at transaction code or amm system
54 I SEGMENT'="AT",SYSTEM'="AMM" S GECSFMS("DOC")=GECSFMS("DOC")_SEGMENT_"1^"_TRANCODE_"^"_DOCUMENT_"^"_SECCODE_FCPFLAG_$C(126)
55 ;
56 ; re-add code sheet to stack file
57 D UPDSTACK(STACKDA,GECSFMS("CTL"),$G(GECSFMS("BAT")),GECSFMS("DOC"),DESCRIPT)
58 Q
59 ;
60 ;
61UPDSTACK(STACKDA,CONTROL,BATCH,DOCUMENT,DESCRIPT) ; kill existing stack
62 ; entry code sheets and add new ones
63 ; stackda = ien of stack entry
64 ; control = control segment
65 ; batch = batch segment (optional, use "" if not defined)
66 ; document = doc and <tc>1 segments (optional, use "" if not defined)
67 ; descript = 79 character description of event
68 I '$D(^GECS(2100.1,STACKDA,0)) Q
69 N DATE,TIME,GDT
70 ;
71 L +^GECS(2100.1,STACKDA)
72 S DATE=$P(CONTROL,"^",10),DATE=($E(DATE,1,2)-17)_$E(DATE,3,8)
73 S TIME=$P(CONTROL,"^",11)
74 S GDT=DATE_"."_TIME
75 S DR="2///^S X=GDT",DIE=2100.1,DA=STACKDA D ^DIE
76 D SETSTAT^GECSSTAA(STACKDA,"")
77 I $L(DESCRIPT) S ^GECS(2100.1,STACKDA,1)=$E(DESCRIPT,1,79)
78 K ^GECS(2100.1,STACKDA,10)
79 ; reset code sheet size to 0, checksum and hold date to null
80 S $P(^GECS(2100.1,STACKDA,11),"^",1,3)="0^^"
81 D SETCS^GECSSTAA(STACKDA,CONTROL)
82 I $P(CONTROL,"^",8),BATCH'="" D SETCS^GECSSTAA(STACKDA,BATCH)
83 I DOCUMENT'="" D SETCS^GECSSTAA(STACKDA,DOCUMENT)
84 L -^GECS(2100.1,STACKDA)
85 Q
86 ;
87 ;
88FORMTIME(TIME) ; return formatted time for control ctl segment
89 N H,M,S
90 S H=$P(TIME,":"),M=$P(TIME,":",2),S=$P(TIME,":",3),H=$E("00",$L(H)+1,2)_H,M=$E("00",$L(M)+1,2)_M,S=$E("00",$L(S)+1,2)_S
91 Q H_M_S
Note: See TracBrowser for help on using the repository browser.