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

BYIMIMM6.m

Go to the documentation of this file.
BYIMIMM6 ;IHS/CIM/THL - IMMUNIZATION DATA EXCHANGE;
 ;;2.0;BYIM IMMUNIZATION DATA EXCHANGE;**3,4,5,6,7,8,9**;JUL 11, 2017;Build 22
 ;
 W @IOF
 N PAC,PAH,VER,EXP,IMP,LOC,OUTPUT,FORMAT
 D M1
 D M2
 Q
 ;-----
M1 ;MENU DISPLAY
 D PATH
 S (PAC,PAH,VER)=""
 S PAC=+$O(^DIC(9.4,"C","BYIM",0))
 S VER=$P($G(^DIC(9.4,PAC,"VERSION")),U)
 S:VER PAH=$O(^DIC(9.4,PAC,22,"B",VER,0))
 S:PAH PAH=$O(^DIC(9.4,PAC,22,PAH,"PAH","B",99999),-1)
 S:PAH]"" VER=VER_" P "_PAH
 S VER="BYIM VERSION: "_VER
 S HL7=" HL7 VERSION: "_BYIMVER
 S LOC=$P($G(^DIC(4,$$DUZ^BYIMIMM(),0)),U)
 N X
 S X="Immunization Data Exchange"
 S EXP=$O(^DIC(19,"B","BYIM IZ AUTO EXPORT",0))
 S EXP=$O(^DIC(19.2,"B",+EXP,0))
 S EXP=$P($G(^DIC(19.2,+EXP,0)),U,2)
 I EXP S Y=EXP D DD^%DT S EXP=$P(Y,",")_"@"_$P(Y,"@",2)
 S EXP="NEXT EXP: "_$S(EXP="":"NOT SCHED",1:EXP)
 S IMP=$O(^DIC(19,"B","BYIM IZ AUTO IMPORT",0))
 S IMP=$O(^DIC(19.2,"B",+IMP,0))
 S IMP=$P($G(^DIC(19.2,+IMP,0)),U,2)
 I IMP S Y=IMP D DD^%DT S IMP=$P(Y,",")_"@"_$P(Y,"@",2)
 S IMP="NEXT IMP: "_$S(IMP="":"NOT SCHED",1:IMP)
 Q
 ;-----
ADDLOT(DFN,IVDA,LOTDA,VDATE) ;EP;TO ADD LOT NUMBER
 ;DFN     - PATIENT DFN
 ;IVDA    - IMMUNIZATION FILE IEN
 ;LOTDA   - LOT NUMBER FILE IEN
 ;VDATE   - VISIT DATE
 H 1
 N X,Y,Z
 S X=$O(^AUPNVIMM("AC",DFN,9999999999),-1)
 Q:'X
 Q:+$G(^AUPNVIMM(X,0))'=IVDA
 Q:$P($G(^AUPNVIMM(X,0)),U,5)
 S Y=+$P($G(^AUPNVIMM(X,0)),U,3)
 Q:$P($G(^AUPNVSIT(Y,0)),".")'=$P(VDATE,".")
 N DIE,DIC,DINUM,DR,DA,DD,DO,DIK,DLAYGO
 S DA=X
 S DR=".05////"_LOTDA
 S DIE="^AUPNVIMM("
 D ^DIE
 K DIE,DIC,DINUM,DR,DA,DD,DO,DIK,DLAYGO
 Q
 ;-----
M2 ;VERSION 2.0 HEADER
 N X
 S X="Immunization Data Exchange"
 W !?80-$L(X)\2,X
 W !?80-$L(LOC)\2,LOC
 W !!?7,VER,?47,EXP
 W !?7,HL7,?47,IMP
 ;PATCH 8 CR 08547 - DISPLAY CONTROLLER STATUS
 S ON=$G(^%ZIS(1,+$G(IO("HOME")),"SUBTYPE"))
 S:ON ON=$G(^%ZIS(2,ON,5))
 S RVON=$P(ON,U,4)
 S RVOFF=$P(ON,U,5)
 S BON=$P(ON,U,8)
 S BOFF=$P(ON,U,9)
 W !?2,"OUTPUT CONTROLLER: "
 I '$$VER^INHB(1) W:RVON]"" @RVON W:BON]"" @BON
 W $S($$VER^INHB(1):"RUNNING",1:"NOT RUNNING-Contact IT support")
 W @RVOFF
 W @BOFF
 W !?2,"FORMAT CONTROLLER: "
 I '$$VER^INHB(2) W:RVON]"" @RVON W:BON]"" @BON
 W $S($$VER^INHB(2):"RUNNING",1:"NOT RUNNING-Contact IT support")
 W @BOFF
 W @RVOFF
 ;PATCH 8 CR 08547 END
 Q
 ;-----
