source: FOIAVistA/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCPLO3.m@ 1582

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

initial load of FOIAVistA 6/30/08 version

File size: 5.6 KB
Line 
1PRCPLO3 ;WOIFO/DAP/RLL-manual run option for GIP reports ; 7/28/06 10:39am
2V ;;5.1;IFCAP;**83,98**;Oct 20, 2000;Build 37
3 ;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5ENT ;This section of the routine executes calls to the separate CLRS GIP
6 ;extract routines.
7 ;
8 N ZTRTN,ZTDESC,ZTDTH,ZTIO,PRCPSSR,ZTSK,ZTREQ,PRCPMSG
9 S ZTRTN="ENT^PRCPLO2"
10 S ZTDESC="PRCPLO CLO GIP Reports CLRS"
11 S ZTDTH=$H
12 S ZTREQ="@"
13 S ZTIO=""
14 D ^%ZTLOAD
15 S PRCPSSR=ZTSK
16 ; Calls mail group message generation and screen display with success
17 ; or exception notification
18 I $D(PRCPSSR)[0 S PRCPMSG(1)="A task could not be created for the CLO GIP Reports - please contact IRM." D MAIL W ! D EN^DDIOL(PRCPMSG(1)) Q
19 ;
20 S PRCPMSG(1)="Task # "_PRCPSSR_" entered for the CLO GIP Reports."
21 W !
22 D EN^DDIOL(PRCPMSG(1))
23 D MAIL
24 ;
25 Q
26 ;
27MAIL ; Builds mail messages to a defined mail group to notify users of the
28 ; success or failure of the TaskMan scheduling for the CLO GIP Reports.
29 ;
30 ;*98 Modified code to work with PRC CLRS OUTLOOK MAILGROUP parameter
31 N XMDUZ,XMMG,XMSUB,XMTEXT,XMY,XMZ,PRCPMG,PRCPMG2
32 S XMSUB="CLO GIP Report Status for "_$$HTE^XLFDT($H)
33 S XMDUZ="Clinical Logistics Report Server"
34 S XMTEXT="PRCPMSG("
35 S XMY("G.PRCPLO CLRS NOTIFICATIONS")=""
36 S PRCPMG=$$GET^XPAR("SYS","PRC CLRS OUTLOOK MAILGROUP",1,"Q")
37 S:$G(PRCPMG)'="" PRCPMG2="S XMY("""_PRCPMG_""")=""""" X PRCPMG2
38 ;
39 D ^XMD
40 Q
41 ;
42BLDGP2 ; Build the DAYS of stock on hand file
43 N FILEDIR,STID,FILG2
44 S FILEDIR=$$GET^XPAR("SYS","PRCPLO EXTRACT DIRECTORY",1,"Q")
45 S STID=$$GET1^DIQ(4,$$KSP^XUPARAM("INST")_",",99)
46 S FILG2="IFCP"_STID_"G2.TXT"
47 D OPEN^%ZISH("FILE1",FILEDIR,FILG2,"W")
48 ; D OPEN^%ZISH("FILE1",FILEDIR,"CLRSG2.TXT","W")
49 D USE^%ZISUTL("FILE1")
50 D GTGIPSOH ; *98 New version
51 D GTGIPSOD ; *98 New version
52 D CLOSE^%ZISH("FILE1")
53 Q
54BLDGP1 ; BUILD THE stock status file
55 N FILEDIR,STID,FILG1
56 S FILEDIR=$$GET^XPAR("SYS","PRCPLO EXTRACT DIRECTORY",1,"Q")
57 S STID=$$GET1^DIQ(4,$$KSP^XUPARAM("INST")_",",99)
58 S FILG1="IFCP"_STID_"G1.TXT"
59 D OPEN^%ZISH("FILE1",FILEDIR,FILG1,"W")
60 ; D OPEN^%ZISH("FILE1",FILEDIR,"CLRSG1.DAT","W")
61 D USE^%ZISUTL("FILE1")
62 ; D GETGIPH2
63 ; D GETGIPSF
64 D GTGIPSSH ; *98, New version
65 D GTGIPSSD ; *98, New version
66 D CLOSE^%ZISH("FILE1")
67 Q
68GETGIPSF ; Get the GIP stock status data from file 446.7 (old format)
69 N GT1,GT2,GT3,GT4
70 S GT1="",GT2="",GT3=""
71 F S GT1=$O(^PRCP(446.7,GT1)) Q:GT1="" D
72 . S GT2=$G(^PRCP(446.7,GT1,2))
73 . I $P(GT2,"*",2)'="" W GT2,!
74 . Q
75 Q
76GTGIPSOD ; *98 Get the GIP Stock on Hand Data new (new format)
77 ;
78 N GT1,GT2,DT3
79 S GT1="",GT2="",DT3=""
80 F S GT1=$O(^PRCP(446.7,GT1)) Q:GT1="" D
81 . S GT2=$G(^PRCP(446.7,GT1,1))_"*"
82 . S DT3=$G(^PRCP(446.7,GT1,2))
83 . I $P(GT2,"*",2)'="" W !,GT2,DT3
84 . Q
85 Q
86GTGIPSSD ; *98 Get GIP Stock Status data (new format)
87 N GT1,GT2,DT3,DT4,DT5,DT6,DT7
88 S GT1="",GT2="",DT3="",DT4="",DT5="",DT6="",DT7=""
89 F S GT1=$O(^PRCP(446.7,GT1)) Q:GT1="" D
90 . S GT2=$G(^PRCP(446.7,GT1,3))_"*"
91 . S DT4=$G(^PRCP(446.7,GT1,4))_"*"
92 . S DT5=$G(^PRCP(446.7,GT1,5))_"*"
93 . S DT6=$G(^PRCP(446.7,GT1,6))_"*"
94 . S DT7=$G(^PRCP(446.7,GT1,7))
95 . I $P(GT2,"*",2)'="" W !,GT2,DT4,DT5,DT6,DT7
96 . Q
97 Q
98GETGIPH1 ; Header for stock on hand report (old format)
99 ;
100 W "StationNum"_"*"_"DateRange"_"*"_"InvIdNum"_"*"
101 W "InventoryPoint"_"*"_"InventoryType"_"*"_"TotalDollars"_"*"
102 W "NumOfLineItemsSoh"_"*"_"NumOfLineItemsInv"_"*"_"CostCenter",!
103 Q
104GTGIPSOH ; *98 Header for stock on hand report (new format)
105 ;
106 W "StationNum"_"*"_"DateRange"_"*"_"InvIdNum"_"*"
107 W "InventoryPoint"_"*"_"InventoryType"_"*"_"TotalDollars"_"*"
108 W "NumOfLineItemsSoh"_"*"_"NumOfLineItemsInv"_"*"_"CostCenter"_"*"
109 W "StdTotDolVal"_"*"_"OdiTotDolVal"_"*"_"AllTotDolVal"_"*"
110 W "StdNumSohItems"_"*"_"OdiNumSohItems"_"*"_"AllNumSohItems"_"*"
111 W "StdNumInvItems"_"*"_"OdiNumInvItems"_"*"_"AllNumInvItems"
112 Q
113GETGIPH2 ; Header for Stock Status Report
114 W "StationNum"_"*"_"DateRange"_"*"_"NumDays"_"*"
115 W "InvIdNum"_"*"_"InventoryPoint"_"*"_"InventoryType"_"*"_"OpenBalTotal"_"*"_"ReceiptsTot"_"*"
116 W "IssuesTotal"_"*"_"AdjTotal"_"*"_"ClosingBalTot"_"*"
117 W "ReceiptsTot#"_"*"_"IssuesTotal#"_"*"_"AdjTotal#"_"*"
118 W "TurnoverTotal"_"*"_"InactiveItmTotal#"_"*"_"InactiveItemTotal$"
119 W "*"_"InactiveItemsPct"_"*"_"LongSupplyTotal#"_"*"_"LongSupplyTotal$"
120 W "*"_"LongSupplyPct"_"*"_"NumOfLineItemsInv",!
121 Q
122GETGIPF ; Get the GIP days of stock on hand data from File 446.7 (old format)
123 ;
124 N GP1,GP2,GP3
125 S GP1=0,GP2=0,GP3=0
126 F S GP1=$O(^PRCP(446.7,GP1)) Q:GP1="" D
127 . S GP2=$G(^PRCP(446.7,GP1,1))
128 . I $P(GP2,"*",1)'="" W GP2,!
129 . Q
130 Q
131GTGIPSSH ; *98 NEW Stock Status Report Header
132 ; Additional Fields were added to accommodate
133 ; Standard Items and On Demand Items
134 W "StNum"_"*"_"DtRng"_"*"_"NmDys"_"*"
135 W "InvIdNum"_"*"_"InvPnt"_"*"_"InvTyp"_"*"
136 W "StdOpnBalTot"_"*"_"OdiOpnBalTot"_"*"_"AllOpnBalTot"_"*"
137 W "StdRcptsTot"_"*"_"OdiRcptsTot"_"*"_"AllRcptsTot"_"*"
138 W "StdIssTot"_"*"_"OdiIssTot"_"*"_"AllIssTot"_"*"
139 W "StdAdjTot"_"*"_"OdiAdjTot"_"*"_"AllAdjTot"_"*"
140 W "StdClseBalTot"_"*"_"OdiClseBalTot"_"*"_"AllClseBalTo"_"*"
141 W "NumStdRcpts"_"*"_"NumOdiRcpts"_"*"_"NumAllRcpts"_"*"
142 W "NumStdIss"_"*"_"NumOdiIss"_"*"_"NumAllIss"_"*"
143 W "NumStdAdj"_"*"_"NumOdiAdj"_"*"_"NumAllAdj"_"*"
144 W "StdTrnvrTot"_"*"_"OdiTrnvrTot"_"*"_"AllTrnvrTot"_"*"
145 W "NumStdInactItms"_"*"_"NumOdiInactItms"_"*"_"NumAllInactItms"_"*"
146 W "StdInactTotDol"_"*"_"OdiInactTotDol"_"*"_"AllInactTotDol"_"*"
147 W "StdInactPct"_"*"_"OdiInactPct"_"*"_"AllInactPct"_"*"
148 ;
149 W "StdNumLngSup"_"*"_"OdiNumLngSup"_"*"_"AllNumLngSup"_"*"
150 W "StdLngSupTotDol"_"*"_"OdiLngSupTotDol"_"*"_"AllLngSupTotDol"_"*"
151 W "StdLngSupPct"_"*"_"OdiLngSupPct"_"*"_"AllLngSupPct"_"*"
152 W "NumStdInvLnItms"_"*"_"NumOdiInvLnItms"_"*"_"NumAllInvLnItms"
153 ;
154 ;
155 Q
Note: See TracBrowser for help on using the repository browser.