source: WorldVistAEHR/trunk/r/PHARMACY_DATA_MANAGEMENT-PSS/PSSDOSLZ.m@ 1006

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

initial load of WorldVistAEHR

File size: 1.4 KB
Line 
1PSSDOSLZ ;BIR/RTR-Dosage edit ;10/24/01
2 ;;1.0;PHARMACY DATA MANAGEMENT;**49**;9/30/97
3 ;
4 ;Reference to ^PS(50.607 supported by DBIA 2221
5 ;
6SET ;x-ref on Dispense Unit per Dose to set Dose field
7 N PSSUNIT,PSSUNITV,PSSDOSEV,PSS2,PSS1,PSS3,PSSU1,PSSUNITA,PSSUNITB,PSSUSL,PSSUST,PSSU50,PSSUSL2,PSSUSL3,PSSUSL4,PSSUSL5
8 N PSSUZ,PSSUZ1,PSSUZD
9 S PSSDOSEV=+$G(X)*+$P($G(^PSDRUG(PSSIEN,"DOS")),"^")
10 S PSSUNIT=$P($G(^PS(50.607,+$P($G(^PSDRUG(PSSIEN,"DOS")),"^",2),0)),"^")
11 S PSSUSL=0 I PSSUNIT["/" S PSSUST=$$PSJST^PSNAPIS(+$P($G(^PSDRUG(PSSIEN,"ND")),"^"),+$P($G(^PSDRUG(PSSIEN,"ND")),"^",3)) D S PSSUST=+$P($G(PSSUST),"^",2) I $G(PSSUST),$G(PSSU50),+$G(PSSUST)'=+$G(PSSU50) S PSSUSL=1
12 .S PSSU50=$P($G(^PSDRUG(PSSIEN,"DOS")),"^")
13 I PSSUNIT["/" S PSSUNITA=$P(PSSUNIT,"/"),PSSUNITB=$P(PSSUNIT,"/",2),PSS1=+$G(PSSUNITA),PSSU1=+$G(PSSUNITB)
14 I PSSUNIT["/",$G(PSSUSL) S PSSUSL2=PSSU50/PSSUST,PSSUSL3=PSSUSL2*X S PSSUSL4=PSSUSL3*$S($G(PSSU1):PSSU1,1:1) S PSSUSL5=$S('$G(PSSU1):PSSUSL4_$G(PSSUNITB),1:PSSUSL4_$P(PSSUNITB,PSSU1,2))
15 I PSSUNIT["/" S PSSUNITV=$S('$G(PSS1):PSSDOSEV,1:($G(PSS1)*PSSDOSEV))_$S($G(PSS1):$P(PSSUNITA,PSS1,2),1:PSSUNITA)_"/"_$S($G(PSSUSL):$G(PSSUSL5),'$G(PSSU1):X_PSSUNITB,1:(X*+PSSU1)_$P(PSSUNITB,PSSU1,2))
16 I PSSUNIT'["/" S PSSUNITV=PSSDOSEV_PSSUNIT
17 I $G(PSSUNITV)["/." S PSSUZD=$G(PSSUNITV) D
18 .S PSSUZ=$P(PSSUZD,"/."),PSSUZ1=$P(PSSUZD,"/.",2)
19 .S PSSUNITV=$G(PSSUZ)_"/0."_$G(PSSUZ1)
20 S X=$S($E($G(PSSUNITV),1)=".":"0",1:"")_$G(PSSUNITV)
21 Q
Note: See TracBrowser for help on using the repository browser.