ACGSFLDS ;IHS/OIRM/DSD/THL,AEF - CONTROL CIS FIELDS AND EXPORT VARIABLES ; [ 03/27/2000 2:22 PM ]
;;2.0t1;CONTRACT INFORMATION SYSTEM;;FEB 16, 2000
;;CONTROL CIS FIELDS AND EXPORT VARIABLES
;;modified for y2k;mlp;01/01/2000
EN I $D(^ACGS(ACGRDA,"DT"))&$D(^("DT1"))&$D(^("DT2"))&$D(^("DT3")) S ACGDT=^("DT"),ACGDT1=^("DT1"),ACGDT2=^("DT2"),ACGDT3=^("DT3"),ACGIHS=^("IHS") D 1
EXIT K ACGSIGN,ACGX
Q
1 S ACGY="",X=$P(ACGDT,U),X=$S('X:" ",$D(^ACGTPA(X,0)):$E($P(^(0),U)),1:" ")
D Y
2 S X=$E($P(ACGDT,U,2),1,15)
S:$L(X)<15 X=X_$J(" ",15-$L(X))
D Y
3 S X=$E($P(ACGDT,U,3),1,12)
S:$L(X)<12 X=X_$J(" ",12-$L(X))
D Y
4 S X=$E($P(ACGDT,U,4),1,3)
S:$L(X)<3 X=X_$J(" ",3-$L(X))
D Y
5 S X=$E($P(ACGDT,U,5),1,40)
S:$L(X)<40 X=X_$J(" ",40-$L(X))
D Y
6 S X=$E($P(ACGDT,U,6),1,30)
S:$L(X)<30 X=X_$J(" ",30-$L(X))
D Y
7 S X=$E($P(ACGDT,U,7),1,23)
S:$L(X)<23 X=X_$J(" ",23-$L(X))
D Y
8 S X=$P(ACGDT,U,8),X=$S('X:"",$D(^DIC(5,X,0)):$E($P(^(0),U),1,19),1:"")
S:$L(X)<19 X=X_$J(" ",19-$L(X))
D Y
9 S X=$E($P(ACGDT,U,9),1,5)
S:$L(X)<5 X=X_$J(" ",5-$L(X))
D Y
10 S X=$E($P(ACGDT,U,10),1,3)
S:X="" X=" "
S:$L(X)<3 X=X_$J("0",3-$L(X))
S:X="MUL"!(+X>99) X="099"
D Y
11 S X=$E($P(ACGDT,U,11),1,12)
S:$L(X)<12 X=X_$J(" ",12-$L(X))
S:$E(X)=2 $E(X,11,12)=" "
D Y
12 S X=$E($P(ACGDT,U,12)),X=$S(X]"":X,1:" ")
D Y
13 S X=$P(ACGDT,U,13),X=$S('X:" ",$D(^AUTTTOB(X,0)):$P(^(0),U),1:" ")
D Y
14 S X=$E($P(ACGDT,U,14),1,2),X=$S(X]"":X,1:" ")
D Y
15 S X=$P(ACGDT,U,15),X=$S('X:" ",$D(^ACGTOC(X,0)):$P(^(0),U),1:" ")
D Y
16 S X=$E($P(ACGDT,U,16)),X=$S(X]"":X,1:" ")
D Y
17 S X=$P(ACGDT,U,17),X=$S('X:" ",$D(^ACGSP(X,0)):$P(^(0),U),1:" ")
D Y
18 S X=$P(ACGDT,U,18),X=$S('X:" ",$D(^ACGFAO(X,0)):$P(^(0),U),1:" ")
D Y
19 S X=$P(ACGDT,U,19),X=$S('X:" ",$D(^ACGEOC(X,0)):$P(^(0),U),1:" ")
D Y
20 S X=$P(ACGDT,U,20),X=$S('X:" ",$D(^ACGMOC(X,0)):$P(^(0),U),1:" ")
D Y
21 S X=$E($P(ACGDT,U,21),1,2),X=$S($L(X)=2:X,X]"":"0"_X,1:"01")
D Y
22 S X=$E($P(ACGDT1,U),1,97)
S:$L(X)<97 X=X_$J(" ",97-$L(X))
D Y
23 ;S X=$E($P(ACGDT1,U,2),2,7)
;S:$L(X)<6 X=X_$J(" ",6-$L(X))
S X=$E($P(ACGDT1,U,2),1,7) ;y2k;mlp
S:$L(X)<7 X=X_$J(" ",7-$L(X)) ;y2k;mlp
D Y
24 ;S X=$E($P(ACGDT1,U,3),2,7)
;S:$L(X)<6 X=X_$J(" ",6-$L(X))
S X=$E($P(ACGDT1,U,3),1,7) ;y2k;mlp
S:$L(X)<7 X=X_$J(" ",7-$L(X)) ;y2k;mlp
D Y
25 ;S X=$E($P(ACGDT1,U,4),2,7)
;S:$L(X)<6 X=X_$J(" ",6-$L(X))
S X=$E($P(ACGDT1,U,4),1,7) ;y2k;mlp
S:$L(X)<7 X=X_$J(" ",7-$L(X)) ;y2k;mlp
D Y
26 S X=$P(ACGDT1,U,5),ACGSIGN=$S($E(X)="-":"-",1:""),ACGX=""
S:+X=0&($E(ACGY)="D") X=1
S:ACGSIGN="-" X=$P(X,"-",2)
S:(10-$L(ACGSIGN)-$L(X)) $P(ACGX,"0",(10-$L(ACGSIGN)-$L(X)))="" S X=ACGSIGN_ACGX_X
D Y
27 S X=$P(ACGDT1,U,6),X=$S('X:" ",$D(^ACGPPC(X,0)):$P(^(0),U),1:" ")
D Y
28 S X=$E($P(ACGDT1,U,7),1,25)
S:$L(X)<25 X=X_$J(" ",25-$L(X))
D Y
29 S X=$E($P(ACGDT1,U,8)),X=$S(X]"":X,1:" ")
D Y
30 S X=$E($P(ACGDT1,U,9)),X=$S(X=1!(X=2):X,1:2)
D Y
31 S X=$E($P(ACGDT1,U,10)),X=$S(X]"":X,1:" ")
D Y
32 S X=$E($P(ACGDT1,U,11)),X=$S(X]"":X,1:" ")
D Y
33 S X=$E($P(ACGDT1,U,12),1,8),X="000000 "
D Y
34 ;S X=$E($P(ACGDT1,U,13),2,7)
;S:$L(X)<6 X=X_$J(" ",6-$L(X))
S X=$E($P(ACGDT1,U,13),1,7) ;y2k;mlp
S:$L(X)<7 X=X_$J(" ",7-$L(X)) ;y2k;mlp
D Y
35 S X=$E($P(ACGDT1,U,14),1,20)
S:$L(X)<20 X=X_$J(" ",20-$L(X))
D Y
CONT D ^ACGSFLD1
Q
Y S ACGY=ACGY_X
Q
ACGSFLDS ;IHS/OIRM/DSD/THL,AEF - CONTROL CIS FIELDS AND EXPORT VARIABLES ; [ 03/27/2000 2:22 PM ]
+1 ;;2.0t1;CONTRACT INFORMATION SYSTEM;;FEB 16, 2000
+2 ;;CONTROL CIS FIELDS AND EXPORT VARIABLES
+3 ;;modified for y2k;mlp;01/01/2000
EN IF $DATA(^ACGS(ACGRDA,"DT"))&$DATA(^("DT1"))&$DATA(^("DT2"))&$DATA(^("DT3"))
SET ACGDT=^("DT")
SET ACGDT1=^("DT1")
SET ACGDT2=^("DT2")
SET ACGDT3=^("DT3")
SET ACGIHS=^("IHS")
DO 1
EXIT KILL ACGSIGN,ACGX
+1 QUIT
1 SET ACGY=""
SET X=$PIECE(ACGDT,U)
SET X=$SELECT('X:" ",$DATA(^ACGTPA(X,0)):$EXTRACT($PIECE(^(0),U)),1:" ")
+1 DO Y
2 SET X=$EXTRACT($PIECE(ACGDT,U,2),1,15)
+1 IF $LENGTH(X)<15
SET X=X_$JUSTIFY(" ",15-$LENGTH(X))
+2 DO Y
3 SET X=$EXTRACT($PIECE(ACGDT,U,3),1,12)
+1 IF $LENGTH(X)<12
SET X=X_$JUSTIFY(" ",12-$LENGTH(X))
+2 DO Y
4 SET X=$EXTRACT($PIECE(ACGDT,U,4),1,3)
+1 IF $LENGTH(X)<3
SET X=X_$JUSTIFY(" ",3-$LENGTH(X))
+2 DO Y
5 SET X=$EXTRACT($PIECE(ACGDT,U,5),1,40)
+1 IF $LENGTH(X)<40
SET X=X_$JUSTIFY(" ",40-$LENGTH(X))
+2 DO Y
6 SET X=$EXTRACT($PIECE(ACGDT,U,6),1,30)
+1 IF $LENGTH(X)<30
SET X=X_$JUSTIFY(" ",30-$LENGTH(X))
+2 DO Y
7 SET X=$EXTRACT($PIECE(ACGDT,U,7),1,23)
+1 IF $LENGTH(X)<23
SET X=X_$JUSTIFY(" ",23-$LENGTH(X))
+2 DO Y
8 SET X=$PIECE(ACGDT,U,8)
SET X=$SELECT('X:"",$DATA(^DIC(5,X,0)):$EXTRACT($PIECE(^(0),U),1,19),1:"")
+1 IF $LENGTH(X)<19
SET X=X_$JUSTIFY(" ",19-$LENGTH(X))
+2 DO Y
9 SET X=$EXTRACT($PIECE(ACGDT,U,9),1,5)
+1 IF $LENGTH(X)<5
SET X=X_$JUSTIFY(" ",5-$LENGTH(X))
+2 DO Y
10 SET X=$EXTRACT($PIECE(ACGDT,U,10),1,3)
+1 IF X=""
SET X=" "
+2 IF $LENGTH(X)<3
SET X=X_$JUSTIFY("0",3-$LENGTH(X))
+3 IF X="MUL"!(+X>99)
SET X="099"
+4 DO Y
11 SET X=$EXTRACT($PIECE(ACGDT,U,11),1,12)
+1 IF $LENGTH(X)<12
SET X=X_$JUSTIFY(" ",12-$LENGTH(X))
+2 IF $EXTRACT(X)=2
SET $EXTRACT(X,11,12)=" "
+3 DO Y
12 SET X=$EXTRACT($PIECE(ACGDT,U,12))
SET X=$SELECT(X]"":X,1:" ")
+1 DO Y
13 SET X=$PIECE(ACGDT,U,13)
SET X=$SELECT('X:" ",$DATA(^AUTTTOB(X,0)):$PIECE(^(0),U),1:" ")
+1 DO Y
14 SET X=$EXTRACT($PIECE(ACGDT,U,14),1,2)
SET X=$SELECT(X]"":X,1:" ")
+1 DO Y
15 SET X=$PIECE(ACGDT,U,15)
SET X=$SELECT('X:" ",$DATA(^ACGTOC(X,0)):$PIECE(^(0),U),1:" ")
+1 DO Y
16 SET X=$EXTRACT($PIECE(ACGDT,U,16))
SET X=$SELECT(X]"":X,1:" ")
+1 DO Y
17 SET X=$PIECE(ACGDT,U,17)
SET X=$SELECT('X:" ",$DATA(^ACGSP(X,0)):$PIECE(^(0),U),1:" ")
+1 DO Y
18 SET X=$PIECE(ACGDT,U,18)
SET X=$SELECT('X:" ",$DATA(^ACGFAO(X,0)):$PIECE(^(0),U),1:" ")
+1 DO Y
19 SET X=$PIECE(ACGDT,U,19)
SET X=$SELECT('X:" ",$DATA(^ACGEOC(X,0)):$PIECE(^(0),U),1:" ")
+1 DO Y
20 SET X=$PIECE(ACGDT,U,20)
SET X=$SELECT('X:" ",$DATA(^ACGMOC(X,0)):$PIECE(^(0),U),1:" ")
+1 DO Y
21 SET X=$EXTRACT($PIECE(ACGDT,U,21),1,2)
SET X=$SELECT($LENGTH(X)=2:X,X]"":"0"_X,1:"01")
+1 DO Y
22 SET X=$EXTRACT($PIECE(ACGDT1,U),1,97)
+1 IF $LENGTH(X)<97
SET X=X_$JUSTIFY(" ",97-$LENGTH(X))
+2 DO Y
23 ;S X=$E($P(ACGDT1,U,2),2,7)
+1 ;S:$L(X)<6 X=X_$J(" ",6-$L(X))
+2 ;y2k;mlp
SET X=$EXTRACT($PIECE(ACGDT1,U,2),1,7)
+3 ;y2k;mlp
IF $LENGTH(X)<7
SET X=X_$JUSTIFY(" ",7-$LENGTH(X))
+4 DO Y
24 ;S X=$E($P(ACGDT1,U,3),2,7)
+1 ;S:$L(X)<6 X=X_$J(" ",6-$L(X))
+2 ;y2k;mlp
SET X=$EXTRACT($PIECE(ACGDT1,U,3),1,7)
+3 ;y2k;mlp
IF $LENGTH(X)<7
SET X=X_$JUSTIFY(" ",7-$LENGTH(X))
+4 DO Y
25 ;S X=$E($P(ACGDT1,U,4),2,7)
+1 ;S:$L(X)<6 X=X_$J(" ",6-$L(X))
+2 ;y2k;mlp
SET X=$EXTRACT($PIECE(ACGDT1,U,4),1,7)
+3 ;y2k;mlp
IF $LENGTH(X)<7
SET X=X_$JUSTIFY(" ",7-$LENGTH(X))
+4 DO Y
26 SET X=$PIECE(ACGDT1,U,5)
SET ACGSIGN=$SELECT($EXTRACT(X)="-":"-",1:"")
SET ACGX=""
+1 IF +X=0&($EXTRACT(ACGY)="D")
SET X=1
+2 IF ACGSIGN="-"
SET X=$PIECE(X,"-",2)
+3 IF (10-$LENGTH(ACGSIGN)-$LENGTH(X))
SET $PIECE(ACGX,"0",(10-$LENGTH(ACGSIGN)-$LENGTH(X)))=""
SET X=ACGSIGN_ACGX_X
+4 DO Y
27 SET X=$PIECE(ACGDT1,U,6)
SET X=$SELECT('X:" ",$DATA(^ACGPPC(X,0)):$PIECE(^(0),U),1:" ")
+1 DO Y
28 SET X=$EXTRACT($PIECE(ACGDT1,U,7),1,25)
+1 IF $LENGTH(X)<25
SET X=X_$JUSTIFY(" ",25-$LENGTH(X))
+2 DO Y
29 SET X=$EXTRACT($PIECE(ACGDT1,U,8))
SET X=$SELECT(X]"":X,1:" ")
+1 DO Y
30 SET X=$EXTRACT($PIECE(ACGDT1,U,9))
SET X=$SELECT(X=1!(X=2):X,1:2)
+1 DO Y
31 SET X=$EXTRACT($PIECE(ACGDT1,U,10))
SET X=$SELECT(X]"":X,1:" ")
+1 DO Y
32 SET X=$EXTRACT($PIECE(ACGDT1,U,11))
SET X=$SELECT(X]"":X,1:" ")
+1 DO Y
33 SET X=$EXTRACT($PIECE(ACGDT1,U,12),1,8)
SET X="000000 "
+1 DO Y
34 ;S X=$E($P(ACGDT1,U,13),2,7)
+1 ;S:$L(X)<6 X=X_$J(" ",6-$L(X))
+2 ;y2k;mlp
SET X=$EXTRACT($PIECE(ACGDT1,U,13),1,7)
+3 ;y2k;mlp
IF $LENGTH(X)<7
SET X=X_$JUSTIFY(" ",7-$LENGTH(X))
+4 DO Y
35 SET X=$EXTRACT($PIECE(ACGDT1,U,14),1,20)
+1 IF $LENGTH(X)<20
SET X=X_$JUSTIFY(" ",20-$LENGTH(X))
+2 DO Y
CONT DO ^ACGSFLD1
+1 QUIT
Y SET ACGY=ACGY_X
+1 QUIT