IBXSAH1 ; ;11/02/18
D DE G BEGIN
DE S DIE="^DGCR(399,D0,""PRV"",",DIC=DIE,DP=399.0222,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^DGCR(399,D0,"PRV",DA,""))=""
I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,1) S:%]"" DE(1)=%,DE(54)=% S %=$P(%Z,U,2) S:%]"" DE(3)=% S %=$P(%Z,U,3) S:%]"" DE(14)=% S %=$P(%Z,U,5) S:%]"" DE(29)=%,DE(41)=% S %=$P(%Z,U,6) S:%]"" DE(33)=%,DE(45)=% S %=$P(%Z,U,7) S:%]"" DE(37)=%,DE(49)=%
I S %=$P(%Z,U,12) S:%]"" DE(28)=%,DE(40)=% S %=$P(%Z,U,13) S:%]"" DE(32)=%,DE(44)=% S %=$P(%Z,U,14) S:%]"" DE(36)=%,DE(48)=% S %=$P(%Z,U,15) S:%]"" DE(10)=%
K %Z Q
;
W W !?DL+DL-2,DLB_": "
Q
O D W W Y W:$X>45 !?9
I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 K X S X("FIELD")=DIFLD,X("FILE")=DP W " ("_$$EZBLD^DIALOG(710,.X)_")" K X S X="" Q ;**
TR Q:DV["K"&(DUZ(0)'="@") R X:DTIME E S (DTOUT,X)=U W $C(7)
Q
A K DQ(DQ) S DQ=DQ+1
B G @DQ
RE G A:DV["K"&(DUZ(0)'["@"),PR:$D(DE(DQ)) D W,TR
N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
RD G QS:X?."?" I X["^" D D G ^DIE17
I X="@" D D G Z^DIE2
I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" I X?.ANP D SET^DIED I 'DDER G V
K DDER G X
P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
V D @("X"_DQ) K YS
UNIQ I DV["U",$D(X),DIFLD=.01 K % M %=@(DIE_"""B"",X)") K %(DA) K:$O(%(0)) X
Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
S X="?BAD"
QS S DZ=X D D,QQ^DIEQ G B
D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
R I DG["P",@("$D(^"_X_"0))") S X=+$P(^(0),U,2) G RP:'$D(^(Y,0)) S Y=$P(^(0),U),X=$P(^DD(X,.01,0),U,3),DG=$P(^(0),U,2) G R
I DG["V",+Y,$P(Y,";",2)["(",$D(@(U_$P(Y,";",2)_"0)")) S X=+$P(^(0),U,2) G RP:'$D(^(+Y,0)) S Y=$P(^(0),U) I $D(^DD(+X,.01,0)) S DG=$P(^(0),U,2),X=$P(^(0),U,3) G R
X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") I %]"" S Y=$S($G(DUZ("LANG"))'>1:%,'DIFLD:%,1:$$SET^DIQ(DP,DIFLD,Y))
RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
I I DV'["I",DV'["#" G RD
D E^DIE0 G RD:$D(X),PR
Q
SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
Q
NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
BEGIN S DNM="IBXSAH1",DQ=1+D G B
1 S DW="0;1",DV="MR*SX",DU="",DIFLD=.01,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C1^IBXSAH1"
S DU="1:REFERRING;2:OPERATING;3:RENDERING;4:ATTENDING;5:SUPERVISING;9:OTHER OPERATING;6:ASSISTANT SURGEON;"
G RE:'D S DQ=2 G 2
C1 G C1S:$D(DE(1))[0 K DB
S X=DE(1),DIC=DIE
K ^DGCR(399,DA(1),"PRV","B",$E(X,1,30),DA)
S X=DE(1),DIC=DIE
K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(1)=$S($D(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"") S X=$P(Y(1),U,4),X=X S DIU=X K Y S X="" X ^DD(399.0222,.01,1,2,2.4)
S X=DE(1),DIC=DIE
K ^DGCR(399,DA(1),"PRV","C",$E($$EXTERNAL^DILFD(399.0222,.01,,X),1,30),DA)
S X=DE(1),DIC=DIE
K ^DGCR(399,DA(1),"PRV","C",$$LOW^XLFSTR($E($$EXTERNAL^DILFD(399.0222,.01,,X),1,30)),DA)
C1S S X="" G:DG(DQ)=X C1F1 K DB
S X=DG(DQ),DIC=DIE
S ^DGCR(399,DA(1),"PRV","B",$E(X,1,30),DA)=""
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(0)=X S X=Y(0),X=X S X=X'=1 I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"") S X=$P(Y(1),U,4),X=X S DIU=X K Y S X="" X ^DD(399.0222,.01,1,2,1.4)
S X=DG(DQ),DIC=DIE
S ^DGCR(399,DA(1),"PRV","C",$E($$EXTERNAL^DILFD(399.0222,.01,,X),1,30),DA)=""
S X=DG(DQ),DIC=DIE
S ^DGCR(399,DA(1),"PRV","C",$$LOW^XLFSTR($E($$EXTERNAL^DILFD(399.0222,.01,,X),1,30)),DA)=""
C1F1 Q
X1 Q
2 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=2 D X2 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X2 S DIPA("RF")=X S:$D(^XUSEC("IB PROVIDER EDIT",DUZ)) DLAYGO=355.93
Q
3 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW="0;2",DV="V",DU="",DIFLD=.02,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C3^IBXSAH1"
G RE
C3 G C3S:$D(DE(3))[0 K DB
S X=DE(3),DIC=DIE
;
S X=DE(3),DIC=DIE
K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(1)=$S($D(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" X ^DD(399.0222,.02,1,2,2.4)
S X=DE(3),DIC=DIE
K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(1)=$S($D(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"") S X=$P(Y(1),U,8),X=X S DIU=X K Y S X="" X ^DD(399.0222,.02,1,3,2.4)
S X=DE(3),DIC=DIE
K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(1)=$S($D(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"") S X=$P(Y(1),U,5),X=X S DIU=X K Y S X="" X ^DD(399.0222,.02,1,4,2.4)
S X=DE(3),DIC=DIE
K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(1)=$S($D(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"") S X=$P(Y(1),U,6),X=X S DIU=X K Y S X="" X ^DD(399.0222,.02,1,5,2.4)
S X=DE(3),DIC=DIE
K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(1)=$S($D(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"") S X=$P(Y(1),U,7),X=X S DIU=X K Y S X="" X ^DD(399.0222,.02,1,6,2.4)
S X=DE(3),DIC=DIE
K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(1)=$S($D(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"") S X=$P(Y(1),U,15),X=X S DIU=X K Y S X="" X ^DD(399.0222,.02,1,7,2.4)
C3S S X="" G:DG(DQ)=X C3F1 K DB
S X=DG(DQ),DIC=DIE
X ^DD(399.0222,.02,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"") S X=$P(Y(1),U,5),X=X S DIU=X K Y S X="" X ^DD(399.0222,.02,1,1,1.4)
S X=DG(DQ),DIC=DIE
X ^DD(399.0222,.02,1,2,1.3) I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X=DIV S X=$$EXTCR^IBCEU5(X) X ^DD(399.0222,.02,1,2,1.4)
S X=DG(DQ),DIC=DIE
X ^DD(399.0222,.02,1,3,1.3) I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"") S X=$P(Y(1),U,8),X=X S DIU=X K Y S X=DIV S X=$$SPEC^IBCEU(X,$P($G(^DGCR(399,D0,"U")),U)) X ^DD(399.0222,.02,1,3,1.4)
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(1)=$S($D(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"") S X=$P(Y(1),U,15),X=X S DIU=X K Y X ^DD(399.0222,.02,1,7,1.1) X ^DD(399.0222,.02,1,7,1.4)
C3F1 Q
X3 Q
4 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=4 D X4 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X4 K DLAYGO S DIPA("PRF")=X S:X="" Y="@10398"
Q
5 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=5 D X5 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X5 N Z1 S Z1=$P($G(^DGCR(399,DA(1),"PRV",DA,0)),U,2) S DIPA("NVA_PRV")=$S(Z1["IBA(355.93":+Z1,1:0)
Q
6 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=6 D X6 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X6 S:DIPA("NVA_PRV")=0 Y="@1038"
Q
7 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=7 N DIERR X DR(99,1,9.3) S Y(101)=$S($D(^IBA(355.93,D0,0)):^(0),1:"") S X=$P(Y(101),U,1) S D0=I(0,0) S D1=I(1,0) S X=$S(D(0)>0:D(0),1:"")
S DGO="^IBXSAH6",DC="^355.93^IBA(355.93," G DIEZ^DIE0
R7 D DE G A
;
8 S DQ=9 ;@1038
9 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=9 D X9 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X9 S DIK="^DGCR(399,"_DA(1)_",""PRV"",",DIK(1)=".02" D EN1^DIK K DIK
Q
10 D:$D(DG)>9 F^DIE17,DE S DQ=10,DW="0;15",DV="P8932.1'",DU="",DIFLD=.15,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DU="USC(8932.1,"
G RE
X10 Q
11 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=11 D X11 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X11 D DISPTAX^IBCEP81($P($G(^DGCR(399,DA(1),"PRV",DA,0)),U,15),"")
Q
12 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=12 D X12 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X12 N Z S Z=$$EXPAND^IBTRE(399.0222,.08,$P($G(^DGCR(399,DA(1),"PRV",DA,0)),U,8)),DIPA("SPC")=$S(Z'="":Z,1:"UNSPECIFIED") W !," Prov Specialty On File: ",DIPA("SPC")
Q
13 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=13 D X13 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X13 S DIPA("CRD")=$$CRED^IBCEU($P(^DGCR(399,DA(1),"PRV",DA,0),U,2))
Q
14 S DW="0;3",DV="F",DU="",DIFLD=.03,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X14 K:$L(X)>3!($L(X)<1) X
I $D(X),X'?.ANP K X
Q
;
15 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=15 D X15 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X15 K DIPA("W1") S:$G(DIPA("CRD"))'=$P(^DGCR(399,DA(1),"PRV",DA,0),U,3) DIPA("W1")=1
Q
16 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=16 D X16 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X16 I $G(DIPA("W1")) D WRT1^IBCSC10H($G(DIPA("CRD")))
Q
17 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X17 K DIPA("W1")
Q
18 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X18 I '$G(DIPA("I1")) S Y="@10305"
Q
19 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X19 D PROVID^IBCEP2B(DA(1),DA,1,.DIPA) S Y=$S(DIPA("EDIT")<0:"@10382",DIPA("EDIT")=1:"@10391",DIPA("EDIT")=2:"@10371",1:"")
Q
20 S DQ=21 ;@10382
21 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=21 D X21 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X21 I '$G(DIPA("I2")) S Y="@10305"
Q
22 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=22 D X22 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X22 D PROVID^IBCEP2B(DA(1),DA,2,.DIPA) S Y=$S(DIPA("EDIT")<0:"@10383",DIPA("EDIT")=1:"@10392",DIPA("EDIT")=2:"@10372",1:"")
Q
23 S DQ=24 ;@10383
24 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=24 D X24 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X24 I '$G(DIPA("I3")) S Y="@10305"
Q
25 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X25 D PROVID^IBCEP2B(DA(1),DA,3,.DIPA) S Y=$S(DIPA("EDIT")<0:"@10305",DIPA("EDIT")=1:"@10393",DIPA("EDIT")=2:"@10373",1:"")
Q
26 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=26 D X26 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X26 S Y="@10305"
Q
27 S DQ=28 ;@10391
28 S DW="0;12",DV="*P355.97'R",DU="",DIFLD=.12,DLB="PRIM INS PERF PROV SECONDARY ID TYPE"
S DE(DW)="C28^IBXSAH1"
S DU="IBE(355.97,"
G RE
C28 G C28S:$D(DE(28))[0 K DB
S X=DE(28),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.12)
C28S S X="" G:DG(DQ)=X C28F1 K DB
S X=DG(DQ),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.12)
C28F1 Q
X28 S DIC("S")="I $$RAINS^IBCEPU(Y)!($$RAOWN^IBCEPU(Y))" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
Q
;
29 D:$D(DG)>9 F^DIE17,DE S DQ=29,DW="0;5",DV="FX",DU="",DIFLD=.05,DLB="PRIM INS PERF PROV SECONDARY ID"
S DE(DW)="C29^IBXSAH1"
G RE
C29 G C29S:$D(DE(29))[0 K DB
S X=DE(29),DIC=DIE
;
S X=DE(29),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.05)
C29S S X="" G:DG(DQ)=X C29F1 K DB
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(0)=X S X=Y(0)="SLF000" I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X="" X ^DD(399.0222,.05,1,1,1.4)
S X=DG(DQ),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.05)
C29F1 Q
X29 I $D(DA) N Z S Z=$G(^DGCR(399,DA(1),"PRV",DA,0)) S:X="/ID" X=$$RECALC^IBCEP2A(.DA,1,$P(Z,U,5)) K:$L(X)>15!'$L(X) X I $D(X),$P(Z,U,2)="",$S($$INPAT^IBCEF(DA(1),1):1,1:X'="SLF000") K X
I $D(X),X'?.ANP K X
Q
;
30 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=30 D X30 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X30 S Y="@10382"
Q
31 S DQ=32 ;@10392
32 D:$D(DG)>9 F^DIE17,DE S DQ=32,DW="0;13",DV="*P355.97'R",DU="",DIFLD=.13,DLB="SECOND INS PERF PROV SECONDARY ID TYPE"
S DE(DW)="C32^IBXSAH1"
S DU="IBE(355.97,"
G RE
C32 G C32S:$D(DE(32))[0 K DB
S X=DE(32),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.13)
C32S S X="" G:DG(DQ)=X C32F1 K DB
S X=DG(DQ),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.13)
C32F1 Q
X32 S DIC("S")="I $$RAINS^IBCEPU(Y)!($$RAOWN^IBCEPU(Y))" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
Q
;
33 D:$D(DG)>9 F^DIE17,DE S DQ=33,DW="0;6",DV="FX",DU="",DIFLD=.06,DLB="SECOND INS PERF PROV SECONDARY ID"
S DE(DW)="C33^IBXSAH1"
G RE
C33 G C33S:$D(DE(33))[0 K DB
S X=DE(33),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.06)
C33S S X="" G:DG(DQ)=X C33F1 K DB
S X=DG(DQ),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.06)
C33F1 Q
X33 I $D(DA) N Z S Z=$G(^DGCR(399,DA(1),"PRV",DA,0)) S:X="/ID" X=$$RECALC^IBCEP2A(.DA,2,$P(Z,U,6)) K:$L(X)>15!'$L(X) X I $D(X),$P(Z,U,2)="",$S($$INPAT^IBCEF(DA(1),1):1,1:X'="SLF000") K X
I $D(X),X'?.ANP K X
Q
;
34 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=34 D X34 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X34 S Y="@10383"
Q
35 S DQ=36 ;@10393
36 D:$D(DG)>9 F^DIE17,DE S DQ=36,DW="0;14",DV="*P355.97'R",DU="",DIFLD=.14,DLB="TERTIARY INS PERF PROV SECONDARY ID TYPE"
S DE(DW)="C36^IBXSAH1"
S DU="IBE(355.97,"
G RE
C36 G C36S:$D(DE(36))[0 K DB
S X=DE(36),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.14)
C36S S X="" G:DG(DQ)=X C36F1 K DB
S X=DG(DQ),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.14)
C36F1 Q
X36 S DIC("S")="I $$RAINS^IBCEPU(Y)!($$RAOWN^IBCEPU(Y))" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
Q
;
37 D:$D(DG)>9 F^DIE17,DE S DQ=37,DW="0;7",DV="FX",DU="",DIFLD=.07,DLB="TERTIARY INS PERF PROV SECONDARY ID"
S DE(DW)="C37^IBXSAH1"
G RE
C37 G C37S:$D(DE(37))[0 K DB
S X=DE(37),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.07)
C37S S X="" G:DG(DQ)=X C37F1 K DB
S X=DG(DQ),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.07)
C37F1 Q
X37 I $D(DA) N Z S Z=$G(^DGCR(399,DA(1),"PRV",DA,0)) S:X="/ID" X=$$RECALC^IBCEP2A(.DA,3,$P(Z,U,7)) K:$L(X)>15!'$L(X) X I $D(X),$P(Z,U,2)="",$S($$INPAT^IBCEF(DA(1),1):1,1:X'="SLF000") K X
I $D(X),X'?.ANP K X
Q
;
38 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=38 D X38 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X38 S Y="@10305"
Q
39 S DQ=40 ;@10371
40 D:$D(DG)>9 F^DIE17,DE S DQ=40,DW="0;12",DV="*P355.97'",DU="",DIFLD=.12,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C40^IBXSAH1"
S DU="IBE(355.97,"
S X=DIPA("PRIDT")
S Y=X
S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD:X="@",Z
C40 G C40S:$D(DE(40))[0 K DB
S X=DE(40),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.12)
C40S S X="" G:DG(DQ)=X C40F1 K DB
S X=DG(DQ),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.12)
C40F1 Q
X40 Q
41 D:$D(DG)>9 F^DIE17,DE S DQ=41,DW="0;5",DV="FX",DU="",DIFLD=.05,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C41^IBXSAH1"
S X=DIPA("PRID")
S Y=X
S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD:X="@",Z
C41 G C41S:$D(DE(41))[0 K DB
S X=DE(41),DIC=DIE
;
S X=DE(41),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.05)
C41S S X="" G:DG(DQ)=X C41F1 K DB
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(0)=X S X=Y(0)="SLF000" I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X="" X ^DD(399.0222,.05,1,1,1.4)
S X=DG(DQ),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.05)
C41F1 Q
X41 Q
42 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=42 D X42 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X42 S Y="@10382"
Q
43 S DQ=44 ;@10372
44 D:$D(DG)>9 F^DIE17,DE S DQ=44,DW="0;13",DV="*P355.97'",DU="",DIFLD=.13,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C44^IBXSAH1"
S DU="IBE(355.97,"
S X=DIPA("PRIDT")
S Y=X
S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD:X="@",Z
C44 G C44S:$D(DE(44))[0 K DB
S X=DE(44),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.13)
C44S S X="" G:DG(DQ)=X C44F1 K DB
S X=DG(DQ),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.13)
C44F1 Q
X44 Q
45 D:$D(DG)>9 F^DIE17,DE S DQ=45,DW="0;6",DV="FX",DU="",DIFLD=.06,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C45^IBXSAH1"
S X=DIPA("PRID")
S Y=X
S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD:X="@",Z
C45 G C45S:$D(DE(45))[0 K DB
S X=DE(45),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.06)
C45S S X="" G:DG(DQ)=X C45F1 K DB
S X=DG(DQ),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.06)
C45F1 Q
X45 Q
46 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=46 D X46 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X46 S Y="@10383"
Q
47 S DQ=48 ;@10373
48 D:$D(DG)>9 F^DIE17,DE S DQ=48,DW="0;14",DV="*P355.97'",DU="",DIFLD=.14,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C48^IBXSAH1"
S DU="IBE(355.97,"
S X=DIPA("PRIDT")
S Y=X
S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD:X="@",Z
C48 G C48S:$D(DE(48))[0 K DB
S X=DE(48),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.14)
C48S S X="" G:DG(DQ)=X C48F1 K DB
S X=DG(DQ),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.14)
C48F1 Q
X48 Q
49 D:$D(DG)>9 F^DIE17,DE S DQ=49,DW="0;7",DV="FX",DU="",DIFLD=.07,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C49^IBXSAH1"
S X=DIPA("PRID")
S Y=X
S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD:X="@",Z
C49 G C49S:$D(DE(49))[0 K DB
S X=DE(49),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.07)
C49S S X="" G:DG(DQ)=X C49F1 K DB
S X=DG(DQ),DIC=DIE
D ATTREND^IBCU1(DA(1),DA,.07)
C49F1 Q
X49 Q
50 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=50 D X50 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X50 S Y="@10305"
Q
51 S DQ=52 ;@10305
52 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=52 D X52 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X52 S Y="@10399"
Q
53 S DQ=54 ;@10398
54 D:$D(DG)>9 F^DIE17,DE S DQ=54,DW="0;1",DV="MR*SX",DU="",DIFLD=.01,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C54^IBXSAH1"
S DU="1:REFERRING;2:OPERATING;3:RENDERING;4:ATTENDING;5:SUPERVISING;9:OTHER OPERATING;6:ASSISTANT SURGEON;"
S Y="@"
S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD
C54 G C54S:$D(DE(54))[0 K DB
D ^IBXSAH7
C54S S X="" G:DG(DQ)=X C54F1 K DB
D ^IBXSAH8
C54F1 Q
X54 Q
55 S DQ=56 ;@10399
56 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=56 D X56 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X56 W @IOF
Q
57 G 1^DIE17
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBXSAH1 18757 printed Dec 13, 2024@02:30:59 Page 2
IBXSAH1 ; ;11/02/18
+1 DO DE
GOTO BEGIN
DE SET DIE="^DGCR(399,D0,""PRV"","
SET DIC=DIE
SET DP=399.0222
SET DL=2
SET DIEL=1
SET DU=""
KILL DG,DE,DB
if $ORDER(^DGCR(399,D0,"PRV",DA,""))=""
QUIT
+1 IF $DATA(^(0))
SET %Z=^(0)
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(1)=%
SET DE(54)=%
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(3)=%
SET %=$PIECE(%Z,U,3)
if %]""
SET DE(14)=%
SET %=$PIECE(%Z,U,5)
if %]""
SET DE(29)=%
SET DE(41)=%
SET %=$PIECE(%Z,U,6)
if %]""
SET DE(33)=%
SET DE(45)=%
SET %=$PIECE(%Z,U,7)
if %]""
SET DE(37)=%
SET DE(49)=%
+2 IF $TEST
SET %=$PIECE(%Z,U,12)
if %]""
SET DE(28)=%
SET DE(40)=%
SET %=$PIECE(%Z,U,13)
if %]""
SET DE(32)=%
SET DE(44)=%
SET %=$PIECE(%Z,U,14)
if %]""
SET DE(36)=%
SET DE(48)=%
SET %=$PIECE(%Z,U,15)
if %]""
SET DE(10)=%
+3 KILL %Z
QUIT
+4 ;
W WRITE !?DL+DL-2,DLB_": "
+1 QUIT
O DO W
WRITE Y
if $X>45
WRITE !?9
+1 IF $LENGTH(Y)>19
IF 'DV
IF DV'["I"
IF (DV["F"!(DV["K"))
GOTO RW^DIR2
+2 ;**
if Y]""
WRITE "// "
IF 'DV
IF DV["I"
IF $DATA(DE(DQ))#2
KILL X
SET X("FIELD")=DIFLD
SET X("FILE")=DP
WRITE " ("_$$EZBLD^DIALOG(710,.X)_")"
KILL X
SET X=""
QUIT
TR if DV["K"&(DUZ(0)'="@")
QUIT
READ X:DTIME
IF '$TEST
SET (DTOUT,X)=U
WRITE $CHAR(7)
+1 QUIT
A KILL DQ(DQ)
SET DQ=DQ+1
B GOTO @DQ
RE if DV["K"&(DUZ(0)'["@")
GOTO A
if $DATA(DE(DQ))
GOTO PR
DO W
DO TR
N IF X=""
if $DATA(^DD("KEY","F",DP,DIFLD))
GOTO NKEY
if DV'["R"
GOTO A
if 'DV
GOTO X
if D'>0
GOTO X
GOTO A
RD if X?."?"
GOTO QS
IF X["^"
DO D
GOTO ^DIE17
+1 IF X="@"
DO D
GOTO Z^DIE2
+2 IF X=" "
IF DV["d"
IF DV'["P"
IF $DATA(^DISV(DUZ,"DIE",DLB))
SET X=^(DLB)
IF DV'["D"
IF DV'["S"
WRITE " "_X
T if DV
GOTO M^DIE17
if DV["V"
GOTO ^DIE3
if DV'["S"
GOTO P
IF X?.ANP
DO SET^DIED
IF 'DDER
GOTO V
+1 KILL DDER
GOTO X
P IF DV["P"
SET DIC=U_DU
SET DIC(0)=$EXTRACT("EN",$DATA(DB(DQ))+1)_"M"_$EXTRACT("L",DV'["'")
if DIC(0)["L"
SET DLAYGO=+$PIECE(DV,"P",2)
if DV["*"
GOTO AST^DIED
DO NOSCR^DIED
SET X=+Y
SET DIC=DIE
if X<0
GOTO X
+1 if DV'["N"
GOTO V
DO D
IF $LENGTH($PIECE(X,"."))>24
KILL X
GOTO Z
+2 IF $PIECE(DQ(DQ),U,5)'["$"
IF X?.1"-".N.1".".N
IF $PIECE(DQ(DQ),U,5,99)["+X'=X"
SET X=+X
V DO @("X"_DQ)
KILL YS
UNIQ IF DV["U"
IF $DATA(X)
IF DIFLD=.01
KILL %
MERGE %=@(DIE_"""B"",X)")
KILL %(DA)
if $ORDER(%(0))
KILL X
Z KILL DIC("S"),DLAYGO
IF $DATA(X)
IF X'=U
if $GET(DE(DW,"INDEX"))
DO SAVEVALS
if '$$KEYCHK
GOTO UNIQFERR^DIE17
SET DG(DW)=X
if DV["d"
SET ^DISV(DUZ,"DIE",DLB)=X
GOTO A
X if '$DATA(ZTQUEUED)
WRITE $CHAR(7),"??"
IF $DATA(DB(DQ))
GOTO Z^DIE17
+1 SET X="?BAD"
QS SET DZ=X
DO D
DO QQ^DIEQ
GOTO B
D SET D=DIFLD
SET DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$PIECE($TEXT(@("X"_DQ))," ",2,99)
QUIT
Y IF '$DATA(DE(DQ))
DO O
if "@"'[X
GOTO RD
if DV'["R"&(X="@")
GOTO A
if X="@"
GOTO X
SET X=Y
GOTO N
PR SET DG=DV
SET Y=DE(DQ)
SET X=DU
IF $DATA(DQ(DQ,2))
XECUTE DQ(DQ,2)
GOTO RP
R IF DG["P"
IF @("$D(^"_X_"0))")
SET X=+$PIECE(^(0),U,2)
if '$DATA(^(Y,0))
GOTO RP
SET Y=$PIECE(^(0),U)
SET X=$PIECE(^DD(X,.01,0),U,3)
SET DG=$PIECE(^(0),U,2)
GOTO R
+1 IF DG["V"
IF +Y
IF $PIECE(Y,";",2)["("
IF $DATA(@(U_$PIECE(Y,";",2)_"0)"))
SET X=+$PIECE(^(0),U,2)
if '$DATA(^(+Y,0))
GOTO RP
SET Y=$PIECE(^(0),U)
IF $DATA(^DD(+X,.01,0))
SET DG=$PIECE(^(0),U,2)
SET X=$PIECE(^(0),U,3)
GOTO R
+2 if DG["D"
XECUTE ^DD("DD")
IF DG["S"
SET %=$PIECE($PIECE(";"_X,";"_Y_":",2),";")
IF %]""
SET Y=$SELECT($GET(DUZ("LANG"))'>1:%,'DIFLD:%,1:$$SET^DIQ(DP,DIFLD,Y))
RP DO O
IF X=""
SET X=DE(DQ)
if 'DV
GOTO A
if DC<2
GOTO A
GOTO N^DIE17
I IF DV'["I"
IF DV'["#"
GOTO RD
+1 DO E^DIE0
if $DATA(X)
GOTO RD
GOTO PR
+2 QUIT
SAVEVALS SET @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$GET(DE(DQ))
if $DATA(^("F"))[0
SET ^("F")=$GET(DE(DQ))
+1 IF $DATA(DE(DW,"4/"))
SET @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
+2 IF '$TEST
KILL @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
+3 QUIT
NKEY if '$DATA(ZTQUEUED)
WRITE "?? Required key field"
SET X="?BAD"
GOTO QS
KEYCHK() if $GET(DE(DW,"KEY"))=""
QUIT 1
QUIT @DE(DW,"KEY")
BEGIN SET DNM="IBXSAH1"
SET DQ=1+D
GOTO B
1 SET DW="0;1"
SET DV="MR*SX"
SET DU=""
SET DIFLD=.01
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C1^IBXSAH1"
+2 SET DU="1:REFERRING;2:OPERATING;3:RENDERING;4:ATTENDING;5:SUPERVISING;9:OTHER OPERATING;6:ASSISTANT SURGEON;"
+3 if 'D
GOTO RE
SET DQ=2
GOTO 2
C1 if $DATA(DE(1))[0
GOTO C1S
KILL DB
+1 SET X=DE(1)
SET DIC=DIE
+2 KILL ^DGCR(399,DA(1),"PRV","B",$EXTRACT(X,1,30),DA)
+3 SET X=DE(1)
SET DIC=DIE
+4 KILL DIV
SET DIV=X
SET D0=DA(1)
SET DIV(0)=D0
SET D1=DA
SET DIV(1)=D1
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,4)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399.0222,.01,1,2,2.4)
+5 SET X=DE(1)
SET DIC=DIE
+6 KILL ^DGCR(399,DA(1),"PRV","C",$EXTRACT($$EXTERNAL^DILFD(399.0222,.01,,X),1,30),DA)
+7 SET X=DE(1)
SET DIC=DIE
+8 KILL ^DGCR(399,DA(1),"PRV","C",$$LOW^XLFSTR($EXTRACT($$EXTERNAL^DILFD(399.0222,.01,,X),1,30)),DA)
C1S SET X=""
if DG(DQ)=X
GOTO C1F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DGCR(399,DA(1),"PRV","B",$EXTRACT(X,1,30),DA)=""
+3 SET X=DG(DQ)
SET DIC=DIE
+4 KILL DIV
SET DIV=X
SET D0=DA(1)
SET DIV(0)=D0
SET D1=DA
SET DIV(1)=D1
SET Y(0)=X
SET X=Y(0)
SET X=X
SET X=X'=1
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,4)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399.0222,.01,1,2,1.4)
+5 SET X=DG(DQ)
SET DIC=DIE
+6 SET ^DGCR(399,DA(1),"PRV","C",$EXTRACT($$EXTERNAL^DILFD(399.0222,.01,,X),1,30),DA)=""
+7 SET X=DG(DQ)
SET DIC=DIE
+8 SET ^DGCR(399,DA(1),"PRV","C",$$LOW^XLFSTR($EXTRACT($$EXTERNAL^DILFD(399.0222,.01,,X),1,30)),DA)=""
C1F1 QUIT
X1 QUIT
2 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=2
DO X2
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X2 SET DIPA("RF")=X
if $DATA(^XUSEC("IB PROVIDER EDIT",DUZ))
SET DLAYGO=355.93
+1 QUIT
3 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=3
SET DW="0;2"
SET DV="V"
SET DU=""
SET DIFLD=.02
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C3^IBXSAH1"
+2 GOTO RE
C3 if $DATA(DE(3))[0
GOTO C3S
KILL DB
+1 SET X=DE(3)
SET DIC=DIE
+2 ;
+3 SET X=DE(3)
SET DIC=DIE
+4 KILL DIV
SET DIV=X
SET D0=DA(1)
SET DIV(0)=D0
SET D1=DA
SET DIV(1)=D1
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,3)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399.0222,.02,1,2,2.4)
+5 SET X=DE(3)
SET DIC=DIE
+6 KILL DIV
SET DIV=X
SET D0=DA(1)
SET DIV(0)=D0
SET D1=DA
SET DIV(1)=D1
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,8)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399.0222,.02,1,3,2.4)
+7 SET X=DE(3)
SET DIC=DIE
+8 KILL DIV
SET DIV=X
SET D0=DA(1)
SET DIV(0)=D0
SET D1=DA
SET DIV(1)=D1
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,5)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399.0222,.02,1,4,2.4)
+9 SET X=DE(3)
SET DIC=DIE
+10 KILL DIV
SET DIV=X
SET D0=DA(1)
SET DIV(0)=D0
SET D1=DA
SET DIV(1)=D1
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,6)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399.0222,.02,1,5,2.4)
+11 SET X=DE(3)
SET DIC=DIE
+12 KILL DIV
SET DIV=X
SET D0=DA(1)
SET DIV(0)=D0
SET D1=DA
SET DIV(1)=D1
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,7)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399.0222,.02,1,6,2.4)
+13 SET X=DE(3)
SET DIC=DIE
+14 KILL DIV
SET DIV=X
SET D0=DA(1)
SET DIV(0)=D0
SET D1=DA
SET DIV(1)=D1
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,15)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399.0222,.02,1,7,2.4)
C3S SET X=""
if DG(DQ)=X
GOTO C3F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE ^DD(399.0222,.02,1,1,1.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,5)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399.0222,.02,1,1,1.4)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 XECUTE ^DD(399.0222,.02,1,2,1.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,3)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=$$EXTCR^IBCEU5(X)
XECUTE ^DD(399.0222,.02,1,2,1.4)
+5 SET X=DG(DQ)
SET DIC=DIE
+6 XECUTE ^DD(399.0222,.02,1,3,1.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,8)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=$$SPEC^IBCEU(X,$PIECE($GET(^DGCR(399,D0,"U")),U))
XECUTE ^DD(399.0222,.02,1,3,1.4)
+7 SET X=DG(DQ)
SET DIC=DIE
+8 ;
+9 SET X=DG(DQ)
SET DIC=DIE
+10 ;
+11 SET X=DG(DQ)
SET DIC=DIE
+12 ;
+13 SET X=DG(DQ)
SET DIC=DIE
+14 KILL DIV
SET DIV=X
SET D0=DA(1)
SET DIV(0)=D0
SET D1=DA
SET DIV(1)=D1
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,15)
SET X=X
SET DIU=X
KILL Y
XECUTE ^DD(399.0222,.02,1,7,1.1)
XECUTE ^DD(399.0222,.02,1,7,1.4)
C3F1 QUIT
X3 QUIT
4 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=4
DO X4
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X4 KILL DLAYGO
SET DIPA("PRF")=X
if X=""
SET Y="@10398"
+1 QUIT
5 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=5
DO X5
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X5 NEW Z1
SET Z1=$PIECE($GET(^DGCR(399,DA(1),"PRV",DA,0)),U,2)
SET DIPA("NVA_PRV")=$SELECT(Z1["IBA(355.93":+Z1,1:0)
+1 QUIT
6 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=6
DO X6
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X6 if DIPA("NVA_PRV")=0
SET Y="@1038"
+1 QUIT
7 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=7
NEW DIERR
XECUTE DR(99,1,9.3)
SET Y(101)=$SELECT($DATA(^IBA(355.93,D0,0)):^(0),1:"")
SET X=$PIECE(Y(101),U,1)
SET D0=I(0,0)
SET D1=I(1,0)
SET X=$SELECT(D(0)>0:D(0),1:"")
+1 SET DGO="^IBXSAH6"
SET DC="^355.93^IBA(355.93,"
GOTO DIEZ^DIE0
R7 DO DE
GOTO A
+1 ;
8 ;@1038
SET DQ=9
9 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=9
DO X9
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X9 SET DIK="^DGCR(399,"_DA(1)_",""PRV"","
SET DIK(1)=".02"
DO EN1^DIK
KILL DIK
+1 QUIT
10 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=10
SET DW="0;15"
SET DV="P8932.1'"
SET DU=""
SET DIFLD=.15
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DU="USC(8932.1,"
+2 GOTO RE
X10 QUIT
11 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=11
DO X11
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X11 DO DISPTAX^IBCEP81($PIECE($GET(^DGCR(399,DA(1),"PRV",DA,0)),U,15),"")
+1 QUIT
12 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=12
DO X12
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X12 NEW Z
SET Z=$$EXPAND^IBTRE(399.0222,.08,$PIECE($GET(^DGCR(399,DA(1),"PRV",DA,0)),U,8))
SET DIPA("SPC")=$SELECT(Z'="":Z,1:"UNSPECIFIED")
WRITE !," Prov Specialty On File: ",DIPA("SPC")
+1 QUIT
13 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=13
DO X13
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X13 SET DIPA("CRD")=$$CRED^IBCEU($PIECE(^DGCR(399,DA(1),"PRV",DA,0),U,2))
+1 QUIT
14 SET DW="0;3"
SET DV="F"
SET DU=""
SET DIFLD=.03
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X14 if $LENGTH(X)>3!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
15 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=15
DO X15
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X15 KILL DIPA("W1")
if $GET(DIPA("CRD"))'=$PIECE(^DGCR(399,DA(1),"PRV",DA,0),U,3)
SET DIPA("W1")=1
+1 QUIT
16 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=16
DO X16
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X16 IF $GET(DIPA("W1"))
DO WRT1^IBCSC10H($GET(DIPA("CRD")))
+1 QUIT
17 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=17
DO X17
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X17 KILL DIPA("W1")
+1 QUIT
18 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=18
DO X18
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X18 IF '$GET(DIPA("I1"))
SET Y="@10305"
+1 QUIT
19 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=19
DO X19
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X19 DO PROVID^IBCEP2B(DA(1),DA,1,.DIPA)
SET Y=$SELECT(DIPA("EDIT")<0:"@10382",DIPA("EDIT")=1:"@10391",DIPA("EDIT")=2:"@10371",1:"")
+1 QUIT
20 ;@10382
SET DQ=21
21 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=21
DO X21
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X21 IF '$GET(DIPA("I2"))
SET Y="@10305"
+1 QUIT
22 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=22
DO X22
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X22 DO PROVID^IBCEP2B(DA(1),DA,2,.DIPA)
SET Y=$SELECT(DIPA("EDIT")<0:"@10383",DIPA("EDIT")=1:"@10392",DIPA("EDIT")=2:"@10372",1:"")
+1 QUIT
23 ;@10383
SET DQ=24
24 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=24
DO X24
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X24 IF '$GET(DIPA("I3"))
SET Y="@10305"
+1 QUIT
25 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=25
DO X25
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X25 DO PROVID^IBCEP2B(DA(1),DA,3,.DIPA)
SET Y=$SELECT(DIPA("EDIT")<0:"@10305",DIPA("EDIT")=1:"@10393",DIPA("EDIT")=2:"@10373",1:"")
+1 QUIT
26 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=26
DO X26
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X26 SET Y="@10305"
+1 QUIT
27 ;@10391
SET DQ=28
28 SET DW="0;12"
SET DV="*P355.97'R"
SET DU=""
SET DIFLD=.12
SET DLB="PRIM INS PERF PROV SECONDARY ID TYPE"
+1 SET DE(DW)="C28^IBXSAH1"
+2 SET DU="IBE(355.97,"
+3 GOTO RE
C28 if $DATA(DE(28))[0
GOTO C28S
KILL DB
+1 SET X=DE(28)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.12)
C28S SET X=""
if DG(DQ)=X
GOTO C28F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.12)
C28F1 QUIT
X28 SET DIC("S")="I $$RAINS^IBCEPU(Y)!($$RAOWN^IBCEPU(Y))"
DO ^DIC
KILL DIC
SET DIC=DIE
SET X=+Y
if Y<0
KILL X
+1 QUIT
+2 ;
29 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=29
SET DW="0;5"
SET DV="FX"
SET DU=""
SET DIFLD=.05
SET DLB="PRIM INS PERF PROV SECONDARY ID"
+1 SET DE(DW)="C29^IBXSAH1"
+2 GOTO RE
C29 if $DATA(DE(29))[0
GOTO C29S
KILL DB
+1 SET X=DE(29)
SET DIC=DIE
+2 ;
+3 SET X=DE(29)
SET DIC=DIE
+4 DO ATTREND^IBCU1(DA(1),DA,.05)
C29S SET X=""
if DG(DQ)=X
GOTO C29F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 KILL DIV
SET DIV=X
SET D0=DA(1)
SET DIV(0)=D0
SET D1=DA
SET DIV(1)=D1
SET Y(0)=X
SET X=Y(0)="SLF000"
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,2)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399.0222,.05,1,1,1.4)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 DO ATTREND^IBCU1(DA(1),DA,.05)
C29F1 QUIT
X29 IF $DATA(DA)
NEW Z
SET Z=$GET(^DGCR(399,DA(1),"PRV",DA,0))
if X="/ID"
SET X=$$RECALC^IBCEP2A(.DA,1,$PIECE(Z,U,5))
if $LENGTH(X)>15!'$LENGTH(X)
KILL X
IF $DATA(X)
IF $PIECE(Z,U,2)=""
IF $SELECT($$INPAT^IBCEF(DA(1),1):1,1:X'="SLF000")
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
30 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=30
DO X30
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X30 SET Y="@10382"
+1 QUIT
31 ;@10392
SET DQ=32
32 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=32
SET DW="0;13"
SET DV="*P355.97'R"
SET DU=""
SET DIFLD=.13
SET DLB="SECOND INS PERF PROV SECONDARY ID TYPE"
+1 SET DE(DW)="C32^IBXSAH1"
+2 SET DU="IBE(355.97,"
+3 GOTO RE
C32 if $DATA(DE(32))[0
GOTO C32S
KILL DB
+1 SET X=DE(32)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.13)
C32S SET X=""
if DG(DQ)=X
GOTO C32F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.13)
C32F1 QUIT
X32 SET DIC("S")="I $$RAINS^IBCEPU(Y)!($$RAOWN^IBCEPU(Y))"
DO ^DIC
KILL DIC
SET DIC=DIE
SET X=+Y
if Y<0
KILL X
+1 QUIT
+2 ;
33 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=33
SET DW="0;6"
SET DV="FX"
SET DU=""
SET DIFLD=.06
SET DLB="SECOND INS PERF PROV SECONDARY ID"
+1 SET DE(DW)="C33^IBXSAH1"
+2 GOTO RE
C33 if $DATA(DE(33))[0
GOTO C33S
KILL DB
+1 SET X=DE(33)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.06)
C33S SET X=""
if DG(DQ)=X
GOTO C33F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.06)
C33F1 QUIT
X33 IF $DATA(DA)
NEW Z
SET Z=$GET(^DGCR(399,DA(1),"PRV",DA,0))
if X="/ID"
SET X=$$RECALC^IBCEP2A(.DA,2,$PIECE(Z,U,6))
if $LENGTH(X)>15!'$LENGTH(X)
KILL X
IF $DATA(X)
IF $PIECE(Z,U,2)=""
IF $SELECT($$INPAT^IBCEF(DA(1),1):1,1:X'="SLF000")
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
34 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=34
DO X34
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X34 SET Y="@10383"
+1 QUIT
35 ;@10393
SET DQ=36
36 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=36
SET DW="0;14"
SET DV="*P355.97'R"
SET DU=""
SET DIFLD=.14
SET DLB="TERTIARY INS PERF PROV SECONDARY ID TYPE"
+1 SET DE(DW)="C36^IBXSAH1"
+2 SET DU="IBE(355.97,"
+3 GOTO RE
C36 if $DATA(DE(36))[0
GOTO C36S
KILL DB
+1 SET X=DE(36)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.14)
C36S SET X=""
if DG(DQ)=X
GOTO C36F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.14)
C36F1 QUIT
X36 SET DIC("S")="I $$RAINS^IBCEPU(Y)!($$RAOWN^IBCEPU(Y))"
DO ^DIC
KILL DIC
SET DIC=DIE
SET X=+Y
if Y<0
KILL X
+1 QUIT
+2 ;
37 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=37
SET DW="0;7"
SET DV="FX"
SET DU=""
SET DIFLD=.07
SET DLB="TERTIARY INS PERF PROV SECONDARY ID"
+1 SET DE(DW)="C37^IBXSAH1"
+2 GOTO RE
C37 if $DATA(DE(37))[0
GOTO C37S
KILL DB
+1 SET X=DE(37)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.07)
C37S SET X=""
if DG(DQ)=X
GOTO C37F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.07)
C37F1 QUIT
X37 IF $DATA(DA)
NEW Z
SET Z=$GET(^DGCR(399,DA(1),"PRV",DA,0))
if X="/ID"
SET X=$$RECALC^IBCEP2A(.DA,3,$PIECE(Z,U,7))
if $LENGTH(X)>15!'$LENGTH(X)
KILL X
IF $DATA(X)
IF $PIECE(Z,U,2)=""
IF $SELECT($$INPAT^IBCEF(DA(1),1):1,1:X'="SLF000")
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
38 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=38
DO X38
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X38 SET Y="@10305"
+1 QUIT
39 ;@10371
SET DQ=40
40 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=40
SET DW="0;12"
SET DV="*P355.97'"
SET DU=""
SET DIFLD=.12
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C40^IBXSAH1"
+2 SET DU="IBE(355.97,"
+3 SET X=DIPA("PRIDT")
+4 SET Y=X
+5 SET X=Y
SET DB(DQ)=1
SET DE(DW,"4/")=""
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+6 if X="@"
GOTO RD
GOTO Z
C40 if $DATA(DE(40))[0
GOTO C40S
KILL DB
+1 SET X=DE(40)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.12)
C40S SET X=""
if DG(DQ)=X
GOTO C40F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.12)
C40F1 QUIT
X40 QUIT
41 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=41
SET DW="0;5"
SET DV="FX"
SET DU=""
SET DIFLD=.05
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C41^IBXSAH1"
+2 SET X=DIPA("PRID")
+3 SET Y=X
+4 SET X=Y
SET DB(DQ)=1
SET DE(DW,"4/")=""
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+5 if X="@"
GOTO RD
GOTO Z
C41 if $DATA(DE(41))[0
GOTO C41S
KILL DB
+1 SET X=DE(41)
SET DIC=DIE
+2 ;
+3 SET X=DE(41)
SET DIC=DIE
+4 DO ATTREND^IBCU1(DA(1),DA,.05)
C41S SET X=""
if DG(DQ)=X
GOTO C41F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 KILL DIV
SET DIV=X
SET D0=DA(1)
SET DIV(0)=D0
SET D1=DA
SET DIV(1)=D1
SET Y(0)=X
SET X=Y(0)="SLF000"
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"PRV",D1,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,2)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399.0222,.05,1,1,1.4)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 DO ATTREND^IBCU1(DA(1),DA,.05)
C41F1 QUIT
X41 QUIT
42 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=42
DO X42
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X42 SET Y="@10382"
+1 QUIT
43 ;@10372
SET DQ=44
44 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=44
SET DW="0;13"
SET DV="*P355.97'"
SET DU=""
SET DIFLD=.13
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C44^IBXSAH1"
+2 SET DU="IBE(355.97,"
+3 SET X=DIPA("PRIDT")
+4 SET Y=X
+5 SET X=Y
SET DB(DQ)=1
SET DE(DW,"4/")=""
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+6 if X="@"
GOTO RD
GOTO Z
C44 if $DATA(DE(44))[0
GOTO C44S
KILL DB
+1 SET X=DE(44)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.13)
C44S SET X=""
if DG(DQ)=X
GOTO C44F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.13)
C44F1 QUIT
X44 QUIT
45 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=45
SET DW="0;6"
SET DV="FX"
SET DU=""
SET DIFLD=.06
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C45^IBXSAH1"
+2 SET X=DIPA("PRID")
+3 SET Y=X
+4 SET X=Y
SET DB(DQ)=1
SET DE(DW,"4/")=""
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+5 if X="@"
GOTO RD
GOTO Z
C45 if $DATA(DE(45))[0
GOTO C45S
KILL DB
+1 SET X=DE(45)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.06)
C45S SET X=""
if DG(DQ)=X
GOTO C45F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.06)
C45F1 QUIT
X45 QUIT
46 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=46
DO X46
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X46 SET Y="@10383"
+1 QUIT
47 ;@10373
SET DQ=48
48 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=48
SET DW="0;14"
SET DV="*P355.97'"
SET DU=""
SET DIFLD=.14
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C48^IBXSAH1"
+2 SET DU="IBE(355.97,"
+3 SET X=DIPA("PRIDT")
+4 SET Y=X
+5 SET X=Y
SET DB(DQ)=1
SET DE(DW,"4/")=""
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+6 if X="@"
GOTO RD
GOTO Z
C48 if $DATA(DE(48))[0
GOTO C48S
KILL DB
+1 SET X=DE(48)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.14)
C48S SET X=""
if DG(DQ)=X
GOTO C48F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.14)
C48F1 QUIT
X48 QUIT
49 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=49
SET DW="0;7"
SET DV="FX"
SET DU=""
SET DIFLD=.07
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C49^IBXSAH1"
+2 SET X=DIPA("PRID")
+3 SET Y=X
+4 SET X=Y
SET DB(DQ)=1
SET DE(DW,"4/")=""
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+5 if X="@"
GOTO RD
GOTO Z
C49 if $DATA(DE(49))[0
GOTO C49S
KILL DB
+1 SET X=DE(49)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.07)
C49S SET X=""
if DG(DQ)=X
GOTO C49F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 DO ATTREND^IBCU1(DA(1),DA,.07)
C49F1 QUIT
X49 QUIT
50 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=50
DO X50
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X50 SET Y="@10305"
+1 QUIT
51 ;@10305
SET DQ=52
52 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=52
DO X52
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X52 SET Y="@10399"
+1 QUIT
53 ;@10398
SET DQ=54
54 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=54
SET DW="0;1"
SET DV="MR*SX"
SET DU=""
SET DIFLD=.01
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C54^IBXSAH1"
+2 SET DU="1:REFERRING;2:OPERATING;3:RENDERING;4:ATTENDING;5:SUPERVISING;9:OTHER OPERATING;6:ASSISTANT SURGEON;"
+3 SET Y="@"
+4 SET X=Y
SET DB(DQ)=1
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+5 GOTO RD
C54 if $DATA(DE(54))[0
GOTO C54S
KILL DB
+1 DO ^IBXSAH7
C54S SET X=""
if DG(DQ)=X
GOTO C54F1
KILL DB
+1 DO ^IBXSAH8
C54F1 QUIT
X54 QUIT
55 ;@10399
SET DQ=56
56 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=56
DO X56
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X56 WRITE @IOF
+1 QUIT
57 GOTO 1^DIE17