source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCHQM1.m@ 1605

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

initial load of WorldVistAEHR

File size: 7.2 KB
Line 
1PRCHQM1 ;WISC/KMB-MANUAL PRINT RFQ PROCESSING 3/26/96 ;7/23/99 16:33
2 ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4START ;
5 W !!!,"Use this option to print the 90 column manual quotation form to a printer.",!
6 K DIR S DIR(0)="SMB^A:ALL MANUALLY SOLICITED;I:INDIVIDUAL"
7 S DIR("A",1)="Do you wish to print RFQs for All manually solicited or an"
8 S DIR("A")="Individual vendor"
9 S DIR("?",1)="All manually solicited vendors will print a RFQ form for each vendor"
10 S DIR("?",2)="who has previously been selected for manual solicitation. Individual"
11 S DIR("?",3)="will enable you to print a manual RFQ for any single vendor, whether"
12 S DIR("?",4)="or not he has previously been specified for manual solicitation."
13 S DIR("?",5)="If the vendor has not been specified for solicitation earlier, he"
14 S DIR("?")="will be added to the list of manually solicited vendors."
15 D ^DIR K DIR
16 I $D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT) K DTOUT,DUOUT,DIRUT,DIROUT Q
17 I Y="I" G SELECT
18ASK S DIC="^PRC(444,",DIC("S")="I $P(^(0),""^"",8)>1",DIC(0)="AEMQZ"
19 D ^DIC K DIC I Y<0 K DA,X,Y Q
20 S DA=+Y
21 S X=0,Y=0
22 F S X=$O(^PRC(444,DA,5,X)) Q:+X'=X I $P($G(^PRC(444,DA,5,X,0)),U,2)="m" S Y=1 Q
23 I 'Y W !!,"There are no vendors for Manual Solicitation!" K DA G ASK
24A S %ZIS("B")="",%ZIS="MQ" D ^%ZIS Q:POP
25 I $E(IOST)'="P"!(IOM'>89) D ^%ZISC,EN^DDIOL("Device must be a printer supporting 90 characters per line.") G A
26 I $D(IO("Q")) S ZTRTN="PROCESS^PRCHQM1",ZTSAVE("DA")="" D ^%ZTLOAD,HOME^%ZIS Q
27 D PROCESS
28 Q
29PROCESS ;
30 N X,Y,FOB,FOB1,FOB2,SB1,SB2,FOB1,FOB2,FOB3,FOB4,I,J,P,UPU,UPR,LOC,IP,FLG
31 N SVEND,PPHONE,REF,LN,LDESC,QTY,ADATE,CBDATE,RDATE,SRC,PA,ZIP,ZIP1,LD
32 N SRC,ISS,K,D0,BC1,BC2,BC3,BC4,BC5,BC6,RFQNUM,LDATE,FDES1,FDES2,FDES3,FDES4
33 N PRCSUB,Z,C1,DIW,DIWF,DIWI,DIWL,DIWR,DIWT,DIWTC,DIWX,PAFAX,PRCEMAIL,VENPH,VENFAX
34 K ^TMP($J) S D0=DA
35 S SVEND=$P($G(^PRC(444,DA,5,0)),"^",4)
36 S (FDES1,FDES2,FDES3,FDES4,BC1,BC2,BC3,BC4,BC5,BC6)=""
37 S (J,P)=1,(PAFAX,PPHONE,SB1,FOB2)=" ",FOB1="x"
38 S:$P($G(^PRC(444,DA,1)),"^")="O" FOB1=" ",FOB2="x"
39 S RFQNUM=$P($G(^PRC(444,DA,0)),"^",1),RDATE=$P($G(^PRC(444,DA,0)),"^",2),CBDATE=$P($G(^PRC(444,DA,0)),"^",3)
40 S REF=$P($G(^PRC(444,DA,0)),"^",9),PA=$P($G(^PRC(444,DA,0)),"^",4)
41 I PA>0 D
42 . N PRCX,DIC,DR,DA,DIQ,D0 K ^UTILITY("DIQ1",$J)
43 . S DIC=200,DR=".01;.135;.136;.151",DA=PA,DIQ="PRCX",DIQ(0)="I" D EN^DIQ1
44 . S PA=PRCX(200,DA,.01,"I"),PPHONE=PRCX(200,DA,.135,"I"),PAFAX=PRCX(200,DA,.136,"I"),PRCEMAIL=PRCX(200,DA,.151,"I") K ^UTILITY("DIQ1",$J)
45 S IP=$P(RFQNUM,"-") I IP'="" S IP=$P($G(^PRC(411,IP,0)),"^",10)
46 I IP'="" S ISS(5)=$P($G(^DIC(4,IP,0)),"^",2),ISS(1)=$P($G(^(0)),"^",8),ISS(6)=$P($G(^(1)),"^",4) F I=1:1:3 S ISS(I+1)=$P($G(^DIC(4,IP,1)),"^",I)
47 S:$G(ISS(5))'="" ISS(5)=$P($G(^DIC(5,ISS(5),0)),"^",2)
48 S Y=$P($G(^PRC(444,DA,1)),"^",3)
49 I Y'="" D
50 . N PRCX,PRCSHIP
51 . S PRCSUB=$P(^PRC(444,DA,0),"^",10) S:PRCSUB="" PRCSUB=$P($P(^PRC(444,DA,0),"^"),"-")
52 . S PRCSHIP=$G(^PRC(411,PRCSUB,1,Y,0)),FDES1=$P(PRCSHIP,"^")
53 . S PRCX=$P(PRCSHIP,"^",5)_", "_$S($P(PRCSHIP,"^",6)]"":$P($G(^DIC(5,$P(PRCSHIP,"^",6),0)),"^",2),1:"")_" "_$P(PRCSHIP,"^",7)
54 . S FDES2=$P(PRCSHIP,"^",2) I FDES2="" S FDES2=PRCX Q
55 . S FDES3=$P(PRCSHIP,"^",3) I FDES3="" S FDES3=PRCX Q
56 . S FDES4=PRCX
57 S SB1=$P($G(^PRC(444,DA,1)),"^",7),ADATE=$P($G(^(1)),"^",2) S:SB1="" SB2="x"
58 ;
59IDATA ;
60 S ZIP=0 F S ZIP=$O(^PRC(444,DA,2,ZIP)) Q:+ZIP=0 D
61 .S LN=$P($G(^PRC(444,DA,2,ZIP,0)),"^"),QTY=$P($G(^(0)),"^",2),UPU=$P($G(^(0)),"^",3)
62 .S:UPU'="" UPU=$P($G(^PRCD(420.5,UPU,0)),"^")
63 .S UPR=""
64 .S FLG=0,ZIP1=$P($G(^PRC(444,DA,2,ZIP,4,0)),"^",4) S:+ZIP1=0 ZIP1=1,FLG=1 F LD=1:1:ZIP1 D
65 ..S LOC=$P($G(^PRC(444,DA,2,ZIP,4,LD,0)),"^",4),LDATE=$P($G(^(0)),"^",2) S:FLG=0 QTY=$P($G(^(0)),"^",3)
66 ..S:LOC'="" LOC=$P(^PRCS(410.8,LOC,0),"^")
67 ..I LDATE'="" S Y=LDATE D DD^%DT S LDATE=Y
68 ..S ^TMP($J,LN,LD)=LN_"^"_LOC_"^"_QTY_"^"_UPU_"^"_UPR_"^"_LDATE_"^"_" "
69 S Y=RDATE D DD^%DT S RDATE=Y
70 S Y=ADATE D DD^%DT S ADATE=Y
71 S Y=CBDATE D DD^%DT S CBDATE=Y
72FVEND ;
73 ;
74 I $G(PRCOPTN)'="ONE" F K=1:1:SVEND D SVEND^PRCHQM3 I '$D(FLAG) D ^PRCHQM2,REP^PRCHQM4,VET^PRCHQM3,ADMCERT^PRCHQM4(DA,P) W !?28,"--LAST PAGE--"
75 I $G(PRCOPTN)="ONE" D
76 . N FILE,VEN,KK,VEN440
77 . S KK=$P(PRCVEN,";"),FILE=$P(PRCVEN,";",2),VEN=@("^"_FILE_KK_",0)")
78 . S VENPH=$S(FILE[440:$P(VEN,U,10),FILE[444.1:$P(VEN,U,6),1:"")
79 . I FILE[440 F I=1:1:8 S SRC(I)=$P(VEN,"^",I)
80 . I FILE[444.1 S SRC(1)=$P(VEN,"^"),VEN(1)=$G(^PRC(444.1,KK,1)) F I=1:1:7 S SRC(I+1)=$P(VEN(1),"^",I)
81 . S:SRC(7)'="" SRC(7)=$P($G(^DIC(5,SRC(7),0)),"^",2)
82 . I FILE[444.1 S VENFAX=$P($G(VEN),"^",7)
83 . I FILE[440 S VEN440=$G(@("^"_FILE_KK_",10)")),VENFAX=$P(VEN440,"^",6)
84 . D ^PRCHQM2,REP^PRCHQM4,VET^PRCHQM3,ADMCERT^PRCHQM4(DA,P)
85 . W !?28,"--LAST PAGE--"
86 . I '$D(^PRC(444,PRCDA,5,"B",PRCVEN)) D
87 . . N DD,DO,DIC,DA,DIE,DR
88 . . S X=PRCVEN,DIC="^PRC(444,PRCDA,5,",DIC(0)="LX",DLAYGO=444.01
89 . . S DIC("P")=$P(^DD(444,20,0),U,2),DA(1)=PRCDA
90 . . D FILE^DICN K DIC,DLAYGO
91 . . Q:+Y<1
92 . . S DIE="^PRC(444,PRCDA,5,",DA(1)=PRCDA,DA=+Y,DR="1////m"
93 . . D ^DIE
94 I $P($G(^PRC(444,DA,9)),U)="" D
95 . N X,Y,%,%H,%I D NOW^%DTC
96 . S $P(^PRC(444,DA,9),U)=%
97 K ^TMP($J),DA,FLAG,PRCVEN I $D(ZTQUEUED) S ZTREQ="@" K PRCOPTN,PRCDA
98 D ^%ZISC
99 Q
100SELECT ;Entry point for Print Single RFQ
101 K DIR,DA,DIC
102 S DIC="^PRC(444,",DIC("S")="I $P(^(0),U,8)=2",DIC(0)="AEMQZ"
103 D ^DIC K DIC I Y<1 K DA,X,Y,DTOUT,DUOUT Q
104 S PRCDA=+Y
105VSELECT ;Vendor select
106 K DIR,DA S DIR(0)="444.01,.01",DIR("A")="Enter an existing Vendor or RETURN"
107 S DIR("?")="^D HELP^PRCHQM1" D ^DIR K DIR
108 I $D(DTOUT)!$D(DUOUT)!$D(DIROUT) G EX
109 S:Y>0 PRCVEN=Y
110 I Y<1 D G:$G(PRCOUT) EX
111 . K DIC,DA S DIC="^PRC(444.1,",DIC(0)="AELMQ",DLAYGO=444.1
112 . S DIC("A")="Enter the Vendor's Name: "
113 . D ^DIC K DIC,DLAYGO
114 . I Y<1 W !,"The vendor was NOT added to the RFQ VENDOR File!" S PRCOUT=1 Q
115 . S DA=+Y,PRCVEN=DA
116 . L +^PRC(444.1,PRCVEN):3 E W !,"This vendor entry is in use, please try later!" S PRCOUT=1 Q
117 . S DIE="^PRC(444.1,",DR=".01;18.3;38;4.8;5;46;1R;2;3;4;4.2R;4.4R;4.6"
118 . D ^DIE K DIE,DR,DA L -^PRC(444.1,PRCVEN)
119 . S PRCVEN=PRCVEN_";PRC(444.1,"
120 K DA S DA=PRCDA,PRCOPTN="ONE"
121DEVICE S %ZIS("A")="Device to Print RFQ: ",%ZIS("B")="",%ZIS="MQ" D ^%ZIS
122 G:POP EX
123 I $E(IOST)'="P"!(IOM'>89) D ^%ZISC,EN^DDIOL("Device must be a printer supporting 90 characters per line.") G DEVICE
124 I $D(IO("Q")) S ZTRTN="PROCESS^PRCHQM1",ZTSAVE("DA")="",ZTSAVE("PRCVEN")="",ZTSAVE("PRCOPTN")="",ZTSAVE("PRCDA")="" D ^%ZTLOAD,HOME^%ZIS K ZTSK G EX
125 D PROCESS
126EX K PRCX,PRCDA,PRCVEN,DA,PRCOPTN,PRCOUT,POP,DIC,DIE,DIRUT,DIROUT,DTOUT,DUOUT,X,Y
127 Q
128HELP ;Help for DIR lookup of vendor
129 N PRCA,PRCX,PRCJ,X,Y,Z,PRCTMP S $P(PRCA," ",81)=""
130 S PRCTMP(1)="The current Solicited Vendors for this RFQ are: "
131 S PRCX=0,PRCJ=1
132 F S PRCX=$O(^PRC(444,PRCDA,5,PRCX)) Q:+PRCX'=PRCX D
133 . Q:'$D(^PRC(444,PRCDA,5,PRCX,0)) S X=^(0)
134 . S Y=$P(X,U),Y=$P($G(@("^"_$P(Y,";",2)_$P(Y,";")_",0)")),U)
135 . S Z=$P(";EDI;MANUAL",";",$F("em",$P(X,U,2)))
136 . S PRCJ=PRCJ+1,PRCTMP(PRCJ)=" "_Y_$E(PRCA,$L(Y)+1,50)_Z
137 S PRCJ=PRCJ+1,PRCTMP(PRCJ)=""
138 S PRCJ=PRCJ+1,PRCTMP(PRCJ)="First check that the Vendor in not already on file in the VENDOR file (#440)"
139 S PRCJ=PRCJ+1,PRCTMP(PRCJ)=" or the RFQ VENDOR file (#444.1). By entering RETURN, you will be"
140 S PRCJ=PRCJ+1,PRCTMP(PRCJ)=" given an opportunity to add a new vendor to the RFQ VENDOR file."
141 S PRCJ=PRCJ+1,PRCTMP(PRCJ)=""
142 D EN^DDIOL(.PRCTMP)
143 Q
Note: See TracBrowser for help on using the repository browser.