source: FOIAVistA/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCX1Q.m@ 1123

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

initial load of FOIAVistA 6/30/08 version

File size: 4.6 KB
Line 
1PRCX1Q ;WISC/PLT-fill in fields 449, 450 of file 410 for carry forward ;
2V ;;5.0;IFCAP;**55**;4/21/95
3 QUIT ;invalid entry
4 ;
5EN ;fill in field 449 and 450 of file 410
6 N PRC,PRCRI,PRCA,PRCB,PRCC,PRCD,PRCE,PRCG,PRCH,PRCF,DMAX
7 N A,B,X,Y
8 ;D EN^DDIOL("Recompile the input templates 'PRCH2138' and 'PRCHNREQ'.")
9 ;S DMAX=4500,X="PRCHT1",Y=$O(^DIE("B","PRCH2138","")) I Y D EN^DIEZ
10 ;S DMAX=4500,X="PRCHT3",Y=$O(^DIE("B","PRCHNREQ","")) I Y D EN^DIEZ
11 ;D EN^DDIOL("Recompile the input templates 'PRCH2138' and 'PRCHNREQ' DONE!")
12410 W @IOF D EN^DDIOL("This is for IFCAP patch PRC*5*55 to fill in new fields")
13 D EN^DDIOL("449 & 450 of file 410 for fiscal year 96 and future years requests only.")
14 D EN^DDIOL("This routine also sets up file 410 entries for all fiscal year 96 and future")
15 D EN^DDIOL("PURCHASE ORDERS without 2237 requests"),EN^DDIOL(" ")
16 I $D(ZTQUEUED) D EN^DDIOL(" "),EN^DDIOL(" You cannot queue this conversion. You need to run the conversion"),EN^DDIOL(" for 1996 by typing 'D ^XUP,EN^PRCX1Q' on your CRT-TERMINAL.") QUIT
17Q1 D YN^PRC0A(.X,.Y,"Ready to run","O","YES")
18 G:X["^"!(X="")!'Y EXIT
19 D EN^DDIOL("Start convert file 410")
20 S PRCRI(411)=0 F S PRCRI(411)=$O(^PRC(411,PRCRI(411))) QUIT:PRCRI(411)>999999!'PRCRI(411) D
21 . S PRC("SITE")=$P($G(^PRC(411,PRCRI(411),0)),"^") QUIT:'PRC("SITE") D
22 .. D EDIT^PRC0B(.X,"420;^PRC(420,;"_PRCRI(411),"9///^S X=""10/1/95""","SL")
23 .. QUIT
24 . S PRCB=PRC("SITE")_"-96-1"
25 . S PRCD=PRCB,PRCB=PRC("SITE")_"-~"
26 . F S PRCD=$O(^PRCS(410,"B",PRCD)) QUIT:PRCD]PRCB!'PRCD S PRCRI(410)=$O(^(PRCD,0)) I PRCRI(410) S PRCE=$G(^PRCS(410,PRCRI(410),0)),A=$G(^(4)),B=$G(^(7)) D
27 .. S PRCG=$P(PRCE,"^",2),PRCF=$P(PRCE,"^",4),PRCH="E"
28 .. W !,$P(PRCE,"^")
29 .. I PRCG="CA" S PRCH="C"
30 .. I PRCG="C" S PRCH="O"
31 .. I PRCG="O" S PRCH=$S($P(A,"^",10)]"":"O",$P(B,"^",6)]"":"A",1:"E") I PRCH="A",$P(A,"^",3)]"",+$P(A,"^",3)=0,$P(A,"^",5)]"" S PRCH="O" W " SECONDARY REQUEST"
32 .. I PRCG="A" S PRCH="O" S:PRCF=1 PRCH=$S($P(A,"^",10)]"":"O",$P(B,"^",6)]"":"A",1:"E")
33 .. D ERS410^PRC0G(PRCRI(410)_"^"_PRCH)
34 .. S PRCE=$G(^PRCS(410,PRCRI(410),0))
35 .. W ?20,$P(PRCE,"^",11),?30,$P(PRCE,"^",12)
36 .. QUIT
37 . QUIT
38 ;
39 D EN^DDIOL(" ")
40 D EN^DDIOL("FILL-IN NEW FIELD 449 & 450 IN FILE 410 DONE")
41 D EN^DDIOL(" ")
42442 D EN^DDIOL("Start convert purchase orders without requests in file 442")
43 S PRCB=2951000
44 F S PRCB=$O(^PRC(442,"AB",PRCB)) QUIT:'PRCB D
45 . S PRCRI(442)="" F S PRCRI(442)=$O(^PRC(442,"AB",PRCB,PRCRI(442))) QUIT:'PRCRI(442) S PRCD=$G(^PRC(442,PRCRI(442),0)),PRCF=$P(PRCD,"^",2) I PRCF-22,PRCF-23,PRCF-24 D:$P($G(^(12)),"^",12)]""&($P($G(^(10,1,0)),"^",2)]"")
46 .. W !,$P(PRCD,"^")
47 .. I $P(PRCD,"^",12)]"" D QUIT
48 ... N A,B
49 ... S A=0 F S A=$O(^PRC(442,PRCRI(442),13,A)) QUIT:'A S B=$P($G(^(A,0)),"^") I B D ERS410^PRC0G(B_"^O") W " REQUEST-"_B
50 ... QUIT
51 .. N PRCOBL,PRCOBD,PRCOBA
52 .. N A,B,X,Y,Z
53 .. W " WITHOUT REQUEST"
54 .. S A=$P(PRCD,"^"),PRC("SITE")=$P(A,"-"),PRCOBL=$P(A,"-",2)_"WR"
55 .. I $$DUP(PRC("SITE"),PRCOBL) W " *** DUPLICATE" QUIT
56 .. S PRCOBD=$P(^PRC(442,PRCRI(442),1),"^",15)
57 .. S PRCOBA=$P($G(^PRC(442,PRCRI(442),0)),"^",16) S:PRCOBA="" PRCOBA=0 S:$P($G(^PRC(442,PRCRI(442),7)),"^",2)=45 PRCOBA=0
58 .. I $P($G(^PRC(442,PRCRI(442),0)),"^",2)=25 S PRCOBA=0
59 .. I '$D(^PRCS(410.1,"B",$P(PRCD,"-")_"-"_$E($$DATE^PRC0C(PRCOBD,"I"),3,4)_"-"_$P($P(PRCD,"^",3)," "))) W !," MISSING SEQ#, NOT CONVERTED" QUIT
60 .. D A410^PRC0F(.X,$P(PRCD,"-")_"^"_$P(PRCD,"^",3)_"^A^^"_PRCOBD_"^"_PRCOBA_"^"_PRCOBL)
61 .. QUIT
62 . QUIT
63 D EN^DDIOL("PURCHASE ORDERS WITHOUT REQUESTS DONE!")
64 G EXIT
65417 I 0 D EN^DDIOL(""),EN^DDIOL("Start convert 820 transactions in file 417")
66 I 0 S PRCRI(411)=0 F S PRCRI(411)=$O(^PRC(411,PRCRI(411))) QUIT:PRCRI(411)>999999!'PRCRI(411) D
67 . S PRC("SITE")=$P($G(^PRC(411,PRCRI(411),0)),"^") QUIT:'PRC("SITE") D
68 . S PRCB=PRC("SITE")_"-96-"
69 . S PRCD=PRCB,PRCB=PRC("SITE")_"-~"
70 . F S PRCD=$O(^PRCS(417,"C",PRCD)) QUIT:PRCD]PRCB!'PRCD W !,PRCD S PRCRI(417)="" F S PRCRI(417)=$O(^PRCS(417,"C",PRCD,PRCRI(417))) QUIT:'PRCRI(417) I PRCRI(417) S PRCE=$G(^PRCS(417,PRCRI(417),0)),PRCF=$P($G(^(1)),"^") D
71 .. N PRCOBL,PRCOBD,PRCOBA
72 .. N A,B,X,Y,Z
73 .. S PRCOBA=$P(PRCE,"^",20),PRCOBD=$P($P(PRCE,"^",22),"."),PRCOBL=$P(PRCE,"^",18)_"_820"
74 .. W !,PRCE
75 .. I $G(PRCF) W " *** DUPLICATE" QUIT
76 .. D A410^PRC0F(.X,$P(PRCD,"-")_"^"_$P(PRCD,"-",4)_"^A^^"_PRCOBD_"^"_PRCOBA_"^"_PRCOBL)
77 .. S:X $P(^PRCS(417,PRCRI(417),1),"^")=X
78 .. QUIT
79 . QUIT
80 D EN^DDIOL("820 FMS TRANSACTION DONE!")
81 D EN^DDIOL("IFCAP PATCH *5*55 CONVERSION DONE!")
82EXIT QUIT
83 ;
84DUP(A,B) ;CHECK DUPLICATION FOR 442 CONVERSION
85 N C,D,E
86 S C=""
87 S D="" F S D=$O(^PRCS(410,"D",B,D)) QUIT:'D I D,+$G(^PRCS(410,D,0))=+PRC("SITE") S C=1 QUIT
88 QUIT C
Note: See TracBrowser for help on using the repository browser.