source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCHAMXE.m@ 945

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1PRCHAMXE ;WISC/DJM-'CHANGES' ROUTINE #5 FOR 443.6 ;2/21/97 15:07
2V ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ;****NOTE-See PRCHAMXA for information on variable PRCHNORE and
6 ;incidence of undefined DIK variable errors.
7 ;
8 ;'PRCHDA1' AND 'PRCHDA' ARE SET IN THE 'LINE ITEM' AMENDMENT
9 ;TEMPLATE.
10 ;'PRCHDA' IS THE SUBFILE INTERNAL ENTRY NUMBER OF THE ITEM THAT OWNS
11 ;THE DELIVERY SCHEDULE BEING EDITED.
12 ;'PRCHDA1' IS THE INTERNAL ENTRY NUMBER OF THE RECORD BEING AMENDED
13 ;IN FILE 443.6. (P.O.) OR 441.6 (REQUISITION).
14 ;
15EN1 ;SAVES 'ITEM' FROM FILE 441.7 CALLED FROM 'ITEM'
16 Q
17 N FF,RECORD,Y,OLD,F2NUMBER
18 S FF="1;441.7",RECORD=PRCHDA,OLD=$S($P(PRCHYY,U,3)=1:0,1:X),F2NUMBER=D0
19 D SAVE(FF,PRCHDA1,RECORD,OLD,F2NUMBER)
20 Q
21 ;
22EN2 ;SAVES 'DELIVERY DATE' FROM FILE 441.7 CALLED FROM 'ITEM'
23 N FF,RECORD,Y,OLD,F2NUMBER
24 S FF="2;441.7",RECORD=PRCHDA,OLD=$S($P(PRCHYY,U,3)=1:0,1:X),F2NUMBER=D0
25 D SAVE(FF,PRCHDA1,RECORD,OLD,F2NUMBER)
26 Q
27 ;
28EN3 ;SAVES 'LOCATION FOR DELIVERY' FROM FILE 441.7 CALLED FROM 'ITEM'
29 N FF,RECORD,Y,OLD,F2NUMBER
30 S FF="3;441.7",RECORD=PRCHDA,OLD=$S($P(PRCHYY,U,3)=1:0,1:X),F2NUMBER=D0
31 D SAVE(FF,PRCHDA1,RECORD,OLD,F2NUMBER)
32 Q
33 ;
34EN4 ;SAVES 'QTY TO BE DELIVERED' FROM FILE 441.7 CALLED FROM 'ITEM'
35 N FF,RECORD,Y,OLD,F2NUMBER
36 S FF="4;441.7",RECORD=PRCHDA,OLD=$S($P(PRCHYY,U,3)=1:0,1:X),F2NUMBER=D0
37 D SAVE(FF,PRCHDA1,RECORD,OLD,F2NUMBER)
38 Q
39 ;
40EN5 ;SAVES 'ITEM' FROM FILE 441.7 CALLED FROM 'ITEM'
41 Q
42 N FF,RECORD,Y,OLD,F2NUMBER
43 S FF="1;441.7",RECORD=PRCHDA,OLD=0,F2NUMBER=D0
44 D SAVE(FF,PRCHDA1,RECORD,OLD,F2NUMBER)
45 Q
46 ;
47EN6 ;SAVES 'DELIVERY DATE' FROM FILE 441.7 CALLED FROM 'ITEM'
48 N FF,RECORD,Y,OLD,F2NUMBER
49 S FF="2;441.7",RECORD=PRCHDA,OLD=0,F2NUMBER=D0
50 D SAVE(FF,PRCHDA1,RECORD,OLD,F2NUMBER)
51 Q
52 ;
53EN7 ;SAVES 'LOCATION FOR DELIVERY' FROM FILE 441.7 CALLED FROM 'ITEM'
54 N FF,RECORD,Y,OLD,F2NUMBER
55 S FF="3;441.7",RECORD=PRCHDA,OLD=0,F2NUMBER=D0
56 D SAVE(FF,PRCHDA1,RECORD,OLD,F2NUMBER)
57 Q
58 ;
59EN8 ;SAVES 'QTY TO BE DELIVERED' FROM FILE 441.7 CALLED FROM 'ITEM'
60 N FF,RECORD,Y,OLD,F2NUMBER
61 S FF="4;441.7",RECORD=PRCHDA,OLD=0,F2NUMBER=D0
62 D SAVE(FF,PRCHDA1,RECORD,OLD,F2NUMBER)
63 Q
64 ;
65SAVE(FF,PRCHDA1,RECORD,OLD,F2NUMBER) ;THIS WILL DO THE ACTUAL SAVING OF THE INFORMATION.
66 ;'PRCHAM' IS DEFINED FROM AMENDMENT ROUTINES.
67 ;IT IS THE 'AMENDMENT' FIELD'S RECORD NUMBER FOR THE AMENDMENT THAT
68 ;IS BEING ENTERED.
69 ;'OLD' IS THE VALUE OF X.
70 ;'PRCHAMDA' IS THE INTERNAL # OF THE AMENDMENT TYPE BEING USED, FROM
71 ;FILE 442.2 OR FILE 441.6.
72 ;F2NUMBER IS THE INTERNAL ENTRY NUMBER FOR THE COPY OF THE 'DELIVERY
73 ;SCHEDULE (ORDER)' FILE RECORD BEING EDITED. THIS IS FROM FILE 441.7
74 N PRCHDA,ALREADY,DS,DIFLD,DIP,D,D0,D1,D2,DIG,DIH,DISYS,DIU,DIV,J,L,DH,DU,DV,DW,DOV,DIOV
75 S ALREADY=$O(^PRC(443.6,"C",PRCHDA1,PRCHAM,FF,RECORD,F2NUMBER,0))
76 Q:ALREADY>0 ;CHECK IF THIS FIELD HAS ALREADY BEEN ENTERED. ONLY THE FIRST ENTRY IS NEEDED.
77 S PRCHDA=""
78 N DA,X
79 D NEXT(PRCHDA1,PRCHAM,.PRCHDA)
80 N DIE,DC,DD,DE,DG,DI,DIEL,DK,DL,DM,DO,DP,DQ,DR
81 S DA(2)=PRCHDA1,DA(1)=PRCHAM,DA=PRCHDA,DIE="^PRC(443.6,"_DA(2)_",6,"_DA(1)_",3,"
82 S DR="1////^S X=PRCHAMDA;2////^S X=FF;3///^S X=OLD;4///^S X=RECORD;7////^S X=F2NUMBER" D ^DIE
83 Q
84 ;
85NEXT(DA,DA1,DA2) ;COME HERE TO CREATE THE NEXT ENTRY IN THE 'CHANGES' MULTIPLE.
86 ;DA2 IS RETURNED WITH THE 'CHANGES' INTERNAL RECORD NUMBER.
87 N AA,BB,DIC,DD,DINUM,DO,X,Y
88 S AA=$G(^PRC(443.6,DA,6,DA1,3,0)) I AA="" S AA=1,^PRC(443.6,DA,6,DA1,3,0)="^"_$P(^DD(443.67,14,0),"^",2) G ENTER
89 S AA=$P(AA,U,3)
90FIND S AA=AA+1,BB=$G(^PRC(443.6,DA,6,DA1,3,AA,0)) I BB'="" G FIND
91ENTER K DD,DO S DA(2)=DA,DA(1)=DA1,DIC="^PRC(443.6,"_DA(2)_",6,"_DA(1)_",3,",DIC(0)="L",(DINUM,X)=AA D FILE^DICN G:+Y'>0 FIND
92 S DA2=+Y Q
Note: See TracBrowser for help on using the repository browser.