Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: APSQFAS4

APSQFAS4.m

Go to the documentation of this file.
APSQFAS4 ;IHS/DSD/JCM - ORDER ENTRY FAST DRUG SELECTION  
 ;;6.0;IHS PHARMACY MODIFICATIONS;**3**;FEB 20, 2001
 ;----------------------------------------------------------
START ;
 S (PSONEW("DFLG"),PSONEW("FIELD"),PSODRG("QFLG"))=0
 D SELECT ; Select Drug
 I $G(PSORX("EDIT"))]"",'PSONEW("FIELD") D TRADE
 G:PSONEW("DFLG")!(PSODRG("QFLG")) END
 D SET ; Set various drug information
 D POST I PSORX("DFLG") S PSONEW("DFLG")=1 K:'$G(PSORX("EDIT")) PSORX("DFLG") ; Do any post selection action
END D EOJ
 Q
 ;------------------------------------------------------------
 ;
SELECT ;
 K DIC,X,Y,PSODRUG("TRADE NAME")
 I $G(PSODRUG("IEN"))]"" S DIC("B")=PSODRUG("NAME"),PSONEW("OLD VAL")=PSODRUG("IEN")
 ;S DIC="^PSDRUG(",DIC(0)="MQEAZO",DIC("A")="DRUG: ",DIC("S")="I $S('$D(^PSDRUG(+Y,""I"")):1,'^(""I""):1,DT'>^(""I""):1,1:0),$S($P($G(^PSDRUG(+Y,2)),""^"",3)'[""O"":0,1:1)" D ^DIC K DIC
 S Y=$G(APSQF(2,"I")),Y(0)=^PSDRUG(Y,0) ;IHS/OKCAO/POC FAST OPTION
 S:Y>0 X=$P(^PSDRUG(Y,0),U,1) ;IHS/OKCAO/POC FAST OPTION
 W !,X ;FAST OPTION
 ;IHS/DSD/ENM 01/31/97 NEXT LI COPIED MODIFIED/DISABLED
 ;S DIC="^PSDRUG(",DIC(0)="MQEAZ",DIC("A")="DRUG: ",DIC("S")="I $S('$D(^PSDRUG(+Y,""I"")):1,'^(""I""):1,DT'>^(""I""):1,1:0),$S($P($G(^PSDRUG(+Y,2)),""^"",3)'[""O"":0,1:1)" D ^DIC K DIC
 I X[U,$L(X)>1 S PSODIR("FLD")=PSONEW("FLD") D JUMP^PSODIR1 S:$G(PSODIR("FIELD")) PSONEW("FIELD")=PSODIR("FIELD") K PSODIR S PSODRG("QFLG")=1 G SELECTX
 I $D(DTOUT)!($D(DUOUT)) S PSONEW("DFLG")=1 G SELECTX
 ;I Y<0 G SELECT
 S:Y<1 PSODRG("QFLG")=1 ;IHS/OKCAO/POC FAST OPTION
 S:$G(PSONEW("OLD VAL"))=+Y PSODRG("QFLG")=1
 K PSOY S PSOY=Y,PSOY(0)=Y(0)
 ;D ^APSPMAN ;IHS/DSD/ENM MANUFACTURER CALL 1-6-95 8/18/2000 IHS/OKCAO/POC
 I $P(PSOY(0),"^")="OTHER DRUG"!($P(PSOY(0),"^")="OUTSIDE DRUG") D TRADE
SELECTX K X,Y,DTOUT,DUOUT
 Q
 ;
TRADE ;
 K DIR,DIC,DA,X,Y
 S DIR(0)="52,6.5" D ^DIR K DIR,DIC
 I $D(DIRUT) S:$D(DUOUT)!$D(DTOUT)&('$D(PSORX("EDIT"))) PSONEW("DFLG")=1 G TRADEX
 S PSODRUG("TRADE NAME")=Y
TRADEX K DIRUT,DTOUT,DUOUT,X,Y
 Q
 ;
SET ;
 S PSODRUG("IEN")=+PSOY,PSODRUG("VA CLASS")=$P(PSOY(0),"^",2)
 S PSODRUG("NAME")=$P(PSOY(0),"^")
 S PSODRUG("NDF")=$S($G(^PSDRUG(+PSOY,"ND"))]"":+^("ND")_"A"_$P(^("ND"),"^",3),1:0)
 S PSODRUG("MAXDOSE")=$P(PSOY(0),"^",4),PSODRUG("DEA")=$P(PSOY(0),"^",3)
 S PSODRUG("CLN")=$S($D(^PSDRUG(+PSOY,"ND")):+$P(^("ND"),"^",6),1:0)
 S PSODRUG("SIG")=$P(PSOY(0),"^",5)
 S PSODRUG("NDC")=$P($G(^PSDRUG(+PSOY,2)),"^",4)
 S PSODRUG("STKLVL")=$G(^PSDRUG(+PSOY,660.1))
 G:$G(^PSDRUG(+PSOY,660))']"" SETX
 S PSOX1=$G(^PSDRUG(+PSOY,660))
 S PSODRUG("COST")=$P($G(PSOX1),"^",6)
 S PSODRUG("UNIT")=$P($G(PSOX1),"^",8)
 ;S PSODRUG("EXPIRATION DATE")=$P($G(PSOX1),"^",9)
 S PSODRUG("AWP")=$P($G(^PSDRUG(+PSOY,999999931)),"^",2) ;AWP PRICE IHS/OKCAO/POC 8/18/2000
 ;MORE CHANGES IHS/OKCAO/POC 8/18/2000
 ;S DIC="^PSDRUG(",DR="9999999.24:9999999.26",DA=PSODRUG("IEN"),DIQ="APSQ(""DIQ1"",",DIQ(0)="I"
 S DIC="^PSDRUG(",DR="9999999.25:9999999.26",DA=PSODRUG("IEN"),DIQ="APSQ(""DIQ1"",",DIQ(0)="I"
 D EN^DIQ1
 ;S PSONEW("MANUFACTURER")=@("APSQ(""DIQ1"",50,"_PSODRUG("IEN")_",9999999.24,""I"")")
 S PSONEW("LOT #")=@("APSQ(""DIQ1"",50,"_PSODRUG("IEN")_",9999999.25,""I"")")
 S PSONEW("EXPIRATION DATE")=@("APSQ(""DIQ1"",50,"_PSODRUG("IEN")_",9999999.26,""I"")")
 I $G(PSONEW("EXPIRATION DATE"))["T+" S X=PSONEW("EXPIRATION DATE"),%DT="" D ^%DT S:Y'=-1 PSONEW("EXPIRATION DATE")=Y ;IHS/OKCAO/POC 1/9/2001 IN CASE FIELD HAS T+ CHANGE TO A FILEMAN DATE
 ;CRAP I NEED THE EXTERNAL FOR THE FAST OPTION
 S DIC="^PSDRUG(",DR="9999999.24",DA=PSODRUG("IEN"),DIQ="APSQ(""DIQ1"",",DIQ(0)="E"
 D EN^DIQ1
 S PSONEW("MANUFACTURER")=@("APSQ(""DIQ1"",50,"_PSODRUG("IEN")_",9999999.24,""E"")")
 ;END OF CHANGES IHS/OKCAO/POC 8/18/2000
SETX K PSOX1,PSOY
 K APSQ("DIQ1") ;8/18/2000 IHS/OKCAO/POC
 Q
 ;
POST ;
 S PSORX("DFLG")=0
 ;I $G(DUZ("AG"))="I" D ^PSODRG99 ; IHS specific call
 D ^PSODRDUP ; Set PSORX("DFLG")=1 if process to stop
 S X="APSQDRDU" X ^%ZOSF("TEST") I $T D ^APSQDRDU ;IHS/DSD/ENM/POC 05/11/98 DUP OUTSIDE RX CK
 Q:$G(PSORX("DFLG"))
 ;D ^PSODGDGI D:$G(PSORX("INTERVENE"))]"" ^PSORXI G:PSORX("DFLG") POSTX
 D ^PSODGDGI G:PSORX("DFLG") POSTX ;IHS/DSD/ENM/POC 05/11/98 MULTI-INTERVENS
 S X="APSQDGDG" X ^%ZOSF("TEST") I $T D ^APSQDGDG G:PSORX("DFLG") POSTX ;IHS/DSD/ENM/POC 05/11/98 OUTSIDE RX CK CHANGED DGLG TO DFLG IHS/OKCAO/POC 5/26/98
 S X="APSQALLE" X ^%ZOSF("TEST") I $T K PSORX("INTERVENE") ;IHS/DSD/ENM/POC 05/11/98 OUTSIDE RX CK
 S X="APSQALLE" X ^%ZOSF("TEST") I $T D EN^APSQALLE D:$G(PSORX("INTERVENE"))]"" ^PSORXI G:PSORX("DFLG") POSTX ;IHS/DSD/ENM/POC 05/11/98 OUTSIDE RX CK CHANGED DGLG TO DFLG IHS/OKCAO/POC 5/26/98
 ;
 ;IHS/DSD/ENM NEXT LINE ROUTINE IS UNDER DEVELOPMENT
 ;D EN^APSPALG D:$G(PSORX("INTERVENE"))]"" ^PSORXI G:PSORX("DFLG") POSTX ;IHS/DSD/POC/ENM ADDED FOR ALLERGY CHECK
 D POSTX ;IHS/OKCAO/POC 9/28/98
 S X="APSQCK" X ^%ZOSF("TEST") I $T D RX^APSQCK D:$G(PSORX("INTERVENE"))]"" ^PSORXI G:PSORX("DFLG") POSTX ;IHS/OKCAO/POC 9/28/98
 D POSTX ;IHS/OKCAO/POC 9/28/98
 D:$P($G(^PSDRUG(PSODRUG("IEN"),"CLOZ1")),"^")]"" CLOZ G:PSORX("DFLG") POSTX
 ; Do ^allergy check
 ;D ^PSODRDUP ; Set PSORX("DFLG")=1 if process to stop
 ; ^Do any other action revolving around the drug selection
POSTX ;
 K PSORX("INTERVENE")
 Q
 ;
EOJ ;
 K PSODRG
 Q
 ;
CLOZ ;
 S ANQRTN=$P(^PSDRUG(PSODRUG("IEN"),"CLOZ1"),"^"),ANQX=0
 S P(5)=PSODRUG("IEN"),DFN=PSODFN,X=ANQRTN
 X ^%ZOSF("TEST") I  D @("^"_ANQRTN) S:$G(ANQX) PSORX("DFLG")=1
 K P(5),ANQRTN,ANQX,X
 Q