source: WorldVistAEHR/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDORNO.m@ 701

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

initial load of WorldVistAEHR

File size: 2.5 KB
Line 
1PSDORNO ;BIR/JPW,LTL-Nurse CS Order Request Entry (One time); 15 Jan 95
2 ;;3.0; CONTROLLED SUBSTANCES ;**20**;13 Feb 97
3 ;
4 ; Reference to DD("DD" supported by DBIA # 10017
5 ; Reference to PSD(58.8 supported by DBIA # 2711
6 ;
7 S DIR(0)="Y",DIR("B")="No"
8 S DIR("A",1)="You have selected "_PSDRN
9 S DIR("A",2)="which is "_$S('$G(^PSD(58.8,+NAOU,1,PSDR,0)):"not stocked by ",1:"inactive on ")_NAOUN_"."
10 S DIR("A")="Are you sure you want to create a one time request"
11 S DIR("?")="^N XQH S XQH=""PSD ORDER ENTRY ONE TIME"" D EN^XQH"
12 W ! D ^DIR K DIR Q:Y<1
13 I '$D(^PSD(58.8,+PSDS,1,PSDR,0)) S MSG=2 D MSG G END
14 S DIR(0)="DA^NOW::AEFT",DIR("A")="Date/time required: "
15 S DIR("?",1)="You are on the verge of creating a priority order."
16 S DIR("?",2)="If this is a mistake, enter ""^"" to create a scheduled order, otherwise,"
17 S DIR("?")="Pharmacy needs to know how soon you need this order."
18 W ! D ^DIR K DIR G:$D(DIRUT) END X ^DD("DD") S PSDT(9)=Y
19 I '$D(^PSD(58.8,+NAOU,1,+PSDR,0)) S DA(1)=+NAOU,DIC="^PSD(58.8,+NAOU,1,",DIC(0)="L",DLAYGO=58.8,X="`"_PSDR,DIC("DR")="13////"_DT_";14////"_"O"_";14.5////"_"One Time Request",DINUM=PSDR D ^DIC K DIC,DLAYGO I Y<1 W !,"Inactive drug" G END
20 S NBKU=$P(^PSD(58.8,+PSDS,1,PSDR,0),"^",8),NPKG=+$P(^(0),"^",9)
21 I NBKU']"" S MSG1=3 D MSG G END
22 I 'NPKG S MSG1=4 D MSG G END
23 W !!,"Sending a Mailman message to the Pharmacy Supervisor(s)...",!!
24 D ^PSDORM,LIST^PSDORL
25QTY K ORD S PSDOUT=0 S PSDQTY=NPKG,CNT=0 D DIE G:PSDOUT END
26 D ASK^PSDORN1 G:PSDOUT END
27END K %,%DT,%H,%I,CNT,CNT1,DA,DIC,DIE,DINUM,DIR,DIROUT,DIRUT,DIWF,DIWL,DIWR,DR,DTOUT,DUOUT,LN,MSG,MSG1
28 K PSDEM,PSDOUT,X,Y
29 Q
30DIE ;create the order request
31 Q:'$D(^PSD(58.8,NAOU,1,PSDR,0))
32 S PSDEM=1
33 S:'$D(^PSD(58.8,NAOU,1,PSDR,3,0)) ^(0)="^58.800118A^^"
34DIE2 S PSDA=$P(^PSD(58.8,NAOU,1,PSDR,3,0),"^",3)+1 I $D(^PSD(58.8,NAOU,1,PSDR,3,PSDA)) S $P(^PSD(58.8,NAOU,1,PSDR,3,0),"^",3)=$P(^PSD(58.8,NAOU,1,PSDR,3,0),"^",3)+1 G DIE2
35 K DA,DIC,DIE,DD,DR,DO S DIC(0)="L",(DIC,DIE)="^PSD(58.8,"_NAOU_",1,"_PSDR_",3,",DA(2)=NAOU,DA(1)=PSDR,(X,DINUM)=PSDA D FILE^DICN K DIC
36 D NOW^%DTC S PSDT=+$E(%,1,12)
37 W ?10,!!,"processing one order for ",PSDQTY," now..."
38 S DA=PSDA,DA(1)=PSDR,DA(2)=NAOU,DR="1////"_PSDT_";2////"_+PSDS_";3////"_PSDUZ_";10////1;5////"_PSDQTY_";24////"_$G(PSDEM)_";13" D ^DIE K DIE,DR
39 Q
40MSG ;display error message
41 W $C(7),!!,?10,"Contact your Pharmacy Coordinator.",!,?10,"This "_$S(MSG=2:"Dispensing Site",MSG=1:"NAOU",1:"Drug")_" is missing "
42 W $S(MSG1=1:"Primary Disp. Site",MSG1=2:"stocked drugs",MSG1=3:"narcotic breakdown unit",MSG1=4:"narcotic package size",1:"data")_".",!
43 Q
Note: See TracBrowser for help on using the repository browser.