source: FOIAVistA/tag/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCHE.m@ 1672

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

initial load of FOIAVistA 6/30/08 version

File size: 7.2 KB
Line 
1PRCHE ;WOIFO/LKG/DST-EDIT ROUTINES FOR SUPPLY SYSTEM ; 6/22/05 8:40am
2V ;;5.1;IFCAP;**1,28,39,81,63**;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4EN1 ;ITEM FILE EDIT
5 N PRCVDA
6 I '$D(PRC("PARAM")) S PRCF("X")="S" D ^PRCFSITE Q:'$D(PRC("PARAM"))
7 W !! D DISP^PRCOSS1
8 S DIC="^PRC(441,",DIC(0)="AEMQL",DLAYGO=441,PRCHPO="",PRCHDA=-1 D ^DIC
9 I Y>0 D
10 . S PRCHDA=+Y,DIE=DIC,DA=+Y
11 . S DR=$S($P($G(^PRC(441,DA,0)),U,15)="":"[PRCHITEM2]",$D(^XUSEC("PRCHITEM MASTER",DUZ)):"[PRCHITEM2]",1:"[PRCHITEM]")
12 . I DR="[PRCHITEM]" D
13 . . N PRCARR S PRCARR(1)="This item is a National Item File entry and you have"
14 . . S PRCARR(2)="not been granted permission to edit the SHORT DESCRIPTION"
15 . . S PRCARR(3)="and DESCRIPTION fields. You will not be able to edit these fields."
16 . . D EN^DDIOL(.PRCARR)
17 . D LCK D:$D(DA) ^DIE
18 . ; Send ITEM master file updates info to DynaMed - **81**
19 . S PRCVDA=$G(DA)
20 S Y=PRCHDA K PRCHDA D Q K PRCHPO
21 I Y<0 D CHECK^PRCOSS1 Q
22 S (PRCHDA,DA,DA(1))=+Y I $O(^PRC(441,DA,4,0)) S DIC="^PRC(441,"_DA(1)_",4,",DIC(0)="QEMAN" D ^DIC S:$G(Y)'=-1 PRCVDA=PRCHDA I Y>0 S DA=+Y,DIE=DIC,DR=3 D ^DIE,Q
23 ; S:$G(Y)'=-1 PRCVDA=PRCHDA
24 ; If either ITEM record (and FCP fields) created or updated, and
25 ; this site is a DynaMed Interface site
26 I $G(PRCVDA),$$GET^XPAR("SYS","PRCV COTS INVENTORY",1,"Q")=1 D ONECHK^PRCVIT(PRCVDA)
27 I $P(^PRC(441,PRCHDA,0),U,10)="",$P(PRC("PARAM"),U,16)="Y" W $C(7),!!,"Warning--BOC is missing from this item--you should",!,"re-edit the item!!",!
28 I $O(^PRCP(445,"AH",PRCHDA,""))]"" D BLDSEG^PRCPHLFM(3,PRCHDA,0) ; update supply stations
29 K PRCHDA G EN1
30 ;
31EN2 ;EDIT SITE PARAMETERS
32 N X R !,"STATION NUMBER: ",X:DTIME Q:'$T!(X["^")!(X="")
33 I "???"[X D EN2DSP G EN2
34 I X'?3N W !,"Please enter a 3 digit number or '^' to exit. If attempting to enter substation information, please use 'Substation Enter/Edit'." G EN2
35 I $D(^PRC(411,"B",X)) G EN2A
36 N PRCX
37 S PRCX=$O(^DIC(4,"D",X,"")) I PRCX="" W " ?? (That is not a valid Station Number)" G EN2
38 S PRCX=$P($G(^DIC(4,PRCX,0)),U,1)
39 D EN^DDIOL("Do you wish to add "_X_" ("_PRCX_") as a NEW station")
40 S %=0 D YN^DICN I %'=1 G EN2
41 ;
42EN2A S DIC="^PRC(411,",DIC(0)="LX",DR="[PRCHSITE]",DLAYGO=411 D DIE
43 G EN2
44EN2DSP ;Display entries from file #411 if they are Ok in file #4. Otherwise,
45 ;alert user about any incomplete entry.
46 N PRCDA,PRCA,J,PRCIEN,PRCINSN
47 S PRCDA=0 F J=2:0 S PRCDA=$O(^PRC(411,"B",PRCDA)) Q:PRCDA="" D
48 . S PRCIEN=$O(^PRC(411,"B",PRCDA,"")) I $D(^PRC(411,PRCIEN,0))#10 D
49 .. S PRCA=$P($G(^PRC(411,PRCIEN,0)),U,1) I PRCA?3N D
50 ... S PRCA(J)=$J("",5)_PRCA_" "
51 ... S PRCINSN=$O(^DIC(4,"D",PRCDA,"")) I PRCINSN']"" D Q
52 .... W !,$C(7),?5,"ENTRY "_PRCDA_" IS NOT SET UP PROPERLY IN FILE #4. PLEASE CALL IRM"
53 ... S PRCA(J)=PRCA(J)_$P($G(^DIC(4,PRCINSN,0)),U,1),J=J+1
54 I J>2 S PRCA(1)=" ",PRCA(J)=" " D EN^DDIOL(.PRCA)
55 Q
56EN3 ;EDIT VENDOR FILE
57 S DIC="^PRC(440,",DIC(0)="AEMQL",DR="[PRCHVENDOR1]",DLAYGO=440 K PRCHPO D DIE Q:Y<0 G EN3
58 ;
59EN5 ;ENTER A NEW P.O.
60 D ST Q:'$D(PRC("SITE"))
61EN50 D ENPO^PRCHUTL Q:'$D(PRCHPO) D LCK1 G:'$D(DA) EN50 D ^PRCHNPO L G EN50
62 ;
63EN6 ;EDIT AN INCOMPLETE P.O.
64 ;Edit an Incomplete Purchase Order created by 'New Purchase Order' option only
65 D ST Q:'$D(PRC("SITE"))
66EN60 N FLG1 S FLG1=1 D PO Q:'$D(PRCHPO)
67 D LCK1 G:'$D(DA) EN60 D ^PRCHNPO L G EN60
68 ;
69EN8 ;DELETE A RECEIVING REPORT
70 N FLG1 S FLG1=0 D ST Q:'$D(PRC("SITE")) G EN80^PRCHEF
71 ;
72EN9 ;EDIT COMMON NUMBERING SERIES
73 W ! S DIC="^PRC(442.6,",DIC(0)="AEMQL",DR=".01:99",DLAYGO=442.6 D DIE Q:Y<0 I $D(^PRC(442.6,+Y)),$P(^(+Y,0),U,5)="" W !!,$C(7),"NOTE: Since you have left the USING SECTION field empty, these",!,"numbers can only be used by P&C.",!
74 G EN9
75 ;
76EN10 ;EDIT SUPPLY EMPLOYEE INFORMATION
77 K DIC,DA,X,Y S DIC="^VA(200,",DIC(0)="AEMQ" D ^DIC
78 G:Y<0 EN10Q
79 S DA=+Y L +^VA(200,DA):0 E W $C(7),!,"ANOTHER USER IS EDITING THIS ENTRY!" G EN10
80 K DR,DIE S DR="400;.135;.136;.151",DIE=DIC D ^DIE K DIE,DR
81 L -^VA(200,DA)
82 W !?5,"To edit the Signature Block Printed Name or title, Use TBOX",!
83 G:'$D(DTOUT) EN10
84EN10Q K DIC,DIE,X,Y,DA,DR,DTOUT,DUOUT
85 Q
86 ;
87EN11 ;EDIT ADMINISTRATIVE CERTIFICATIONS
88 S DIC="^PRC(442.7,",DIC(0)="AEMLQ",DR=".01:99",DLAYGO=442.7 D DIE Q:Y<0 G EN11
89 ;
90EN12 ;EDIT DELIVERY DATE
91 N PRCHP D ST Q:'$D(PRC("SITE"))
92 ;S PRCHP("S")="$P($G(^(7)),U,2)>19,$P($G(^(7)),U,2)<30,($P($G(^(0)),U,2)=25!($S($D(PRCHNRQ):$P($G(^(0)),U,2)=8,1:$P($G(^(0)),U,2)<8)))"
93EN120 D PORQ I '$D(PRCHPO) G Q
94 ;I X<20!(X>29) W " ??",$C(7) G EN120
95 I "^20^21^22^23^24^25^26^27^28^29^32^34^39^44^46^47^"'[(U_X_U) W " ??",$C(7) G EN120
96 D LCK1 G:'$D(DA) EN120
97 S D0=DA,%=2,%B="",%A="REVIEW ORDER " D ^PRCFYN D:%=1 ^PRCHDP1
98 W ! S PRCHDT=$P(^PRC(442,PRCHPO,0),U,10) S DA=PRCHPO,DIE="^PRC(442,",DR="[PRCHDEL]" D ^DIE S X=$P(^PRC(442,PRCHPO,0),U,10) I X,X'=PRCHDT,$P(^(0),U,20)="" S $P(^(0),U,20)=PRCHDT
99 ; trigger bulletin for changed delivery date
100 S PRCHDTT=$P(^PRC(442,PRCHPO,0),U,10) I PRCHDTT'=PRCHDT D ^PRCFACS2
101 K PRCHDT D Q G EN120
102 ;
103EN13 ; Delete 2237 option has been de-activated.
104 ; See documentation for PRC*5*128.
105 Q
106EN14 ;CREATE ADJUSTMENT VOUCHER
107 D ST Q:'$D(PRC("SITE"))
108EN140 D PORQ Q:'$D(PRCHPO)
109 I X=28!(X=33) W $C(7),!,"Adjustment Vouchers not allowed until after order has been Obligated!!" G EN140
110 I '$O(^PRC(442,PRCHPO,11,0)) W !?3,"Order has no Receiving Reports !",$C(7) G EN140
111 D ^PRCHAM4 G EN140
112 ;
113EN15 ;ENTER LOG DEPARTMENTS TO FCP FILE (420)
114 D ST Q:'$D(PRC("SITE"))
115EN150 S DIC="^PRC(420,"_PRC("SITE")_",1,",DIC(0)="AEMNQ"
116 S DIC("A")="Select CONTROL POINT: ",D="B^C" D MIX^DIC1 G:Y<0 Q
117 S DIE=DIC,DA(1)=PRC("SITE"),DA=+Y,DR=19 D ^DIE
118 D:$P(^PRC(420,DA(1),1,DA,0),U,18)?1"11".E
119 . W !,">>> You have just assigned a LOG DEPARTMENT that should only be used for Subsistence FCPs. If that is NOT true, please reassign it or you will be asked for a Food Group on every item purchased."
120 G EN150
121 ;
122DIE S PRCHDA=-1 D ^DIC
123 I Y>0 S PRCHDA=+Y,DIE=DIC,DA=+Y D LCK I $D(DA) D ^DIE
124 S Y=PRCHDA K PRCHDA G Q
125 ;
126QQ S:'$D(ROUTINE) ROUTINE=$T(+0) W !!,$$ERR^PRCHQQ(ROUTINE,PRCSIG) W:PRCSIG=0!(PRCSIG=-3) !,"Notify Application Coordinator!",$C(7) S DIR(0)="EAO",DIR("A")="Press <return> to continue" D ^DIR
127 ;
128Q K DA,DIC,DIE,DIK,DR,DLAYGO,D0,E,I,J,L,PRCHEX,PRCHPUSH,%,ROUTINE,CHECK L
129 Q
130 ;
131LCK1 S DIC="^PRC(442,"
132 ;
133LCK L @(DIC_DA_"):0") E W !,$C(7),"ANOTHER USER IS EDITING THIS ENTRY!" K DA
134 Q
135 ;
136ST S PRCF("X")="S" D ^PRCFSITE
137 Q
138 ;
139PO S PRCHP("A")="P.O./REQ.NO.: "
140 S PRCHP("S")=$S(FLG1:"$P($G(^(7)),U,2)<10,($P(^(0),U,2)<10!($P(^(0),U,2)=25&($P($G(^(23)),U,11)=""""))!($P(^(0),U,2)=26))",1:"$P(^(0),U,2)<10!($P(^(0),U,2)=25)!($P(^(0),U,2)=26)")
141 S:$G(PRCHPC)=1 PRCHP("S")="$P($G(^(7)),U,2)<9,$P($G(^(1)),U,10)=DUZ,$P($G(^(0)),U,2)=25,$P($G(^(23)),U,11)=""S"""
142 S:$G(PRCHPC)=2 PRCHP("S")="$P($G(^(7)),U,2)<9,$P($G(^(1)),U,10)=DUZ,$P($G(^(0)),U,2)=25,$P($G(^(23)),U,11)=""P"""
143 S:$G(PRCHDELV) PRCHP("S")="$P($G(^(7)),U,2)<9,$P($G(^(23)),U,11)=""D"",$P(^(0),U,2)'=26"
144 S:$G(PRCHPC)=3 PRCHP("S")="$P($G(^(7)),U,2)<9,$P($G(^(1)),U,10)=DUZ,$P($G(^(0)),U,2)=25,$P($G(^(23)),U,11)=""P"""
145 S:$G(PRCHPHAM) PRCHP("S")="$P($G(^(7)),U,2)<9,$P($G(^(23)),U,11)=""D"",$P(^(0),U,2)=26"
146 D EN3^PRCHPAT
147 Q
148 ;
149PORQ S:$D(PRCHNRQ) PRCHP("A")="REQUISITION NO.: "
150 I $G(PRCHAUTH)=1 S PRCHP("S")="$P($G(^(23)),U,11)=""P"""
151 I $G(PRCHAUTH)=2 S PRCHP("S")="$P($G(^(23)),U,11)=""D"""
152 D EN3^PRCHPAT
153 Q
Note: See TracBrowser for help on using the repository browser.