source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCST22.m@ 823

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

initial load of WorldVistAEHR

File size: 8.3 KB
RevLine 
[613]1PRCST22 ; ;10/27/00
2 D DE G BEGIN
3DE S DIE="^PRCS(410,D0,""IT"",",DIC=DIE,DP=410.02,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^PRCS(410,D0,"IT",DA,""))=""
4 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,1) S:%]"" DE(2)=% S %=$P(%Z,U,2) S:%]"" DE(11)=%,DE(18)=% S %=$P(%Z,U,3) S:%]"" DE(19)=% S %=$P(%Z,U,4) S:%]"" DE(9)=%,DE(15)=% S %=$P(%Z,U,5) S:%]"" DE(5)=% S %=$P(%Z,U,6) S:%]"" DE(20)=%
5 I S %=$P(%Z,U,7) S:%]"" DE(21)=%
6 K %Z Q
7 ;
8W W !?DL+DL-2,DLB_": "
9 Q
10O D W W Y W:$X>45 !?9
11 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
12 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
13TR R X:DTIME E S (DTOUT,X)=U W $C(7)
14 Q
15A K DQ(DQ) S DQ=DQ+1
16B G @DQ
17RE G PR:$D(DE(DQ)) D W,TR
18N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
19RD G QS:X?."?" I X["^" D D G ^DIE17
20 I X="@" D D G Z^DIE2
21 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
22T 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
23 K DDER G X
24P 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
25 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
26 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
27V D @("X"_DQ) K YS
28Z 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
29X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
30 S X="?BAD"
31QS S DZ=X D D,QQ^DIEQ G B
32D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
33Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
34PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
35R 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
36 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
37 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
38RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
39I I DV'["I",DV'["#" G RD
40 D E^DIE0 G RD:$D(X),PR
41 Q
42SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
43 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
44 D ^DIR I 'DDER S %=Y(0),X=Y
45 Q
46SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
47 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
48 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
49 Q
50NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
51KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
52BEGIN S DNM="PRCST22",DQ=1
531 S DQ=2 ;@1
542 S DW="0;1",DV="MRNJ3,0",DU="",DLB="LINE ITEM NUMBER",DIFLD=.01
55 S DE(DW)="C2^PRCST22"
56 S Y="1"
57 G Y
58C2 G C2S:$D(DE(2))[0 K DB
59 S X=DE(2),DIC=DIE
60 K ^PRCS(410,DA(1),"IT","B",$E(X,1,30),DA)
61 S X=DE(2),DIC=DIE
62 K ^PRCS(410,DA(1),"IT","AB",$E(X,1,30),DA)
63C2S S X="" Q:DG(DQ)=X K DB
64 S X=DG(DQ),DIC=DIE
65 S ^PRCS(410,DA(1),"IT","B",$E(X,1,30),DA)=""
66 S X=DG(DQ),DIC=DIE
67 S ^PRCS(410,DA(1),"IT","AB",$E(X,1,30),DA)=""
68 Q
69X2 K:+X'=X!(X>999)!(X<1)!(X?.E1"."1N.N) X
70 Q
71 ;
723 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=3 D X3 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
73X3 I $D(^PRCS(410,DA(1),3)),$P(^(3),"^",4),$D(^(2)),$P(^(2),"^",1)'="" S PRCSV=$P(^(3),"^",4)
74 Q
754 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
76X4 I '$D(PRCSV) S Y=1
77 Q
785 D:$D(DG)>9 F^DIE17,DE S DQ=5,DW="0;5",DV="FX",DU="",DLB="ITEM MASTER FILE NO.",DIFLD=5
79 S DE(DW)="C5^PRCST22"
80 G RE
81C5 G C5S:$D(DE(5))[0 K DB
82 S X=DE(5),DIC=DIE
83 K ^PRCS(410,DA(1),"IT","AG",$E(X,1,30),DA)
84C5S S X="" Q:DG(DQ)=X K DB
85 S X=DG(DQ),DIC=DIE
86 S ^PRCS(410,DA(1),"IT","AG",$E(X,1,30),DA)=""
87 Q
88X5 K:X[""""!($A(X)=45) X I $D(X) D ITEM^PRCSES1
89 I $D(X),X'?.ANP K X
90 Q
91 ;
926 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=6 D X6 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
93X6 K PRCSSUB I X="" S Y=1
94 Q
957 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=7 D X7 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
96X7 S PRCSSUB=$S($D(^PRCD(420.1,+$S($D(^PRCS(410,DA(1),3)):$P(^(3),U,3),1:""),1,+$S($D(^PRC(441,+$S($D(^PRCS(410,DA(1),"IT",DA,0)):$P(^(0),U,5),1:""),0)):$P(^(0),U,10),1:""),0)):$P(^(0),U),1:"")
97 Q
988 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=8 D X8 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
99X8 S X=$P($G(^PRCS(410,DA(1),3)),U,3) I X]"" S X=$$GETBOCNT^PRCSECP(PRC("SITE"),+PRC("CP"),+X) I (+X=1) S $P(^PRCS(410,DA(1),"IT",DA,0),U,4)=$P(X,U,2),Y="@44" W !,"BOC: ",$P(X,U,2)
100 Q
1019 D:$D(DG)>9 F^DIE17,DE S DQ=9,DW="0;4",DV="RFX",DU="",DLB="BOC",DIFLD=4
102 S DE(DW)="C9^PRCST22"
103 G RE
104C9 G C9S:$D(DE(9))[0 K DB
105 S X=DE(9),DIC=DIE
106 K ^PRCS(410,"AD",$E(X,1,30),DA(1))
107C9S S X="" Q:DG(DQ)=X K DB
108 S X=DG(DQ),DIC=DIE
109 S ^PRCS(410,"AD",$E(X,1,30),DA(1))=""
110 Q
111X9 K:X[""""!($A(X)=45) X I $D(X) D SUB^PRCSES
112 I $D(X),X'?.ANP K X
113 Q
114 ;
11510 S DQ=11 ;@44
11611 D:$D(DG)>9 F^DIE17,DE S DQ=11,DW="0;2",DV="RNJ9,2",DU="",DLB="QUANTITY",DIFLD=2
117 S DE(DW)="C11^PRCST22"
118 G RE
119C11 G C11S:$D(DE(11))[0 K DB
120 S X=DE(11),DIC=DIE
121 X "S E=0,E(1)="""" S:'$D(^PRCS(410,DA(1),4)) ^(4)="""" F E(0)=1:1 S E=$O(^PRCS(410,DA(1),""IT"",E)) S:E?1N.N&(E'=DA) E(1)=E(1)+($P(^(E,0),U,2)*$P(^(0),U,7)) I E'?1N.N X ^DD(410.02,2,1,1,1.4) K E Q"
122C11S S X="" Q:DG(DQ)=X K DB
123 S X=DG(DQ),DIC=DIE
124 X "S E=0,E(1)="""" S:'$D(^PRCS(410,DA(1),4)) ^(4)="""" F E(0)=1:1 S E=$O(^PRCS(410,DA(1),""IT"",E)) S:E?1N.N E(1)=E(1)+($P(^(E,0),U,2)*$P(^(0),U,7)) I E'?1N.N X ^DD(410.02,2,1,1,1.4) K E Q"
125 Q
126X11 K:+X'=X!(X>999999)!(X<.01)!(X?.E1"."3N.N) X
127 Q
128 ;
12912 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=12 D X12 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
130X12 S Y="@4"
131 Q
13213 D:$D(DG)>9 F^DIE17,DE S DQ=13,D=0 K DE(1) ;1
133 S Y="DESCRIPTION^W^^0;1^Q",DG="1",DC="^410.03" D DIEN^DIWE K DE(1) G A
134 ;
13514 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 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
136X14 S X=$P($G(^PRCS(410,DA(1),3)),U,3) I X]"" S X=$$GETBOCNT^PRCSECP(PRC("SITE"),+PRC("CP"),+X) I (+X=1) S $P(^PRCS(410,DA(1),"IT",DA,0),U,4)=$P(X,U,2),Y="@444" W !,"BOC: ",$P(X,U,2)
137 Q
13815 S DW="0;4",DV="RFX",DU="",DLB="BOC",DIFLD=4
139 S DE(DW)="C15^PRCST22"
140 G RE
141C15 G C15S:$D(DE(15))[0 K DB
142 S X=DE(15),DIC=DIE
143 K ^PRCS(410,"AD",$E(X,1,30),DA(1))
144C15S S X="" Q:DG(DQ)=X K DB
145 S X=DG(DQ),DIC=DIE
146 S ^PRCS(410,"AD",$E(X,1,30),DA(1))=""
147 Q
148X15 K:X[""""!($A(X)=45) X I $D(X) D SUB^PRCSES
149 I $D(X),X'?.ANP K X
150 Q
151 ;
15216 S DQ=17 ;@444
15317 S DQ=18 ;@2
15418 D:$D(DG)>9 F^DIE17,DE S DQ=18,DW="0;2",DV="RNJ9,2",DU="",DLB="QUANTITY",DIFLD=2
155 S DE(DW)="C18^PRCST22"
156 G RE
157C18 G C18S:$D(DE(18))[0 K DB
158 S X=DE(18),DIC=DIE
159 X "S E=0,E(1)="""" S:'$D(^PRCS(410,DA(1),4)) ^(4)="""" F E(0)=1:1 S E=$O(^PRCS(410,DA(1),""IT"",E)) S:E?1N.N&(E'=DA) E(1)=E(1)+($P(^(E,0),U,2)*$P(^(0),U,7)) I E'?1N.N X ^DD(410.02,2,1,1,1.4) K E Q"
160C18S S X="" Q:DG(DQ)=X K DB
161 S X=DG(DQ),DIC=DIE
162 X "S E=0,E(1)="""" S:'$D(^PRCS(410,DA(1),4)) ^(4)="""" F E(0)=1:1 S E=$O(^PRCS(410,DA(1),""IT"",E)) S:E?1N.N E(1)=E(1)+($P(^(E,0),U,2)*$P(^(0),U,7)) I E'?1N.N X ^DD(410.02,2,1,1,1.4) K E Q"
163 Q
164X18 K:+X'=X!(X>999999)!(X<.01)!(X?.E1"."3N.N) X
165 Q
166 ;
16719 D:$D(DG)>9 F^DIE17,DE S DQ=19,DW="0;3",DV="RP420.5'",DU="",DLB="UNIT OF PURCHASE",DIFLD=3
168 S DU="PRCD(420.5,"
169 G RE
170X19 Q
17120 S DW="0;6",DV="FX",DU="",DLB="STOCK NUMBER",DIFLD=6
172 G RE
173X20 K:$L(X)>24!($L(X)<1)!(X'?.ANP) X
174 I $D(X),X'?.ANP K X
175 Q
176 ;
17721 S DW="0;7",DV="RNJ10,2X",DU="",DLB="EST. ITEM (UNIT) COST",DIFLD=7
178 S DE(DW)="C21^PRCST22"
179 G RE
180C21 G C21S:$D(DE(21))[0 K DB
181 D ^PRCST23
182C21S S X="" Q:DG(DQ)=X K DB
183 D ^PRCST24
184 Q
185X21 S:X["$" X=$P(X,"$",2) Q:X?1"N/C" K:+X'=X&(X'?.N1"."2N)!(X>9999999)!(X<0) X I $D(X) S:X=0 X="N/C"
186 Q
187 ;
18822 S DQ=23 ;@4
18923 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=23 D X23 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
190X23 K PRCSV
191 Q
19224 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=24 D X24 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
193X24 D 2^PRCSCK
194 Q
19525 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 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
196X25 I $D(PRCSERR),PRCSERR S Y="@1"
197 Q
19826 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=26 D X26 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
199X26 D QRB^PRCSCK
200 Q
20127 D:$D(DG)>9 F^DIE17 G ^PRCST25
Note: See TracBrowser for help on using the repository browser.