IBCORC2 ;ALB/CPM - RANK INSURANCE CARRIERS (BULLETIN) ; 30-JUN-93
;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
;
BULL ; Generate a bulletin containing the report.
S XMSUB="RANKING INSURANCE CARRIERS"
S XMDUZ="INTEGRATED BILLING PACKAGE"
S XMTEXT="IBT("
S XMY($P($G(^IBE(350.9,1,4)),"^",5))=""
S XMY(DUZ)=""
;
; - set up report header
S X="Ranking Of The Top "_IBNR_" Insurance Carriers By Total Amount Billed"
S IBT(1)=$J("",80-$L(X)\2)_X
S IBT(2)=" "
S X=$$SITE^VASITE,X=$E($P(X,"^",2)_" ("_$P(X,"^",3)_")"_$J("",46),1,46)
S IBT(3)=" Facility: "_X_"Run Date: "_$$DAT1^IBOUTL(DT)
S IBT(4)="Date Range: "_$$DAT1^IBOUTL(IBABEG)_" thru "_$$DAT1^IBOUTL(IBAEND)_$J("",28)_"Page: 1 of 1"
S IBT(5)=" "
S IBT(6)=$$DASH^IBCORC1
S IBT(7)=" Rank"_$J("",14)_"Insurance Carrier"_$J("",18)_"Total Amt Billed"
S IBT(8)=$$DASH^IBCORC1
S IBT(9)=" ",IBC=9
;
; - set up report body
S (IBTAMT,IBCNT)=0,IBAMT=""
F S IBAMT=$O(^TMP("IBORIC",$J,"AMT",IBAMT)) Q:IBAMT=""!(IBCNT>IBNR) D
.S IBINS=0 F S IBINS=$O(^TMP("IBORIC",$J,"AMT",IBAMT,IBINS)) Q:'IBINS!(IBCNT>IBNR) D
..S IBCNT=IBCNT+1 Q:IBCNT>IBNR
..S IBAMTP=-IBAMT,IBTAMT=IBTAMT+IBAMTP
..S IBINS0=$G(^DIC(36,IBINS,0)),IBINSA=$G(^(.11))
..S IBC=IBC+1,IBT(IBC)=" "
..S X=IBAMTP,X2="2$",X3=15 D COMMA^%DTC
..S IBC=IBC+1,IBT(IBC)=$J(IBCNT,4)_"."_$J("",15)_$E($S($P(IBINS0,"^")]"":$P(IBINS0,"^"),1:"CARRIER UNKNOWN")_$J("",34),1,34)_X
..D INSBULL(IBINSA)
;
; - set up totals
S IBC=IBC+1,IBT(IBC)=" "
S X=IBTAMT,X2="2$",X3=15 D COMMA^%DTC
S IBC=IBC+1,IBT(IBC)="Total Amount Billed to all Ranked Carriers:"_$J("",11)_X
;
; - deliver and quit
D ^XMD
K IBAMT,IBAMTP,IBCNT,IBINS0,IBINSA,IBC,IBT,IBTAMT,X,XMSUB,XMDUZ,XMY,XMTEXT,Y
Q
;
INSBULL(X) ; Display Insurance Company name and address for bulletin.
; Input: X -- .11 node of ins company entry in file #36
S:$P(X,"^")]"" IBC=IBC+1,IBT(IBC)=$J("",20)_$P(X,"^")
S:$P(X,"^",2)]"" IBC=IBC+1,IBT(IBC)=$J("",20)_$P(X,"^",2)
S:$P(X,"^",3)]"" IBC=IBC+1,IBT(IBC)=$J("",20)_$P(X,"^",3)
S IBC=IBC+1,IBT(IBC)=$J("",20)_$P(X,"^",4)
S:$P(X,"^",4)]""&($P(X,"^",5)]"") IBT(IBC)=IBT(IBC)_", "
S IBT(IBC)=IBT(IBC)_$P($G(^DIC(5,+$P(X,"^",5),0)),"^")
S:$P(X,"^",6)]""&($P(X,"^",4)]""!($P(X,"^",5)]"")) IBT(IBC)=IBT(IBC)_" "
S IBT(IBC)=IBT(IBC)_$P(X,"^",6)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBCORC2 2339 printed Nov 22, 2024@17:28:46 Page 2
IBCORC2 ;ALB/CPM - RANK INSURANCE CARRIERS (BULLETIN) ; 30-JUN-93
+1 ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
+2 ;
BULL ; Generate a bulletin containing the report.
+1 SET XMSUB="RANKING INSURANCE CARRIERS"
+2 SET XMDUZ="INTEGRATED BILLING PACKAGE"
+3 SET XMTEXT="IBT("
+4 SET XMY($PIECE($GET(^IBE(350.9,1,4)),"^",5))=""
+5 SET XMY(DUZ)=""
+6 ;
+7 ; - set up report header
+8 SET X="Ranking Of The Top "_IBNR_" Insurance Carriers By Total Amount Billed"
+9 SET IBT(1)=$JUSTIFY("",80-$LENGTH(X)\2)_X
+10 SET IBT(2)=" "
+11 SET X=$$SITE^VASITE
SET X=$EXTRACT($PIECE(X,"^",2)_" ("_$PIECE(X,"^",3)_")"_$JUSTIFY("",46),1,46)
+12 SET IBT(3)=" Facility: "_X_"Run Date: "_$$DAT1^IBOUTL(DT)
+13 SET IBT(4)="Date Range: "_$$DAT1^IBOUTL(IBABEG)_" thru "_$$DAT1^IBOUTL(IBAEND)_$JUSTIFY("",28)_"Page: 1 of 1"
+14 SET IBT(5)=" "
+15 SET IBT(6)=$$DASH^IBCORC1
+16 SET IBT(7)=" Rank"_$JUSTIFY("",14)_"Insurance Carrier"_$JUSTIFY("",18)_"Total Amt Billed"
+17 SET IBT(8)=$$DASH^IBCORC1
+18 SET IBT(9)=" "
SET IBC=9
+19 ;
+20 ; - set up report body
+21 SET (IBTAMT,IBCNT)=0
SET IBAMT=""
+22 FOR
SET IBAMT=$ORDER(^TMP("IBORIC",$JOB,"AMT",IBAMT))
if IBAMT=""!(IBCNT>IBNR)
QUIT
Begin DoDot:1
+23 SET IBINS=0
FOR
SET IBINS=$ORDER(^TMP("IBORIC",$JOB,"AMT",IBAMT,IBINS))
if 'IBINS!(IBCNT>IBNR)
QUIT
Begin DoDot:2
+24 SET IBCNT=IBCNT+1
if IBCNT>IBNR
QUIT
+25 SET IBAMTP=-IBAMT
SET IBTAMT=IBTAMT+IBAMTP
+26 SET IBINS0=$GET(^DIC(36,IBINS,0))
SET IBINSA=$GET(^(.11))
+27 SET IBC=IBC+1
SET IBT(IBC)=" "
+28 SET X=IBAMTP
SET X2="2$"
SET X3=15
DO COMMA^%DTC
+29 SET IBC=IBC+1
SET IBT(IBC)=$JUSTIFY(IBCNT,4)_"."_$JUSTIFY("",15)_$EXTRACT($SELECT($PIECE(IBINS0,"^")]"":$PIECE(IBINS0,"^"),1:"CARRIER UNKNOWN")_$JUSTIFY("",34),1,34)_X
+30 DO INSBULL(IBINSA)
End DoDot:2
End DoDot:1
+31 ;
+32 ; - set up totals
+33 SET IBC=IBC+1
SET IBT(IBC)=" "
+34 SET X=IBTAMT
SET X2="2$"
SET X3=15
DO COMMA^%DTC
+35 SET IBC=IBC+1
SET IBT(IBC)="Total Amount Billed to all Ranked Carriers:"_$JUSTIFY("",11)_X
+36 ;
+37 ; - deliver and quit
+38 DO ^XMD
+39 KILL IBAMT,IBAMTP,IBCNT,IBINS0,IBINSA,IBC,IBT,IBTAMT,X,XMSUB,XMDUZ,XMY,XMTEXT,Y
+40 QUIT
+41 ;
INSBULL(X) ; Display Insurance Company name and address for bulletin.
+1 ; Input: X -- .11 node of ins company entry in file #36
+2 if $PIECE(X,"^")]""
SET IBC=IBC+1
SET IBT(IBC)=$JUSTIFY("",20)_$PIECE(X,"^")
+3 if $PIECE(X,"^",2)]""
SET IBC=IBC+1
SET IBT(IBC)=$JUSTIFY("",20)_$PIECE(X,"^",2)
+4 if $PIECE(X,"^",3)]""
SET IBC=IBC+1
SET IBT(IBC)=$JUSTIFY("",20)_$PIECE(X,"^",3)
+5 SET IBC=IBC+1
SET IBT(IBC)=$JUSTIFY("",20)_$PIECE(X,"^",4)
+6 if $PIECE(X,"^",4)]""&($PIECE(X,"^",5)]"")
SET IBT(IBC)=IBT(IBC)_", "
+7 SET IBT(IBC)=IBT(IBC)_$PIECE($GET(^DIC(5,+$PIECE(X,"^",5),0)),"^")
+8 if $PIECE(X,"^",6)]""&($PIECE(X,"^",4)]""!($PIECE(X,"^",5)]""))
SET IBT(IBC)=IBT(IBC)_" "
+9 SET IBT(IBC)=IBT(IBC)_$PIECE(X,"^",6)
+10 QUIT