source: FOIAVistA/trunk/r/DRUG_ACCOUNTABILITY-PSA/PSAPROC3.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 6.8 KB
Line 
1PSAPROC3 ;BIR/JMB-Process Uploaded Prime Vendor Invoice Data - CONT'D ;7/23/97
2 ;;3.0; DRUG ACCOUNTABILITY/INVENTORY INTERFACE;**3,60**; 10/24/97;Build 4
3 ;This routine allows the user to edit invoices with errors or missing
4 ;data.
5 ;
6DUOU ;Gets & stores dispense unit per order unit in XTMP
7 W:'$G(PSADU) !,"DISPENSE UNITS: "_$P($G(^PSDRUG(PSAIEN,660)),"^",8)
8 S PSADU=1
9 ;
10 ;DAVE B (PSA*3*3)
11 S DIR(0)="NO^::2",DIR("A")="DISPENSE UNIT PER ORDER UNIT",DIR("?")="Enter the number of dispense units contained in one order unit.",DIR("??")="^D DUOUHELP^PSAPROC3"
12 D ^DIR K DIR I $G(DTOUT)!($G(DUOUT)) S PSAOUT=1 Q
13 I +Y S $P(^XTMP("PSAPV",PSACTRL,"IT",PSALINE),"^",20)=+Y,PSADATA=^(PSALINE) Q
14 ;
15 W !,"The dispense units per order unit must be entered",!,"to change the status of the invoice to Processed."
16 S DIR(0)="Y",DIR("B")="Y",DIR("A")="Do you want to enter the data now"
17 S DIR("?",1)="Enter Yes to return to the DISPENSE UNIT PER ORDER UNIT prompt.",DIR("?")="Enter No to bypass entering the dispense units now."
18 S DIR("??")="^D DUOUYN^PSAPROC8" D ^DIR K DIR I $G(DTOUT)!($G(DUOUT)) S PSAOUT=1 Q
19 Q:Y="" G:+Y DUOU Q
20 ;
21GETOU ;Get the Order Unit if it is blank or if it is not in the ORDER UNIT file.
22 S DIR(0)="P^51.5:EMZ",DIR("A")="ORDER UNIT",DIR("?")="Enter the unit of order.",DIR("??")="^D OUHELP^PSAPROC3"
23 S DIR("B")=$S(+$P($P(PSADATA,"^",2),"~",2):$P($G(^DIC(51.5,+$P($P(PSADATA,"^",2),"~",2),0)),"^"),+$P($G(^PSDRUG(PSAIEN,660)),"^",2):$P($G(^DIC(51.5,+$P($G(^PSDRUG(PSAIEN,660)),"^",2),0)),"^"),1:"")
24 D ^DIR K DIR I $G(DIRUT) S PSAOUT=1 Q
25 ;
26 ;DAVE B (PSA*3*3)
27 ;Q:+$P($P(PSADATA,"^",2),"~",2)=+Y
28 I +Y S $P(^XTMP("PSAPV",PSACTRL,"IT",PSALINE),"^",12)=+Y,$P(^(PSALINE),"^",13)=DUZ,$P(^(PSALINE),"^",14)=DT,PSADATA=^(PSALINE) Q
29 ;
30 W !,"The order unit must be entered to change",!,"the status of the invoice to Processed.",!
31 S DIR(0)="Y",DIR("B")="Y",DIR("A")="Do you want to enter the data now"
32 S DIR("?",1)="Enter Yes to return to the ORDER UNIT prompt.",DIR("?")="Enter No to bypass entering the order units now.",DIR("??")="^D OUYN^PSAPROC3"
33 D ^DIR K DIR I $G(DTOUT)!($G(DUOUT)) S PSAOUT=1 Q
34 Q:Y=""
35 G:+Y GETOU
36 Q
37 ;
38PRICE ;If price per order unit is blank or 0, get price from user.
39 S DIR(0)="NO^0:9999:4",DIR("A")="PRICE PER ORDER UNIT",DIR("B")=0
40 S DIR("?",1)="If the price per order unit is not zero (0), enter",DIR("?",2)="the correct price. If the price per order unit is",DIR("?")="zero, press return to verify that the price is correct."
41 S DIR("??")="^D PRICEHLP^PSAPROC3" D ^DIR K DIR I $G(DTOUT)!($G(DUOUT)) S PSAOUT=1 Q
42 I +$P(PSADATA,"^",3),+$P(PSADATA,"^",3)=+Y Q
43 S $P(^XTMP("PSAPV",PSACTRL,"IT",PSALINE),"^",23)=+Y,$P(^(PSALINE),"^",24)=DUZ,$P(^(PSALINE),"^",25)=DT,PSADATA=^(PSALINE)
44 Q
45 ;
46QTY ;If qty is blank, prompt for it.
47 S DIR(0)="N",DIR("A")="QUANTITY RECEIVED",DIR("B")=$S(+$P(PSADATA,"^",8):+$P(PSADATA,"^",8),+PSADATA:+PSADATA,1:0)
48 S DIR("?",1)="If the quantity received is different than the",DIR("?")="quantity invoiced, enter the correct quantity received.",DIR("??")="^D QTYHELP^PSAPROC3"
49 D ^DIR K DIR I $G(DIRUT) S PSAOUT=1 Q
50 Q:+PSADATA=+Y S PSADJQTY=+Y
51 S DIR(0)="F^1:30",DIR("A")="ADJUSTMENT REASON",DIR("?")="Enter the reason you adjusted the quantity received.",DIR("??")="^D ADJREA^PSAPROC3"
52 D ^DIR K DIR I $G(DIRUT) S PSAOUT=1 Q
53 S $P(^XTMP("PSAPV",PSACTRL,"IT",PSALINE),"^",8)=PSADJQTY,$P(^(PSALINE),"^",9)=DUZ,$P(^(PSALINE),"^",10)=DT,$P(^(PSALINE),"^",11)=Y,PSADATA=^(PSALINE)
54 Q
55 ;
56RECD ;Enter the date the invoiced drugs were received.
57 S DIR(0)="D",DIR("A")="Date received",DIR("?")="Enter the date the drugs were received.",DIR("??")="^D RECHELP^PSAPROC3" ;*60 removed default receive date
58 D ^DIR K DIR I $G(DIRUT) S PSAOUT=1 Q
59 S:$P(^XTMP("PSAPV",PSACTRL,"IN"),"^",6)'=+Y $P(^XTMP("PSAPV",PSACTRL,"IN"),"^",11)=+Y S PSAIN=^XTMP("PSAPV",PSACTRL,"IN")
60 Q
61 ;
62SETLINE ;Set line as process if all data is present.
63 S PSADATA=^XTMP("PSAPV",PSACTRL,"IT",PSALINE),PSAIN=^XTMP("PSAPV",PSACTRL,"IN")
64 I $D(^XTMP("PSAPV",PSACTRL,"IT",PSALINE,"SUP")) S $P(^XTMP("PSAPV",PSACTRL,"IT",PSALINE),"^",18)="P",PSALINES=PSALINES+1,PSALLSUP=PSALLSUP+1 Q
65 S PSAIEN=$S(+$P(PSADATA,"^",15):+$P(PSADATA,"^",15),+$P(PSADATA,"^",6):+$P(PSADATA,"^",6),1:0),PSASUB=+$P(PSADATA,"^",7)
66 I PSAIEN,$P($G(^PSDRUG(PSAIEN,2)),"^",3)["N" S $P(^XTMP("PSAPV",PSACTRL,"IT",PSALINE),"^",19)="CS"
67 E S $P(^XTMP("PSAPV",PSACTRL,"IT",PSALINE),"^",19)=""
68 S PSADATA=^XTMP("PSAPV",PSACTRL,"IT",PSALINE),PSALOC=$S($P(PSADATA,"^",19)'="CS":+$P(PSAIN,"^",7),1:+$P(PSAIN,"^",12))
69 I +$P(PSADATA,"^",6)!(+$P(PSADATA,"^",15)),$P(PSADATA,"^")'=""!($P(PSADATA,"^",8)'=""),$P($G(^PSDRUG(PSAIEN,660)),"^",8)'="" D
70 .I +$P($G(^PSDRUG(PSAIEN,1,+$G(PSASUB),0)),"^",7)!(+$P(PSADATA,"^",20)),+$P($P(PSADATA,"^",2),"~",2)!(+$P(PSADATA,"^",12))!(+$P($G(^PSDRUG(PSAIEN,1,+$G(PSASUB),0)),"^",5)) D
71 ..S $P(^XTMP("PSAPV",PSACTRL,"IT",PSALINE),"^",18)="P",PSALINES=PSALINES+1,$P(^XTMP("PSAPV",PSACTRL,"IN"),"^",13)="",PSAIN=^("IN")
72 Q
73 ;
74ADJREA ;Extended help for 'qty adjustment reason'
75 W !?5,"Enter why you changed the quantity.",!?5,"For example: 2 bottles were broken.",!?5," Package contained only 11 tubes."
76 Q
77DUOUHELP ;Extended help for entering dispense units per order unit
78 W !?5,"Enter the number of dispense units contained in the order unit.",!!?5,"For example: Dispense Units: TAB",!?18,"Order Unit : CS"
79 W !!?18,"The case contains 12 bottles of 1,000 tablets",!?18,"12 x 1,000 = 12,000",!?18,"DISPENSE UNITS PER ORDER UNIT: 12,000"
80 Q
81NDCHELP ;Extended help for selecting invoiced drug
82 W !?5,"Enter the number to the left of the invoiced drug. If you select a drug",!?5,"from the list, the invoiced drug will be matched to that drug. If you"
83 W !?5,"choose to select another drug, you can select the invoiced drug from the",!?5,"DRUG file or flag this item as a supply item."
84 Q
85OUHELP ;Extended help for selecting the Order Unit
86 W !?5,"Enter the packaging unit for which the drug was ordered."
87 Q
88OUYN ;Extended help for returning to the 'ORDER UNIT' prompt.
89 W !?5,"Enter Yes if you want to enter the order unit now.",!?5,"Enter No to bypass entering the order unit."
90 W !!?5,"The invoice will not be placed in a Processed",!?5,"status if the order units are not entered."
91 Q
92PRICEHLP ;Extended help for price per order unit
93 W !?5,"If the price per order unit is not zero, enter the correct price. ",!?5,"The total cost for the item will be adjusted. If it is zero, press ",!?5,"the return key to verify that zero is the correct price."
94 Q
95QTYHELP ;Extended help for quantity delivered
96 W !?5,"If the quantity received is different than the quantity",!?5,"displayed, enter the correct quantity you received. The",!?5,"total cost for the item will be adjusted."
97 Q
98RECHELP ;Extended help to 'Date Received'
99 W !?5,"Enter the date the drugs were received. The date the prime vendor",!?5,"said the drugs were delivered and the date you say the drugs were",!?5,"received will be retained."
100 Q
Note: See TracBrowser for help on using the repository browser.