source: WorldVistAEHR/trunk/r/DRUG_ACCOUNTABILITY-PSA/PSAUNL.m@ 1154

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

initial load of WorldVistAEHR

File size: 1.6 KB
Line 
1PSAUNL ;BIR/LTL-Connect Unlinked DRUG/ITEM MASTER file Entries ;7/23/97
2 ;;3.0; DRUG ACCOUNTABILITY/INVENTORY INTERFACE;**21**; 10/24/97
3 ;
4 ;References to ^PS(59.7 are covered by IA #3034
5 ;References to ^PSDRUG( are covered by IA #2095
6 D DT^DICRW
7STOR ;to store and retrieve a restart drug
8 N D0,D1,DA,DIC,DIE,DIR,DIRUT,DLAYGO,DR,DTOUT,DUOUT,PSASTOP,PSAIT,PSAS,X,Y S PSAS=+$O(^PS(59.7,0)) G:'$D(^PS(59.7,PSAS,70)) START
9CHEC W !!,$S($P($G(^VA(200,+$P(^PS(59.7,PSAS,70),U,2),0)),U)]"":$P(^(0),U),1:"Someone")_" was last scanning on "
10 S Y=$S($P(^PS(59.7,PSAS,70),U,3):$P(^(70),U,3),1:"sometime") X ^DD("DD") W Y_".",!!,"He/she stopped at "_$S($P($G(^PSDRUG(+$P(^PS(59.7,PSAS,70),U),0)),U)]"":$P(^(0),U),1:"... gee, I'm not sure")_".",! D G:$D(DIRUT) QUIT
11 .S DIR(0)="Y",DIR("A")="Would you like to start from there" D ^DIR K DIR S:Y=1&($P(^PS(59.7,+PSAS,70),U)) PSAIT=+$P(^PS(59.7,PSAS,70),U)-1
12START ;compiles edit loop
13 S:'$D(PSAIT) PSAIT=0
14 ;DAVE B (PSA*3*23) PSAIT is killed in PSATI if no drug is
15 ;selected at the Select Drug prompt. This causes an undefined
16 ;and killed the loop process.
17LOOP F S PSAIT=$O(^PSDRUG(PSAIT)) Q:'PSAIT S PSASTOP=PSAIT I '$O(^PSDRUG(PSAIT,441,0)),'$D(^PSDRUG(PSAIT,"I")) D START^PSATI Q:$D(DIRUT) I $G(PSAIT)="",$G(PSASTOP)'="" S PSAIT=PSASTOP
18 W:$G(PSAIT) !,"OK, done with "_$P(^PSDRUG(PSAIT,0),U),!
19STOP I $G(PSAIT),$D(PSAS),$D(PSASTOP) S DIE="^PS(59.7,",DA=PSAS,DR="70///^S X=PSASTOP;70.1///^S X=""`""_DUZ;70.2///^S X=DT" D ^DIE K DIE W !!,"I'll store this last drug in case you want to resume at this point next time.",!!
20 W:'$G(PSAIT) !,"**Congratulations, you've reached the end of your DRUG file.**",!
21QUIT Q
Note: See TracBrowser for help on using the repository browser.