source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCHQ1.m@ 1141

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

initial load of WorldVistAEHR

File size: 3.9 KB
Line 
1PRCHQ1 ;(WASH ISC)/LKG-RFQ ;8/22/96 17:25
2 ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4IT1 ;Input Transform File 444, Field #14
5 N Z0,DIC
6 S Z0=$S($P($G(^PRC(444,D0,0)),U,10)]"":$P(^(0),U,10),1:$E($P($G(^PRC(444,D0,0)),U),1,3)) K:'Z0 X Q:'Z0
7 S DIC="^PRC(411,Z0,1,",DIC(0)="QEM" D ^DIC S X=+Y K:Y'>0 X
8 Q
9OT1 ;Output Transform File 444, Field #14
10 N Z0
11 Q:Y']""
12 S Z0=$S($P($G(^PRC(444,D0,0)),U,10)]"":$P(^(0),U,10),1:$E($P($G(^PRC(444,D0,0)),U),1,3)) Q:'Z0
13 S Y=$P($S($D(^PRC(411,Z0,1,Y,0))#10:^(0),1:""),U)
14 Q
15EH1 ;Executable Help File 444, Field #14
16 N D,Z0,DIC
17 S X="?",Z0=$S($P($G(^PRC(444,D0,0)),U,10)]"":$P(^(0),U,10),1:$E($P($G(^PRC(444,D0,0)),U),1,3)) Q:'Z0
18 S DIC="^PRC(411,Z0,1,",DIC(0)="QEM" D ^DIC
19 Q
20IT2 ;Part of input transform for File 444, Field #.01
21 ;Validate that RFQ number based on an existing 2237 number
22 ;and work sheet status
23 N PRCX,Y,Z
24 D
25 . S PRCX=$P(X,"-",1,5),Y=$O(^PRCS(410,"B",PRCX,"")) I Y'?1.N K X Q
26 . I ";2;3;4;"'[(";"_$P($G(^PRCS(410,Y,0)),U,4)_";") K X Q
27 . S Z=$P($G(^PRC(443,Y,0)),U,7) I Z="" K X Q
28 . I ";70;80;"'[(";"_$P($G(^PRCD(442.3,Z,0)),U,2)_";") K X Q
29 Q
30QUOTEDUE ;Input transform for Date Quote Due
31 N X1,X2,%Y,PRCX
32 S PRCX=X,X1=X,X2=$$GET^DDSVAL(444,DA,1,"","I") D ^%DTC
33 I X<3 D Q
34 . D HLP^DDSUTL("Quote Due Date must be at least 3 days after RFQ Reference Date.")
35 . S DDSERROR=1
36 S X=PRCX
37 I X'<$$GET^DDSVAL(444,DA,13,"","I") D Q
38 . D HLP^DDSUTL("Quote Due Date must be before Required Delivery Date.")
39 . S DDSERROR=1
40 Q
41NSN ;Additional Validation of National Stock Number in ScreenMan
42 Q:$G(X)=""
43 N PRCX
44 I '$D(^PRC(441.2,+X,0)) D Q
45 . D HLP^DDSUTL("Invalid NSN - First 4 characters must be a FSC Code.")
46 . S DDSERROR=1
47 S PRCX=$O(^PRC(441,"BB",X,0))
48 S:PRCX=$$GET^DDSVAL(444.019,.DA,1,"","I") PRCX=$O(^PRC(441,"BB",X,PRCX))
49 I PRCX'="" D Q
50 . S PRCX="This NSN has already been assigned to Item # "_PRCX
51 . D HLP^DDSUTL(PRCX) S DDSERROR=1
52 Q
53STUFFITM ;Stuff Item Description, National Stock #, FSC, & SIC Code upon change
54 ;of referenced Item Master #
55 N PRCX,PRCY,PRCZ S PRCX=X
56 I PRCX?1.N D
57 . S PRCZ=$G(^PRC(441,PRCX,0))
58 . D PUT^DDSVAL(444.019,.DA,1.6,$P(PRCZ,U,2))
59 . D PUT^DDSVAL(444.019,.DA,1.5,"^PRC(441,PRCX,1)")
60 . D PUT^DDSVAL(444.019,.DA,4,$P(PRCZ,U,3))
61 . S PRCY=$P(PRCZ,U,14) S:PRCY="" PRCY="@"
62 . D PUT^DDSVAL(444.019,.DA,12,PRCY,"",$S(PRCY'="@":"I",1:"E"))
63 S PRCY=$S(PRCX="":"",1:$P($G(^PRC(441,PRCX,3)),U,10))
64 D:PRCY?1.N PUT^DDSVAL(444.019,.DA,6,PRCY,"","I")
65 S PRCY=$S($G(DDSOLD)]""&($G(PRCX)=""):"@",$G(PRCX)="":"",1:$P($G(^PRC(441,PRCX,0)),U,5))
66 D:PRCY'="" PUT^DDSVAL(444.019,.DA,5,PRCY,"","E")
67 S PRCY=$S($G(DDSOLD)]""&($G(PRCX)=""):"@",$G(PRCX)="":"",1:$P($G(^PRC(441,PRCX,3)),U,5))
68 D:PRCY'="" PUT^DDSVAL(444.019,.DA,8,PRCY,"","E")
69 S PRCY=$S($G(DDSOLD)]""&($G(PRCX)=""):"@",$G(PRCX)="":"",1:$P($G(^PRC(441,PRCX,0)),U,4))
70 I PRCY="@" D
71 . N PRCI
72 . F PRCI=13,14,14.1,14.2,14.3 D PUT^DDSVAL(444.019,.DA,PRCI,PRCY)
73 I PRCY?1.N D
74 . N PRCW,PRCV
75 . D PUT^DDSVAL(444.019,.DA,13,PRCY,"","I")
76 . S PRCZ=$G(^PRC(441,PRCX,2,PRCY,0)) Q:PRCZ=""
77 . S PRCW(1)=$P(PRCZ,U,8),PRCV=$P(PRCZ,U,7) S:PRCW(1)]"" PRCW(1)="PACKAGING MULTIPLE: "_PRCW(1)
78 . S:PRCV]"" PRCW(1)=PRCW(1)_"/"_$P($G(^PRCD(420.5,PRCV,0)),U)
79 . D:PRCW(1)]"" PUT^DDSVAL(444.019,.DA,1.5,"PRCW","","A")
80 . D PUT^DDSVAL(444.019,.DA,14.1,$P(PRCZ,U,2))
81 . D PUT^DDSVAL(444.019,.DA,14.2,$P(PRCZ,U,7),"","I")
82 . D PUT^DDSVAL(444.019,.DA,14.3,$P(PRCZ,U,6),"","I")
83 . S PRCY=$P(PRCZ,U,5) S:PRCY="" PRCY="@"
84 . D PUT^DDSVAL(444.019,.DA,7,PRCY)
85 . S PRCZ=$P(PRCZ,U,4) S:PRCZ="" PRCZ="@"
86 . D PUT^DDSVAL(444.019,.DA,14,PRCZ)
87 Q
88PA(PRCX) ;Verify Purchasing Agent has Commercial Phone
89 Q:$G(PRCX)=""
90 I $P($G(^VA(200,+PRCX,.13)),U,5)="" D
91 . D HLP^DDSUTL("Contracting Officer lacks Commercial Phone #")
92 . S DDSERROR=1
93 Q
94ESIG(PRCX) ;Verifies that editor has ESIG on file
95 I $G(PRCX)]"",$P($G(^VA(200,PRCX,20)),U,4)]"" Q 1
96 W !,"*** You must have an Electronic Signature Code on file to use this option!",!
97 Q 0
Note: See TracBrowser for help on using the repository browser.