source: WorldVistAEHR/trunk/r/NATIONAL_DRUG_FILE-PSN/PSNFRMLY.m@ 738

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

initial load of WorldVistAEHR

File size: 2.5 KB
Line 
1PSNFRMLY ;BIR/WRT-formulary report routine ;09/26/98 11:08
2 ;;4.0; NATIONAL DRUG FILE;**5**; 30 Oct 98
3 W !!,"This report gives you a printed copy of formulary drugs from your local file",!,"with synonyms marked as trade names. You"
4 W " will be asked if you want to include",!,"supply items. You are asked to type in a title for this report.",!,"You are then asked to print by Generic Name/Tradename or VA Class Code."
5 W !,"If you choose to print by VA Class Code, it"
6 W " will ask you to pick a range",!,"of VA Drug Class Codes."
7 W " Only active drugs will print. Drugs with",!,"a future inactive date will print as well."
8 W !,"You may queue the report to print, if you wish.",!! D SUPPLY Q:$D(DIRUT)
9HEADER R !,"Enter title for report: HOSPITAL// ",PSNANS:DTIME S:'$T PSNANS="^" S:PSNANS']"" PSNANS="HOSPITAL" G:"^"[$E(PSNANS) KILL
10 I $D(PSNANS),PSNANS?.E1C.E K PSNANS G HEADER
11 I $D(PSNANS),$L(PSNANS)>30 W !,"Your answer must 30 characters or less.",! K PSNANS G HEADER
12 I $D(PSNANS),"@"[$E(PSNANS) W !,"You cannot delete. This is a free text field. Please enter the name that you",!,"want to print at the top of this report.",! K PSNANS G HEADER
13 I $D(PSNANS),"?"[$E(PSNANS) W !!,"Enter the name you want to print. This name will print at the top of this report",!,"along with the word ""FORMULARY""." D UPAR^PSNHELP K PSNANS G HEADER
14 I $D(PSNANS) I PSNANS'="^" D ASKEM I $D(PSNANSR),PSNANSR="^" K PSNANS,PSNANSR
15 Q
16BEGIN K ^TMP($J) S DIC="^PSDRUG(",L=0,FLDS="[PSNFRMPRT]",BY="@VA CLASSIFICATION",DHD="@@",DIOEND="D ENQ1^PSNHFRM1" D EN1^DIP
17 D KILL Q
18HEAD1 I "Cc"[$E(PSNANSR) W !,PSNANS_" FORMULARY (BY VA CLASS)",!
19 Q
20KILL K PSNANS,PSNANSR,PSNB,^TMP($J,"PSNDT"),PSNDATE
21 Q
22ASKEM W !!,"You may print by DRUG GENERIC NAME/TRADENAME or VA CLASS CODE.",!,"Enter a <RET> or ""G"" to print by DRUG GENERIC NAME/TRADENAME or",!,"""C"" for VA CLASS CODE."
23 W !!,"Print by:" R !,?3,"DRUG GENERIC NAME/TRADENAME// ",PSNANSR:DTIME S:'$T PSNANSR="^" Q:PSNANSR="^" S:PSNANSR']"" PSNANSR="Gg"
24 I "?"[$E(PSNANSR) W !!,?5,"Enter a ""<RET>"" or ""Gg"" to print by local generic name/tradename.",!?5,"Enter a ""C"" to print by VA Drug Class Code",!?5,"You may enter an ""^"" to exit." K PSNANSR G ASKEM
25 I "^"[$E(PSNANSR) Q
26 I "CcGg"'[$E(PSNANSR) G ASKEM
27 I $D(PSNANSR),PSNANSR?.E1C.E K PSNANSR G ASKEM
28 I "Cc"[$E(PSNANSR) W ?40,"CLASS",! D BEGIN
29 I $D(PSNANSR),"Gg"[$E(PSNANSR) W ?40,"GENERIC/TRADE",! K ^TMP($J) S PSNANS=PSNANS_" FORMULARY" D ^PSNHFRM
30 Q
31SUPPLY K DIR S DIR(0)="Y",DIR("B")="NO",DIR("A")="Do you wish to include supply items" D ^DIR K DIR Q:$D(DIRUT)
32 I Y(0)="YES" S SF=1
33 I Y(0)="NO" S SF=0
34 Q
Note: See TracBrowser for help on using the repository browser.