source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOBGMG3.m@ 691

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

initial load of WorldVistAEHR

File size: 3.8 KB
Line 
1PSOBGMG3 ;BHAM ISC/LC - BINGO BOARD MANAGER (CONT'D) ; 06/19/96
2 ;;7.0;OUTPATIENT PHARMACY;**11,77**;DEC 1997
3 ;External reference to PS(50.7 is supported by DBIA 2223
4 ;External reference to PSDRUG( is supported by DBIA 221
5 ;
6STATUS ;
7STATUS1 N DA,DIC,DIK,NDA,NDA1,PAS,PAS1,RX,RX1,RXNUM,XX,Y
8 S (EXT,DTME,RX,OLDT)="",(CNT,CNT1,RXNUM)=0
9 W ! K DIC,DLAYGO S DIC=2,DIC(0)="AEMQZ",DIC("S")="I $D(^PS(52.11,""B"",+Y))!($D(^PS(52.41,""AOR"",+Y)))",DIC("A")="Enter Patient Name: " D ^DIC K DIC G:+Y'>0!($G(DTOUT))!($G(DUOUT)) EX S NAM=Y(0,0),NNUM=+Y
10BING ;do not remove this entry point SAB
11 S NNAM="" F S NNAM=$O(^PS(52.11,"BA",NNAM)) Q:NNAM="" I NAM=NNAM D
12 .F NDA=0:0 S NDA=$O(^PS(52.11,"BA",NNAM,NDA)) Q:'NDA I +$G(^PS(52.11,NDA,0))=$G(NNUM) S CNT=CNT+1,NDA(CNT)=NDA
13PEND F NNAM=0:0 S NNAM=$O(^PS(52.41,"AOR",NNAM)) Q:'NNAM I NNAM=$G(NNUM),NAM=$P($G(^DPT(NNAM,0)),"^") D
14 .F NDAINS=0:0 S NDAINS=$O(^PS(52.41,"AOR",NNAM,NDAINS)) Q:'NDAINS F NDA=0:0 S NDA=$O(^PS(52.41,"AOR",NNAM,NDAINS,NDA)) Q:'NDA S CNT1=CNT1+1,NDA1(CNT1)=NDA
15 F LP=0:0 S LP=$O(NDA(LP)) Q:('LP)!$G(EXT) S DA=NDA(LP) D OLDT,PRSE
16 F LP=0:0 S LP=$O(NDA1(LP)) Q:('LP)!$G(EXT) S DA=NDA1(LP) D:$G(^PS(52.41,DA,0)) PRSE1
17 K CNT,CNT1,LP,NDA,NDA1,NAM,NNAM,OI,OLDT,PAS,PAS1,NDAINS
18 G:'$G(PSOHA) STATUS1
19EX K CNT,CNT1,DG,EXT,LP,NDA,NDA1,NAM,NNAM,NNUM,OI,OLDT,PAS,PAS1,DA,DIC,DIK,DTME,DIS,DIV,PKP,TIN,TOUT,XX,Y,PN,ODTP,EBY,PROV,DRG,LOGDT,MW
20 Q
21 ;
22OLDT ;
23 S OLDT="" I $P($P($G(^PS(52.11,DA,0)),"^",5),".")'=DT S Y=$P($P($G(^PS(52.11,DA,0)),"^",5),".") D DD^%DT S OLDT="***Entered on "_Y_"***"
24 Q
25 ;
26PRSE ;
27 S RX="",RX1="",RXNUM=0
28 F XX=0:0 S XX=$O(^PS(52.11,DA,2,"B",XX)) Q:'XX S XX1=$S($G(^PSRX(XX,0)):$P(^(0),"^"),1:XX) D
29 .S:$L(RX_XX1)>200 RX1=RX1_XX1_", " S:$L(RX_XX1)<200 RX=RX_XX1_", ",RXNUM=RXNUM+1
30 S DTME=$P(^PS(52.11,DA,0),"^",5),DIS=$S($P(^(0),"^",7)'="":1,1:0),DIV=$P(^(0),"^",4),DG=$P(^(0),"^",3),TIN=$P(^(0),"^",6),TOUT=$P(^(0),"^",7)
31 S PKP=$S($D(^PS(52.11,"AD",DG,DA)):1,1:0),PKPD=$S($D(^PS(52.11,"ANAMK",DA,DG,NNUM)):1,1:0)
32 S TIN=+$E(TIN,1,2)_":"_$E(TIN,3,4),TOUT=+$E(TOUT,1,2)_":"_$E(TOUT,3,4) S Y=DTME X ^DD("DD") S DTME=Y
33 W:'$G(PAS) @IOF,!,?8,NAM_" has the following orders for "_+$E(DT,4,5)_"/"_+$E(DT,6,7)_"/"_$E(DT,2,3)
34 I '$G(DIS) W !!,"Being Processed: "_OLDT,!,?3,"Division: "_$P(^PS(59,DIV,0),"^"),?42,"Time In: "_TIN,?60,"Time Out: ",!,?3,"Rx #: "_RX W:$G(RX1) !,?3,RX1
35 I $Y+6>IOSL D ENPG Q:$G(EXT)
36 I $G(DIS),$G(PKP),'$G(PKPD) W !!,"Ready For Pickup: ",!,?3,"Division: "_$P(^PS(59,DIV,0),"^"),?42,"Time In: "_TIN,?60,"Time Out: "_TOUT,!,?3,"Rx #: "_RX W:$G(RX1) !,?3,RX1
37 I $Y+6>IOSL D ENPG Q:$G(EXT)
38 ;*****Picked Up status is dependent on wait time stored in ^PSRX*****
39 I $G(DIS),$G(PKPD) W !!,"Picked Up: ",!,?3,"Division: "_$P(^PS(59,DIV,0),"^"),?42,"Time In: "_TIN,?60,"Time Out: "_TOUT,!,?3,"Rx #: "_RX W:$G(RX1) !,?3,RX1
40 I $Y+6>IOSL D ENPG Q:$G(EXT)
41 S PAS=1
42STEX K DA,DIC,DG,DIK,DTME,DIS,DIV,PKP,PKPD,TIN,TOUT,XX,XX1,Y
43 Q
44PRSE1 ;PENDING
45 Q:$P(^PS(52.41,DA,0),"^",3)="RF"
46 S PN=$P(^PS(52.41,DA,0),"^"),ODTP=$P(^(0),"^",3),EBY=$P(^(0),"^",4),PROV=$P(^(0),"^",5),DRG=$P(^(0),"^",9),LOGDT=$P(^(0),"^",12),MW=$P(^(0),"^",17),OI=$P(^(0),"^",8)
47 S Y=LOGDT,LOGDT=+$E(Y,4,5)_"/"_+$E(Y,6,7)_"/"_$E(Y,2,3)_"@"_$E($P(Y,".",2),1,2)_":"_$E($P(Y,".",2),3,4)
48 ;format text for screen
49 W:'$G(PAS)&('$G(PAS1)) @IOF,!,?8,NAM_" has the following orders for "_+$E(DT,4,5)_"/"_+$E(DT,6,7)_"/"_$E(DT,2,3)
50 ;
51 W !!,"Pending: ",!,?3,"Orderable Item: "_$P(^PS(50.7,OI,0),"^"),?52,"Provider: "_$P(^VA(200,PROV,0),"^")
52 W !,?3,"Entered By: "_$P(^VA(200,EBY,0),"^"),?52,"Time In: "_LOGDT
53 W !,?3,"Drug: "_$S($G(DRG):$P(^PSDRUG(DRG,0),"^"),1:""),?52,"Routing: "_$S($G(MW)="M":"MAIL",1:"WINDOW")
54 I $Y+6>IOSL D ENPG Q:$G(EXT)
55STEX1 K DA,DIC,DIK,PN,ODTP,EBY,PROV,DRG,LOGDT,MW,XX,XX1,Y
56 S PAS1=1
57 Q
58ENPG K DIR,DUOUT,DTOUT,DIRUT S DIR(0)="E"
59 D ^DIR S:'Y EXT=1
60 K DIR,DTOUT,DIRUT,DUOUT W @IOF
61 Q
Note: See TracBrowser for help on using the repository browser.