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

ACDWIIF.m

Go to the documentation of this file.
ACDWIIF ;IHS/ADC/EDE/KML - SET LOC VARS FROM ACDIIF FILE;
 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
 ;***********************************************************
 ;//^ACDWDRV1, ^ACDWDRV3, ^ACDWCD1
 ;Needs ACDDA as internal DA to file entry
 ;*************************************************************
 K ACDN0,ACDPROBP,ACDP,ACDDUA,ACDDUD,ACDDTA,ACDPTA,ACDDH,ACDAAR,ACDSUS,ACDPS,ACDES,ACDSS,ACDCS,ACDBS,ACDPLAR,ACDP,ACDPLAA,ACDIF,ACDSTAT,ACDHRS
 S ACDN0=^ACDIIF(ACDDA,0)
 S ACDPROBP=$P(ACDN0,U) S:'ACDPROBP ACDPROBP="NONE" S ACDPROBP=$S($D(^ACDPROB(ACDPROBP,0)):$P(^(0),U),1:"NONE")
 ;
 S ACDP(3)=$P(ACDN0,U,3),ACDP(1)=9002170,ACDP(2)=2 S ACDCIT=$$SETS^ACDFUNC(.ACDP)
 S ACDP(3)=$P(ACDN0,U,30),ACDP(1)=9002170,ACDP(2)=30 S ACDTOB=$$SETS^ACDFUNC(.ACDP)
 S ACDDUA=$P(ACDN0,U,4)
 S ACDDUD=$P(ACDN0,U,5)
 S ACDOTHRS=$P(ACDN0,U,6) S:$G(ACDOTHRS)="" ACDOTHRS=.0001
 I $D(^ACDIIF(ACDDA,2)) F ACDAE=0:0 S ACDAE=$O(^ACDIIF(ACDDA,2,ACDAE)) Q:'ACDAE  I $D(^(ACDAE,0)) S ACDDTP=$P(^(0),U) S:'$D(^ACDDRUG(ACDDTP,0)) ACDDTP="XX" I ACDDTP'="XX" S ACDDTA($P(^ACDDRUG(ACDDTP,0),U,2)_"="_$P(^(0),U))=""
XXX ;
 I $D(^ACDIIF(ACDDA,3)) F ACDAE=0:0 S ACDAE=$O(^ACDIIF(ACDDA,3,ACDAE)) Q:'ACDAE  I $D(^(ACDAE,0)) S ACDPTP=$P(^(0),U) S:'$D(^ACDPROB(ACDPTP,0)) ACDPTP="XX" I ACDPTP'="XX" S ACDPTA($P(^ACDPROB(ACDPTP,0),U,2)_"="_$P(^(0),U))=""
 S ACDHRS=$P(ACDN0,U,6)
 S ACDDH=$P(ACDN0,U,7)
 S ACDAAR=$P(ACDN0,U,8)
 S ACDSUS=$P(ACDN0,U,10)
 S ACDPS=$P(ACDN0,U,11)
 S ACDES=$P(ACDN0,U,12)
 S ACDSS=$P(ACDN0,U,13)
 S ACDCS=$P(ACDN0,U,14)
 S ACDBS=$P(ACDN0,U,15)
 S ACDBV=$P(ACDN0,U,22)
 S Y=0 F X="ACDSUS","ACDPS","ACDES","ACDSS","ACDCS","ACDBS","ACDBV" S:@X>0 Y=Y+1
 S ACDSAVG=0
 I Y S ACDSAVG=$J(((ACDSUS+ACDPS+ACDES+ACDSS+ACDCS+ACDBS+ACDBV)/Y),3,1)
 S ACDPLAR=$P(ACDN0,U,16) S:'ACDPLAR ACDPLAR="NONE" S ACDPLAR=$S($D(^ACDCOMP(ACDPLAR,0)):$P(^(0),U),1:"NONE")
 S ACDPLAR1=$P(ACDN0,U,17)
 S ACDP(3)=$P(ACDN0,U,17),ACDP(1)=9002170,ACDP(2)=16 S ACDPLARL=$$SETS^ACDFUNC(.ACDP)
 S ACDPLAA=$P(ACDN0,U,18) S:'ACDPLAA ACDPLAA="NONE" S ACDPLAA=$S($D(^ACDCOMP(ACDPLAA,0)):$P(^(0),U),1:"NONE")
 S ACDPLAA1=$P(ACDN0,U,19)
 S ACDP(3)=$P(ACDN0,U,19),ACDP(1)=9002170,ACDP(2)=18 S ACDPLAAL=$$SETS^ACDFUNC(.ACDP)
 S ACDDIF=$P(ACDN0,U,20) S:'ACDDIF ACDDIF="NONE" S ACDDIF=$S($D(^ACDPLEX(ACDDIF,0)):$P(^(0),U),1:"NONE")
 ;
 S ACDOTDIS=$P(ACDN0,U,21) I ACDOTDIS S ACDOTDIS=$S($D(^ACDPLEX(ACDOTDIS,0)):$P(^(0),U),1:"NF")
 S ACDP(3)=$P(ACDN0,U,23),ACDP(1)=9002170,ACDP(2)=23 S ACDSTAT=$$SETS^ACDFUNC(.ACDP)
 K ACDN0,X