source: WorldVistAEHR/trunk/r/DRUG_ACCOUNTABILITY-PSA/PSALNA.m@ 837

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

initial load of WorldVistAEHR

File size: 3.2 KB
Line 
1PSALNA ;BIR/LTL-Automated DRUG/ITEM MASTER file Link by NDC ;7/23/97
2 ;;3.0; DRUG ACCOUNTABILITY/INVENTORY INTERFACE;**15**; 10/24/97
3 ;
4 ;References to ^PSDRUG( are covered by IA #2095
5 ;References to ^PRC( are covered by IA #214
6 ;References to ^PSDRUG("AB" are covered by IA #2095
7 ;
8 D DT^DICRW
9START ;sets up edit loop
10 N D0,D1,DA,DIC,DIE,DLAYGO,DR,DIR,DIRUT,DTOUT,DUOUT,PSAD,PSADD,PSAIT,PSALN,PSAOUT,PSAPG,PSARPDT,X,Y
11QUES S DIR(0)="Y",DIR("A")="Have you run the Report Potential NDC Matches option",DIR("??")="^D RUN^PSALNA",PSAOUT=1 D ^DIR K DIR G:$D(DIRUT) QUIT D:Y<1 G:PSAOUT QUIT
12 .S DIR(0)="Y",DIR("A")="Would you like to run the report now",DIR("B")="YES",DIR("??")="^D NOW^PSALNA" D ^DIR K DIR S:$G(DIRUT) PSAOUT=1 I Y D ^PSALND S PSAOUT=0
13 W ! S DIR(0)="Y",DIR("A",1)="Are you ready to link ALL of the drugs",DIR("A")="that have matches in the ITEM MASTER file",DIR("B")="N",DIR("??")="^D READY^PSALNA"
14 D ^DIR K DIR G:'Y!($G(DIRUT)) QUIT
15DEV ;asks device and queueing info
16 W !!,"I'll list each DRUG/ITEM MASTER file entry as they're linked.",!
17 K IO("Q") N %ZIS,%ZIS,IOP,POP S %ZIS="Q",%ZIS("A")="Please select DEVICE for output: " D ^%ZIS I POP W !,"NO DEVICE SELECTED OR REPORT PRINTED!" G QUIT
18 I $D(IO("Q")) N ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTDTH,ZTSK S ZTRTN="LOOP^PSALNA",ZTDESC="Linking DRUG/ITEM FILE by NDC" D ^%ZTLOAD,HOME^%ZIS S PSAOUT=1 G QUIT
19LOOP S (PSAD,PSAPG,PSAOUT)=0,Y=DT D DD^%DT S PSARPDT=Y,Y=1 D HEADER
20 F K PSADD S PSAD=$O(^PSDRUG(PSAD)) G:'PSAD QUIT D:$Y+4>IOSL HEADER G:PSAOUT QUIT W:'(PSAD#100) "." I $P($G(^PSDRUG(PSAD,2)),U,4)]"" S PSAD(1)=$P($G(^(2)),U,4) D:'$D(^PSDRUG(PSAD,"I"))
21 .S PSAIT=$$ITEM^PSAUTL(PSAD(1)) Q:'PSAIT I $D(^PRC(441,+PSAIT,0)) D Q:$D(PSADD) W !,$E($P(^PSDRUG(PSAD,0),U),1,39),?40,$E($P(^PRC(441,PSAIT,0),U,2),1,39),!
22NOT ..S:$O(^PSDRUG("AB",PSAIT,"")) PSADD="" I $D(^PRC(441,PSAIT,3)),$P(^(3),U)=1 S PSADD=""
23OK .I '$D(PSADD) S DIE=50,DA=PSAD,DR="441///^S X=PSAIT" D ^DIE W "Linked to Item #"_PSAIT
24QUIT I $E(IOST)'="C" W @IOF
25 I $E(IOST,1,2)="C-",'PSAOUT W !! S DIR(0)="EA",DIR("A")="END OF REPORT! Press <RET> to return to the menu." D ^DIR
26 D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@" K IO("Q") Q
27HEADER ;prints header info
28 I $E(IOST,1,2)'="P-",PSAPG S DIR(0)="E" D ^DIR K DIR I 'Y S PSAOUT=1 Q
29 I $$S^%ZTLOAD W !!,"Task #",$G(ZTSK),", ",$G(ZTDESC)," was stopped by ",$P($G(^VA(200,+$G(DUZ),0)),U),"." S PSAOUT=1 Q
30 W:$Y @IOF S $P(PSALN,"-",81)="",PSAPG=PSAPG+1 W !?2,"Linking DRUG/ITEM MASTER file by NDC",?55,PSARPDT,?70,"PAGE: "_PSAPG,!,PSALN,!,"DRUG file",?40,"ITEM MASTER file"
31 Q
32NOW ;Extended help to 'Would you like to run the report now?'
33 W !?5,"Enter YES if you want to print the report now.",!!?5,"Enter NO if you do not want to run the report now.",!?5,"You will not exit the option."
34 Q
35READY ;Extended help to 'Are you ready to link ALL of the drugs that have matches in the ITEM MASTER file?'
36 W !?5,"Enter YES to begin linking every drug that has been matched.",!?5,"Enter NO to exit the option."
37 Q
38RUN ;Extended help to 'Have you run the Report Potential NDC Matches option?'
39 W !?5,"Enter YES if you have run the Report Potential NDC Matches option",!?5,"and produced a report.",!!?5,"Enter NO if you have not run the option. You will be given the",!?5,"opportunity to run the report now."
40 Q
Note: See TracBrowser for help on using the repository browser.