source: FOIAVistA/trunk/r/NATIONAL_DRUG_FILE-PSN/PSNCLPR.m

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

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1PSNCLPR ;BIR/DMA&WRT-print products sorted by class ; 11/22/98 15:10
2 ;;4.0; NATIONAL DRUG FILE;**3**; 30 Oct 98
3PRELIM W !,"This report will print out all VA Product Names by VA Drug Class. You may",!,"sort by Primary, Secondary, or Both Classes. This information comes from",!,"the VA Products file.",!
4 W "You may queue the report to print, if you wish.",!! D DISC
5 K DIR S DIR(0)="SA^P:PRIMARY;S:SECONDARY;B:BOTH",DIR("A")="Sort by Primary (P), Secondary (S), or Both (B) Classes? " D ^DIR G END:$D(DIRUT) S S=Y
6 S ZTSAVE("S")="" D EN^XUTMDEVQ("GO^PSNCLPR","PRINT DRUGS SORTED BY CLASS",.ZTSAVE) I POP W !,"No device selected",!
7END K DIR,S,X,Y,ZTSAVE,^TMP($J,"PSN"),CL,DA,K,LINE,NA,TD,DIR Q
8 ;
9GO ;ENTRY POINT
10 K ^TMP($J,"PSN")
11 S DA=0 F S DA=$O(^PSNDF(50.68,DA)) Q:'DA S NA=$P(^(DA,0),"^") D
12 .I S'="S" S CL=$P($G(^PSNDF(50.68,DA,3)),"^"),CL=$P(^PS(50.605,+CL,0),"^"),^TMP($J,"PSN",CL,NA)=""
13 .I S'="P" S K=0 F S K=$O(^PSNDF(DA,4,K,0)) Q:'K S CL=$P($G(^PS(50.605,K,0)),"^")_$S(S="B":"*",1:""),^TMP($J,"PSN",CL,NA)=""
14 ;
15 S PG=1,TD=$TR($$HTE^XLFDT($H),"@"," "),$P(LINE,"-",IOM-1)=""
16 D HEAD S CL="" F S CL=$O(^TMP($J,"PSN",CL)),NA="" Q:CL="" F S NA=$O(^TMP($J,"PSN",CL,NA)) Q:NA="" W !,CL,?S="B"*8+10,NA I $Y+4>IOSL D HEAD
17 K CL,DA,K,LINE,NA,S,TD S:$D(ZTQUEUED) ZTREQ="@" D ^%ZISC Q
18 ;
19HEAD W:$Y @IOF W !,"VA PRODUCT LIST",?IOM-35," ",TD," PAGE ",PG,!! W:S="P" "PRIMARY",! W:S="S" "SECONDARY",! W:S="B" "PRIMARY OR",!,"SECONDARY",!,"VA CLASS CODE" W:S'="B" "VA CLASS",!,"CODE" W ?S="B"*10+12,"VA PRODUCT NAME",!,LINE,! S PG=PG+1 Q
20DISC W !!,"***DISCLAIMER: The Secondary VA Drug Class field has not been populated",!,"with data at this time. No report will be generated if sort by Secondary (S)",!,"is chosen. Currently, sorting"
21 W " by Primary (P) VA Drug Class is the same as",!,"sorting by both classes. This disclaimer will be removed once the field is",!,"populated with data.",!! Q
Note: See TracBrowser for help on using the repository browser.