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

APSKAMN5.m

Go to the documentation of this file.
APSKAMN5 ;IHS/ANMC/SFB/MRS - CALC MIN & MAX SERUM CONC.,DOSING INTERVALS & RATE; [ 09/28/94  1:03 PM ]
 ;;1.0;Aminoglycoside Kinetics;;OCT 31,1994
 ;
LOOP ;EP
 ;===>DETERMINS THE MAXIMUM AND MINIMUM SERUM CONCENTRATIONS BASED ON
 ;===>THE USERS INPUTS OF ACCEPTABLE INFUSION RATE AND DOSING INTERVAL.
 ;===>THE USER HAS THE OPPORTUNITY REPEAT THE MAX AND MIN SERUM
 ;===>CONCENTRATIONS.
 I APSKPTIN=0 D NOINFO^APSKAMN Q
 S APSKXX=-APSKK1*APSKT0 D EXP^APSKAMN6
 S APSKC4A=APSKK3*(1-APSKEE)
 S APSKXX=(-APSKK1*APSKT3) D EXP^APSKAMN6
 S APSKC4B=(APSKK1*APSKV1*(1-APSKEE))
 S APSKC4=(APSKC4A/APSKC4B)
 S APSKXX=(-APSKK1*(APSKT3-APSKT0)) D EXP^APSKAMN6
 S APSKC5=APSKC4*APSKEE
 S APSKC4=$P(100*APSKC4+.5,".",1)/100
 S APSKC4=$E(APSKC4,1,6)
 S APSKC5=$P(100*APSKC5+.5,".",1)/100
 I APSKFIN=1 D SB,FINALR Q
 W !,APSKK3," mg/hr given over ",APSKT0," hour every ",APSKT3," hours will produce:"
 W !,"    ",$J(APSKC4,3,2)," mcg per ml MAXIMUM serum concentrations"
 W !,"    ",$J(APSKC5,3,2)," mcg per ml MINIMUM serum concentrations"
 W !!
 K DIR S DIR(0)="Y",DIR("B")="YES"
 S DIR("A")="Do you want this option printed on the final worksheet "
 D ^DIR G END:$D(DIRUT)
 I Y=1 D SB
SKIP2 K DIR S DIR(0)="Y",DIR("B")="YES"
 S DIR("A")="Do you wish to change the dose or the dosing interval"
 D ^DIR G END:$D(DIRUT) S APSKQ=Y
 ;===>IF USER WISHES TO CHANGE DOSE AND INTERVAL GO TO REPEAT
 I APSKQ=1 G REPEAT
 K DIR S DIR(0)="Y" W !!
 S DIR("A")="Is the current choice your FINAL recommendation"
 D ^DIR G END:$D(DIRUT) S APSKCC=Y
 ;===>IF IT IS THE FINAL RECOMMENDATION QUIT. OTHEWISE,
 ;===>GO TO REPEAT2 AND ENTER THE RECOMMENDED DOSE AND INTERVAL
 I APSKCC=1 G FINALR
REPEAT2 ;===>USER ENTERS RECOMMENDED DOSE AND INTERVAL
 ;===>THE MAXIMUM AND MINIMUM SERUM CONCENTRATIONS ARE CALCULATED
 ;===>AND PRINTED IN THE FINAL PRINTOUT
 W !! K DIR S DIR(0)="N"
 S DIR("A")="Enter the Recommended DOSE"
 D ^DIR G END:$D(DIRUT) S APSKK3=Y W !
 K DIR S DIR(0)="N"
 S DIR("A")="Enter the Recommended INTERVAL"
 D ^DIR G END:$D(DIRUT) S APSKT3=Y
 S APSKFIN=1
 G LOOP
REPEAT ;EP
 I APSKPTIN=0 D NOINFO^APSKAMN Q
 K DIR S DIR(0)="N"
 S DIR("A")="Enter the new DOSE"
 D ^DIR G END:$D(DIRUT) S APSKK3=Y W !
 K DIR S DIR(0)="N"
 S DIR("A")="Enter the new INTERVAL"
 D ^DIR G END:$D(DIRUT) S APSKT3=Y
 ;===>CALCULATES NEW MAX AND MIN SERUM CONCENTRATIONS BASED ON USER'S
 ;===>    NEW DOSE AND INTERVAL VALUES.
 G LOOP
 ;
FINALR S %ZIS="PQ" D ^%ZIS G END:POP,QUE2:$D(IO("Q"))
 D EN2
 D ^%ZISC
 Q
QUE2 K IO("Q"),ZTSAVE
 F %="APSK*" S ZTSAVE(%)=""
 S ZTRTN="EN2^APSKAMN5",ZTDESC="POSSIBLE OPTIONS"
 D ^%ZTLOAD K ZTSK
 D ^%ZISC
 Q
EN2 S (APSKN0,APSKCNT,APSKPAGE)=0
 U IO D @("HDR"_(2-($E(IOST,1,2)="C-")))
 F  S APSKN0=$O(APSK(APSKN0)) Q:'APSKN0  D
 .S APSKND=APSK(APSKN0)
 .S APSKK3=$P(APSKND,"^",1),APSKT0=$P(APSKND,"^",2)
 .S APSKT3=$P(APSKND,"^",3),APSKC4=$P(APSKND,"^",4)
 .S APSKC5=$P(APSKND,"^",5)
 .D HDR1:$Y+5>IOSL
 .W !,APSKK3," mg/hr given over ",APSKT0," hour every ",APSKT3," hours will produce:"
 .W !,"    ",$J(APSKC4,3,2)," mcg per ml MAXIMUM serum concentrations"
 .W !,"    ",$J(APSKC5,3,2)," mcg per ml MINIMUM serum concentrations"
 .W !!
 .S APSKCNT=APSKCNT+1
 .I APSKNP=1 D APSKREM
 .D HDR:($Y+5>IOSL)&(APSKCNT>0) Q
 D ^%ZISC
 Q
HDR I $E(IOST,1,2)="C-" K DIR S DIR(0)="EO" D ^DIR G END:$D(DIRUT)
 Q:APSKCNT=APSKSS
HDR1 W @IOF
HDR2 S APSKPAGE=APSKPAGE+1
 I $D(IOST),$E(IOST,1,2)="C-",$Y+5>IOSL D HDR
 W ! F APSK=1:1:22 W "*"
 W " CONFIDENTIAL PATIENT INFORMATION "
 F APSK=1:1:22 W "*"
 W !,"Printed by: ",$P(^VA(200,DUZ,0),U),?(IOM-10),"PAGE: ",$J(APSKPAGE,3)
 W !!!,"THIS IS INTENDED TO BE ONLY A WORKSHEET. IT SHOULD BE SHREDDED WHEN YOU ARE"
 W !,"FINISHED."
 W !!!,"NAME:",?6,APSKNAME,?34,"DOSING WT:",APSKWT," KG"
 W !,"DATE OF ANALYSIS: ",APSKDATE,?34,"CHART NUMBER: ",APSKCHRT
 W !!?15,"AMINOGLYCOSIDE KINETICS WORKSHEET"
 W !?15,"---------------------------------"
 W !!,"POSSIBLE OPTIONS"
 W !,"----------------",!
 Q
SB S APSKSS=APSKSS+1
 S APSK(APSKSS)=APSKK3_"^"_APSKT0_"^"_APSKT3_"^"_APSKC4_"^"_APSKC5
 Q
APSKREM F APSKCLR=1:1:APSKCNT K APSK(APSKCLR)
END Q