IBCONS4 ;ALB/ARH - NSC W/INSURANCE OUTPUT (SETUP) ; 12-23-96
;;Version 2.0 ; INTEGRATED BILLING ;**66**; 21-MAR-94
;
RPT N DIR,X,Y,DIRUT,DTOUT,DUOUT,IBX,IBY,IBI S (IBPRTRDS,IBPRTIEX,IBPRTICR,IBPRTIPC,IBPRTIGC)=0
S (IBSELUBL,IBSELBNA,IBSELBIL,IBSELRNB,IBSELCDV,IBSELTRM,IBSELRNG)=0
;
W !!,?5,"Enter Report to print:"
W !,?10,"1 - Unbilled Episodes"
W !,?10,"2 - Billed Episodes but Not Authorized"
W !,?10,"3 - Billed Episodes (Authorized)",!
;
S DIR(0)="LO^1:3:0"
S DIR("A")="Report",DIR("B")="1",DIR("??")="^D RHELP1^IBCONS4" D ^DIR K DIR I +Y'>0 S IBQUIT=1 G EXIT
;
S IBY=Y F IBI=1:1 S Y=$P(IBY,",",IBI) Q:'Y D
. ;
. I Y=1 S IBSELUBL=1 ; unbilled episodes
. I Y=2 S IBSELBNA=1 ; billed but not authorized
. I Y=3 S IBSELBIL=1 ; billed episodes (authorized)
;
W !!,?5,"Optional format requirements:"
W !,?10,"1 - Include Episodes with a Reason Not Billable"
W !,?10,"2 - Include Only Episodes with a Reason Not Billable"
W !,?10,"3 - Combine Divisions into one Report"
W !,?10,"4 - Sort by Terminal Digit"
W !,?10,"5 - Select Sort Range"
W !!,?5,"Optional print fields:"
W !,?10,"6 - Patient's Rated Disabilities"
W !,?10,"7 - Patient Insurance Dates"
W !,?10,"8 - Coverage and Riders"
W !,?10,"9 - Policy Comments"
W !,?10,"10 - Group Comments",!
;
S DIR(0)="LO^1:10:0"
S DIR("A")="Optional requirements",DIR("??")="^D RHELP2^IBCONS4" D ^DIR I $D(DTOUT)!$D(DUOUT) S IBQUIT=1 G EXIT
;
S IBY=Y F IBI=1:1 S Y=$P(IBY,",",IBI) Q:'Y D
. ;
. I Y=1 S IBSELRNB=1 ; include episodes with a RNB
. I Y=2 S IBSELRNB=2 ; include episodes with a RNB only
. I Y=3 S IBSELCDV=1 ; combine divisions
. I Y=4 S IBSELTRM=1 ; sort by terminal digit
. I Y=5 S IBSELRNG=1 ; select range of patients (PT name or TD)
. I Y=6 S IBPRTRDS=1 ; patient's rated disabilities
. I Y=7 S IBPRTIEX=1 ; patient insurance dates and group #
. I Y=8 S IBPRTICR=1 ; coverage limits and riders
. I Y=9 S IBPRTIPC=1 ; patient policy comments
. I Y=10 S IBPRTIGC=1 ; group plan comments
;
I $G(IBSELRNG)=1 W ! D SRTRNG I '$D(IBSELSR1)!'$D(IBSELSR2) S IBQUIT=1 G EXIT
W ! D DATE I ($G(IBBEG)'?7N)!($G(IBEND)'?7N) S IBQUIT=1 G EXIT
D ASKDIV
EXIT Q
;
SRTRNG ; get which data item to range on: Patient Name or Terminal Digit
N DIR,X,Y,DIRUT,DUOUT,DTOUT S IBSELRNG=0 K IBSELSR1,IBSELSR2
S DIR("A")="Select Range of Patients By",DIR(0)="SO^1:Patient Name;2:Terminal Digit;3:Insurance Company" D ^DIR
I +Y=1 S IBSELRNG=+Y D SRTRNGP
I +Y=2 S IBSELRNG=+Y D SRTRNGT
I +Y=3 S IBSELRNG=+Y D SRTRNGI
Q
;
SRTRNGP ; select patient name range for sort
N DIR,X,Y,DIRUT,DUOUT,DTOUT K IBSELSR1,IBSELSR2
S DIR(0)="FO"
S DIR("B")="FIRST",DIR("A")="START WITH PATIENT NAME" D ^DIR Q:$D(DIRUT) S:Y="FIRST" Y="" S IBSELSR1=$$ASCII^IBCONS2(Y)
;
S DIR("B")="LAST",DIR("A")="GO TO PATIENT NAME" D ^DIR Q:$D(DIRUT) S:Y="LAST" Y="" S IBSELSR2=$$ASCII^IBCONS2(Y)
Q
;
SRTRNGT ; select terminal digit range for sort
N DIR,X,Y,DIRUT,DUOUT,DTOUT K IBSELSR1,IBSELSR2
S DIR(0)="FO^1:9^K:X'?1.9N X",DIR("?")="Enter up to 9 digits of the Terminal Digit to include in report"
;
S DIR("B")="0000",DIR("A")="START WITH TERMINAL DIGIT" D ^DIR Q:$D(DIRUT) S IBSELSR1=$E((Y_"000000000"),1,9)
;
S DIR("B")=9999,DIR("A")="GO TO TERMINAL DIGIT" D ^DIR Q:$D(DIRUT) S IBSELSR2=$E((Y_"999999999"),1,9)
Q
;
SRTRNGI ; select insurance company name range for sort
N DIR,X,Y,DIRUT,DUOUT,DTOUT K IBSELSR1,IBSELSR2
S DIR(0)="FO"
S DIR("B")="FIRST",DIR("A")="START WITH INSURANCE COMPANY NAME" D ^DIR Q:$D(DIRUT) S:Y="FIRST" Y="" S IBSELSR1=$$ASCII^IBCONS2(Y)
;
S DIR("B")="LAST",DIR("A")="GO TO INSURANCE COMPANY NAME" D ^DIR Q:$D(DIRUT) S:Y="LAST" Y="" S IBSELSR2=$$ASCII^IBCONS2(Y)
Q
;
DATE ; Issue prompts for Begin and End dates
N %DT,Y,X K IBBEG,IBEND
S %DT="AEPX",%DT("A")="Start with DATE: " D ^%DT Q:Y<0 S IBBEG=+Y\1
S %DT="AEPX",%DT("A")="Go to DATE: ",%DT(0)=+Y D ^%DT Q:Y<0 S IBEND=+Y\1
Q
;
ASKDIV ; Issue prompt for Division (ALL: VAUTD=1, SELECT: VAUTD=0, VAUTD(DV)=DV NAME, ELSE: Y=-1)
D PSDR^IBODIV I Y<0 S IBQUIT=1
Q
;
RHELP1 ; help for report question
W !,"------------------------------------------------------------------------------"
W !,"Determines what types of episodes are included on the report.",!
W !,"Required: specify if report should include billed and/or unbilled episodes"
W !!,?3,"1 - Unbilled: no Third Party bill can be identified for episode"
W !,?3,"2 - Billed/Not Authorized: one or more Third Party bills exists for the",!,?30,"episode, but at least one of them has not yet been",!,?30,"authorized or passed to AR"
W !,?3,"3 - Billed/Authorized: one or more Third Party bills exists for the",!,?30,"episode and all of them have been Authorized"
W !!,"Choose one or more of the above to include on the report."
W !,"------------------------------------------------------------------------------"
Q
;
RHELP2 ; help for optional requirements question
W !,"------------------------------------------------------------------------------"
W !,"Determines which episodes are included on the report and how they are sorted."
W !!,"Optional: special requirements for printing the report,",!,?11,"these apply to both billed and unbilled episode reports."
W !!,?3,"1 - Include Episodes with a RNB: (default excludes episodes with a RNB)"
W !,?3,"2 - Include Only Episodes with a RNB: (default is No)"
W !,?3,"3 - Combine Divisions: (default is separate report for each Division)"
W !,?3,"4 - Sort by Terminal Digit: (default sort alphabetically by Patient Name)"
W !,?3,"5 - Select Range of Pat Names or Term Digits or Ins Company: (default is all)"
;
W !!,"Terminal Digit Sort: the output will be sorted by the 8th and 9th digits and",!,"then the 6th and 7th digits of the patient's SSN"
W !,"{Reason Not Billable}: if episodes with RNB are included then inpatient",!,"episodes with all movements SC are included on the report"
;
W !!,"All of the optional print fields apply to the patient and if chosen will",!,"print once for each patient on the report."
W !,"Indications of the Insurance Coverage and Riders, Policy Comments, and Group",!,"Comments are only printed if they exist for the policy/plan."
W !,"------------------------------------------------------------------------------"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBCONS4 6604 printed Dec 13, 2024@02:18:29 Page 2
IBCONS4 ;ALB/ARH - NSC W/INSURANCE OUTPUT (SETUP) ; 12-23-96
+1 ;;Version 2.0 ; INTEGRATED BILLING ;**66**; 21-MAR-94
+2 ;
RPT NEW DIR,X,Y,DIRUT,DTOUT,DUOUT,IBX,IBY,IBI
SET (IBPRTRDS,IBPRTIEX,IBPRTICR,IBPRTIPC,IBPRTIGC)=0
+1 SET (IBSELUBL,IBSELBNA,IBSELBIL,IBSELRNB,IBSELCDV,IBSELTRM,IBSELRNG)=0
+2 ;
+3 WRITE !!,?5,"Enter Report to print:"
+4 WRITE !,?10,"1 - Unbilled Episodes"
+5 WRITE !,?10,"2 - Billed Episodes but Not Authorized"
+6 WRITE !,?10,"3 - Billed Episodes (Authorized)",!
+7 ;
+8 SET DIR(0)="LO^1:3:0"
+9 SET DIR("A")="Report"
SET DIR("B")="1"
SET DIR("??")="^D RHELP1^IBCONS4"
DO ^DIR
KILL DIR
IF +Y'>0
SET IBQUIT=1
GOTO EXIT
+10 ;
+11 SET IBY=Y
FOR IBI=1:1
SET Y=$PIECE(IBY,",",IBI)
if 'Y
QUIT
Begin DoDot:1
+12 ;
+13 ; unbilled episodes
IF Y=1
SET IBSELUBL=1
+14 ; billed but not authorized
IF Y=2
SET IBSELBNA=1
+15 ; billed episodes (authorized)
IF Y=3
SET IBSELBIL=1
End DoDot:1
+16 ;
+17 WRITE !!,?5,"Optional format requirements:"
+18 WRITE !,?10,"1 - Include Episodes with a Reason Not Billable"
+19 WRITE !,?10,"2 - Include Only Episodes with a Reason Not Billable"
+20 WRITE !,?10,"3 - Combine Divisions into one Report"
+21 WRITE !,?10,"4 - Sort by Terminal Digit"
+22 WRITE !,?10,"5 - Select Sort Range"
+23 WRITE !!,?5,"Optional print fields:"
+24 WRITE !,?10,"6 - Patient's Rated Disabilities"
+25 WRITE !,?10,"7 - Patient Insurance Dates"
+26 WRITE !,?10,"8 - Coverage and Riders"
+27 WRITE !,?10,"9 - Policy Comments"
+28 WRITE !,?10,"10 - Group Comments",!
+29 ;
+30 SET DIR(0)="LO^1:10:0"
+31 SET DIR("A")="Optional requirements"
SET DIR("??")="^D RHELP2^IBCONS4"
DO ^DIR
IF $DATA(DTOUT)!$DATA(DUOUT)
SET IBQUIT=1
GOTO EXIT
+32 ;
+33 SET IBY=Y
FOR IBI=1:1
SET Y=$PIECE(IBY,",",IBI)
if 'Y
QUIT
Begin DoDot:1
+34 ;
+35 ; include episodes with a RNB
IF Y=1
SET IBSELRNB=1
+36 ; include episodes with a RNB only
IF Y=2
SET IBSELRNB=2
+37 ; combine divisions
IF Y=3
SET IBSELCDV=1
+38 ; sort by terminal digit
IF Y=4
SET IBSELTRM=1
+39 ; select range of patients (PT name or TD)
IF Y=5
SET IBSELRNG=1
+40 ; patient's rated disabilities
IF Y=6
SET IBPRTRDS=1
+41 ; patient insurance dates and group #
IF Y=7
SET IBPRTIEX=1
+42 ; coverage limits and riders
IF Y=8
SET IBPRTICR=1
+43 ; patient policy comments
IF Y=9
SET IBPRTIPC=1
+44 ; group plan comments
IF Y=10
SET IBPRTIGC=1
End DoDot:1
+45 ;
+46 IF $GET(IBSELRNG)=1
WRITE !
DO SRTRNG
IF '$DATA(IBSELSR1)!'$DATA(IBSELSR2)
SET IBQUIT=1
GOTO EXIT
+47 WRITE !
DO DATE
IF ($GET(IBBEG)'?7N)!($GET(IBEND)'?7N)
SET IBQUIT=1
GOTO EXIT
+48 DO ASKDIV
EXIT QUIT
+1 ;
SRTRNG ; get which data item to range on: Patient Name or Terminal Digit
+1 NEW DIR,X,Y,DIRUT,DUOUT,DTOUT
SET IBSELRNG=0
KILL IBSELSR1,IBSELSR2
+2 SET DIR("A")="Select Range of Patients By"
SET DIR(0)="SO^1:Patient Name;2:Terminal Digit;3:Insurance Company"
DO ^DIR
+3 IF +Y=1
SET IBSELRNG=+Y
DO SRTRNGP
+4 IF +Y=2
SET IBSELRNG=+Y
DO SRTRNGT
+5 IF +Y=3
SET IBSELRNG=+Y
DO SRTRNGI
+6 QUIT
+7 ;
SRTRNGP ; select patient name range for sort
+1 NEW DIR,X,Y,DIRUT,DUOUT,DTOUT
KILL IBSELSR1,IBSELSR2
+2 SET DIR(0)="FO"
+3 SET DIR("B")="FIRST"
SET DIR("A")="START WITH PATIENT NAME"
DO ^DIR
if $DATA(DIRUT)
QUIT
if Y="FIRST"
SET Y=""
SET IBSELSR1=$$ASCII^IBCONS2(Y)
+4 ;
+5 SET DIR("B")="LAST"
SET DIR("A")="GO TO PATIENT NAME"
DO ^DIR
if $DATA(DIRUT)
QUIT
if Y="LAST"
SET Y=""
SET IBSELSR2=$$ASCII^IBCONS2(Y)
+6 QUIT
+7 ;
SRTRNGT ; select terminal digit range for sort
+1 NEW DIR,X,Y,DIRUT,DUOUT,DTOUT
KILL IBSELSR1,IBSELSR2
+2 SET DIR(0)="FO^1:9^K:X'?1.9N X"
SET DIR("?")="Enter up to 9 digits of the Terminal Digit to include in report"
+3 ;
+4 SET DIR("B")="0000"
SET DIR("A")="START WITH TERMINAL DIGIT"
DO ^DIR
if $DATA(DIRUT)
QUIT
SET IBSELSR1=$EXTRACT((Y_"000000000"),1,9)
+5 ;
+6 SET DIR("B")=9999
SET DIR("A")="GO TO TERMINAL DIGIT"
DO ^DIR
if $DATA(DIRUT)
QUIT
SET IBSELSR2=$EXTRACT((Y_"999999999"),1,9)
+7 QUIT
+8 ;
SRTRNGI ; select insurance company name range for sort
+1 NEW DIR,X,Y,DIRUT,DUOUT,DTOUT
KILL IBSELSR1,IBSELSR2
+2 SET DIR(0)="FO"
+3 SET DIR("B")="FIRST"
SET DIR("A")="START WITH INSURANCE COMPANY NAME"
DO ^DIR
if $DATA(DIRUT)
QUIT
if Y="FIRST"
SET Y=""
SET IBSELSR1=$$ASCII^IBCONS2(Y)
+4 ;
+5 SET DIR("B")="LAST"
SET DIR("A")="GO TO INSURANCE COMPANY NAME"
DO ^DIR
if $DATA(DIRUT)
QUIT
if Y="LAST"
SET Y=""
SET IBSELSR2=$$ASCII^IBCONS2(Y)
+6 QUIT
+7 ;
DATE ; Issue prompts for Begin and End dates
+1 NEW %DT,Y,X
KILL IBBEG,IBEND
+2 SET %DT="AEPX"
SET %DT("A")="Start with DATE: "
DO ^%DT
if Y<0
QUIT
SET IBBEG=+Y\1
+3 SET %DT="AEPX"
SET %DT("A")="Go to DATE: "
SET %DT(0)=+Y
DO ^%DT
if Y<0
QUIT
SET IBEND=+Y\1
+4 QUIT
+5 ;
ASKDIV ; Issue prompt for Division (ALL: VAUTD=1, SELECT: VAUTD=0, VAUTD(DV)=DV NAME, ELSE: Y=-1)
+1 DO PSDR^IBODIV
IF Y<0
SET IBQUIT=1
+2 QUIT
+3 ;
RHELP1 ; help for report question
+1 WRITE !,"------------------------------------------------------------------------------"
+2 WRITE !,"Determines what types of episodes are included on the report.",!
+3 WRITE !,"Required: specify if report should include billed and/or unbilled episodes"
+4 WRITE !!,?3,"1 - Unbilled: no Third Party bill can be identified for episode"
+5 WRITE !,?3,"2 - Billed/Not Authorized: one or more Third Party bills exists for the",!,?30,"episode, but at least one of them has not yet been",!,?30,"authorized or passed to AR"
+6 WRITE !,?3,"3 - Billed/Authorized: one or more Third Party bills exists for the",!,?30,"episode and all of them have been Authorized"
+7 WRITE !!,"Choose one or more of the above to include on the report."
+8 WRITE !,"------------------------------------------------------------------------------"
+9 QUIT
+10 ;
RHELP2 ; help for optional requirements question
+1 WRITE !,"------------------------------------------------------------------------------"
+2 WRITE !,"Determines which episodes are included on the report and how they are sorted."
+3 WRITE !!,"Optional: special requirements for printing the report,",!,?11,"these apply to both billed and unbilled episode reports."
+4 WRITE !!,?3,"1 - Include Episodes with a RNB: (default excludes episodes with a RNB)"
+5 WRITE !,?3,"2 - Include Only Episodes with a RNB: (default is No)"
+6 WRITE !,?3,"3 - Combine Divisions: (default is separate report for each Division)"
+7 WRITE !,?3,"4 - Sort by Terminal Digit: (default sort alphabetically by Patient Name)"
+8 WRITE !,?3,"5 - Select Range of Pat Names or Term Digits or Ins Company: (default is all)"
+9 ;
+10 WRITE !!,"Terminal Digit Sort: the output will be sorted by the 8th and 9th digits and",!,"then the 6th and 7th digits of the patient's SSN"
+11 WRITE !,"{Reason Not Billable}: if episodes with RNB are included then inpatient",!,"episodes with all movements SC are included on the report"
+12 ;
+13 WRITE !!,"All of the optional print fields apply to the patient and if chosen will",!,"print once for each patient on the report."
+14 WRITE !,"Indications of the Insurance Coverage and Riders, Policy Comments, and Group",!,"Comments are only printed if they exist for the policy/plan."
+15 WRITE !,"------------------------------------------------------------------------------"
+16 QUIT