source: WorldVistAEHR/trunk/r/PHARMACY_DATA_MANAGEMENT-PSS/PSSPOIM3.m@ 1801

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

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1PSSPOIM3 ;BIR/RTR/WRT-Initial Solution and Additive matching ; 10/09/97 13:08
2 ;;1.0;PHARMACY DATA MANAGEMENT;**2**;9/30/97
3 ;
4 S (PSSSSS1,PSOOOUT)=0,PSSSSS=1
5 S X1=DT,X2=-365 D C^%DTC S PSXDATE=X
6 W !!?5,"MATCHING IV ADDITIVES!",! S BBBBB="" F S BBBBB=$O(^PS(52.6,"B",BBBBB)) Q:BBBBB=""!($G(PSOOOUT)) F AAAA=0:0 S AAAA=$O(^PS(52.6,"B",BBBBB,AAAA)) Q:'AAAA!($G(PSOOOUT)) I AAAA,$D(^PS(52.6,AAAA,0)),'$P(^(0),"^",11),$P(^(0),"^",2) D
7 .S BBBB=+$P(^PS(52.6,AAAA,0),"^",2) Q:'$D(^PSDRUG(BBBB,0))
8 .S PSXADATE=+$P($G(^PS(52.6,AAAA,"I")),"^") I PSXADATE,PSXADATE<PSXDATE Q
9 .S PSSSSS1=1
10 .S PSAIEN=AAAA,PSANAME=$P(^PS(52.6,PSAIEN,0),"^"),PSDISP=$P(^(0),"^",2),PSPOI=$P(^(0),"^",11) W !,"IV Additive -> ",PSANAME,! S PSSSSS=1 D ENTER^PSSADDIT
11 .W ! K DIR S DIR(0)="Y",DIR("A")="Continue matching IV Additives",DIR("B")="YES" D ^DIR W !! K DIR I Y'=1 S PSOOOUT=1
12 I 'PSSSSS1 W !?3,"IV Additives are all matched!",!
13 I $G(PSOOOUT) G END
14SOL K PSPOI S PSSSSS1=0,PSSSSS=1
15 W !!?5,"MATCHING IV SOLUTIONS!",! S AAAAA="" F S AAAAA=$O(^PS(52.7,"B",AAAAA)) Q:AAAAA=""!($G(PSOOOUT)) F AAAA=0:0 S AAAA=$O(^PS(52.7,"B",AAAAA,AAAA)) Q:'AAAA!($G(PSOOOUT)) I AAAA,$D(^PS(52.7,AAAA,0)),'$P(^(0),"^",11),$P(^(0),"^",2) D
16 .S BBBB=+$P(^PS(52.7,AAAA,0),"^",2) Q:'$D(^PSDRUG(BBBB,0))
17 .S PSXSDATE=+$P($G(^PS(52.7,AAAA,"I")),"^") I PSXSDATE,PSXSDATE<PSXDATE Q
18 .S PSSSSS1=1
19 .S PSSIEN=AAAA,PSSNAME=$P(^PS(52.7,AAAA,0),"^"),PSDISP=$P(^(0),"^",2),PSSOI=$P(^(0),"^",11),PSSVOL=$P(^(0),"^",3) W !!,"IV Solution -> ",PSSNAME," ",PSSVOL S PSSSSS=1 D ENTER^PSSSOLIT
20 .W ! K DIR S DIR(0)="Y",DIR("B")="YES",DIR("A")="Continue matching IV Solutions" D ^DIR W !! K DIR I Y'=1 S PSOOOUT=1
21 I 'PSSSSS1 W !?3,"IV Solutions are all matched!",!
22END K PSSSSS1,AAAA,BBBB,CCCC Q
23 ;
24DIR I $G(PSOIEN),$D(^PS(50.7,PSOIEN)),$P(^PS(50.7,PSOIEN,0),"^",4)]"" W !!,"This Orderable Item is Inactive. ***" S Y=$P(^PS(50.7,PSOIEN,0),"^",4) X ^DD("DD") W ?43,Y,!
25 I $G(PSSOI),$D(^PS(50.7,PSSOI)),$P(^PS(50.7,PSSOI,0),"^",4)]"" W !!,"This Orderable Item is Inactive. ***" S Y=$P(^PS(50.7,PSSOI,0),"^",4) X ^DD("DD") W ?43,Y,!
26 I $G(PSPOI),$D(^PS(50.7,PSPOI)),$P(^PS(50.7,PSPOI,0),"^",4)]"" W !!,"This Orderable Item is Inactive. ***" S Y=$P(^PS(50.7,PSPOI,0),"^",4) X ^DD("DD") W ?43,Y,!
27 K DIR,PSSDIR S DIR(0)="Y",DIR("B")="NO",DIR("A")="Edit Orderable Item" D ^DIR K DIR I Y=1 S PSSDIR=1
28 Q
Note: See TracBrowser for help on using the repository browser.