source: WorldVistAEHR/trunk/r/FEE_BASIS-FB/FBCTV3.m@ 794

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

initial load of WorldVistAEHR

File size: 6.0 KB
Line 
1FBCTV3 ; ;12/27/07
2 D DE G BEGIN
3DE S DIE="^FBAAV(",DIC=DIE,DP=161.2,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^FBAAV(DA,""))=""
4 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,17) S:%]"" DE(1)=% S %=$P(%Z,U,18) S:%]"" DE(2)=%
5 I $D(^(1)) S %Z=^(1) S %=$P(%Z,U,1) S:%]"" DE(5)=% S %=$P(%Z,U,10) S:%]"" DE(6)=%,DE(7)=%
6 I $D(^("AMS")) S %Z=^("AMS") S %=$P(%Z,U,1) S:%]"" DE(11)=% S %=$P(%Z,U,2) S:%]"" DE(13)=% S %=$P(%Z,U,3) S:%]"" DE(14)=% S %=$P(%Z,U,4) S:%]"" DE(15)=% S %=$P(%Z,U,5) S:%]"" DE(16)=% S %=$P(%Z,U,6) S:%]"" DE(17)=%
7 K %Z Q
8 ;
9W W !?DL+DL-2,DLB_": "
10 Q
11O D W W Y W:$X>45 !?9
12 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
13 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
14TR R X:DTIME E S (DTOUT,X)=U W $C(7)
15 Q
16A K DQ(DQ) S DQ=DQ+1
17B G @DQ
18RE G PR:$D(DE(DQ)) D W,TR
19N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
20RD G QS:X?."?" I X["^" D D G ^DIE17
21 I X="@" D D G Z^DIE2
22 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
23T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I W:'$D(DB(DQ)) " "_% G V
24 K DDER G X
25P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
26 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
27 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
28V D @("X"_DQ) K YS
29Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
30X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
31 S X="?BAD"
32QS S DZ=X D D,QQ^DIEQ G B
33D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
34Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
35PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
36R I DG["P",@("$D(^"_X_"0))") S X=+$P(^(0),U,2) G RP:'$D(^(Y,0)) S Y=$P(^(0),U),X=$P(^DD(X,.01,0),U,3),DG=$P(^(0),U,2) G R
37 I DG["V",+Y,$P(Y,";",2)["(",$D(@(U_$P(Y,";",2)_"0)")) S X=+$P(^(0),U,2) G RP:'$D(^(+Y,0)) S Y=$P(^(0),U) I $D(^DD(+X,.01,0)) S DG=$P(^(0),U,2),X=$P(^(0),U,3) G R
38 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
39RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
40I I DV'["I",DV'["#" G RD
41 D E^DIE0 G RD:$D(X),PR
42 Q
43SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
44 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
45 D ^DIR I 'DDER S %=Y(0),X=Y
46 Q
47SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
48 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
49 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
50 Q
51NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
52KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
53BEGIN S DNM="FBCTV3",DQ=1
541 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW="0;17",DV="F",DU="",DLB="MEDICARE ID NUMBER",DIFLD=22
55 S X=$P(Z1,U,17)
56 S Y=X
57 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
58 G RD:X="@",Z
59X1 Q
602 S DW="0;18",DV="F",DU="",DLB="MAIL ROUTE CODE",DIFLD=5.18
61 S X=$P(Z1,U,18)
62 S Y=X
63 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
64 G RD:X="@",Z
65X2 Q
663 S DQ=4 ;@10
674 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=4 D X4 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
68X4 S:'$D(Z3) Y="@20"
69 Q
705 S DW="1;1",DV="F",DU="",DLB="PHONE NUMBER",DIFLD=14
71 S X=$P(Z3,U,1)
72 S Y=X
73 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
74 G RD:X="@",Z
75X5 Q
766 S DW="1;10",DV="S",DU="",DLB="BUSINESS TYPE (FPDS)",DIFLD=24
77 S DU="1:SMALL BUSINESS;2:LARGE BUSINESS;3:OUTSIDE U.S.;4:OTHER ENTITIES;"
78 S Y="@"
79 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
80 G RD:X="@",Z
81X6 Q
827 S DW="1;10",DV="S",DU="",DLB="BUSINESS TYPE (FPDS)",DIFLD=24
83 S DU="1:SMALL BUSINESS;2:LARGE BUSINESS;3:OUTSIDE U.S.;4:OTHER ENTITIES;"
84 S X=$P(Z3,U,10)
85 S Y=X
86 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
87 G RD:X="@",Z
88X7 Q
898 S DQ=9 ;@20
909 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=9 D X9 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
91X9 S:'$D(Z4) Y=""
92 Q
9310 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=10 D X10 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
94X10 S:$G(FBTMPCK) Y="@30"
95 Q
9611 S DW="AMS;1",DV="FX",DU="",DLB="AUSTIN NAME FIELD",DIFLD=30.01
97 S DE(DW)="C11^FBCTV3"
98 S X=$P(Z4,U)
99 S Y=X
100 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
101 G RD:X="@",Z
102C11 G C11S:$D(DE(11))[0 K DB
103 S X=DE(11),DIC=DIE
104 K ^FBAAV("D",$E(X,1,30),DA)
105C11S S X="" G:DG(DQ)=X C11F1 K DB
106 S X=DG(DQ),DIC=DIE
107 S ^FBAAV("D",$E(X,1,30),DA)=""
108C11F1 Q
109X11 Q
11012 S DQ=13 ;@30
11113 D:$D(DG)>9 F^DIE17,DE S DQ=13,DW="AMS;2",DV="FXO",DU="",DLB="PRICER EXEMPT",DIFLD=30.02
112 S DQ(13,2)="S Y(0)=Y D OUTYN^FBAAUTL3"
113 S X=$P(Z4,U,2)
114 S Y=X
115 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
116 G RD:X="@",Z
117X13 Q
11814 S DW="AMS;3",DV="FXO",DU="",DLB="1099 VENDOR",DIFLD=30.03
119 S DQ(14,2)="S Y(0)=Y D OUTYN^FBAAUTL3"
120 S X=$P(Z4,U,3)
121 S Y=X
122 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
123 G RD:X="@",Z
124X14 Q
12515 S DW="AMS;4",DV="S",DU="",DLB="FMS VENDOR TYPE",DIFLD=30.04
126 S DU="C:commercial;I:individual;F:federal;"
127 S X=$P(Z4,U,4)
128 S Y=X
129 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
130 G RD:X="@",Z
131X15 Q
13216 S DW="AMS;5",DV="S",DU="",DLB="PROVIDER CODE",DIFLD=30.05
133 S DU="B:both;V:vendor only;P:provider only;"
134 S X=$P(Z4,U,5)
135 S Y=X
136 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
137 G RD:X="@",Z
138X16 Q
13917 S DW="AMS;6",DV="RS",DU="",DLB="TAX ID/SSN FLAG",DIFLD=30.06
140 S DU="T:TAX ID NUMBER;S:SSN NUMBER;"
141 S X=$P(Z4,U,6)
142 S Y=X
143 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
144 G RD:X="@",Z
145X17 Q
14618 G 0^DIE17
Note: See TracBrowser for help on using the repository browser.