IBY399P4 ;ALB/ARH - IB*2*399 POST-INSTALL - FTF CONVERSION ; 2/27/09
;;2.0;INTEGRATED BILLING;**399**;21-MAR-94;Build 8
;;Per VHA Directive 2004-038, this routine should not be modified.
;
Q
;
CONVF ; Convert free text Filing Time Frames to Standard Filing Time Frames
; if the free text Filing Time Frame exactly matchs a pre-defined text then it is deleted and
; the corresponding Standard Filing Time Frame and Value is added,
; both Insurance Company and Group Plan Filing Time Frames are converted, active and non-medicare only
N IBA,IBC,IBINS,IBINS0,IBFTF,IBSFTF,DIE,DIC,DA,DR,X,Y S IBC=0
;
; Insurance Company Filing Time Frame (#36,.12) converted to Standard Filing Time Frame (.18) and Value (.19)
S (IBC,IBINS)=0 F S IBINS=$O(^DIC(36,IBINS)) Q:'IBINS D
. S IBINS0=$G(^DIC(36,IBINS,0)) I '$$ACTIVE(IBINS) Q
. I +$P(IBINS0,U,18) Q
. S IBFTF=$P(IBINS0,U,12) I IBFTF="" Q
. S IBSFTF=$$STND(IBFTF) I 'IBSFTF Q
. ;
. S DR=".12////@;.18////"_+IBSFTF I +$P(IBSFTF,U,3) S DR=DR_";.19////"_+$P(IBSFTF,U,3)
. S DIE="^DIC(36,",DA=IBINS D ^DIE K DIE S IBC=IBC+1
;
S IBA=">> Insurance Companies (#36) Converted to Standard Filing Time Frames, "_IBC D MSG(IBA)
;
; Insurance Plan Filing Time Frame (#355.3,.13) converted to Standard Filing Time Frame (.16) and Value (.17)
S (IBC,IBINS)=0 F S IBINS=$O(^IBA(355.3,IBINS)) Q:'IBINS D
. S IBINS0=$G(^IBA(355.3,IBINS,0)) I '$$ACTIVE(+IBINS0,IBINS) Q
. I +$P(IBINS0,U,16) Q
. S IBFTF=$P(IBINS0,U,13) I IBFTF="" Q
. S IBSFTF=$$STND(IBFTF) I 'IBSFTF Q
. ;
. S DR=".13////@;.16////"_+IBSFTF I +$P(IBSFTF,U,3) S DR=DR_";.17////"_+$P(IBSFTF,U,3)
. S DIE="^IBA(355.3,",DA=IBINS D ^DIE K DIE S IBC=IBC+1
;
S IBA=">> Insurance Plan (#355.3) Converted to Standard Filing Time Frames, "_IBC D MSG(IBA)
;
Q
;
ACTIVE(IBINS,IBPLN) ; check if the insurance should have the Standard FTF added, active and not medicare
N IBACT,IBINS0,IBPLN0 S IBACT=1
S IBINS0=$G(^DIC(36,+$G(IBINS),0)),IBPLN0=$G(^IBA(355.3,+$G(IBPLN),0))
;
I +$P(IBINS0,U,5) S IBACT=0
I $P(IBINS0,U,1)["MEDICARE" S IBACT=0
I $G(^IBE(355.2,+$P(IBINS0,U,13),0))["MEDICARE" S IBACT=0
;
I +$P(IBPLN0,U,11) S IBACT=0
I $P($G(^IBE(355.1,+$P(IBPLN0,U,9),0)),U,3)=5 S IBACT=0
;
Q IBACT
;
;
STND(IBFTF) ; return the Standard Filing Time Frame and Value that correspond to the Free Text Filing Time Frame
; Input: Filing Time Frame Free Text
; Returns: Standard FTF pointer (#355.13) ^ Standard FTF Name ^ Standard FTF Value (from input IBFTF)
;
N IBSFTF,IBFTV,IBFTU S IBSFTF="" I '$G(IBFTF) G STNDQ
;
S IBFTF=$$UP^XLFSTR(IBFTF),IBFTV=+IBFTF,IBFTU=$P(IBFTF,IBFTV,2,999) I $E(IBFTU)=" " S IBFTU=$E(IBFTU,2,999)
;
I IBFTU="D" S IBSFTF="DAYS"_U_IBFTV G STNDQ
I IBFTU="DAYS" S IBSFTF="DAYS"_U_IBFTV G STNDQ
I IBFTU="DAYS DOS" S IBSFTF="DAYS"_U_IBFTV G STNDQ
I IBFTU="DAYS FROM DOS" S IBSFTF="DAYS"_U_IBFTV G STNDQ
;
I IBFTU="M" S IBSFTF="MONTH(S)"_U_IBFTV G STNDQ
I IBFTU="MO" S IBSFTF="MONTH(S)"_U_IBFTV G STNDQ
I IBFTU="MOS" S IBSFTF="MONTH(S)"_U_IBFTV G STNDQ
I IBFTU="MTHS" S IBSFTF="MONTH(S)"_U_IBFTV G STNDQ
I IBFTU="MONTHS" S IBSFTF="MONTH(S)"_U_IBFTV G STNDQ
I IBFTU="MO DOS" S IBSFTF="MONTH(S)"_U_IBFTV G STNDQ
I IBFTU="MOS DOS" S IBSFTF="MONTH(S)"_U_IBFTV G STNDQ
I IBFTU="MONTHS DOS" S IBSFTF="MONTH(S)"_U_IBFTV G STNDQ
I IBFTU="MOS FROM DOS" S IBSFTF="MONTH(S)"_U_IBFTV G STNDQ
I IBFTU="MONTHS FROM DOS" S IBSFTF="MONTH(S)"_U_IBFTV G STNDQ
;
I IBFTU="YR" S IBSFTF="YEAR(S)"_U_IBFTV G STNDQ
I IBFTU="YRS" S IBSFTF="YEAR(S)"_U_IBFTV G STNDQ
I IBFTU="YEAR" S IBSFTF="YEAR(S)"_U_IBFTV G STNDQ
I IBFTU="YEARS" S IBSFTF="YEAR(S)"_U_IBFTV G STNDQ
I IBFTU="YR DOS" S IBSFTF="YEAR(S)"_U_IBFTV G STNDQ
I IBFTU="YRS DOS" S IBSFTF="YEAR(S)"_U_IBFTV G STNDQ
I IBFTU="YEAR DOS" S IBSFTF="YEAR(S)"_U_IBFTV G STNDQ
I IBFTU="YEARS DOS" S IBSFTF="YEAR(S)"_U_IBFTV G STNDQ
I IBFTU="YR FROM DOS" S IBSFTF="YEAR(S)"_U_IBFTV G STNDQ
I IBFTU="YRS FROM DOS" S IBSFTF="YEAR(S)"_U_IBFTV G STNDQ
I IBFTU="YEAR FROM DOS" S IBSFTF="YEAR(S)"_U_IBFTV G STNDQ
I IBFTU="YEARS FROM DOS" S IBSFTF="YEAR(S)"_U_IBFTV G STNDQ
;
I IBFTF="3-31 FOL YR" S IBSFTF="MONTHS OF FOLLOWING YEAR^3" G STNDQ
I IBFTF="3/31 FOL YR" S IBSFTF="MONTHS OF FOLLOWING YEAR^3" G STNDQ
I IBFTF="3-31 FOLLOWING YR" S IBSFTF="MONTHS OF FOLLOWING YEAR^3" G STNDQ
I IBFTF="3/31 FOLLOWING YR" S IBSFTF="MONTHS OF FOLLOWING YEAR^3" G STNDQ
I IBFTF="3-31 FOLLOWING YEAR" S IBSFTF="MONTHS OF FOLLOWING YEAR^3" G STNDQ
I IBFTF="3/31 FOLLOWING YEAR" S IBSFTF="MONTHS OF FOLLOWING YEAR^3" G STNDQ
;
I IBFTF="12-31 FOL YR" S IBSFTF="END OF FOLLOWING YEAR" G STNDQ
I IBFTF="12/31 FOL YR" S IBSFTF="END OF FOLLOWING YEAR" G STNDQ
I IBFTF="12-31 FOLLOWING YR" S IBSFTF="END OF FOLLOWING YEAR" G STNDQ
I IBFTF="12/31 FOLLOWING YR" S IBSFTF="END OF FOLLOWING YEAR" G STNDQ
I IBFTF="12-31 FOLLOWING YEAR" S IBSFTF="END OF FOLLOWING YEAR" G STNDQ
I IBFTF="12/31 FOLLOWING YEAR" S IBSFTF="END OF FOLLOWING YEAR" G STNDQ
;
STNDQ I IBSFTF'="" S IBSFTF=$O(^IBE(355.13,"B",$P(IBSFTF,U,1),0))_U_IBSFTF
Q IBSFTF
;
MSG(IBA) ;
N IBM S IBM(1)=" ",IBM(2)=" "_$G(IBA)
D MES^XPDUTL(.IBM)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBY399P4 5218 printed Dec 13, 2024@02:34:02 Page 2
IBY399P4 ;ALB/ARH - IB*2*399 POST-INSTALL - FTF CONVERSION ; 2/27/09
+1 ;;2.0;INTEGRATED BILLING;**399**;21-MAR-94;Build 8
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;
CONVF ; Convert free text Filing Time Frames to Standard Filing Time Frames
+1 ; if the free text Filing Time Frame exactly matchs a pre-defined text then it is deleted and
+2 ; the corresponding Standard Filing Time Frame and Value is added,
+3 ; both Insurance Company and Group Plan Filing Time Frames are converted, active and non-medicare only
+4 NEW IBA,IBC,IBINS,IBINS0,IBFTF,IBSFTF,DIE,DIC,DA,DR,X,Y
SET IBC=0
+5 ;
+6 ; Insurance Company Filing Time Frame (#36,.12) converted to Standard Filing Time Frame (.18) and Value (.19)
+7 SET (IBC,IBINS)=0
FOR
SET IBINS=$ORDER(^DIC(36,IBINS))
if 'IBINS
QUIT
Begin DoDot:1
+8 SET IBINS0=$GET(^DIC(36,IBINS,0))
IF '$$ACTIVE(IBINS)
QUIT
+9 IF +$PIECE(IBINS0,U,18)
QUIT
+10 SET IBFTF=$PIECE(IBINS0,U,12)
IF IBFTF=""
QUIT
+11 SET IBSFTF=$$STND(IBFTF)
IF 'IBSFTF
QUIT
+12 ;
+13 SET DR=".12////@;.18////"_+IBSFTF
IF +$PIECE(IBSFTF,U,3)
SET DR=DR_";.19////"_+$PIECE(IBSFTF,U,3)
+14 SET DIE="^DIC(36,"
SET DA=IBINS
DO ^DIE
KILL DIE
SET IBC=IBC+1
End DoDot:1
+15 ;
+16 SET IBA=">> Insurance Companies (#36) Converted to Standard Filing Time Frames, "_IBC
DO MSG(IBA)
+17 ;
+18 ; Insurance Plan Filing Time Frame (#355.3,.13) converted to Standard Filing Time Frame (.16) and Value (.17)
+19 SET (IBC,IBINS)=0
FOR
SET IBINS=$ORDER(^IBA(355.3,IBINS))
if 'IBINS
QUIT
Begin DoDot:1
+20 SET IBINS0=$GET(^IBA(355.3,IBINS,0))
IF '$$ACTIVE(+IBINS0,IBINS)
QUIT
+21 IF +$PIECE(IBINS0,U,16)
QUIT
+22 SET IBFTF=$PIECE(IBINS0,U,13)
IF IBFTF=""
QUIT
+23 SET IBSFTF=$$STND(IBFTF)
IF 'IBSFTF
QUIT
+24 ;
+25 SET DR=".13////@;.16////"_+IBSFTF
IF +$PIECE(IBSFTF,U,3)
SET DR=DR_";.17////"_+$PIECE(IBSFTF,U,3)
+26 SET DIE="^IBA(355.3,"
SET DA=IBINS
DO ^DIE
KILL DIE
SET IBC=IBC+1
End DoDot:1
+27 ;
+28 SET IBA=">> Insurance Plan (#355.3) Converted to Standard Filing Time Frames, "_IBC
DO MSG(IBA)
+29 ;
+30 QUIT
+31 ;
ACTIVE(IBINS,IBPLN) ; check if the insurance should have the Standard FTF added, active and not medicare
+1 NEW IBACT,IBINS0,IBPLN0
SET IBACT=1
+2 SET IBINS0=$GET(^DIC(36,+$GET(IBINS),0))
SET IBPLN0=$GET(^IBA(355.3,+$GET(IBPLN),0))
+3 ;
+4 IF +$PIECE(IBINS0,U,5)
SET IBACT=0
+5 IF $PIECE(IBINS0,U,1)["MEDICARE"
SET IBACT=0
+6 IF $GET(^IBE(355.2,+$PIECE(IBINS0,U,13),0))["MEDICARE"
SET IBACT=0
+7 ;
+8 IF +$PIECE(IBPLN0,U,11)
SET IBACT=0
+9 IF $PIECE($GET(^IBE(355.1,+$PIECE(IBPLN0,U,9),0)),U,3)=5
SET IBACT=0
+10 ;
+11 QUIT IBACT
+12 ;
+13 ;
STND(IBFTF) ; return the Standard Filing Time Frame and Value that correspond to the Free Text Filing Time Frame
+1 ; Input: Filing Time Frame Free Text
+2 ; Returns: Standard FTF pointer (#355.13) ^ Standard FTF Name ^ Standard FTF Value (from input IBFTF)
+3 ;
+4 NEW IBSFTF,IBFTV,IBFTU
SET IBSFTF=""
IF '$GET(IBFTF)
GOTO STNDQ
+5 ;
+6 SET IBFTF=$$UP^XLFSTR(IBFTF)
SET IBFTV=+IBFTF
SET IBFTU=$PIECE(IBFTF,IBFTV,2,999)
IF $EXTRACT(IBFTU)=" "
SET IBFTU=$EXTRACT(IBFTU,2,999)
+7 ;
+8 IF IBFTU="D"
SET IBSFTF="DAYS"_U_IBFTV
GOTO STNDQ
+9 IF IBFTU="DAYS"
SET IBSFTF="DAYS"_U_IBFTV
GOTO STNDQ
+10 IF IBFTU="DAYS DOS"
SET IBSFTF="DAYS"_U_IBFTV
GOTO STNDQ
+11 IF IBFTU="DAYS FROM DOS"
SET IBSFTF="DAYS"_U_IBFTV
GOTO STNDQ
+12 ;
+13 IF IBFTU="M"
SET IBSFTF="MONTH(S)"_U_IBFTV
GOTO STNDQ
+14 IF IBFTU="MO"
SET IBSFTF="MONTH(S)"_U_IBFTV
GOTO STNDQ
+15 IF IBFTU="MOS"
SET IBSFTF="MONTH(S)"_U_IBFTV
GOTO STNDQ
+16 IF IBFTU="MTHS"
SET IBSFTF="MONTH(S)"_U_IBFTV
GOTO STNDQ
+17 IF IBFTU="MONTHS"
SET IBSFTF="MONTH(S)"_U_IBFTV
GOTO STNDQ
+18 IF IBFTU="MO DOS"
SET IBSFTF="MONTH(S)"_U_IBFTV
GOTO STNDQ
+19 IF IBFTU="MOS DOS"
SET IBSFTF="MONTH(S)"_U_IBFTV
GOTO STNDQ
+20 IF IBFTU="MONTHS DOS"
SET IBSFTF="MONTH(S)"_U_IBFTV
GOTO STNDQ
+21 IF IBFTU="MOS FROM DOS"
SET IBSFTF="MONTH(S)"_U_IBFTV
GOTO STNDQ
+22 IF IBFTU="MONTHS FROM DOS"
SET IBSFTF="MONTH(S)"_U_IBFTV
GOTO STNDQ
+23 ;
+24 IF IBFTU="YR"
SET IBSFTF="YEAR(S)"_U_IBFTV
GOTO STNDQ
+25 IF IBFTU="YRS"
SET IBSFTF="YEAR(S)"_U_IBFTV
GOTO STNDQ
+26 IF IBFTU="YEAR"
SET IBSFTF="YEAR(S)"_U_IBFTV
GOTO STNDQ
+27 IF IBFTU="YEARS"
SET IBSFTF="YEAR(S)"_U_IBFTV
GOTO STNDQ
+28 IF IBFTU="YR DOS"
SET IBSFTF="YEAR(S)"_U_IBFTV
GOTO STNDQ
+29 IF IBFTU="YRS DOS"
SET IBSFTF="YEAR(S)"_U_IBFTV
GOTO STNDQ
+30 IF IBFTU="YEAR DOS"
SET IBSFTF="YEAR(S)"_U_IBFTV
GOTO STNDQ
+31 IF IBFTU="YEARS DOS"
SET IBSFTF="YEAR(S)"_U_IBFTV
GOTO STNDQ
+32 IF IBFTU="YR FROM DOS"
SET IBSFTF="YEAR(S)"_U_IBFTV
GOTO STNDQ
+33 IF IBFTU="YRS FROM DOS"
SET IBSFTF="YEAR(S)"_U_IBFTV
GOTO STNDQ
+34 IF IBFTU="YEAR FROM DOS"
SET IBSFTF="YEAR(S)"_U_IBFTV
GOTO STNDQ
+35 IF IBFTU="YEARS FROM DOS"
SET IBSFTF="YEAR(S)"_U_IBFTV
GOTO STNDQ
+36 ;
+37 IF IBFTF="3-31 FOL YR"
SET IBSFTF="MONTHS OF FOLLOWING YEAR^3"
GOTO STNDQ
+38 IF IBFTF="3/31 FOL YR"
SET IBSFTF="MONTHS OF FOLLOWING YEAR^3"
GOTO STNDQ
+39 IF IBFTF="3-31 FOLLOWING YR"
SET IBSFTF="MONTHS OF FOLLOWING YEAR^3"
GOTO STNDQ
+40 IF IBFTF="3/31 FOLLOWING YR"
SET IBSFTF="MONTHS OF FOLLOWING YEAR^3"
GOTO STNDQ
+41 IF IBFTF="3-31 FOLLOWING YEAR"
SET IBSFTF="MONTHS OF FOLLOWING YEAR^3"
GOTO STNDQ
+42 IF IBFTF="3/31 FOLLOWING YEAR"
SET IBSFTF="MONTHS OF FOLLOWING YEAR^3"
GOTO STNDQ
+43 ;
+44 IF IBFTF="12-31 FOL YR"
SET IBSFTF="END OF FOLLOWING YEAR"
GOTO STNDQ
+45 IF IBFTF="12/31 FOL YR"
SET IBSFTF="END OF FOLLOWING YEAR"
GOTO STNDQ
+46 IF IBFTF="12-31 FOLLOWING YR"
SET IBSFTF="END OF FOLLOWING YEAR"
GOTO STNDQ
+47 IF IBFTF="12/31 FOLLOWING YR"
SET IBSFTF="END OF FOLLOWING YEAR"
GOTO STNDQ
+48 IF IBFTF="12-31 FOLLOWING YEAR"
SET IBSFTF="END OF FOLLOWING YEAR"
GOTO STNDQ
+49 IF IBFTF="12/31 FOLLOWING YEAR"
SET IBSFTF="END OF FOLLOWING YEAR"
GOTO STNDQ
+50 ;
STNDQ IF IBSFTF'=""
SET IBSFTF=$ORDER(^IBE(355.13,"B",$PIECE(IBSFTF,U,1),0))_U_IBSFTF
+1 QUIT IBSFTF
+2 ;
MSG(IBA) ;
+1 NEW IBM
SET IBM(1)=" "
SET IBM(2)=" "_$GET(IBA)
+2 DO MES^XPDUTL(.IBM)
+3 QUIT