- IBCICMS ;DSI/ESG - IBCI CLAIMSMANAGER STATUS REPORT ;2-APR-2001
- ;;2.0;INTEGRATED BILLING;**161**;21-MAR-94
- ;;Per VHA Directive 10-93-142, this routine should not be modified.
- ;
- NEW STOP,IBCIRTN,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT,POP,RPTSPECS
- ;
- S STOP=0
- S IBCIRTN="IBCICMS"
- W @IOF
- W !?10,"ClaimsManager Status Report",!
- A10 D DATE I STOP G EXIT
- A20 D DTRANGE I STOP G:$$STOP EXIT G A10
- A30 D STATUS I STOP G:$$STOP EXIT G A20
- A40 D TYPE I STOP G:$$STOP EXIT G A30
- A50 D SELASN I STOP G:$$STOP EXIT G A40
- A60 D ASSIGN I STOP G:$$STOP EXIT G A50
- A70 D SORTBY I STOP G:$$STOP EXIT G A60
- A75 D COMMENTS I STOP G:$$STOP EXIT G A70
- A80 D DEVICE(IBCIRTN) I STOP G:$$STOP EXIT G:RPTSPECS("TYPE")="S" A40 G A75
- ;
- EXIT ;
- QUIT ; quit from routine
- ;
- COMPILE ; This entry point is called from EN^XUTMDEVQ in either
- ; direct mode or queued mode.
- NEW IBCISCNT
- D BUILD ; compile report
- I '$G(ZTSTOP) D EN^IBCICMSP ; print report
- D ^%ZISC ; close the device
- KILL ^TMP($J,IBCIRTN) ; kill scratch global
- I $D(ZTQUEUED) S ZTREQ="@" ; purge the task record
- COMPX ;
- QUIT ; quit from routine
- ;
- ;
- STOP() ; See if the user wants to exit out of the whole option
- W !
- S DIR(0)="Y"
- S DIR("A")="Do you want to exit out of this option entirely"
- S DIR("B")="YES"
- S DIR("?",1)=" Enter YES to immediately exit out of this option."
- S DIR("?")=" Enter NO to return to the previous question."
- D ^DIR K DIR
- I $D(DIRUT) S (STOP,Y)=1 G STOPX
- I 'Y S STOP=0
- STOPX ;
- Q Y
- ;
- DATE ;
- W !
- S DIR(0)="SO^1:Event Date (Date of Service);2:Entered Date (Date of Entry into VistA)"
- S DIR("A")="Select Date Range by"
- S DIR("B")="Event Date"
- S DIR("?",1)=" Please enter the type of date on which you would like to report."
- S DIR("?",2)=" The Event Date is the date on which the services were performed."
- S DIR("?")=" The Entered Date is the date on which the bill was Entered into VistA."
- D ^DIR K DIR
- I $D(DIRUT) S STOP=1 G DATEX
- S RPTSPECS("DATYP")=Y
- S RPTSPECS("DATYP1")=$S(Y=1:"Event",1:"Entered")
- DATEX ;
- Q
- ;
- DTRANGE ;
- NEW X,Y,%DT
- W !
- S %DT="AEX"
- S %DT("A")="Enter the beginning "_RPTSPECS("DATYP1")_" Date: "
- S %DT(0)="-NOW"
- D ^%DT
- I Y=-1!$D(DTOUT) S STOP=1 G DTRNGX
- S RPTSPECS("BEGDATE")=Y
- W !
- S %DT="AEX"
- S %DT("A")=" Enter the ending "_RPTSPECS("DATYP1")_" Date: "
- S %DT(0)=RPTSPECS("BEGDATE")
- D ^%DT
- I Y=-1!$D(DTOUT) S STOP=1 G DTRNGX
- S RPTSPECS("ENDDATE")=Y
- DTRNGX ;
- Q
- ;
- ;
- STATUS ;
- NEW CH,IEN,TXT
- W !
- S CH="1:All ClaimsManager Statuses;"
- S CH=CH_"2:One Specific ClaimsManager Status;"
- S CH=CH_"3:Any ClaimsManager Status (Bill is still Editable)"
- S DIR(0)="SO^"_CH
- S DIR("A")="Select the ClaimsManager Status Option"
- S DIR("B")=3
- S DIR("?",1)=" Option 1 - All ClaimsManager Statuses - indicates that all bills"
- S DIR("?",2)=" will be included on the report regardless of ClaimsManager"
- S DIR("?",3)=" status."
- S DIR("?",4)=" "
- S DIR("?",5)=" Option 2 - One Specific ClaimsManager Status - will allow you to"
- S DIR("?",6)=" choose a ClaimsManager status and only bills with this specific"
- S DIR("?",7)=" status will be included on the report."
- S DIR("?",8)=" "
- S DIR("?",9)=" Option 3 - Any ClaimsManager Status (Bill is still Editable) -"
- S DIR("?",10)=" will only select those bills that are still open for editing in"
- S DIR("?")=" the IB Enter/Edit Billing Information option."
- D ^DIR K DIR
- I $D(DIRUT) S STOP=1 G STATX
- S RPTSPECS("STATYP")=Y,RPTSPECS("IBCISTAT")=""
- I RPTSPECS("STATYP")'=2 G STATX
- ;
- ; Ask the user which status they want to report on
- W !
- S IEN=0,CH=""
- F S IEN=$O(^IBA(351.91,IEN)) Q:'IEN D
- . S TXT=$P($G(^IBA(351.91,IEN,0)),U,2)
- . I CH="" S CH=IEN_":"_TXT
- . E S CH=CH_";"_IEN_":"_TXT
- . Q
- S DIR(0)="SO^"_CH
- S DIR("A")="Please choose a ClaimsManager Status"
- D ^DIR K DIR
- I $D(DIRUT) S STOP=1 G STATX
- S RPTSPECS("IBCISTAT")=Y
- STATX ;
- Q
- ;
- ;
- S RPTSPECS("IBCICOMM")=1 ; default
- I RPTSPECS("TYPE")="S" G COMMX ; don't ask if summary
- W !
- S DIR(0)="Y"
- S DIR("A")="Do you want to see ClaimsManager comments associated with these bills"
- S DIR("B")="YES"
- S DIR("?",1)=" Enter YES if you would like to see the comments which are stored in the"
- S DIR("?",2)=" ClaimsManager file (#351.9) for each bill on this report."
- S DIR("?",3)=""
- S DIR("?")=" Enter NO if you do not want to see these comments."
- D ^DIR K DIR
- I $D(DIRUT) S STOP=1 G COMMX
- S RPTSPECS("IBCICOMM")=+Y
- COMMX ;
- Q
- ;
- ;
- SELASN ;
- W !
- S DIR(0)="F^1:1"
- S DIR("A",1)="Do you want to include one specific Assigned to person or All?"
- S DIR("A")="Please enter 1 or A"
- S DIR("B")="A"
- S DIR("?",1)=" Enter '1' to indicate that you only want to include one specific"
- S DIR("?",2)=" Assigned to person on this report. You will then be asked"
- S DIR("?",3)=" to select this person."
- S DIR("?",4)=""
- S DIR("?",5)=" Enter 'A' to indicate that you want to include all Assigned to"
- S DIR("?",6)=" people on this report. You will then be asked if you want"
- S DIR("?")=" to sort by the Assigned to person."
- D ^DIR K DIR
- I $D(DIRUT) S STOP=1 G SELASNX
- I '$F(".1.A.","."_Y_".") W *7," Invalid response ... Please enter '1' or 'A'" G SELASN
- S RPTSPECS("SELASN")=Y
- SELASNX ;
- Q
- ;
- ;
- ASSIGN ;
- NEW DIC,X,Y
- W !
- S RPTSPECS("ASNSORT")=0
- S RPTSPECS("ASNDUZ")=0
- I RPTSPECS("SELASN")="A" D G ASSIGNX
- . I RPTSPECS("TYPE")="S" Q ; don't ask this if summary
- . S DIR(0)="Y"
- . S DIR("A")="Do you want the primary sort by the Assigned To person"
- . S DIR("B")="YES"
- . S DIR("?",1)=" Enter YES if you would like the bills on this report primarily"
- . S DIR("?",2)=" sorted by the Assigned To person. If a bill is not assigned"
- . S DIR("?",3)=" to anyone, then the word ""UNASSIGNED"" will be used."
- . S DIR("?",4)=""
- . S DIR("?")=" Enter NO if you would like to choose a different primary sort."
- . D ^DIR K DIR
- . I $D(DIRUT) S STOP=1 Q
- . S RPTSPECS("ASNSORT")=+Y
- . Q
- ;
- ; At this point, we know that the user wants to include only one
- ; assigned to person. We need to select this person here.
- ;
- S DIC="^VA(200,"
- S DIC(0)="AEMQO"
- S DIC("A")="Enter the Assigned to person to include: "
- S DIC("S")="I $D(^IBA(351.9,""ASN"",+Y))"
- I $D(^IBA(351.9,"ASN",DUZ)) S DIC("B")=DUZ
- D ^DIC
- I Y<0 S STOP=1 G ASSIGNX
- S RPTSPECS("ASNDUZ")=+Y
- ASSIGNX ;
- Q
- ;
- ;
- SORTBY ;
- S RPTSPECS("SORTBY")=3 ; default
- I RPTSPECS("TYPE")="S" G SORTBYX ; don't ask if summary
- NEW CH,PS
- W !
- S CH="1:Terminal Digit;"
- S CH=CH_"2:Insurance Company Name;"
- S CH=CH_"3:Patient Last Name;"
- S CH=CH_"4:Total Charges;"
- S CH=CH_"5:Bill Number"
- S DIR(0)="SO^"_CH
- S PS=$S(RPTSPECS("ASNSORT"):"secondary",1:"primary")
- S DIR("A")="Please enter the "_PS_" sort criteria"
- S DIR("B")="Patient Last Name"
- D ^DIR K DIR
- I $D(DIRUT) S STOP=1 G SORTBYX
- S RPTSPECS("SORTBY")=Y
- SORTBYX ;
- Q
- ;
- TYPE ;
- W !
- S DIR(0)="S^D:Detailed;S:Summary"
- S DIR("A")="Please enter the report type"
- S DIR("B")="Detailed"
- S DIR("?",1)=" The Detailed report will show the breakout of bills &"
- S DIR("?",2)=" a summary based on the criteria that you selected."
- S DIR("?",3)=""
- S DIR("?",4)=" The Summary report will show the total amount of bills"
- S DIR("?")=" based on the criteria that you selected."
- D ^DIR K DIR
- I $D(DIRUT) S STOP=1 G TYPEX
- S RPTSPECS("TYPE")=Y
- TYPEX ;
- Q
- ;
- DEVICE(IBCIRTN) ; Device Handler and possible TaskManager calls
- NEW ZTRTN,ZTDESC,ZTSAVE,POP
- W !!!,"*** This report is 132 characters wide ***",!
- S ZTRTN="COMPILE^"_IBCIRTN
- S ZTDESC="IBCI ClaimsManager Status Report"
- I IBCIRTN="IBCICME" S ZTDESC="IBCI ClaimsManager Error Report"
- S ZTSAVE("RPTSPECS(")=""
- S ZTSAVE("IBCIRTN")=""
- D EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE)
- I POP S STOP=1
- DEVICEX ;
- Q
- ;
- ;
- BUILD ; Build the scratch global based on the selection and sort criteria
- ;
- NEW SUBSCRPT,RDT,IBIFN,CMDATA,IBDATA,CMSTATUS,BILLID,PATDATA
- NEW NAME,SSN,BILLER,CODER,OIFLG,ASSIGNED,CHARGES,ERR,ERRCODES
- NEW SORT1,SORT2,SORT3,SORT4,SORT5,RPTDATA,COUNT,ASNSUB,NAMESUB
- NEW INSNAME
- ;
- KILL ^TMP($J,IBCIRTN)
- ;
- S SUBSCRPT="D" ; for event date looping
- I RPTSPECS("DATYP")=2 S SUBSCRPT="APD" ; for entry date looping
- ;
- ; Get the starting date for looping purposes
- S RDT=$O(^DGCR(399,SUBSCRPT,RPTSPECS("BEGDATE")),-1)
- ;
- S COUNT=0
- ; Main loop....stop when we get to a date after the report end date
- F S RDT=$O(^DGCR(399,SUBSCRPT,RDT)) Q:'RDT!($P(RDT,".",1)>RPTSPECS("ENDDATE"))!$G(ZTSTOP) D
- . S IBIFN=0
- . F S IBIFN=$O(^DGCR(399,SUBSCRPT,RDT,IBIFN)) Q:'IBIFN!$G(ZTSTOP) D
- .. S COUNT=COUNT+1
- .. I $D(ZTQUEUED),COUNT#100=0,$$S^%ZTLOAD() S ZTSTOP=1 Q
- .. S CMDATA=$G(^IBA(351.9,IBIFN,0))
- .. I CMDATA="" Q
- .. S IBDATA=$G(^DGCR(399,IBIFN,0))
- .. I IBDATA="" Q
- .. ;
- .. ; If the user chose a specific ClaimsManager status to report
- .. ; on, then make sure this bill has the status they want.
- .. S CMSTATUS=$P(CMDATA,U,2)
- .. I RPTSPECS("STATYP")=2,CMSTATUS'=RPTSPECS("IBCISTAT") Q
- .. ;
- .. ; If the user wants to see bills that are still open for editing
- .. I RPTSPECS("STATYP")=3,'$F(".1.","."_$P(IBDATA,U,13)_".") Q ;DSI/DJW 3/21/02
- .. ;
- .. ; If the user wants to include a specific assigned to person,
- .. ; then make sure the assigned to person is the one they want.
- .. I RPTSPECS("ASNDUZ"),RPTSPECS("ASNDUZ")'=$P(CMDATA,U,12) Q
- .. ;
- .. ; At this point, we know we want to include this bill.
- .. D GETDATA^IBCICME1
- .. S ^TMP($J,IBCIRTN,SORT1,SORT2,SORT3,SORT4,SORT5,NAME,IBIFN)=RPTDATA
- .. Q
- . Q
- ;
- BUILDX ;
- Q
- ;
- ;
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBCICMS 9900 printed Jan 18, 2025@03:14:27 Page 2
- IBCICMS ;DSI/ESG - IBCI CLAIMSMANAGER STATUS REPORT ;2-APR-2001
- +1 ;;2.0;INTEGRATED BILLING;**161**;21-MAR-94
- +2 ;;Per VHA Directive 10-93-142, this routine should not be modified.
- +3 ;
- +4 NEW STOP,IBCIRTN,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT,POP,RPTSPECS
- +5 ;
- +6 SET STOP=0
- +7 SET IBCIRTN="IBCICMS"
- +8 WRITE @IOF
- +9 WRITE !?10,"ClaimsManager Status Report",!
- A10 DO DATE
- IF STOP
- GOTO EXIT
- A20 DO DTRANGE
- IF STOP
- if $$STOP
- GOTO EXIT
- GOTO A10
- A30 DO STATUS
- IF STOP
- if $$STOP
- GOTO EXIT
- GOTO A20
- A40 DO TYPE
- IF STOP
- if $$STOP
- GOTO EXIT
- GOTO A30
- A50 DO SELASN
- IF STOP
- if $$STOP
- GOTO EXIT
- GOTO A40
- A60 DO ASSIGN
- IF STOP
- if $$STOP
- GOTO EXIT
- GOTO A50
- A70 DO SORTBY
- IF STOP
- if $$STOP
- GOTO EXIT
- GOTO A60
- A75 DO COMMENTS
- IF STOP
- if $$STOP
- GOTO EXIT
- GOTO A70
- A80 DO DEVICE(IBCIRTN)
- IF STOP
- if $$STOP
- GOTO EXIT
- if RPTSPECS("TYPE")="S"
- GOTO A40
- GOTO A75
- +1 ;
- EXIT ;
- +1 ; quit from routine
- QUIT
- +2 ;
- COMPILE ; This entry point is called from EN^XUTMDEVQ in either
- +1 ; direct mode or queued mode.
- +2 NEW IBCISCNT
- +3 ; compile report
- DO BUILD
- +4 ; print report
- IF '$GET(ZTSTOP)
- DO EN^IBCICMSP
- +5 ; close the device
- DO ^%ZISC
- +6 ; kill scratch global
- KILL ^TMP($JOB,IBCIRTN)
- +7 ; purge the task record
- IF $DATA(ZTQUEUED)
- SET ZTREQ="@"
- COMPX ;
- +1 ; quit from routine
- QUIT
- +2 ;
- +3 ;
- STOP() ; See if the user wants to exit out of the whole option
- +1 WRITE !
- +2 SET DIR(0)="Y"
- +3 SET DIR("A")="Do you want to exit out of this option entirely"
- +4 SET DIR("B")="YES"
- +5 SET DIR("?",1)=" Enter YES to immediately exit out of this option."
- +6 SET DIR("?")=" Enter NO to return to the previous question."
- +7 DO ^DIR
- KILL DIR
- +8 IF $DATA(DIRUT)
- SET (STOP,Y)=1
- GOTO STOPX
- +9 IF 'Y
- SET STOP=0
- STOPX ;
- +1 QUIT Y
- +2 ;
- DATE ;
- +1 WRITE !
- +2 SET DIR(0)="SO^1:Event Date (Date of Service);2:Entered Date (Date of Entry into VistA)"
- +3 SET DIR("A")="Select Date Range by"
- +4 SET DIR("B")="Event Date"
- +5 SET DIR("?",1)=" Please enter the type of date on which you would like to report."
- +6 SET DIR("?",2)=" The Event Date is the date on which the services were performed."
- +7 SET DIR("?")=" The Entered Date is the date on which the bill was Entered into VistA."
- +8 DO ^DIR
- KILL DIR
- +9 IF $DATA(DIRUT)
- SET STOP=1
- GOTO DATEX
- +10 SET RPTSPECS("DATYP")=Y
- +11 SET RPTSPECS("DATYP1")=$SELECT(Y=1:"Event",1:"Entered")
- DATEX ;
- +1 QUIT
- +2 ;
- DTRANGE ;
- +1 NEW X,Y,%DT
- +2 WRITE !
- +3 SET %DT="AEX"
- +4 SET %DT("A")="Enter the beginning "_RPTSPECS("DATYP1")_" Date: "
- +5 SET %DT(0)="-NOW"
- +6 DO ^%DT
- +7 IF Y=-1!$DATA(DTOUT)
- SET STOP=1
- GOTO DTRNGX
- +8 SET RPTSPECS("BEGDATE")=Y
- +9 WRITE !
- +10 SET %DT="AEX"
- +11 SET %DT("A")=" Enter the ending "_RPTSPECS("DATYP1")_" Date: "
- +12 SET %DT(0)=RPTSPECS("BEGDATE")
- +13 DO ^%DT
- +14 IF Y=-1!$DATA(DTOUT)
- SET STOP=1
- GOTO DTRNGX
- +15 SET RPTSPECS("ENDDATE")=Y
- DTRNGX ;
- +1 QUIT
- +2 ;
- +3 ;
- STATUS ;
- +1 NEW CH,IEN,TXT
- +2 WRITE !
- +3 SET CH="1:All ClaimsManager Statuses;"
- +4 SET CH=CH_"2:One Specific ClaimsManager Status;"
- +5 SET CH=CH_"3:Any ClaimsManager Status (Bill is still Editable)"
- +6 SET DIR(0)="SO^"_CH
- +7 SET DIR("A")="Select the ClaimsManager Status Option"
- +8 SET DIR("B")=3
- +9 SET DIR("?",1)=" Option 1 - All ClaimsManager Statuses - indicates that all bills"
- +10 SET DIR("?",2)=" will be included on the report regardless of ClaimsManager"
- +11 SET DIR("?",3)=" status."
- +12 SET DIR("?",4)=" "
- +13 SET DIR("?",5)=" Option 2 - One Specific ClaimsManager Status - will allow you to"
- +14 SET DIR("?",6)=" choose a ClaimsManager status and only bills with this specific"
- +15 SET DIR("?",7)=" status will be included on the report."
- +16 SET DIR("?",8)=" "
- +17 SET DIR("?",9)=" Option 3 - Any ClaimsManager Status (Bill is still Editable) -"
- +18 SET DIR("?",10)=" will only select those bills that are still open for editing in"
- +19 SET DIR("?")=" the IB Enter/Edit Billing Information option."
- +20 DO ^DIR
- KILL DIR
- +21 IF $DATA(DIRUT)
- SET STOP=1
- GOTO STATX
- +22 SET RPTSPECS("STATYP")=Y
- SET RPTSPECS("IBCISTAT")=""
- +23 IF RPTSPECS("STATYP")'=2
- GOTO STATX
- +24 ;
- +25 ; Ask the user which status they want to report on
- +26 WRITE !
- +27 SET IEN=0
- SET CH=""
- +28 FOR
- SET IEN=$ORDER(^IBA(351.91,IEN))
- if 'IEN
- QUIT
- Begin DoDot:1
- +29 SET TXT=$PIECE($GET(^IBA(351.91,IEN,0)),U,2)
- +30 IF CH=""
- SET CH=IEN_":"_TXT
- +31 IF '$TEST
- SET CH=CH_";"_IEN_":"_TXT
- +32 QUIT
- End DoDot:1
- +33 SET DIR(0)="SO^"_CH
- +34 SET DIR("A")="Please choose a ClaimsManager Status"
- +35 DO ^DIR
- KILL DIR
- +36 IF $DATA(DIRUT)
- SET STOP=1
- GOTO STATX
- +37 SET RPTSPECS("IBCISTAT")=Y
- STATX ;
- +1 QUIT
- +2 ;
- +3 ;
- +1 ; default
- SET RPTSPECS("IBCICOMM")=1
- +2 ; don't ask if summary
- IF RPTSPECS("TYPE")="S"
- GOTO COMMX
- +3 WRITE !
- +4 SET DIR(0)="Y"
- +5 SET DIR("A")="Do you want to see ClaimsManager comments associated with these bills"
- +6 SET DIR("B")="YES"
- +7 SET DIR("?",1)=" Enter YES if you would like to see the comments which are stored in the"
- +8 SET DIR("?",2)=" ClaimsManager file (#351.9) for each bill on this report."
- +9 SET DIR("?",3)=""
- +10 SET DIR("?")=" Enter NO if you do not want to see these comments."
- +11 DO ^DIR
- KILL DIR
- +12 IF $DATA(DIRUT)
- SET STOP=1
- GOTO COMMX
- +13 SET RPTSPECS("IBCICOMM")=+Y
- COMMX ;
- +1 QUIT
- +2 ;
- +3 ;
- SELASN ;
- +1 WRITE !
- +2 SET DIR(0)="F^1:1"
- +3 SET DIR("A",1)="Do you want to include one specific Assigned to person or All?"
- +4 SET DIR("A")="Please enter 1 or A"
- +5 SET DIR("B")="A"
- +6 SET DIR("?",1)=" Enter '1' to indicate that you only want to include one specific"
- +7 SET DIR("?",2)=" Assigned to person on this report. You will then be asked"
- +8 SET DIR("?",3)=" to select this person."
- +9 SET DIR("?",4)=""
- +10 SET DIR("?",5)=" Enter 'A' to indicate that you want to include all Assigned to"
- +11 SET DIR("?",6)=" people on this report. You will then be asked if you want"
- +12 SET DIR("?")=" to sort by the Assigned to person."
- +13 DO ^DIR
- KILL DIR
- +14 IF $DATA(DIRUT)
- SET STOP=1
- GOTO SELASNX
- +15 IF '$FIND(".1.A.","."_Y_".")
- WRITE *7," Invalid response ... Please enter '1' or 'A'"
- GOTO SELASN
- +16 SET RPTSPECS("SELASN")=Y
- SELASNX ;
- +1 QUIT
- +2 ;
- +3 ;
- ASSIGN ;
- +1 NEW DIC,X,Y
- +2 WRITE !
- +3 SET RPTSPECS("ASNSORT")=0
- +4 SET RPTSPECS("ASNDUZ")=0
- +5 IF RPTSPECS("SELASN")="A"
- Begin DoDot:1
- +6 ; don't ask this if summary
- IF RPTSPECS("TYPE")="S"
- QUIT
- +7 SET DIR(0)="Y"
- +8 SET DIR("A")="Do you want the primary sort by the Assigned To person"
- +9 SET DIR("B")="YES"
- +10 SET DIR("?",1)=" Enter YES if you would like the bills on this report primarily"
- +11 SET DIR("?",2)=" sorted by the Assigned To person. If a bill is not assigned"
- +12 SET DIR("?",3)=" to anyone, then the word ""UNASSIGNED"" will be used."
- +13 SET DIR("?",4)=""
- +14 SET DIR("?")=" Enter NO if you would like to choose a different primary sort."
- +15 DO ^DIR
- KILL DIR
- +16 IF $DATA(DIRUT)
- SET STOP=1
- QUIT
- +17 SET RPTSPECS("ASNSORT")=+Y
- +18 QUIT
- End DoDot:1
- GOTO ASSIGNX
- +19 ;
- +20 ; At this point, we know that the user wants to include only one
- +21 ; assigned to person. We need to select this person here.
- +22 ;
- +23 SET DIC="^VA(200,"
- +24 SET DIC(0)="AEMQO"
- +25 SET DIC("A")="Enter the Assigned to person to include: "
- +26 SET DIC("S")="I $D(^IBA(351.9,""ASN"",+Y))"
- +27 IF $DATA(^IBA(351.9,"ASN",DUZ))
- SET DIC("B")=DUZ
- +28 DO ^DIC
- +29 IF Y<0
- SET STOP=1
- GOTO ASSIGNX
- +30 SET RPTSPECS("ASNDUZ")=+Y
- ASSIGNX ;
- +1 QUIT
- +2 ;
- +3 ;
- SORTBY ;
- +1 ; default
- SET RPTSPECS("SORTBY")=3
- +2 ; don't ask if summary
- IF RPTSPECS("TYPE")="S"
- GOTO SORTBYX
- +3 NEW CH,PS
- +4 WRITE !
- +5 SET CH="1:Terminal Digit;"
- +6 SET CH=CH_"2:Insurance Company Name;"
- +7 SET CH=CH_"3:Patient Last Name;"
- +8 SET CH=CH_"4:Total Charges;"
- +9 SET CH=CH_"5:Bill Number"
- +10 SET DIR(0)="SO^"_CH
- +11 SET PS=$SELECT(RPTSPECS("ASNSORT"):"secondary",1:"primary")
- +12 SET DIR("A")="Please enter the "_PS_" sort criteria"
- +13 SET DIR("B")="Patient Last Name"
- +14 DO ^DIR
- KILL DIR
- +15 IF $DATA(DIRUT)
- SET STOP=1
- GOTO SORTBYX
- +16 SET RPTSPECS("SORTBY")=Y
- SORTBYX ;
- +1 QUIT
- +2 ;
- TYPE ;
- +1 WRITE !
- +2 SET DIR(0)="S^D:Detailed;S:Summary"
- +3 SET DIR("A")="Please enter the report type"
- +4 SET DIR("B")="Detailed"
- +5 SET DIR("?",1)=" The Detailed report will show the breakout of bills &"
- +6 SET DIR("?",2)=" a summary based on the criteria that you selected."
- +7 SET DIR("?",3)=""
- +8 SET DIR("?",4)=" The Summary report will show the total amount of bills"
- +9 SET DIR("?")=" based on the criteria that you selected."
- +10 DO ^DIR
- KILL DIR
- +11 IF $DATA(DIRUT)
- SET STOP=1
- GOTO TYPEX
- +12 SET RPTSPECS("TYPE")=Y
- TYPEX ;
- +1 QUIT
- +2 ;
- DEVICE(IBCIRTN) ; Device Handler and possible TaskManager calls
- +1 NEW ZTRTN,ZTDESC,ZTSAVE,POP
- +2 WRITE !!!,"*** This report is 132 characters wide ***",!
- +3 SET ZTRTN="COMPILE^"_IBCIRTN
- +4 SET ZTDESC="IBCI ClaimsManager Status Report"
- +5 IF IBCIRTN="IBCICME"
- SET ZTDESC="IBCI ClaimsManager Error Report"
- +6 SET ZTSAVE("RPTSPECS(")=""
- +7 SET ZTSAVE("IBCIRTN")=""
- +8 DO EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE)
- +9 IF POP
- SET STOP=1
- DEVICEX ;
- +1 QUIT
- +2 ;
- +3 ;
- BUILD ; Build the scratch global based on the selection and sort criteria
- +1 ;
- +2 NEW SUBSCRPT,RDT,IBIFN,CMDATA,IBDATA,CMSTATUS,BILLID,PATDATA
- +3 NEW NAME,SSN,BILLER,CODER,OIFLG,ASSIGNED,CHARGES,ERR,ERRCODES
- +4 NEW SORT1,SORT2,SORT3,SORT4,SORT5,RPTDATA,COUNT,ASNSUB,NAMESUB
- +5 NEW INSNAME
- +6 ;
- +7 KILL ^TMP($JOB,IBCIRTN)
- +8 ;
- +9 ; for event date looping
- SET SUBSCRPT="D"
- +10 ; for entry date looping
- IF RPTSPECS("DATYP")=2
- SET SUBSCRPT="APD"
- +11 ;
- +12 ; Get the starting date for looping purposes
- +13 SET RDT=$ORDER(^DGCR(399,SUBSCRPT,RPTSPECS("BEGDATE")),-1)
- +14 ;
- +15 SET COUNT=0
- +16 ; Main loop....stop when we get to a date after the report end date
- +17 FOR
- SET RDT=$ORDER(^DGCR(399,SUBSCRPT,RDT))
- if 'RDT!($PIECE(RDT,".",1)>RPTSPECS("ENDDATE"))!$GET(ZTSTOP)
- QUIT
- Begin DoDot:1
- +18 SET IBIFN=0
- +19 FOR
- SET IBIFN=$ORDER(^DGCR(399,SUBSCRPT,RDT,IBIFN))
- if 'IBIFN!$GET(ZTSTOP)
- QUIT
- Begin DoDot:2
- +20 SET COUNT=COUNT+1
- +21 IF $DATA(ZTQUEUED)
- IF COUNT#100=0
- IF $$S^%ZTLOAD()
- SET ZTSTOP=1
- QUIT
- +22 SET CMDATA=$GET(^IBA(351.9,IBIFN,0))
- +23 IF CMDATA=""
- QUIT
- +24 SET IBDATA=$GET(^DGCR(399,IBIFN,0))
- +25 IF IBDATA=""
- QUIT
- +26 ;
- +27 ; If the user chose a specific ClaimsManager status to report
- +28 ; on, then make sure this bill has the status they want.
- +29 SET CMSTATUS=$PIECE(CMDATA,U,2)
- +30 IF RPTSPECS("STATYP")=2
- IF CMSTATUS'=RPTSPECS("IBCISTAT")
- QUIT
- +31 ;
- +32 ; If the user wants to see bills that are still open for editing
- +33 ;DSI/DJW 3/21/02
- IF RPTSPECS("STATYP")=3
- IF '$FIND(".1.","."_$PIECE(IBDATA,U,13)_".")
- QUIT
- +34 ;
- +35 ; If the user wants to include a specific assigned to person,
- +36 ; then make sure the assigned to person is the one they want.
- +37 IF RPTSPECS("ASNDUZ")
- IF RPTSPECS("ASNDUZ")'=$PIECE(CMDATA,U,12)
- QUIT
- +38 ;
- +39 ; At this point, we know we want to include this bill.
- +40 DO GETDATA^IBCICME1
- +41 SET ^TMP($JOB,IBCIRTN,SORT1,SORT2,SORT3,SORT4,SORT5,NAME,IBIFN)=RPTDATA
- +42 QUIT
- End DoDot:2
- +43 QUIT
- End DoDot:1
- +44 ;
- BUILDX ;
- +1 QUIT
- +2 ;
- +3 ;