BPSSCRCV ;BHAM ISC/SS - ECME SCREEN CHANGE VIEW ;05-APR-05
;;1.0;E CLAIMS MGMT ENGINE;**1,5,7,11,14,20,22,23**;JUN 2004;Build 44
;;Per VA Directive 6402, this routine should not be modified.
;USER SCREEN
Q
;****
;This software is using PARAMETER TOOLS (see XT*7.3*26) to store user's settings:
;PARAMETER DEFINITION NAME="BPS USRSCR" (file #8989.51, IA# 2263)
;ENTITY is "USR" , i.e. IEN in ^VA(200 -- see definition for "BPS USRSCR"
;INSTANCEs are as follows:
;1.01 ONE/ALL USERS --'U' ONE USER, 'A' ALL; Display claims for ONE or ALL users
;1.02 ONE/ALL PATIENTS --'P' FOR ONE PATIENT; 'A' FOR ALL; Display claims for ONE/ALL PATIENTS
;1.03 ONE/ALL RX --'R' FOR ONE RX; 'A' FOR ALL; Display claims for ONE or ALL RX
;1.031 DATE RANGE/TIMEFRAME -- 'D' FOR DATE RANGE; 'T' FOR TIMEFRAME;
;1.032 ACTIVITY BEGINNING DATE - Beginning Date of the Date Range
;1.033 ACTIVITY ENDING DATE - Ending Date of the Date Range
;1.04 HOURS/DAYS -- 'D' FOR DAYS; 'H' FOR HOURS; Use HOURS or DAYS to specify timeframe
;1.05 TIMEFRAME -- NUMBER Depends on the value of the field "USR SCR HOURS/DAYS" this field will
;store the default number of HOURS from NOW or DAYS from TODAY to select claims to display
;1.06 REJECTED/PAYABLE --'R' FOR REJECTS; 'P' FOR PAYABLES; 'U' FOR UNSTRANDED; 'A' FOR ALL; Display Rejects or Payables or Unstranded or ALL claims
;1.07 RELEASED/NOT RELEASED --'R' FOR RELEASED; 'N' FOR NON-RELEASED; 'A' FOR ALL; Display Released Rxs or Non-Released Rxs or ALL
;1.08 CMOP/MAIL/WINDOW --'C' FOR CMOP; 'M' FOR MAIL;'W' FOR WINDOW;'A' FOR ALL; Display CMOP or Mail or Window or ALL Rxs
;1.09 REALTIME/BACKBILL --'R' FOR REALTIME; 'B' FOR BACKBILLS; 'P' FOR PRO Option; 'S' FOR ECME User Screen Resubmits;
; 'A' FOR ALL; Display RealTime, Backbills, PRO Option, Resubmission, or ALL
;1.1 REJECT CODE/ALL --'R' FOR REJECT CODE; 'A' FOR ALL; Display Specific Reject Code or ALL Reject
;Codes 0 means ALL Reject Codes otherwise - Reject Code value
;1.11 SPECIFIC/ALL INSURANCES --'I' FOR SPECIFIC INSURANCE(S);'A' FOR ALL; Display Specific Insurance Company(s) or All null - ALL otherwise - pointer to INSURANCE COMPANY file #36
;1.12 SORT LIST --'T' FOR TRANSACTION DATE;'D' FOR DIVISION; 'I' FOR INSURANCE; 'C' FOR REJECT CODE;
;'P' FOR PATIENT NAME -- 'N' FOR DRUG NAME; 'B' FOR BILL TYPE (BB/P2/RT/RS); 'L' FOR FILL LOCATION;
;'R' FOR RELEASED/NON-RELEASED -- 'A' FOR ACTIVE/DISCONTINUED; the field used to sort claims in the list
;1.13 ALL ECME PHARMACY DIVISIONS --'D' FOR DIVISION; 'A' FOR ALL;
;1.14 SELECTED INSURANCE -- Single, or multiple, insurance(s) to select claims for the User Screen, to store INSURANCE COMPANY pointer (#36)
;1.15 SELECTED REJECTED CODE --POINTER TO BPS NCPDP REJECT CODES FILE (#9002313.93) Reject code selected by the user to filter claims.
;1.16 SELECTED USER -- POINTER TO NEW PERSON FILE (#200) Selected user for the user screen
;1.17 SELECTED PATIENT -- POINTER TO PATIENT FILE (#2) Selected patient for the User Screen
;1.18 SELECTED RX -- POINTER TO PRESCRIPTION FILE (#52) Selected RX
;1.19 NON-BILLABLE TRI/CVA ENTRIES OPEN/CLOSED/ALL -- 'O' Open; 'C' Closed; 'A' All
;2 ECME PHARMACY DIVISION -- the list of POINTERs TO BPS PHARMACIES FILE (#9002313.56) separated by ";"
;should start and end with ";", example: ";4;5;"
;2.01 ELIGIBILITY TYPE --'V' FOR VETERAN;'T' FOR TRICARE;'C' FOR CHAMPVA;'A' FOR ALL; Display claims for specific Eligibility Type or ALL (BNT BPS*1.0*7)
;2.02 OPEN/CLOSED/ALL --'O' OPEN CLAIMS;'C' CLOSED CLAIMS;'A' FOR ALL; Display Open, Closed, or ALL claims (BNT BPS*1.0*7)
;2.03 SUBMISSION TYPE --'B' BILLING REQUESTS;'R' REVERSALS;'A' FOR ALL; Display specific submission type claims or ALL (BNT BPS*1.0*7)
;2.04 INSURANCES -- List of POINTERs to the INSURANCE COMPANY FILE (#36) separated by ";"
;should start and end with ";", example: ";4;5;"
;NOTE: use D ^XPAREDIT to add/edit values
;
;*****
;
CV ;
N BPSRESCV,BPSTMPCV,DIR,Y
D FULL^VALM1
W @IOF
S BPSTMPCV=$G(BPARR("TEMPCV")) ; Define Temp View Flag before BPARR is killed
K BPARR
I +$G(DUZ)=0 D ERRMSG^BPSSCRCV("Unknown User") Q
N BPDUZ7
S BPDUZ7=+DUZ
;always get current profile from the file
D READPROF^BPSSCRSL(.BPARR,BPDUZ7)
; BPARR("1.13") is the parameter for Pharmacy Division.
; If BPARR("1.13") is defined, the user has a preferred view defined.
I ($G(BPSTMPCV)=1)&($G(BPARR("1.13"))'="") D
. S DIR(0)="Y"
. S DIR("A")="Restore your Preferred View and exit Change View (Y/N)"
. D ^DIR
. S BPSRESCV=Y
I $G(BPSRESCV)=1 G CV1 ; User replied YES - restore to preferred view.
D SAVEVIEW^BPSSCR01(.BPARR)
;edit current profile
D EDITPROF(.BPARR,.BPDUZ7)
;ask user if need to save everything in USR PROFILE file
;(except SORT LIST field)
N BPSRT S BPSRT=BPARR(1.12)
K BPARR(1.12)
D ENDEDIT^BPSSCRSL(.BPARR,+BPDUZ7)
S BPARR(1.12)=BPSRT
CV1 ;
D SAVEVIEW^BPSSCR01(.BPARR)
S VALMBG=1
D REDRAW^BPSSCRUD("Updating screen...")
Q
;edit user profile for CHANGE VIEW
EDITPROF(BPARR,BPDUZ7) ;
I +$G(DUZ)=0 D ERRMSG("Unknown User") Q
N BP1,BPACT,BPTF,BPQ,BPINP
N BPRET
N DIR,DR,DIE,DA
N BPS106,BPS106STR,BPS108,BPS108STR,BPS109,BPS109STR,BPS115,BPS115AR,BPS115NM,BPS115X
N BPS116,BPS116AR,BPS116NM,BPS116X,BPS117,BPS117AR,BPS117NM,BPS117X,BPS118,BPS118AR,BPS118X
N BPS201,BPS201STR,BPSCNT,BPSDRUG,BPSERR,BPSRXD,BPSRXN,BPSSEL,BPSX,BPSDAYS,BPSTMPDT
;get ONE/ALL USERS?
;EDITFLD(FILENO,FLDNO,RECIEN,CODESET,PRMTMSG,DFLTCODE) ;
;
BPS113 ; FIELD 1.13 - Division
S BPRET=$$DS^BPSSCRDS(.BPARR,+BPDUZ7) ;get divisions
Q:BPRET=-2 ;quit due to timeout or ^
; If (D)ivision option was selected but no Divisons entered, set BPARR(1.13)to "A"
; and re-prompt current question.
I ($G(BPARR(1.13))="D")&(($G(BPARR("DIVS"))="")!($G(BPARR("DIVS"))=";")) S BPARR(1.13)="A" G BPS113
;
I $$BPS201^BPSSCRV1(.BPARR)=0 Q
I $$BPS101^BPSSCRV1(.BPARR)=0 Q
I $$BPS102^BPSSCRV1(.BPARR)=0 Q
I BPARR(1.02)="A" S BPSTMPDT="" D DTERNG ; If ALL patients, verify date range is not over 180 days
I $$BPS103^BPSSCRV1(.BPARR)=0 Q
;
DATETIME ; Display by Date Range or Timeframe
; Prompt the user to select Display Activity Date Range or Timeframe.
S BPINP=$$ACTTYP()
Q:BPINP=-1 ;quit due to timeout or ^
;
S BPACT=BPINP
S BPQ=0
;
S BPSDAYS=180
I BPARR(1.02)="P" S BPSDAYS=366
;
; If Date Range was selected, prompt for Activity Beginning and Ending Date.
I BPACT="D" D
. ; Clear out Timeframe parameters.
. S (BPARR(1.04),BPARR(1.05))=""
. ;
. S BPINP=$$BEGDATE()
. I BPINP=-1 S BPQ=-1 Q
. S BPINP=$$ENDDATE()
. I BPINP=-1 S BPQ=-1 Q
;
I BPQ=-1 D G DATETIME ; Date Range selected, but no dates entered
. W !!,"Beginning and Ending Dates are required for Date Range"
. ; Don't allow user to exit out without making valid selections.
. ; If user selects Date Range but no valid dates default to Timeframe and 7 days.
. S BPARR(1.031)="T",BPARR(1.04)="D",BPARR(1.05)=7
;
; If Timeframe was selected, prompt for Days or Hours and Activity Timeframe Value.
I BPACT="T" D
. ; Clear out Date Range Parameters.
. S (BPARR(1.032),BPARR(1.033))=""
. ;
. S BPINP=$$EDITFLD(1.04,+BPDUZ7,"S^D:DAYS;H:HOURS","Activity Timeframe (H)ours or (D)ays","DAYS",.BPARR)
. I BPINP=-1 S BPQ=-1 Q
. S BPTF=$P(BPINP,U,2)
. S BPINP=$$EDITFLD(1.05,+BPDUZ7,"N^1:"_BPSDAYS_":0","Activity Timeframe Value",$S(BPTF="H":24,1:7),.BPARR)
. I BPINP=-1 S BPQ=-1 Q
Q:BPQ=-1 ;quit due to timeout or ^
;
Q:$$EDITFLD(2.02,+BPDUZ7,"S^O:OPEN CLAIMS;C:CLOSED CLAIMS;A:ALL","Select Open/Closed or All Claims","O",.BPARR)=-1
Q:$$EDITFLD(1.19,+BPDUZ7,"S^O:Open Non-Billable Entries;C:Closed Non-Billable Entries;A:ALL","Display (O)pen or (C)losed or (A)ll Non-Billable Entries","A",.BPARR)=-1
Q:$$EDITFLD(2.03,+BPDUZ7,"S^B:BILLING REQUESTS;R:REVERSALS;A:ALL","Select Submission Type","A",.BPARR)=-1
I $$BPS106^BPSSCRV2(.BPARR)=0 Q
Q:$$EDITFLD(1.07,+BPDUZ7,"S^R:RELEASED;N:NON-RELEASED;A:ALL","Display (R)eleased Rxs or (N)on-Released Rxs or (A)LL","RELEASED",.BPARR)=-1
I $$BPS108^BPSSCRV2(.BPARR)=0 Q
I $$BPS109^BPSSCRV2(.BPARR)=0 Q
I $$BPS110^BPSSCRV2(.BPARR)=0 Q
;
Q:$$INSURSEL^BPSSCRCU(.BPARR,+BPDUZ7)=-1
Q
;
ERRMSG(BPMSG) ;
W !,"***",BPMSG,"***",!
D PAUSE^VALM1
Q
;/**
;FLDNO - PARAMETERS INSTANCE
;RECIEN - User DUZ
;DIR0 - like DIR(0) node for ^DIR - i.e. field type, etc
;PRMTMSG - user prompt
;DFLTVAL - pass the default value for the case if there is no value in database
;BPARRAY - array to store and change values in profile
;returns:
;as return value:
; "1^value" - if selected
; "-1" if timeout or uparrow
;via BPARRAY
; BPARRAY(filedno)=value
EDITFLD(FLDNO,RECIEN,DIR0,PRMTMSG,DFLTVAL,BPARRAY) ;*/
N DIR,RETV,RETARR
N RECIENS,FDA,LCK,ERRARR
S RETV=$$GETPARAM^BPSSCRSL(FLDNO,RECIEN)
I FLDNO=1.17 S RETV=$P($G(^DPT(+RETV,0)),U)
;Use the External Code from File #9002313.93 as the default value to display to user.
I FLDNO=1.15 S RETV=$P($G(^BPSF(9002313.93,+RETV,0)),U)
;if data then use it, otherwise use data from parameter
I $L($G(RETV))>0&($G(BPSERR)'=1) S DFLTVAL=RETV E S DFLTVAL=$G(DFLTVAL)
;prompt the user
S RETV=$$PROMPT(DIR0,PRMTMSG,DFLTVAL)
Q:RETV<0 -1
;save it in the database
S BPARRAY(FLDNO)=RETV
Q "1^"_RETV
;
;
FILEIT(FILENO,FLDNO,RECIEN,NEWVAL) ;
N RECIENS
S RECIENS=RECIEN_","
S FDA(FILENO,RECIENS,FLDNO)=NEWVAL
L +^BPS(FILENO,RECIEN,1):10 S LCK=$T I 'LCK Q "0^"_NEWVAL_"^LOCKED" ;quit
D FILE^DIE("","FDA","ERRARR")
I LCK L -^BPS(FILENO,RECIEN,1)
I $D(ERRARR) Q "0^"_NEWVAL_"^"_ERRARR("DIERR",1,"TEXT",1)
Q "1^"_NEWVAL
;
;prompts for selection
;returns selection
;OR -1 when timeout and uparrow
PROMPT(ZERONODE,PRMTMSG,DFLTVAL) ;
N Y,DUOUT,DTOUT,BPQUIT,DIROUT
S BPQUIT=0
I $E(ZERONODE,1,1)="P" D
. N DIC
. S DIC="^"_$P(ZERONODE,U,2)
. S DIC(0)="AEMNQ"
. S:$L($G(DFLTVAL))>0 DIC("B")=DFLTVAL
. S DIC("A")=PRMTMSG_": "
. D ^DIC
. I (Y=-1)!$D(DUOUT)!$D(DTOUT) S BPQUIT=1
E D
. N DIR
. S DIR(0)=ZERONODE
. S DIR("A")=PRMTMSG
. S:$L($G(DFLTVAL))>0 DIR("B")=DFLTVAL
. ;
. ; display some extra text for FLDNO=1.19 (BPS*1*20)
. I $G(FLDNO)=1.19 D
.. S DIR("A",1)=" Please note this question only applies to"
.. S DIR("A",2)=" TRICARE or CHAMPVA Non-Billable Entries."
.. S DIR("A",3)=" "
.. Q
. ;
. D ^DIR
. I (Y=-1)!$D(DIROUT)!$D(DUOUT)!$D(DTOUT) S BPQUIT=1
I BPQUIT=1 Q -1
Q $P(Y,U)
;
GETFLD(FILENO,FLDNO,RECIEN) ;
N RETV,RETARR
N RECIENS
S RECIENS=RECIEN_","
; first try to get the value from file
D GETS^DIQ(FILENO,RECIENS,FLDNO,"E","RETARR")
S RETV=$G(RETARR(FILENO,RECIENS,FLDNO,"E"))
Q $G(RETV)
;
;save all profile array to file
;BPARRAY - arrays with pointers to 9002313.56
;BPDUZ7 - DUZ
FILEALL(BPARRAY,BPDUZ7) ;
;BPS*14 - RRA changed API, because previously it was re-writing Division
;and Insurance parameter regardless if it was modified and had a value
;ticket 337299
N BPFLD,BP2
S BPFLD=0
F S BPFLD=$O(BPARRAY(BPFLD)) Q:$G(BPFLD)="" D
. I BPFLD="DIVS" I $$SAVEPAR^BPSSCRSL(2,BPDUZ7,$G(BPARRAY("DIVS")))
. I BPFLD="INS" I $$SAVEPAR^BPSSCRSL(2.04,BPDUZ7,$G(BPARRAY("INS")))
. Q:+BPFLD=0 I $$SAVEPAR^BPSSCRSL(BPFLD,+BPDUZ7,$G(BPARRAY(BPFLD)))
Q
;
ACTTYP() ; Prompt the user to select Display Activity Date Range or Timeframe.
; The user is required to select D or T and there is no default value.
;
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,RETV,X,Y
S RETV=$$GETPARAM^BPSSCRSL(1.031,+BPDUZ7)
S DIR(0)="S^D:Date Range;T:Timeframe"
S DIR("A")="Display Activity (D)ate Range or (T)imeframe"
S DIR("B")="T"
I RETV'="" S DIR("B")=RETV
S DIR("?",1)="Date Range will allow a user to specify an activity beginning and ending date."
S DIR("?")="Timeframe will allow a user to specify the activity by days or hours."
D ^DIR
;
;quit due to timeout or ^
I $D(DIRUT) Q -1
;
S BPARR(1.031)=Y
Q BPARR(1.031)
;
BEGDATE() ; Enter Activity Beginning Date when Date Range is selected
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,RETV,X,Y
S RETV=$$GETPARAM^BPSSCRSL(1.032,+BPDUZ7)
I $G(BPSTMPDT)=1 S RETV="T-7"
BEGDATE1 ;
S DIR(0)="D"
S DIR("A")="Activity Beginning Date"
I RETV'="" S DIR("B")=$$FMTE^XLFDT(RETV,"D")
S DIR("?")="Enter a date which is less than or equal to "_$$FMTE^XLFDT($$NOW^XLFDT(),"D")
D ^DIR
;
;quit due to timeout or ^
I $D(DIRUT) Q -1
;
I Y>$$NOW^XLFDT() W !,"Enter a date less than or equal to "_$$FMTE^XLFDT($$NOW^XLFDT(),"D"),! G BEGDATE1
;
W " (",Y(0),")"
S BPARR(1.032)=Y
Q BPARR(1.032)
;
ENDDATE() ; Enter Activity Ending Date when Date Range is selected
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,RETV,X,Y
S RETV=$$GETPARAM^BPSSCRSL(1.033,+BPDUZ7)
I $G(BPSTMPDT)=1 S RETV="T"
ENDDATE1 ;
S DIR(0)="D"
S DIR("A")="Activity Ending Date"
I RETV'="" S DIR("B")=$$FMTE^XLFDT(RETV,"D")
S DIR("?")="Enter a date which is no more than "_BPSDAYS_" days after the Beginning Date."
D ^DIR
;
;quit due to timeout or ^
I $D(DIRUT) Q -1
;
I Y<BPARR(1.032) W !!,"Ending Date precedes Beginning Date.",! G ENDDATE1
;
I $$FMDIFF^XLFDT(Y,BPARR(1.032))>BPSDAYS D G ENDDATE1
. W !!,"Date range exceeds "_BPSDAYS_" day limit. Select an Ending Date no more"
. W !,"than "_BPSDAYS_" days after the Beginning Date.",!
;
W " (",Y(0),")"
S BPARR(1.033)=Y
Q BPARR(1.033)
;
DTERNG ; Date Range Check
; If ALL patients selected, verify the user preferred time frame
; is not outside of the allowable range. If time frame is outside
; of the allowable range, update range to the past 7 days.
N BPS1031,BPS1032,BPS1033,BPS104,BPS105,BPSDAYS
S BPS1031=$$GETPARAM^BPSSCRSL(1.031,+BPDUZ7)
S BPS1032=$$GETPARAM^BPSSCRSL(1.032,+BPDUZ7)
S BPS1033=$$GETPARAM^BPSSCRSL(1.033,+BPDUZ7)
S BPS104=$$GETPARAM^BPSSCRSL(1.04,+BPDUZ7)
S BPS105=$$GETPARAM^BPSSCRSL(1.05,+BPDUZ7)
I ((BPS1031="T")&(BPS105>180))!((BPS1031="D")&($$FMDIFF^XLFDT(BPS1033,BPS1032)>180)) D
. S BPARR(1.031)="T"
. S BPARR(1.032)=""
. S BPARR(1.033)=""
. S BPARR(1.04)="D"
. S BPARR(1.05)=7
. I BPS1031="T" S BPSDAYS=BPS105
. I BPS1031="D" S BPSDAYS=$$FMDIFF^XLFDT(BPS1033,BPS1032)
. W !!,"Date range exceeds 180 day limit which is not allowed when all patients"
. W !,"are selected. The window of time has changed from "_BPSDAYS_" days to the"
. W !,"last 7 days."
. S BPSTMPDT=1
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HBPSSCRCV 14495 printed Oct 16, 2024@17:53:57 Page 2
BPSSCRCV ;BHAM ISC/SS - ECME SCREEN CHANGE VIEW ;05-APR-05
+1 ;;1.0;E CLAIMS MGMT ENGINE;**1,5,7,11,14,20,22,23**;JUN 2004;Build 44
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;USER SCREEN
+4 QUIT
+5 ;****
+6 ;This software is using PARAMETER TOOLS (see XT*7.3*26) to store user's settings:
+7 ;PARAMETER DEFINITION NAME="BPS USRSCR" (file #8989.51, IA# 2263)
+8 ;ENTITY is "USR" , i.e. IEN in ^VA(200 -- see definition for "BPS USRSCR"
+9 ;INSTANCEs are as follows:
+10 ;1.01 ONE/ALL USERS --'U' ONE USER, 'A' ALL; Display claims for ONE or ALL users
+11 ;1.02 ONE/ALL PATIENTS --'P' FOR ONE PATIENT; 'A' FOR ALL; Display claims for ONE/ALL PATIENTS
+12 ;1.03 ONE/ALL RX --'R' FOR ONE RX; 'A' FOR ALL; Display claims for ONE or ALL RX
+13 ;1.031 DATE RANGE/TIMEFRAME -- 'D' FOR DATE RANGE; 'T' FOR TIMEFRAME;
+14 ;1.032 ACTIVITY BEGINNING DATE - Beginning Date of the Date Range
+15 ;1.033 ACTIVITY ENDING DATE - Ending Date of the Date Range
+16 ;1.04 HOURS/DAYS -- 'D' FOR DAYS; 'H' FOR HOURS; Use HOURS or DAYS to specify timeframe
+17 ;1.05 TIMEFRAME -- NUMBER Depends on the value of the field "USR SCR HOURS/DAYS" this field will
+18 ;store the default number of HOURS from NOW or DAYS from TODAY to select claims to display
+19 ;1.06 REJECTED/PAYABLE --'R' FOR REJECTS; 'P' FOR PAYABLES; 'U' FOR UNSTRANDED; 'A' FOR ALL; Display Rejects or Payables or Unstranded or ALL claims
+20 ;1.07 RELEASED/NOT RELEASED --'R' FOR RELEASED; 'N' FOR NON-RELEASED; 'A' FOR ALL; Display Released Rxs or Non-Released Rxs or ALL
+21 ;1.08 CMOP/MAIL/WINDOW --'C' FOR CMOP; 'M' FOR MAIL;'W' FOR WINDOW;'A' FOR ALL; Display CMOP or Mail or Window or ALL Rxs
+22 ;1.09 REALTIME/BACKBILL --'R' FOR REALTIME; 'B' FOR BACKBILLS; 'P' FOR PRO Option; 'S' FOR ECME User Screen Resubmits;
+23 ; 'A' FOR ALL; Display RealTime, Backbills, PRO Option, Resubmission, or ALL
+24 ;1.1 REJECT CODE/ALL --'R' FOR REJECT CODE; 'A' FOR ALL; Display Specific Reject Code or ALL Reject
+25 ;Codes 0 means ALL Reject Codes otherwise - Reject Code value
+26 ;1.11 SPECIFIC/ALL INSURANCES --'I' FOR SPECIFIC INSURANCE(S);'A' FOR ALL; Display Specific Insurance Company(s) or All null - ALL otherwise - pointer to INSURANCE COMPANY file #36
+27 ;1.12 SORT LIST --'T' FOR TRANSACTION DATE;'D' FOR DIVISION; 'I' FOR INSURANCE; 'C' FOR REJECT CODE;
+28 ;'P' FOR PATIENT NAME -- 'N' FOR DRUG NAME; 'B' FOR BILL TYPE (BB/P2/RT/RS); 'L' FOR FILL LOCATION;
+29 ;'R' FOR RELEASED/NON-RELEASED -- 'A' FOR ACTIVE/DISCONTINUED; the field used to sort claims in the list
+30 ;1.13 ALL ECME PHARMACY DIVISIONS --'D' FOR DIVISION; 'A' FOR ALL;
+31 ;1.14 SELECTED INSURANCE -- Single, or multiple, insurance(s) to select claims for the User Screen, to store INSURANCE COMPANY pointer (#36)
+32 ;1.15 SELECTED REJECTED CODE --POINTER TO BPS NCPDP REJECT CODES FILE (#9002313.93) Reject code selected by the user to filter claims.
+33 ;1.16 SELECTED USER -- POINTER TO NEW PERSON FILE (#200) Selected user for the user screen
+34 ;1.17 SELECTED PATIENT -- POINTER TO PATIENT FILE (#2) Selected patient for the User Screen
+35 ;1.18 SELECTED RX -- POINTER TO PRESCRIPTION FILE (#52) Selected RX
+36 ;1.19 NON-BILLABLE TRI/CVA ENTRIES OPEN/CLOSED/ALL -- 'O' Open; 'C' Closed; 'A' All
+37 ;2 ECME PHARMACY DIVISION -- the list of POINTERs TO BPS PHARMACIES FILE (#9002313.56) separated by ";"
+38 ;should start and end with ";", example: ";4;5;"
+39 ;2.01 ELIGIBILITY TYPE --'V' FOR VETERAN;'T' FOR TRICARE;'C' FOR CHAMPVA;'A' FOR ALL; Display claims for specific Eligibility Type or ALL (BNT BPS*1.0*7)
+40 ;2.02 OPEN/CLOSED/ALL --'O' OPEN CLAIMS;'C' CLOSED CLAIMS;'A' FOR ALL; Display Open, Closed, or ALL claims (BNT BPS*1.0*7)
+41 ;2.03 SUBMISSION TYPE --'B' BILLING REQUESTS;'R' REVERSALS;'A' FOR ALL; Display specific submission type claims or ALL (BNT BPS*1.0*7)
+42 ;2.04 INSURANCES -- List of POINTERs to the INSURANCE COMPANY FILE (#36) separated by ";"
+43 ;should start and end with ";", example: ";4;5;"
+44 ;NOTE: use D ^XPAREDIT to add/edit values
+45 ;
+46 ;*****
+47 ;
CV ;
+1 NEW BPSRESCV,BPSTMPCV,DIR,Y
+2 DO FULL^VALM1
+3 WRITE @IOF
+4 ; Define Temp View Flag before BPARR is killed
SET BPSTMPCV=$GET(BPARR("TEMPCV"))
+5 KILL BPARR
+6 IF +$GET(DUZ)=0
DO ERRMSG^BPSSCRCV("Unknown User")
QUIT
+7 NEW BPDUZ7
+8 SET BPDUZ7=+DUZ
+9 ;always get current profile from the file
+10 DO READPROF^BPSSCRSL(.BPARR,BPDUZ7)
+11 ; BPARR("1.13") is the parameter for Pharmacy Division.
+12 ; If BPARR("1.13") is defined, the user has a preferred view defined.
+13 IF ($GET(BPSTMPCV)=1)&($GET(BPARR("1.13"))'="")
Begin DoDot:1
+14 SET DIR(0)="Y"
+15 SET DIR("A")="Restore your Preferred View and exit Change View (Y/N)"
+16 DO ^DIR
+17 SET BPSRESCV=Y
End DoDot:1
+18 ; User replied YES - restore to preferred view.
IF $GET(BPSRESCV)=1
GOTO CV1
+19 DO SAVEVIEW^BPSSCR01(.BPARR)
+20 ;edit current profile
+21 DO EDITPROF(.BPARR,.BPDUZ7)
+22 ;ask user if need to save everything in USR PROFILE file
+23 ;(except SORT LIST field)
+24 NEW BPSRT
SET BPSRT=BPARR(1.12)
+25 KILL BPARR(1.12)
+26 DO ENDEDIT^BPSSCRSL(.BPARR,+BPDUZ7)
+27 SET BPARR(1.12)=BPSRT
CV1 ;
+1 DO SAVEVIEW^BPSSCR01(.BPARR)
+2 SET VALMBG=1
+3 DO REDRAW^BPSSCRUD("Updating screen...")
+4 QUIT
+5 ;edit user profile for CHANGE VIEW
EDITPROF(BPARR,BPDUZ7) ;
+1 IF +$GET(DUZ)=0
DO ERRMSG("Unknown User")
QUIT
+2 NEW BP1,BPACT,BPTF,BPQ,BPINP
+3 NEW BPRET
+4 NEW DIR,DR,DIE,DA
+5 NEW BPS106,BPS106STR,BPS108,BPS108STR,BPS109,BPS109STR,BPS115,BPS115AR,BPS115NM,BPS115X
+6 NEW BPS116,BPS116AR,BPS116NM,BPS116X,BPS117,BPS117AR,BPS117NM,BPS117X,BPS118,BPS118AR,BPS118X
+7 NEW BPS201,BPS201STR,BPSCNT,BPSDRUG,BPSERR,BPSRXD,BPSRXN,BPSSEL,BPSX,BPSDAYS,BPSTMPDT
+8 ;get ONE/ALL USERS?
+9 ;EDITFLD(FILENO,FLDNO,RECIEN,CODESET,PRMTMSG,DFLTCODE) ;
+10 ;
BPS113 ; FIELD 1.13 - Division
+1 ;get divisions
SET BPRET=$$DS^BPSSCRDS(.BPARR,+BPDUZ7)
+2 ;quit due to timeout or ^
if BPRET=-2
QUIT
+3 ; If (D)ivision option was selected but no Divisons entered, set BPARR(1.13)to "A"
+4 ; and re-prompt current question.
+5 IF ($GET(BPARR(1.13))="D")&(($GET(BPARR("DIVS"))="")!($GET(BPARR("DIVS"))=";"))
SET BPARR(1.13)="A"
GOTO BPS113
+6 ;
+7 IF $$BPS201^BPSSCRV1(.BPARR)=0
QUIT
+8 IF $$BPS101^BPSSCRV1(.BPARR)=0
QUIT
+9 IF $$BPS102^BPSSCRV1(.BPARR)=0
QUIT
+10 ; If ALL patients, verify date range is not over 180 days
IF BPARR(1.02)="A"
SET BPSTMPDT=""
DO DTERNG
+11 IF $$BPS103^BPSSCRV1(.BPARR)=0
QUIT
+12 ;
DATETIME ; Display by Date Range or Timeframe
+1 ; Prompt the user to select Display Activity Date Range or Timeframe.
+2 SET BPINP=$$ACTTYP()
+3 ;quit due to timeout or ^
if BPINP=-1
QUIT
+4 ;
+5 SET BPACT=BPINP
+6 SET BPQ=0
+7 ;
+8 SET BPSDAYS=180
+9 IF BPARR(1.02)="P"
SET BPSDAYS=366
+10 ;
+11 ; If Date Range was selected, prompt for Activity Beginning and Ending Date.
+12 IF BPACT="D"
Begin DoDot:1
+13 ; Clear out Timeframe parameters.
+14 SET (BPARR(1.04),BPARR(1.05))=""
+15 ;
+16 SET BPINP=$$BEGDATE()
+17 IF BPINP=-1
SET BPQ=-1
QUIT
+18 SET BPINP=$$ENDDATE()
+19 IF BPINP=-1
SET BPQ=-1
QUIT
End DoDot:1
+20 ;
+21 ; Date Range selected, but no dates entered
IF BPQ=-1
Begin DoDot:1
+22 WRITE !!,"Beginning and Ending Dates are required for Date Range"
+23 ; Don't allow user to exit out without making valid selections.
+24 ; If user selects Date Range but no valid dates default to Timeframe and 7 days.
+25 SET BPARR(1.031)="T"
SET BPARR(1.04)="D"
SET BPARR(1.05)=7
End DoDot:1
GOTO DATETIME
+26 ;
+27 ; If Timeframe was selected, prompt for Days or Hours and Activity Timeframe Value.
+28 IF BPACT="T"
Begin DoDot:1
+29 ; Clear out Date Range Parameters.
+30 SET (BPARR(1.032),BPARR(1.033))=""
+31 ;
+32 SET BPINP=$$EDITFLD(1.04,+BPDUZ7,"S^D:DAYS;H:HOURS","Activity Timeframe (H)ours or (D)ays","DAYS",.BPARR)
+33 IF BPINP=-1
SET BPQ=-1
QUIT
+34 SET BPTF=$PIECE(BPINP,U,2)
+35 SET BPINP=$$EDITFLD(1.05,+BPDUZ7,"N^1:"_BPSDAYS_":0","Activity Timeframe Value",$SELECT(BPTF="H":24,1:7),.BPARR)
+36 IF BPINP=-1
SET BPQ=-1
QUIT
End DoDot:1
+37 ;quit due to timeout or ^
if BPQ=-1
QUIT
+38 ;
+39 if $$EDITFLD(2.02,+BPDUZ7,"S^O
QUIT
+40 if $$EDITFLD(1.19,+BPDUZ7,"S^O
QUIT
+41 if $$EDITFLD(2.03,+BPDUZ7,"S^B
QUIT
+42 IF $$BPS106^BPSSCRV2(.BPARR)=0
QUIT
+43 if $$EDITFLD(1.07,+BPDUZ7,"S^R
QUIT
+44 IF $$BPS108^BPSSCRV2(.BPARR)=0
QUIT
+45 IF $$BPS109^BPSSCRV2(.BPARR)=0
QUIT
+46 IF $$BPS110^BPSSCRV2(.BPARR)=0
QUIT
+47 ;
+48 if $$INSURSEL^BPSSCRCU(.BPARR,+BPDUZ7)=-1
QUIT
+49 QUIT
+50 ;
ERRMSG(BPMSG) ;
+1 WRITE !,"***",BPMSG,"***",!
+2 DO PAUSE^VALM1
+3 QUIT
+4 ;/**
+5 ;FLDNO - PARAMETERS INSTANCE
+6 ;RECIEN - User DUZ
+7 ;DIR0 - like DIR(0) node for ^DIR - i.e. field type, etc
+8 ;PRMTMSG - user prompt
+9 ;DFLTVAL - pass the default value for the case if there is no value in database
+10 ;BPARRAY - array to store and change values in profile
+11 ;returns:
+12 ;as return value:
+13 ; "1^value" - if selected
+14 ; "-1" if timeout or uparrow
+15 ;via BPARRAY
+16 ; BPARRAY(filedno)=value
EDITFLD(FLDNO,RECIEN,DIR0,PRMTMSG,DFLTVAL,BPARRAY) ;*/
+1 NEW DIR,RETV,RETARR
+2 NEW RECIENS,FDA,LCK,ERRARR
+3 SET RETV=$$GETPARAM^BPSSCRSL(FLDNO,RECIEN)
+4 IF FLDNO=1.17
SET RETV=$PIECE($GET(^DPT(+RETV,0)),U)
+5 ;Use the External Code from File #9002313.93 as the default value to display to user.
+6 IF FLDNO=1.15
SET RETV=$PIECE($GET(^BPSF(9002313.93,+RETV,0)),U)
+7 ;if data then use it, otherwise use data from parameter
+8 IF $LENGTH($GET(RETV))>0&($GET(BPSERR)'=1)
SET DFLTVAL=RETV
IF '$TEST
SET DFLTVAL=$GET(DFLTVAL)
+9 ;prompt the user
+10 SET RETV=$$PROMPT(DIR0,PRMTMSG,DFLTVAL)
+11 if RETV<0
QUIT -1
+12 ;save it in the database
+13 SET BPARRAY(FLDNO)=RETV
+14 QUIT "1^"_RETV
+15 ;
+16 ;
FILEIT(FILENO,FLDNO,RECIEN,NEWVAL) ;
+1 NEW RECIENS
+2 SET RECIENS=RECIEN_","
+3 SET FDA(FILENO,RECIENS,FLDNO)=NEWVAL
+4 ;quit
LOCK +^BPS(FILENO,RECIEN,1):10
SET LCK=$TEST
IF 'LCK
QUIT "0^"_NEWVAL_"^LOCKED"
+5 DO FILE^DIE("","FDA","ERRARR")
+6 IF LCK
LOCK -^BPS(FILENO,RECIEN,1)
+7 IF $DATA(ERRARR)
QUIT "0^"_NEWVAL_"^"_ERRARR("DIERR",1,"TEXT",1)
+8 QUIT "1^"_NEWVAL
+9 ;
+10 ;prompts for selection
+11 ;returns selection
+12 ;OR -1 when timeout and uparrow
PROMPT(ZERONODE,PRMTMSG,DFLTVAL) ;
+1 NEW Y,DUOUT,DTOUT,BPQUIT,DIROUT
+2 SET BPQUIT=0
+3 IF $EXTRACT(ZERONODE,1,1)="P"
Begin DoDot:1
+4 NEW DIC
+5 SET DIC="^"_$PIECE(ZERONODE,U,2)
+6 SET DIC(0)="AEMNQ"
+7 if $LENGTH($GET(DFLTVAL))>0
SET DIC("B")=DFLTVAL
+8 SET DIC("A")=PRMTMSG_": "
+9 DO ^DIC
+10 IF (Y=-1)!$DATA(DUOUT)!$DATA(DTOUT)
SET BPQUIT=1
End DoDot:1
+11 IF '$TEST
Begin DoDot:1
+12 NEW DIR
+13 SET DIR(0)=ZERONODE
+14 SET DIR("A")=PRMTMSG
+15 if $LENGTH($GET(DFLTVAL))>0
SET DIR("B")=DFLTVAL
+16 ;
+17 ; display some extra text for FLDNO=1.19 (BPS*1*20)
+18 IF $GET(FLDNO)=1.19
Begin DoDot:2
+19 SET DIR("A",1)=" Please note this question only applies to"
+20 SET DIR("A",2)=" TRICARE or CHAMPVA Non-Billable Entries."
+21 SET DIR("A",3)=" "
+22 QUIT
End DoDot:2
+23 ;
+24 DO ^DIR
+25 IF (Y=-1)!$DATA(DIROUT)!$DATA(DUOUT)!$DATA(DTOUT)
SET BPQUIT=1
End DoDot:1
+26 IF BPQUIT=1
QUIT -1
+27 QUIT $PIECE(Y,U)
+28 ;
GETFLD(FILENO,FLDNO,RECIEN) ;
+1 NEW RETV,RETARR
+2 NEW RECIENS
+3 SET RECIENS=RECIEN_","
+4 ; first try to get the value from file
+5 DO GETS^DIQ(FILENO,RECIENS,FLDNO,"E","RETARR")
+6 SET RETV=$GET(RETARR(FILENO,RECIENS,FLDNO,"E"))
+7 QUIT $GET(RETV)
+8 ;
+9 ;save all profile array to file
+10 ;BPARRAY - arrays with pointers to 9002313.56
+11 ;BPDUZ7 - DUZ
FILEALL(BPARRAY,BPDUZ7) ;
+1 ;BPS*14 - RRA changed API, because previously it was re-writing Division
+2 ;and Insurance parameter regardless if it was modified and had a value
+3 ;ticket 337299
+4 NEW BPFLD,BP2
+5 SET BPFLD=0
+6 FOR
SET BPFLD=$ORDER(BPARRAY(BPFLD))
if $GET(BPFLD)=""
QUIT
Begin DoDot:1
+7 IF BPFLD="DIVS"
IF $$SAVEPAR^BPSSCRSL(2,BPDUZ7,$GET(BPARRAY("DIVS")))
+8 IF BPFLD="INS"
IF $$SAVEPAR^BPSSCRSL(2.04,BPDUZ7,$GET(BPARRAY("INS")))
+9 if +BPFLD=0
QUIT
IF $$SAVEPAR^BPSSCRSL(BPFLD,+BPDUZ7,$GET(BPARRAY(BPFLD)))
End DoDot:1
+10 QUIT
+11 ;
ACTTYP() ; Prompt the user to select Display Activity Date Range or Timeframe.
+1 ; The user is required to select D or T and there is no default value.
+2 ;
+3 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,RETV,X,Y
+4 SET RETV=$$GETPARAM^BPSSCRSL(1.031,+BPDUZ7)
+5 SET DIR(0)="S^D:Date Range;T:Timeframe"
+6 SET DIR("A")="Display Activity (D)ate Range or (T)imeframe"
+7 SET DIR("B")="T"
+8 IF RETV'=""
SET DIR("B")=RETV
+9 SET DIR("?",1)="Date Range will allow a user to specify an activity beginning and ending date."
+10 SET DIR("?")="Timeframe will allow a user to specify the activity by days or hours."
+11 DO ^DIR
+12 ;
+13 ;quit due to timeout or ^
+14 IF $DATA(DIRUT)
QUIT -1
+15 ;
+16 SET BPARR(1.031)=Y
+17 QUIT BPARR(1.031)
+18 ;
BEGDATE() ; Enter Activity Beginning Date when Date Range is selected
+1 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,RETV,X,Y
+2 SET RETV=$$GETPARAM^BPSSCRSL(1.032,+BPDUZ7)
+3 IF $GET(BPSTMPDT)=1
SET RETV="T-7"
BEGDATE1 ;
+1 SET DIR(0)="D"
+2 SET DIR("A")="Activity Beginning Date"
+3 IF RETV'=""
SET DIR("B")=$$FMTE^XLFDT(RETV,"D")
+4 SET DIR("?")="Enter a date which is less than or equal to "_$$FMTE^XLFDT($$NOW^XLFDT(),"D")
+5 DO ^DIR
+6 ;
+7 ;quit due to timeout or ^
+8 IF $DATA(DIRUT)
QUIT -1
+9 ;
+10 IF Y>$$NOW^XLFDT()
WRITE !,"Enter a date less than or equal to "_$$FMTE^XLFDT($$NOW^XLFDT(),"D"),!
GOTO BEGDATE1
+11 ;
+12 WRITE " (",Y(0),")"
+13 SET BPARR(1.032)=Y
+14 QUIT BPARR(1.032)
+15 ;
ENDDATE() ; Enter Activity Ending Date when Date Range is selected
+1 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,RETV,X,Y
+2 SET RETV=$$GETPARAM^BPSSCRSL(1.033,+BPDUZ7)
+3 IF $GET(BPSTMPDT)=1
SET RETV="T"
ENDDATE1 ;
+1 SET DIR(0)="D"
+2 SET DIR("A")="Activity Ending Date"
+3 IF RETV'=""
SET DIR("B")=$$FMTE^XLFDT(RETV,"D")
+4 SET DIR("?")="Enter a date which is no more than "_BPSDAYS_" days after the Beginning Date."
+5 DO ^DIR
+6 ;
+7 ;quit due to timeout or ^
+8 IF $DATA(DIRUT)
QUIT -1
+9 ;
+10 IF Y<BPARR(1.032)
WRITE !!,"Ending Date precedes Beginning Date.",!
GOTO ENDDATE1
+11 ;
+12 IF $$FMDIFF^XLFDT(Y,BPARR(1.032))>BPSDAYS
Begin DoDot:1
+13 WRITE !!,"Date range exceeds "_BPSDAYS_" day limit. Select an Ending Date no more"
+14 WRITE !,"than "_BPSDAYS_" days after the Beginning Date.",!
End DoDot:1
GOTO ENDDATE1
+15 ;
+16 WRITE " (",Y(0),")"
+17 SET BPARR(1.033)=Y
+18 QUIT BPARR(1.033)
+19 ;
DTERNG ; Date Range Check
+1 ; If ALL patients selected, verify the user preferred time frame
+2 ; is not outside of the allowable range. If time frame is outside
+3 ; of the allowable range, update range to the past 7 days.
+4 NEW BPS1031,BPS1032,BPS1033,BPS104,BPS105,BPSDAYS
+5 SET BPS1031=$$GETPARAM^BPSSCRSL(1.031,+BPDUZ7)
+6 SET BPS1032=$$GETPARAM^BPSSCRSL(1.032,+BPDUZ7)
+7 SET BPS1033=$$GETPARAM^BPSSCRSL(1.033,+BPDUZ7)
+8 SET BPS104=$$GETPARAM^BPSSCRSL(1.04,+BPDUZ7)
+9 SET BPS105=$$GETPARAM^BPSSCRSL(1.05,+BPDUZ7)
+10 IF ((BPS1031="T")&(BPS105>180))!((BPS1031="D")&($$FMDIFF^XLFDT(BPS1033,BPS1032)>180))
Begin DoDot:1
+11 SET BPARR(1.031)="T"
+12 SET BPARR(1.032)=""
+13 SET BPARR(1.033)=""
+14 SET BPARR(1.04)="D"
+15 SET BPARR(1.05)=7
+16 IF BPS1031="T"
SET BPSDAYS=BPS105
+17 IF BPS1031="D"
SET BPSDAYS=$$FMDIFF^XLFDT(BPS1033,BPS1032)
+18 WRITE !!,"Date range exceeds 180 day limit which is not allowed when all patients"
+19 WRITE !,"are selected. The window of time has changed from "_BPSDAYS_" days to the"
+20 WRITE !,"last 7 days."
+21 SET BPSTMPDT=1
End DoDot:1
+22 QUIT