SCRN(INDA) ;EP;TO SCREEN IMM'S TO INCLUDE IN EXPORT
 ;PATCH 8 CR 08626 - INCLUDE/EXCLUDE PREVIOUSLY EXPORTED
 ;PATCH 8 CR 08695 - INCLUDE/EXCLUDE HISTORIC IMMS
 ;PATCH 8 CR 08694 - EXCLUDE IMM PRIOR TO SELECTED DATE
 K ^TMP("ADM")
 N IMM,IMM12,VIS,T,BYIMALL,BYIMADM,DDATE
 S IMM=$G(^AUPNVIMM(+INDA,0))
 S IMM12=$G(^AUPNVIMM(+INDA,12))
 S VIS=$G(^AUPNVSIT(+$P(IMM,U,3),0))
 I '+IMM!'$P(IMM,U,2)!'$P(IMM,U,3) Q 0
 S BYIMALL=$G(INDA("BYIMALL"))
 S BYIMADM=$G(INDA("BYIMADM"))
 S DDATE=$G(INDA("DDATE"))
 S T=0
 I BYIMALL=2,BYIMADM=2 S T=1
 I BYIMALL=2,BYIMADM=1,"CTNOEDXM"'[$P(VIS,U,7) S T=1
 I BYIMALL=1,BYIMADM=1,"CTNOEDXM"'[$P(VIS,U,7),'$D(^BYIMEXP("D",+INDA)) S T=1
 I BYIMALL=1,BYIMADM=2,'$D(^BYIMEXP("D",+INDA)) S T=1
 I $L(DDATE)=7,$P(IMM12,U,18)>DDATE S T=1
 I '$G(BYIMDATE) N X S X=9999999999,BYIMDATE=0 F  S X=$O(^BYIMPARA($$DUZ^BYIMIMM(),"LAST EXPORT",X),-1) Q:'X!BYIMDATE  I $P(^(X),U,2)]"" S BYIMDATE=X
 I BYIMDATE,$P($P(IMM12,U,18),".")>BYIMDATE S T=1
 I '$D(^BYIMEXP("D",+INDA)),$P(IMM,U,15)!($P($G(^AUTTIMM(+$G(^AUPNVIMM(+$G(INDA),0)),0)),U,3)=999) S ^BYIMEXP("D",+INDA)="" S T=0
 Q T
 ;PATCH 8 CR 08626 END
 ;PATCH 8 CR 08695 END
 ;PATCH 8 CR 08694 END
 ;-----
