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

PSSUTIL3.m

Go to the documentation of this file.
PSSUTIL3 ;BIR/SJA-utility routine for NDF changes ;07/09/10
 ;;1.0;PHARMACY DATA MANAGEMENT;**155**;9/30/97;Build 36
 ;
EN2 N PSSPKG
 S PSSPKG=$P($$POSDOS^PSNAPIS(PSSND),"^",3)
 D  S:PSSTOT>1 PSSTOTX=PSSTOT-1,^PSDRUG(PSSDIEN,"DOS")=PSSST_"^"_PSSUN,PSSONLYO=1,PSSBOTH=0,^PSDRUG(PSSDIEN,"DOS1",0)="^50.0903^"_$G(PSSTOTX)_"^"_$G(PSSTOTX) I '(PSSI&PSSO) G LOC^PSSUTIL
 .S PSSTOT=1 F PSSDUPD=1,2 D
 ..I PSSUPRA="NO"&(PSSDUPD=2) Q
 ..S PSSTODOS=PSSDUPD*PSSST
 ..S ^PSDRUG(PSSDIEN,"DOS1",PSSTOT,0)=PSSDUPD_"^"_PSSTODOS_"^"_PSSPKG,^PSDRUG(PSSDIEN,"DOS1","B",PSSDUPD,PSSTOT)="" S PSSTOT=PSSTOT+1
 Q
TEST ;
 K PSSNL,PSSNLF,PSSNLX
 Q:$G(PSNOUNPT)=""
 Q:$L(PSNOUNPT)'>3
 S PSSNL=$E(PSNOUNPT,($L(PSNOUNPT)-2),$L(PSNOUNPT))
 I $G(PSSNL)="(S)"!($G(PSSNL)="(s)") S PSSNLF=1 D
 .I $G(PSDUPDPT)'>1 S PSSNLX=$E(PSNOUNPT,1,($L(PSNOUNPT)-3))
 .I $G(PSDUPDPT)>1 S PSSNLX=$E(PSNOUNPT,1,($L(PSNOUNPT)-3))_$E(PSSNL,2)
 Q
SUPRA(PSSND) ; set supra flag
 N PSSDOS,PSSCD,PSSDOSC,PSSPKG
 S PSSDOS=$$POSDOS^PSNAPIS(PSSND),PSSCD=$P(PSSDOS,"^"),PSSDOSC=$P(PSSDOS,"^",2),PSSPKG=$P(PSSDOS,"^",3)
 Q $S(PSSCD="N"&(PSSDOSC="O"):"NO",(PSSCD="N")&(PSSDOSC="B"):"NB",(PSSCD="N")&(PSSDOSC="N"):"NN",1:"")
 ;
CHECK(PSSIEN) ; check if the drug meets the criteria to have Possible Dosages
 N PSSNAT,PSSNAT1,PSSNATND,PSSNATDF,PSSNATUN,PSSNATST
 D NATND
 I 'PSSNATDF!('PSSNATUN)!($G(PSSNATST)="") Q 0
 I '$D(^PS(50.606,PSSNATDF,0))!('$D(^PS(50.607,PSSNATUN,0))) Q 0
 I PSSNATST'?.N&(PSSNATST'?.N1".".N) Q 0
 I $D(^PS(50.606,"ACONI",PSSNATDF,PSSNATUN)),$O(^PS(50.606,"ADUPI",PSSNATDF,0)) Q 1
 I $D(^PS(50.606,"ACONO",PSSNATDF,PSSNATUN)),$O(^PS(50.606,"ADUPO",PSSNATDF,0)) Q 1
 Q 0
NATND S PSSNAT=+$P($G(^PSDRUG(PSSIEN,"ND")),"^",3),PSSNAT1=$P($G(^("ND")),"^")
 S PSSNATND=$$DFSU^PSNAPIS(PSSNAT1,PSSNAT)
 S PSSNATDF=$P(PSSNATND,"^"),PSSNATST=$P(PSSNATND,"^",4),PSSNATUN=$P(PSSNATND,"^",5)
 Q