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

BPCBHADM.m

Go to the documentation of this file.
BPCBHADM ; IHS/OIT/MJL - BEHAVIORAL HEALTH SPECIAL CROSSREFERENCE FOR LOADING LISTVIEW FOR ADM ;
 ;;1.5;BPC;;MAY 26, 2005
 ;
ADM ; Get EDUCATION PROTOCOLS
 ;
 I '$D(BGUDRIVR) D  Q
 .S BGUDRIVR="ADM^BPCBHADM",BGUCRFS="",BPCPIEN=BGUBEGIN
 .S BPCSDATE=BGUBEGIN,BPCEDATE=$P(BGUEND,"`",1)
 .S BPCVWNO=$P(BGUEND,"`",2),BPCLBONL=$P(BGUEND,"`",3)
 .S BPCVWOPT=$P(BGUEND,"`",4),BGUMAX=$S('BPCVWOPT:BPCVWNO,1:32000)
 .S (BGUBEGIN,BGUEND)=""
 S BPCVWOPT="2"
 D ADM1
 Q
ADM1 ;
 S:'(+BPCVWNO) BPCVWNO=10 S:BPCSDATE="" BPCSDATE="1/1/1980"
 S:BPCEDATE="" BPCEDATE="T" S:BPCVWOPT="" BPCVWOPT="0"
 S:BPCLBONL="" BPCLBONL="1"
 D DT^DILF("",BPCSDATE,.BPCSDAT)
 I BPCSDAT=-1 S BPCSDATE="1/1/1980" D DT^DILF("",BPCSDATE,.BPCSDAT)
 D DT^DILF("",BPCEDATE,.BPCEDAT)
 I BPCEDAT=-1 S BPCEDATE="T" D DT^DILF("",BPCEDATE,.BPCEDAT)
 S BPCC=0,BPCX=0,BPCLIM=$S(BPCVWOPT="0":BPCVWNO,1:999999)
 S BPCCTYPE=$O(^AMHTSET("B","ADMINISTRATIVE",""))
 ;F  S BPCX=$O(^AUPNVSIT("AA",BPCPIEN,BPCX)) Q:'BPCX  D  Q:BPCC=BPCLIM
 S BPCX=$O(^AMHREC("AD",BPCSDAT),-1) F  S BPCX=$O(^AMHREC("AD",BPCX)) Q:'BPCX  Q:BPCX>BPCEDAT  D  Q:BPCC=BPCLIM
 .S BPCVIEN=0 F  S BPCVIEN=$O(^AMHREC("AD",BPCX,BPCVIEN)) Q:'BPCVIEN  D  Q:BPCC=BPCLIM
 ..Q:$P(^AMHREC(BPCVIEN,0),U,7)'=BPCCTYPE
 ..S BPCC=BPCC+1,BGUSUB(1)=BPCVIEN,BGUV(BGUFILE,99999)=$O(^AMHRPRO("AD",BPCVIEN,0))
 ..S BGUV(BGUFILE,88888)=0 F  S BGUV(BGUFILE,88888)=$O(^AMHRPROV("AD",BPCVIEN,BGUV(BGUFILE,88888))),BGUV(BGUFILE,99999)=$O(^AMHRPRO("AD",BPCVIEN,0)) Q:BGUV(BGUFILE,88888)=""  Q:$P(^AMHRPROV(BGUV(BGUFILE,88888),0),U,4)="P"
 ..D FIELDS^BGULIST
 Q