source: FOIAVistA/trunk/r/PHARMACY_DATA_MANAGEMENT-PSS/PSSNOUNR.m@ 1713

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

initial load of FOIAVistA 6/30/08 version

File size: 2.9 KB
Line 
1PSSNOUNR ;BIR/RTR-Dosage Form and Noun report ;03/24/00
2 ;;1.0;PHARMACY DATA MANAGEMENT;**34,48**;9/30/97
3 ;
4EN ;
5 W !!,"This report shows the Dosage Forms and Nouns, along with the package use for",!,"each Noun and the resulting Local Possible Dosage.",!
6 K IOP,%ZIS,POP S %ZIS="QM" D ^%ZIS I $G(POP) W !!,"Nothing queued to print.",! Q
7 I $D(IO("Q")) S ZTRTN="START^PSSNOUNR",ZTDESC="Dosage Form/Noun Report" D ^%ZTLOAD K %ZIS W !,"Report queued to print.",! Q
8START ;
9 U IO
10 S PSSOUT=0,PSSDV=$S($E(IOST)="C":"C",1:"P"),PSSCT=1
11 K PSSLINE S $P(PSSLINE,"-",78)=""
12 D NOHD
13 S PSSDF="" F S PSSDF=$O(^PS(50.606,"B",PSSDF)) Q:PSSDF=""!($G(PSSOUT)) F PSSN=0:0 S PSSN=$O(^PS(50.606,"B",PSSDF,PSSN)) Q:'PSSN!($G(PSSOUT)) D
14 .S PSSNODE=$G(^PS(50.606,PSSN,0)) I $P(PSSNODE,"^",2),$P(PSSNODE,"^",2)<DT Q
15 .I ($Y+5)>IOSL D NOHD Q:$G(PSSOUT)
16 .W !!,$P(PSSNODE,"^") K PSSDAR F PSSDUP=0:0 S PSSDUP=$O(^PS(50.606,PSSN,"DUPD",PSSDUP)) Q:'PSSDUP I $P($G(^(PSSDUP,0)),"^") S PSSDAR($P($G(^(0)),"^"))=""
17 .I $O(PSSDAR(0)) W ?34,"(" F PSSX=0:0 S PSSX=$O(PSSDAR(PSSX)) Q:'PSSX W PSSX W:$O(PSSDAR(PSSX)) ","
18 .I $O(PSSDAR(0)) W ")"
19 .I ($Y+5)>IOSL D NOHD Q:$G(PSSOUT)
20 .S PSSNFLAG=0
21 .F PSSNN=0:0 S PSSNN=$O(^PS(50.606,PSSN,"NOUN",PSSNN)) Q:'PSSNN!($G(PSSOUT)) S PSSNAME=$P($G(^(PSSNN,0)),"^"),PSSPAK=$P($G(^(0)),"^",2) I PSSNAME'="" S PSSNFLAG=1 D
22 ..I ($Y+5)>IOSL D NOHD Q:$G(PSSOUT)
23 ..I '$O(PSSDAR(0)) W !?2,$G(PSSNAME) D Q
24 ...I $G(PSSPAK)="" W ?34,"(No package)" Q
25 ...W ?34,$S($L($G(PSSPAK))>1:$G(PSSPAK),1:" "_$G(PSSPAK))_"--> "_$G(PSSNAME)
26 ..I $G(PSSPAK)="" W !?2,$G(PSSNAME),?34,"(No package)" Q
27 ..W !?2,$G(PSSNAME),?34,$S($L($G(PSSPAK))>1:$G(PSSPAK),1:" "_$G(PSSPAK))
28 ..S PSSZC=1 F PSSZ=0:0 S PSSZ=$O(PSSDAR(PSSZ)) Q:'PSSZ!($G(PSSOUT)) D
29 ...I PSSZC=1 D PARN W "--> "_PSSZ_" "_$S($G(PSSXN)'="":$G(PSSXN),1:$G(PSSNAME)) S PSSZC=PSSZC+1 Q
30 ...I ($Y+5)>IOSL D NOHD Q:$G(PSSOUT)
31 ...D PARN W !?34,$S($L($G(PSSPAK))>1:$G(PSSPAK),1:" "_$G(PSSPAK)),"--> ",PSSZ_" "_$S($G(PSSXN)'="":$G(PSSXN),1:$G(PSSNAME))
32 .I '$G(PSSNFLAG) W !?2,"(No Nouns)"
33END ;
34 I '$G(PSSOUT),$G(PSSDV)="C" W !!,"End of Report." K DIR S DIR(0)="E",DIR("A")="Press Return to continue" D ^DIR K DIR
35 I $G(PSSDV)="C" W !
36 E W @IOF
37 K PSSDF,PSSN,PSSOUT,PSSLINE,PSSDV,PSSCT,PSSDAR,PSSDUP,PSSX,PSSNN,PSSNFLAG,PSSNAME,PSSNODE,PSSPAK,PSSZ,PSSZC,PSSXN,PSSXNX D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
38 Q
39NOHD ;
40 I $G(PSSDV)="C",$G(PSSCT)'=1 W ! K DIR S DIR(0)="E",DIR("A")="Press Return to continue, '^' to exit" D ^DIR K DIR I 'Y S PSSOUT=1 Q
41 W @IOF W !,"Dosage Form",?34,"Dispense Units per Dose",?69,"PAGE: "_$G(PSSCT) S PSSCT=PSSCT+1
42 W !?2,"Noun(s)",?26,"Package-->Local Possible Dosage",!,PSSLINE
43 Q
44PARN ;
45 K PSSXN,PSSXNX
46 Q:$G(PSSNAME)=""
47 Q:$L(PSSNAME)'>3
48 S PSSXNX=$E(PSSNAME,($L(PSSNAME)-2),$L(PSSNAME))
49 I $G(PSSXNX)="(S)"!($G(PSSXNX)="(s)") D
50 .I $G(PSSZ)'>1 S PSSXN=$E(PSSNAME,1,($L(PSSNAME)-3))
51 .I $G(PSSZ)>1 S PSSXN=$E(PSSNAME,1,($L(PSSNAME)-3))_$E(PSSXNX,2)
52 Q
Note: See TracBrowser for help on using the repository browser.