source: FOIAVistA/trunk/r/AUTO_REPLENISHMENT_WARD_STOCK-PSGW/PSGWADE1.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: 2.9 KB
Line 
1PSGWADE1 ;BHAM ISC/PTD,CML-Enter AMIS Data for All Drugs in All AOUs - CONTINUED ; 23 Mar 93 / 10:29 AM
2 ;;2.3; Automatic Replenishment/Ward Stock ;;4 JAN 94
3DONE I (PSGWFLG=1)&(PSGWRET=0) W !!!,"All drugs in all AOUs contain AMIS data.",!,"If you need to edit data for a selected drug,",!,"use the AMIS Data Enter/Edit (Single Drug) option.",!!!
4 I W "If you wish to view the data stored in the drug file for",!,"AR/WS AMIS statistics, use the Data for AMIS Stats - Print option.",!!!
5END K ^TMP("PSGW",$J),^TMP("PSGWDN",$J),K,PSGWFLG,PSGWRET,PSGWAOU,PSGWITM,PSGWDR,PSGWTY,PSGWNM,PSGWCT,PSGWCN,PSGW2,PSGWDT,PSGWPC,%,%I,%H,DA Q
6 ;
7 ;LOOP THROUGH UTILITY GLOBAL BY TYPE, DRUG NAME & DRUG #. CHECK FOR AMIS INFO IN DRUG FILE.
8LOOP S PSGWTY=""
9L1 S PSGWTY=$O(^TMP("PSGW",$J,PSGWTY)),PSGWNM="" G:'PSGWTY DONE W:(PSGWTY'=9999)&($D(^PSI(58.16,PSGWTY,0))) !!?5,"TYPE: ",$P(^PSI(58.16,PSGWTY,0),"^") W:PSGWTY=9999 !!?5,"** UNCLASSIFIED BY TYPE:"
10L2 S PSGWNM=$O(^TMP("PSGW",$J,PSGWTY,PSGWNM)),PSGWDR="" G:PSGWNM="" L1 I (PSGWTY=9999)&($D(^TMP("PSGWDN",$J,PSGWNM))) G L2
11L3 S PSGWDR=$O(^TMP("PSGW",$J,PSGWTY,PSGWNM,PSGWDR)) G:'PSGWDR L2
12CHK S PSGW2=1 I $D(^PSDRUG(PSGWDR,"PSG")) G:($P(^PSDRUG(PSGWDR,"PSG"),"^",2)'="")&($P(^PSDRUG(PSGWDR,"PSG"),"^",3)'="") L3
13 I $P(^PSDRUG(PSGWDR,0),"^")'="" W !!,"==> "_$P(^(0),"^")
14 E W !!,"The name for drug number ",PSGWDR," is missing from your drug file.",!,"Please notify your package coordinator!"
15 I '$D(^PSDRUG(PSGWDR,"PSG")) D ASKCAT G:PSGWCT="^" END G:('$T)&(PSGWCT="") END S:PSGWCT="" PSGWRET=1 G:PSGWCT="" L3 D ASKCON G:PSGWCN="^" END G:('$T)&(PSGWCN="") END S:PSGWCN="" PSGWRET=1 G:PSGWCN="" L3 D SETNOD S PSGWFLG=0 G L3
16 I $D(^PSDRUG(PSGWDR,"PSG"))&($P(^PSDRUG(PSGWDR,"PSG"),"^",2)="") D ASKCAT G:PSGWCT="^" END G:('$T)&(PSGWCT="") END S:PSGWCT="" PSGWRET=1 G:PSGWCT="" L3 S PSGWFLG=0,PSGWPC=2,PSGW2=0 D SETPC
17 I $D(^PSDRUG(PSGWDR,"PSG"))&($P(^PSDRUG(PSGWDR,"PSG"),"^",3)="") W:PSGW2=1 !,"AMIS Category: ",$P(^PSDRUG(PSGWDR,"PSG"),"^",2) D ASKCON G:PSGWCN="^" END G:('$T)&(PSGWCN="") END S:PSGWCN="" PSGWRET=1 G:PSGWCN="" L3 S PSGWFLG=0,PSGWPC=3 D SETPC
18 G L3
19 ;
20ASKCAT R !,"Enter AMIS Category: ",PSGWCT:DTIME S:'$T PSGWCT="^" Q:"^"[PSGWCT
21 I "?"[$E(PSGWCT)!(PSGWCT<0)!(PSGWCT>3)!(PSGWCT'?1N) D HELP G ASKCAT
22 Q
23 ;
24ASKCON R !,"Enter AMIS Conversion Number: ",PSGWCN:DTIME S:'$T PSGWCN="^" Q:"^"[PSGWCN
25 I "?"[$E(PSGWCN)!(PSGWCN'?1.4N)!(PSGWCN<1)!(PSGWCN>9999) W *7,!!,"Enter a whole number between 1 and 9999.",!,"This number reflects the number of doses/units",!,"contained in a single quantity dispensed.",!! G ASKCON
26 Q
27 ;
28SETNOD S ^PSDRUG(PSGWDR,"PSG")="^"_PSGWCT_"^"_PSGWCN Q
29 ;
30SETPC I PSGWPC=2 S $P(^PSDRUG(PSGWDR,"PSG"),"^",2)=PSGWCT
31 I PSGWPC=3 S $P(^PSDRUG(PSGWDR,"PSG"),"^",3)=PSGWCN
32 Q
33HELP W *7,!!,"Enter the category that this drug is to be classified as for AMIS:",!?5,"==> ""0"" for field 03 or 04",!?5,"==> ""1"" for field 06 or 07",!?5,"==> ""2"" for field 17",!?5,"==> ""3"" for field 22",!! Q
Note: See TracBrowser for help on using the repository browser.