HFSA(DEST,PRI) ;EP;TO FIND HL7 MESSAGE THAT HAVEN'T BEEN EXPORTED
 Q:PRI=""!'DEST
 K ^BYIMTMP("LE")
 K ^BYIMTMP("OF")
 N X,Y,Z,XX
 S X=""
 F  S X=$O(^INLHDEST(DEST,PRI,X)) Q:X=""  D
 .S Y=0
 .F  S Y=$O(^INLHDEST(DEST,PRI,X,Y)) Q:'Y  S ^BYIMTMP("OF",Y)="" S:$G(^INTHU(Y,3,1,0))["FHS|" XX=$P(X,",")_","_($P(X,",",2)+1)
 S X=0
 ;PATCH 5 change ..."LAST EXPORT"),X... to ..."LAST EXPORT",X)...
 ;F  S X=$O(^BYIMPARA($$DUZ^BYIMIMM(),"LAST EXPORT",X)) Q:'X  I X'=DT,'$P(^(X),U,2) S ^BYIMTMP("LE",X+17000000)="",$P(^BYIMPARA($$DUZ^BYIMIMM(),"LAST EXPORT"),X,U,2)=$P(^BYIMPARA($$DUZ^BYIMIMM(),"LAST EXPORT",X),U)
 F  S X=$O(^BYIMPARA($$DUZ^BYIMIMM(),"LAST EXPORT",X)) Q:'X  I X'=DT,'$P(^(X),U,2) S ^BYIMTMP("LE",X+17000000)="",$P(^BYIMPARA($$DUZ^BYIMIMM(),"LAST EXPORT",X),U,2)=$P(^BYIMPARA($$DUZ^BYIMIMM(),"LAST EXPORT",X),U)
 ;END PATCH 5
 S:$G(BYIM("MSH3.1"))="" BYIM("MSH3.1")=$P($G(^BYIMPARA($$DUZ^BYIMIMM()),1),U,3)
 S:$G(BYIM("MSH3.1"))="" BYIM("MSH3.1")="RPMS"
 S:'$G(XX) XX=$H
 S X=0
 F  S X=$O(^INTHU(X)) Q:'X  S Z=$G(^(X,3,1,0)) I Z["VXU^V04",Z["MSH|" D
 .Q:$P($P(Z,"|",3),U)'=BYIM("MSH3.1")
 .Q:$P(Z,"|",10)=""
 .Q:$D(^BYIMTMP("OF",X))
 .Q:$D(^BYIMMM("MID",$P(Z,"|",10)))
 .S Y=$E($P(Z,"|",7),1,8)
 .Q:'$D(^BYIMTMP("LE",Y))
 .S ^BYIMMM("MID",$P(Z,"|",10))=""
 .S ^INLHDEST(DEST,PRI,XX,X)=""
 .S ^BYIMTMP("OF",X)=""
 .S $P(^BYIMTMP("NUM"),U,2)=$P($G(^BYIMTMP("NUM")),U,2)+1
 .S Y=0
 .F  S Y=$O(^INTHU(X,3,Y)) Q:'Y  S:^(Y,0)["RXA|" $P(^BYIMTMP("NUM"),U,3)=$P($G(^BYIMTMP("NUM")),U,3)+1
 K ^BYIMTMP("LE")
 K ^BYIMTMP("OF")
 Q
 ;-----
RLSH ;EP;TO DISPLAY AND EDIT RELATIONSHIP
 K BYIMQUIT
 D RUPD
 D RDISPLAY
 F  D REDIT Q:$D(BYIMQUIT)
 Q
 ;-----
RUPD ;EP;TO UPDATE IZ RELATIONSHIP FILE FROM RELATIONSHIP FILE
 N X,Y,Z,XX,YY,ZZ
 S XX=0
 F  S XX=$O(^AUTTRLSH(XX)) Q:'XX  S Y=$P(^(XX,0),U) D:'$D(^BYIMREL(XX))
 .S Z=$O(^BYIMCDC("C",Y,0))
 .S X=XX
 .K DIC,DINUM,DR,DA
 .S DINUM=X
 .S DIC="^BYIMREL("
 .S DIC(0)="L"
 .S:Z DIC("DR")=".02////"_Z
 .D FILE^DICN
 .K DIC,DINUM,DR,DA
 .Q:$D(ZTQUEUED)
 .W !,XX,?10,$P(^AUTTRLSH(XX,0),U)," added to BYIM Relationship Table."
 Q
 ;-----
RDISPLAY ;EP;TO DISPLAY BYIM/CDC RELATIONSHIP CROSS OVER
 D RDHEAD
 D PAUSE
 D RD
 N X,Y,Z,XX,YY,ZZ,JJ,BYIMPAUS
 S BYIMPAUS=""
 S JJ=0
 S XX=0
 F  S XX=$O(^BYIMREL(XX)) Q:'XX!$L(BYIMPAUS)  S Y=^(XX,0) D
 .S Z=^AUTTRLSH(XX,0)
 .S Z21=$G(^AUTTRLSH(XX,21))
 .W !,$J(XX,4)
 .W:$P(Y,U,2) ?10,$P(^BYIMCDC($P(Y,U,2),0),U)
 .W ?20,$P(Z,U),?52,$P(Z21,U,4)
 .S JJ=JJ+1
 .I JJ#15=0 D PAUSE
 Q
 ;-----
