source: FOIAVistA/trunk/r/FEE_BASIS-FB/FBCTV.m@ 761

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

initial load of FOIAVistA 6/30/08 version

File size: 8.0 KB
Line 
1FBCTV ; GENERATED FROM 'FB VENDOR UPDATE' INPUT TEMPLATE(#1055), FILE 161.2;06/29/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,1) S:%]"" DE(2)=% S %=$P(%Z,U,2) S:%]"" DE(3)=% S %=$P(%Z,U,3) S:%]"" DE(4)=% S %=$P(%Z,U,4) S:%]"" DE(5)=% S %=$P(%Z,U,5) S:%]"" DE(6)=% S %=$P(%Z,U,6) S:%]"" DE(7)=% S %=$P(%Z,U,7) S:%]"" DE(8)=%
5 I S %=$P(%Z,U,8) S:%]"" DE(9)=% S %=$P(%Z,U,9) S:%]"" DE(10)=% S %=$P(%Z,U,10) S:%]"" DE(11)=% S %=$P(%Z,U,13) S:%]"" DE(12)=% S %=$P(%Z,U,14) S:%]"" DE(13)=%,DE(14)=%
6 I $D(^(3)) S %Z=^(3) S %=$P(%Z,U,2) S:%]"" DE(15)=%
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="FBCTV",DQ=1
54 N DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR K DIEFIRE,DIEBADK S DIEZTMP=$$GETTMP^DIKC1("DIEZ")
55 M DIEZAR=^DIE(1055,"AR") S DICRREC="TRIG^DIE17"
56 S:$D(DTIME)[0 DTIME=300 S D0=DA,DIIENS=DA_",",DIEZ=1055,U="^"
571 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=1 D X1 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
58X1 S:'$D(Z1) Y="@10"
59 Q
602 S DW="0;1",DV="RFX",DU="",DLB="NAME",DIFLD=.01
61 S DE(DW)="C2^FBCTV"
62 S X=$P(Z1,U)
63 S Y=X
64 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)
65 G RD:X="@",Z
66C2 G C2S:$D(DE(2))[0 K DB
67 S X=DE(2),DIC=DIE
68 K ^FBAAV("B",$E(X,1,46),DA)
69C2S S X="" G:DG(DQ)=X C2F1 K DB
70 S X=DG(DQ),DIC=DIE
71 S ^FBAAV("B",$E(X,1,46),DA)=""
72C2F1 Q
73X2 Q
743 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW="0;2",DV="RFOX",DU="",DLB="ID NUMBER",DIFLD=1
75 S DQ(3,2)="S Y(0)=Y S Y=$E(Y,1,3)_""-""_$E(Y,4,5)_""-""_$E(Y,6,99)"
76 S DE(DW)="C3^FBCTV"
77 S X=$P(Z1,U,2)
78 S Y=X
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
81C3 G C3S:$D(DE(3))[0 K DB
82 S X=DE(3),DIC=DIE
83 K ^FBAAV("C",$E(X,1,30),DA)
84 S X=DE(3),DIC=DIE
85 K ^FBAAV("BS",$E(X,6,9),DA)
86 S X=DE(3),DIC=DIE
87 K:$P(^FBAAV(DA,0),U,10) ^FBAAV("AD",X_$E("0000",$L($P(^(0),U,10))+1,4)_$P(^(0),U,10),DA)
88 S X=DE(3),DIC=DIE
89 K ^FBAAV("E",$E(X,1,9),DA)
90C3S S X="" G:DG(DQ)=X C3F1 K DB
91 S X=DG(DQ),DIC=DIE
92 S ^FBAAV("C",$E(X,1,30),DA)=""
93 S X=DG(DQ),DIC=DIE
94 S ^FBAAV("BS",$E(X,6,9),DA)=""
95 S X=DG(DQ),DIC=DIE
96 S:$P(^FBAAV(DA,0),U,10) ^FBAAV("AD",X_$E("0000",$L($P(^(0),U,10))+1,4)_$P(^(0),U,10),DA)=""
97 S X=DG(DQ),DIC=DIE
98 S ^FBAAV("E",$E(X,1,9),DA)=""
99C3F1 Q
100X3 Q
1014 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW="0;3",DV="F",DU="",DLB="STREET ADDRESS",DIFLD=2
102 S X=$P(Z1,U,3)
103 S Y=X
104 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)
105 G RD:X="@",Z
106X4 Q
1075 S DW="0;4",DV="RF",DU="",DLB="CITY",DIFLD=3
108 S X=$P(Z1,U,4)
109 S Y=X
110 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)
111 G RD:X="@",Z
112X5 Q
1136 S DW="0;5",DV="RP5'",DU="",DLB="STATE",DIFLD=4
114 S DE(DW)="C6^FBCTV"
115 S DU="DIC(5,"
116 S X=$P(Z1,U,5)
117 S Y=X
118 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)
119 G RD:X="@",Z
120C6 G C6S:$D(DE(6))[0 K DB
121 S X=DE(6),DIC=DIE
122 K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^FBAAV(D0,0)):^(0),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X="" S DIH=$S($D(^FBAAV(DIV(0),0)):^(0),1:""),DIV=X S $P(^(0),U,13)=DIV,DIH=161.2,DIG=5.5 D ^DICR:$O(^DD(DIH,DIG,1,0))>0
123C6S S X="" G:DG(DQ)=X C6F1 K DB
124 S X=DG(DQ),DIC=DIE
125 ;
126C6F1 Q
127X6 Q
1287 D:$D(DG)>9 F^DIE17,DE S DQ=7,DW="0;6",DV="RFX",DU="",DLB="ZIP CODE",DIFLD=5
129 S X=$P(Z1,U,6)
130 S Y=X
131 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)
132 G RD:X="@",Z
133X7 Q
1348 S DW="0;7",DV="RS",DU="",DLB="TYPE OF VENDOR",DIFLD=6
135 S DU="1:PUBLIC HOSPITAL;2:PHYSICIAN;3:PHARMACY;4:PROSTHETICS;5:TRAVEL;6:RADIOLOGY;7:LABORATORY;8:OTHER;9:PRIVATE HOSPITAL;10:FEDERAL HOSPITAL;"
136 S X=$P(Z1,U,7)
137 S Y=X
138 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)
139 G RD:X="@",Z
140X8 Q
1419 S DW="0;8",DV="P161.6'",DU="",DLB="SPECIALTY CODE",DIFLD=.05
142 S DU="FBAA(161.6,"
143 S X=$P(Z1,U,8)
144 S Y=X
145 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)
146 G RD:X="@",Z
147X9 Q
14810 S DW="0;9",DV="RP161.81'",DU="",DLB="PART CODE",DIFLD=7
149 S DU="FBAA(161.81,"
150 S X=$P(Z1,U,9)
151 S Y=X
152 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)
153 G RD:X="@",Z
154X10 Q
15511 S DW="0;10",DV="FX",DU="",DLB="CHAIN",DIFLD=8
156 S DE(DW)="C11^FBCTV"
157 S X=$P(Z1,U,10)
158 S Y=X
159 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)
160 G RD:X="@",Z
161C11 G C11S:$D(DE(11))[0 K DB
162 S X=DE(11),DIC=DIE
163 K:$P(^FBAAV(DA,0),U,2) ^FBAAV("AD",$P(^(0),U,2)_$E("0000",$L(X)+1,4)_X,DA)
164C11S S X="" G:DG(DQ)=X C11F1 K DB
165 S X=DG(DQ),DIC=DIE
166 S:$P(^FBAAV(DA,0),U,2) ^FBAAV("AD",$P(^(0),U,2)_$E("0000",$L(X)+1,4)_X,DA)=""
167C11F1 Q
168X11 Q
16912 D:$D(DG)>9 F^DIE17,DE S DQ=12,DW="0;13",DV="RNJ4,0XO",DU="",DLB="COUNTY",DIFLD=5.5
170 S DQ(12,2)="S Y(0)=Y S Y(0)=Y Q:Y']"""" S Z0=$S($D(^FBAAV(D0,0)):+$P(^(0),""^"",5),1:"""") Q:'Z0 S Y=$P($S($D(^DIC(5,Z0,1,Y,0)):^(0),1:""""),""^"",1)"
171 S X=$P(Z1,U,13)
172 S Y=X
173 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)
174 G RD:X="@",Z
175X12 Q
17613 S DW="0;14",DV="F",DU="",DLB="STREET ADDRESS 2",DIFLD=2.5
177 S Y="@"
178 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)
179 G RD:X="@",Z
180X13 Q
18114 S DW="0;14",DV="F",DU="",DLB="STREET ADDRESS 2",DIFLD=2.5
182 S X=$P(Z1,U,14)
183 S Y=X
184 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)
185 G RD:X="@",Z
186X14 Q
18715 S DW="3;2",DV="FX",DU="",DLB="NPI",DIFLD=41.01
188 S DE(DW)="C15^FBCTV"
189 S X=Z6
190 S Y=X
191 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)
192 G RD:X="@",Z
193C15 G C15S:$D(DE(15))[0 K DB
194 D ^FBCTV1
195C15S S X="" G:DG(DQ)=X C15F1 K DB
196 D ^FBCTV2
197C15F1 Q
198X15 Q
19916 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=16 G A
20017 D:$D(DG)>9 F^DIE17 G ^FBCTV3
Note: See TracBrowser for help on using the repository browser.