REDIT ;EP;TO EDIT RELATIONSHIP CROSS OVER
 W !!,"Select No. to Edit"
 K DIR
 S DIR(0)="NO^1:"_$O(^BYIMREL(9999999999),-1)
 S DIR("A")="LOCAL Relationship No. (or '^' to exit)"
 W !
 D ^DIR
 K DIR
 I X[U S BYIMQUIT="" Q
 Q:X=""
 S BYIMJ=X
 I '$D(^BYIMREL(BYIMJ,0)) W !!,"No. ",BYIMJ," isn't defined." H 2 Q
 W !!?10,"RPMS - RELATIONSHIP entry selected: ",$P($G(^AUTTRLSH(BYIMJ,0)),U)
 S DA=BYIMJ
 S DR=".02T"
 S DIE="^BYIMREL("
 D ^DIE
 Q
 ;
RDHEAD ;
 W @IOF
 W !!?10,"CDC HL7 Table 0063 Codes and Descriptions"
 W !!,"Code",?10,"Description"
 W !,"-------",?10,"------------------------------"
 N X,Y,Z
 S X=0
 F  S X=$O(^BYIMCDC(X)) Q:'X  S Y=^(X,0) D
 .W !,$P(Y,U),?10,$P(Y,U,2)
 Q
 ;-----
RD ;RELATIONSHIP LIST DISPLAY
 W @IOF
 W !?10,"BYIM Immunization Data Exchange"
 W !?10,"Local RELATIONSHIP entry and CDC HL7 Table 0063 Code"
 W !?10,"(NOTE: Local RELATIONSHIP without CDC HL7 code will be sent as 'OTH')"
 W !!,?10,"CDC HL7",?52,"Local HL7"
 W !,"No.",?10,"Code",?20,"Local RELATIONSHIP Description",?52,"Code"
 W !,"----",?10,"---",?20,"------------------------------",?52,"---------"
 Q
 ;-----
PATH ;EP;SET PATH
 N X,X0
 S X0=$G(^BYIMPARA($$DUZ^BYIMIMM(),0))
 S X1=$G(^BYIMPARA($$DUZ^BYIMIMM(),1))
 S X6=$G(^BYIMPARA($$DUZ^BYIMIMM(),6))
 ;PATCH 8 CR 08627 - ENSURE COMPLETE PATH WITH TERMINATING / OR \
 S OPATH=$P(X0,U,2)
 S OPATH=$$SLASH(OPATH)
 S IPATH=$P(X0,U,3)
 S IPATH=$$SLASH(IPATH)
 S QPATH=$P(X1,U)
 S QPATH=$$SLASH(QPATH)
 S RPATH=$P(X1,U,2)
 S RPATH=$$SLASH(RPATH)
 ;PATCH 8 CR 08627 END
 S BYIMEXT=$P(X0,U,8)
 S:BYIMEXT="" BYIMEXT="dat"
 S BYIMIN1=$P(X0,U,16)
 ;PATCH 8 CR 08781 - CPT CODE
 S BYIMCVX=$P(X0,U,17)
 ;PATCH 8 CR 08781 END
 S X=$P(X0,U,11)
 S Y=$P(^DD(90480,.11,0),U,3)
 S BYIMVER=$P($P(Y,X_":",2),";")
 S BYIMBDG=$P(X0,U,12)
 S BYIMQT=$P(X0,U,13)
 S BYIMMSH8=$P(X0,U,15)
 S BYIM("MSH4.1")=$P(X0,U,7)
 S BYIM("MSH3.1")=$P(X1,U,3)
 S BYIM("MSH3.2")=$P(X1,U,4)
 S BYIM("MSH3.3")=$P(X1,U,5)
 S BYIM("MSH4.2")=$P(X1,U,6)
 S BYIM("MSH4.3")=$P(X1,U,7)
 S BYIM("MSH6")=$P(X1,U,8)
 S BYIM("PD13.1")=$P(X6,U)
 S BYIM("PD13.2")=$P(X6,U,2)
 S BYIM("MSH5.1")=$P(X6,U,3)
 S BYIM("MSH5.2")=$P(X6,U,4)
 S BYIM("MSH5.3")=$P(X6,U,5)
 S BYIMHIST=$P(X6,U,6)
 S BYIMESSN=$P(X6,U,7)
 ;PATCH 8 CR 08631 - PATIENT ADDRESS TYPE
 S BYIMATYP=$P(X6,U,8)
 ;PATCH 8 CR 08631 END
 S BYIMDVOL=$P(X6,U,10)
 S ASUFAC=$P($G(^AUTTLOC($$DUZ^BYIMIMM(),0)),U,10)
 Q
 ;-----
NOPATH ;EP;NO PATH MESSAGE
 I $D(ZTQUEUED) S BYIMQUIT="" Q
 W @IOF
 W !!,"You are logged into site: ",$P($G(^AUTTLOC($$DUZ^BYIMIMM(),0)),U,2)
 W !!,"Directory path information was missing."
 W !,"Please contact your Site Manager.  There must be entries in the"
 W !!?10,"PATH FOR OUTNBOUND MESSAGES field and the"
 W !?10,"PATH FOR INBOUND MESSAGES field of the"
 W !?10,"IZ PARAMETERS file for ",$P($G(^AUTTLOC($$DUZ^BYIMIMM(),0)),U,2)
 D PAUSE
 Q
 ;-----
PAUSE ;EP;FOR PAUSE READ
 Q:$E($G(IOST),1,2)'="C-"
 W !
 K DIR
 S DIR(0)="E"
 S:'$D(DIR("A")) DIR("A")="Press <ENTER> to continue or '^' to exit..."
 D ^DIR
 K DIR
 S BYIMPAUS=X
 Q
 ;-----
SLASH(PATH) ;ENSURE PATH HAS TERMINATING SLASH
 ;PATCH 8 CR# 08627 - ENSURE COMPLETE PATH WITH TERMINATING / OR \
 S X=PATH
 Q:"/\"[$E(X,$L(X)) PATH
 S:X["/" PATH=PATH_"/"
 S:X["\" PATH=PATH_"\"
 Q PATH
 ;PATCH 8 CR# 08627 END
 ;-----
P8PREP ;SET UP FOR P8 TESTING
 I 1
 Q
 K BYIMQUIT
 N X,Y,Z,STOP
 S STOP=""
 I $$PROD^XUPROD() D  Q
 .S BYIMQUIT=1
 .W !,"This is flagged in the KERNEL SYSTEM PARMETERS as a PRODUCTION database."
 .W !,"P8 Prep cannot be run on a PRODUCTION database."
 .H 4
 S X1=DT,X2=-14
 D C^%DTC
 S X14=X
 S X=9999999999
 F  S X=$O(^AUPNVSIT("B",X),-1) Q:'X!(X<X14)!STOP  D
 .S Y=0
 .F  S Y=$O(^AUPNVSIT("B",X,Y)) Q:'Y!STOP  D
 ..S Z=$G(^AUPNVSIT(Y,0))
 ..Q:$P($G(^DPT(+$P(Z,U,5),0)),U)["DEMO,"
 ..S STOP=1
 I STOP D
 .W !!,"There appear to be non-DEMO patients with a VISIT within the past 14 days."
 .W !,"Are you absolutley certain this is NOT a PRODUCTION database?"
 .W !!,"Be absolutely certain this is NOT a PRODUCTION database before you proceed."
 .H 4
 K DIR,BYIMQUIT
 S BYIMQUIT=""
 S DIR(0)="YO"
 S DIR("A")="Are you certain you are on a TEST database"
 S DIR("B")="NO"
 W !!,"The patch 8 preparation process should ONLY be run on a TEST database."
 W !
 D ^DIR
 K DIR
 I Y'=1 S BYIMQUIT=1 Q
 S J=0
 S X=9999999999
 F  S X=$O(^AUPNVIMM(X),-1) Q:'X  D
 .S J=J+1
 .I J>199 S:'$D(^BYIMEXP("D",X)) ^BYIMEXP("D",X)="",^TMP($J,"BYIMD",X)=""
 .W:X#100=0 "S"
 .I J<200 D
 ..K ^BYIMEXP("D",X)
 ..S DAT=X
 ..S P=+$P($G(^AUPNVIMM(X,0)),U,2)
 ..W "K"
 ..M ^BIPXX(P)=^BIP(P)
 ..I X#2 S $P(^BIP(P,0),U,24)=1 W "P1"
 ..I '(X#2) S $P(^BIP(P,0),U,24)=0 W "P0"
 S DAT=$P($G(^AUPNVIMM(DAT,0)),U,3)
 S DAT=$P($G(^AUPNVSIT(DAT,0)),".")
 S DEST=+$O(^INRHD("B","HL IHS IZV04 FRAMEWORK",0))
 K ^INLHDEST(DEST),^BYIMTMP("EXP FAIL"),^BYIMTMP("DEST"),^INLHSCH("ACT",DEST)
 S X=""
 F  S Z=$O(^INLHSCH(0,X)) Q:X=""  D
 .S DA=0
 .F  S DA=$O(^INLHSCH(0,X,DA)) Q:'DA  I $G(^INTHU(DA,3,1,0))["VXU^V04" K ^INLHSCH(0,X,DA)
 S X=DAT
 F  S X=$O(^BYIMPARA($$DUZ^BYIMIMM(),"LAST EXPORT",X)) Q:'X  K ^BYIMPARA($$DUZ^BYIMIMM(),"LAST EXPORT",X)
 W !!,"Patch 8 testing prep complete."
 I $L(DAT)=7 D
 .S ^BYIMPARA($$DUZ^BYIMIMM(),"LAST EXPORT",DAT)=$H_U_$H
 .W !!,"When you use the IZDE option to create an export file,"
 .W !,"at the 'Export Immunizations given since ...: ' prompt,"
 .W !,"use ",$E(DAT,4,5),"/",$E(DAT,6,7),"/",$E(DAT,1,3)+1700," for the start date of the export."
 D PAUSE
 Q
 ;-----
NEW(DFN,BYIMALL,BYIMADM,DDDATE) ;EP;DETERMINE IF PATIENT HAS IMMS THAT HAVEN'T BEEN EXPORTED
 ;PATCH 8 CR 08626 - INCLUDE/EXCLUDE PREVIOUSLY EXPORTED
 ;PATCH 8 CR 08695 - INCLUDE/EXCLUDE HISTORIC IMMS
 ;PATCH 8 CR 08694 - EXCLUDE IMM PRIOR TO SELECTED DATE
 N INDA,Y
 S INDA("BYIMALL")=$G(BYIMALL)
 S INDA("BYIMADM")=$G(BYIMADM)
 S INDA("DDATE")=$S($G(DDDATE):DDDATE,1:$O(^BYIMPARA($$DUZ^BYIMIMM(),"LAST EXPORT",9999999999),-1))
 S Y=0
 S INDA=9999999999
 F  S INDA=$O(^AUPNVIMM("AC",DFN,INDA),-1) Q:'INDA!Y  D
 .S Y=$$SCRN^BYIMIMM6(.INDA)
 Q Y
 ;PATCH 8 CR 08626 END
 ;PATCH 8 CR 08695 END
 ;PATCH 8 CR 08694 END
 ;-----
BKGTST ;TEST BACKGROUND EXPORT
 I 1
 Q
 I $G(BYIMQUIT) K BYIMQUIT Q
 D NOW^%DTC
 S START=%
 S S1=$P(START,".")
 S S2=1_$E($P(START,".",2),1,4)
 S:$L(S2)<5 S2=S2_$E("00000",1,5-$L(S2))
 S S2=S2+10
 S:$E(S2,4,5)>59 S2=$E(S2,1,3)+1_"0"_$E(S2,5)
 S:$E(S2,2,3)>23 S1=S1+1,S2="100"_$E(S2,4,5)
 S S2=$E(S2,2,5)
 S START=S1_"."_S2
 S DIC("DR")="2////"_START
 S X=$O(^DIC(19,"B","BYIM IZ AUTO EXPORT",0))
 Q:'X
 S DIC="^DIC(19.2,"
 S DIC(0)="L"
 D FILE^DICN
 S START=1_$E($P(START,".",2),1,4)
 S:$L(START)<5 START=START_0
 S START=$E($S(START>11259:(START-1200),1:START),2,5)
 W !!,"The BYIM IZ AUTO EXPORT option will run in background shortly."
 W !,"Please check your '.../requests' folder for the new file in about 10 minutes."
 Q
 ;-----
P8PREPB ;SET BACK TO PRE-P8PREP VALUES
 S X=0
 F  S X=$O(^TMP($J,"BYIMD",X)) Q:'X  K ^BYIMEXP("D",X)
 K ^TMP($J,"BYIMD")
 S X=0
 F  S X=$O(^BIPXX(X)) Q:'X  M ^BIP(X,0)=^BIPXX(X,0) K ^BIPXX(X,0)
 Q
 ;-----