BPSSCR01 ;BHAM ISC/SS - USER SCREEN ;10-MAR-2005
;;1.0;E CLAIMS MGMT ENGINE;**1,5,11,20,23**;JUN 2004;Build 44
;;Per VA Directive 6402, this routine should not be modified.
;USER SCREEN
Q
;User Screen header
;input:
; BPSLN - line of the header
;output:
; text string for the header
HDR(BPSLN) ; -- header code
N BPARR,BPX,BPXSL
Q:'$D(@VALMAR@("VIEWPARAMS"))
D RESTVIEW(.BPARR)
I BPSLN=1 Q "SELECTED DIVISION(S): "_$$GETVDIVS(.BPARR,58)
I BPSLN=2 Q $$GETVDETS(.BPARR)
I BPSLN=3 D Q BPX
. S BPXSL=$$SORTTYPE^BPSSCRSL($G(BPARR(1.12)))
. I BPXSL="" S BPXSL="Transaction date by default"
. S BPX=" Sorted by: "_BPXSL
Q ""
;/**
;get current view details
GETVDETS(BPARR) ;*/
N BPSTR
; If Date Range was selected display the Activity Beginning and Ending Dates.
I $G(BPARR(1.031))="D" S BPSTR=$$LJ^BPSSCR02(" Activity Date Range: "_$$FMTE^XLFDT(BPARR(1.032))_" - "_$$FMTE^XLFDT(BPARR(1.033)),61)
;
; If Timeframe was selected display the number of hours or days.
E S BPSTR=" Activity Date Range: within the past "_$G(BPARR(1.05))_$S($G(BPARR(1.04))="H":" hour(s)",1:" day(s)")
Q BPSTR
;
;/**
;get divisions selected
GETVDIVS(BPARRAY,BPMLEN) ;*/
I $G(BPARRAY(1.13))="A" Q "ALL"
N BPDIV,BPCNT,BPSTR,BPQUIT
S BPQUIT=0,BPSTR=""
F BPCNT=1:1:20 S BPDIV=$P($G(BPARRAY("DIVS")),";",BPCNT+1) Q:+BPDIV=0 D Q:BPQUIT=1
. I $L(BPSTR_$$DIVNAME^BPSSCRDS(BPDIV))>(BPMLEN-4) D S BPQUIT=1 Q
. . S BPSTR=$$LJ^BPSSCR02(BPSTR_",...",BPMLEN)
. S BPSTR=BPSTR_$S(BPCNT>1:", ",1:"")_$$DIVNAME^BPSSCRDS(BPDIV)
Q BPSTR
;/**
;input:
; BPARR - local array to store user profile info
;returns:
; the last number in LM ARRAY
INIT() ; -- init variables and list array*/
N BPLN,BPLM,BP59,BPSORT,BPTMPGL,BPRET
N BPARR
;
;get user's ien in BPS PRFILE file
;if array is not defined then read information from file,
;otherwise use current info from the array, because the user
;may specify criteria in array without saving it in file for
;the temporary use
I '$D(@VALMAR@("VIEWPARAMS")) D
. D READPROF^BPSSCRSL(.BPARR,+DUZ)
. D SAVEVIEW(.BPARR)
E D RESTVIEW(.BPARR)
;get date/time range
I $$GETDT^BPSSCRU1(.BPARR)=0 Q
;
S BPTMPGL=$NA(^TMP($J,"BPSSCR"))
K @BPTMPGL,@VALMAR
D COLLECT^BPSSCR04(BPTMPGL,.BPARR)
D SAVEVIEW(.BPARR)
S BPRET=$$LMARRAY(BPTMPGL,.BPARR)
K @BPTMPGL
S:BPRET>1 BPRET=BPRET-1
Q BPRET
;
;/**
;make elements for List Manager array
;input:
;BPTMPGL - TMP global to store selected claims
;BPARR - local array to store user profile info
;returns:
; the last number in LM ARRAY
;indexing (example):
;S ^TMP("BPSSCR",$J,"VALM",1,0)="2 BUMSTEAD,CHARLE 5444 WEBMD"
;S ^TMP("BPSSCR",$J,"VALM",2,0)=" 2.1 CEFACLOR 500MG CAP"
;S ^TMP("BPSSCR",$J,"VALM",3,0)=" 2.2 AMPICILLIN 250MG CAP"
;S ^TMP("BPSSCR",$J,"VALM","LMIND",2,437272,7008776.00001,0)=""
;S ^TMP("BPSSCR",$J,"VALM","LMIND",2.1,437272,7008778.00011,1)=""
;S ^TMP("BPSSCR",$J,"VALM","LMIND",2.2,437272,7009457.00001,2)=""
LMARRAY(BPTMPGL,BPARR) ;*/
N BPSRTVAL,BP59,BPSORT,BPLN,BPLM,BPSTR1,BPCLM,BPPREV
S BPLM=0 ;patient_AND_insurance level counter
S BPCLM=0 ;claim level counter
S BP59=0
S BPLN=1 ;line counter for List manager array to display on the screen
S BPPREV=0 ;to store data from previous patient group
;sort type:
;'T' FOR TRANSACTION DATE
;'D' FOR DIVISION (ECME pharmacy)
;'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 (Windows/Mail/CMOP)
;'R' FOR RELEASED/NON-RELEASED RX
;'A' FOR ACTIVE/DISCONTINUED RX
S BPSORT=$G(BPARR(1.12))
S:BPSORT="" BPSORT="T" ;default
S BPSRTVAL="" ;a value that "makes" an order, can be a string
F S BPSRTVAL=$O(@BPTMPGL@("SORT",BPSORT,BPSRTVAL)) Q:BPSRTVAL="" D
. I BPSORT="D" D
. . S BPSTR1="---- Division: "_$$DIVNAME^BPSSCRDS(+$P(BPSRTVAL,U,2))_" "
. . D SET^VALM10(BPLN,BPSTR1_$$LINE^BPSSCRU3(79-$L(BPSTR1),"-"),0)
. . S BPLN=BPLN+1
. I BPSORT="C" D
. . S BPSTR1=$E("---- Reject code: "_$$GETRJNAM^BPSSCRU3(BPSRTVAL)_" ",1,79)
. . D SET^VALM10(BPLN,BPSTR1_$$LINE^BPSSCRU3(79-$L(BPSTR1),"-"),0)
. . S BPLN=BPLN+1
. S BP59=0
. F S BP59=+$O(@BPTMPGL@("SORT",BPSORT,BPSRTVAL,BP59)) Q:+BP59=0 D
. . I BP59'=0 D MKARRELM^BPSSCR02(.BPLN,VALMAR,BP59,.BPLM,.BPCLM,.BPPREV)
D UPDPREV^BPSSCR02(VALMAR,BPLM,BPPREV)
Q BPLN
;
HELP ; -- help code
N X S X="?" D DISP^XQORM1 W !!
Q
;
EXIT ; -- exit code
Q
;
EXPND ; -- expand code
Q
;/**
;store current view params in VALMAR("VIEWPARAMS") TMP global array
;to display in the header
;input:
; BPARR - array with user profile info to store
SAVEVIEW(BPARR) ; S @VALMAR@("VIEWPARAMS",BPLMIND,BPDFN,BP59,BPLINE)=""
Q:'$D(BPARR)
M @VALMAR@("VIEWPARAMS")=BPARR
Q
;
;/**
;restore current view params from VALMAR("VIEWPARAMS") TMP global array
;input:
; BPARR - array with user profile info to store
RESTVIEW(BPARR) ; S @VALMAR@("VIEWPARAMS",BPLMIND,BPDFN,BP59,BPLINE)=""
Q:'$D(@VALMAR@("VIEWPARAMS"))
M BPARR=@VALMAR@("VIEWPARAMS")
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HBPSSCR01 5162 printed Dec 13, 2024@01:53:02 Page 2
BPSSCR01 ;BHAM ISC/SS - USER SCREEN ;10-MAR-2005
+1 ;;1.0;E CLAIMS MGMT ENGINE;**1,5,11,20,23**;JUN 2004;Build 44
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;USER SCREEN
+4 QUIT
+5 ;User Screen header
+6 ;input:
+7 ; BPSLN - line of the header
+8 ;output:
+9 ; text string for the header
HDR(BPSLN) ; -- header code
+1 NEW BPARR,BPX,BPXSL
+2 if '$DATA(@VALMAR@("VIEWPARAMS"))
QUIT
+3 DO RESTVIEW(.BPARR)
+4 IF BPSLN=1
QUIT "SELECTED DIVISION(S): "_$$GETVDIVS(.BPARR,58)
+5 IF BPSLN=2
QUIT $$GETVDETS(.BPARR)
+6 IF BPSLN=3
Begin DoDot:1
+7 SET BPXSL=$$SORTTYPE^BPSSCRSL($GET(BPARR(1.12)))
+8 IF BPXSL=""
SET BPXSL="Transaction date by default"
+9 SET BPX=" Sorted by: "_BPXSL
End DoDot:1
QUIT BPX
+10 QUIT ""
+11 ;/**
+12 ;get current view details
GETVDETS(BPARR) ;*/
+1 NEW BPSTR
+2 ; If Date Range was selected display the Activity Beginning and Ending Dates.
+3 IF $GET(BPARR(1.031))="D"
SET BPSTR=$$LJ^BPSSCR02(" Activity Date Range: "_$$FMTE^XLFDT(BPARR(1.032))_" - "_$$FMTE^XLFDT(BPARR(1.033)),61)
+4 ;
+5 ; If Timeframe was selected display the number of hours or days.
+6 IF '$TEST
SET BPSTR=" Activity Date Range: within the past "_$GET(BPARR(1.05))_$SELECT($GET(BPARR(1.04))="H":" hour(s)",1:" day(s)")
+7 QUIT BPSTR
+8 ;
+9 ;/**
+10 ;get divisions selected
GETVDIVS(BPARRAY,BPMLEN) ;*/
+1 IF $GET(BPARRAY(1.13))="A"
QUIT "ALL"
+2 NEW BPDIV,BPCNT,BPSTR,BPQUIT
+3 SET BPQUIT=0
SET BPSTR=""
+4 FOR BPCNT=1:1:20
SET BPDIV=$PIECE($GET(BPARRAY("DIVS")),";",BPCNT+1)
if +BPDIV=0
QUIT
Begin DoDot:1
+5 IF $LENGTH(BPSTR_$$DIVNAME^BPSSCRDS(BPDIV))>(BPMLEN-4)
Begin DoDot:2
+6 SET BPSTR=$$LJ^BPSSCR02(BPSTR_",...",BPMLEN)
End DoDot:2
SET BPQUIT=1
QUIT
+7 SET BPSTR=BPSTR_$SELECT(BPCNT>1:", ",1:"")_$$DIVNAME^BPSSCRDS(BPDIV)
End DoDot:1
if BPQUIT=1
QUIT
+8 QUIT BPSTR
+9 ;/**
+10 ;input:
+11 ; BPARR - local array to store user profile info
+12 ;returns:
+13 ; the last number in LM ARRAY
INIT() ; -- init variables and list array*/
+1 NEW BPLN,BPLM,BP59,BPSORT,BPTMPGL,BPRET
+2 NEW BPARR
+3 ;
+4 ;get user's ien in BPS PRFILE file
+5 ;if array is not defined then read information from file,
+6 ;otherwise use current info from the array, because the user
+7 ;may specify criteria in array without saving it in file for
+8 ;the temporary use
+9 IF '$DATA(@VALMAR@("VIEWPARAMS"))
Begin DoDot:1
+10 DO READPROF^BPSSCRSL(.BPARR,+DUZ)
+11 DO SAVEVIEW(.BPARR)
End DoDot:1
+12 IF '$TEST
DO RESTVIEW(.BPARR)
+13 ;get date/time range
+14 IF $$GETDT^BPSSCRU1(.BPARR)=0
QUIT
+15 ;
+16 SET BPTMPGL=$NAME(^TMP($JOB,"BPSSCR"))
+17 KILL @BPTMPGL,@VALMAR
+18 DO COLLECT^BPSSCR04(BPTMPGL,.BPARR)
+19 DO SAVEVIEW(.BPARR)
+20 SET BPRET=$$LMARRAY(BPTMPGL,.BPARR)
+21 KILL @BPTMPGL
+22 if BPRET>1
SET BPRET=BPRET-1
+23 QUIT BPRET
+24 ;
+25 ;/**
+26 ;make elements for List Manager array
+27 ;input:
+28 ;BPTMPGL - TMP global to store selected claims
+29 ;BPARR - local array to store user profile info
+30 ;returns:
+31 ; the last number in LM ARRAY
+32 ;indexing (example):
+33 ;S ^TMP("BPSSCR",$J,"VALM",1,0)="2 BUMSTEAD,CHARLE 5444 WEBMD"
+34 ;S ^TMP("BPSSCR",$J,"VALM",2,0)=" 2.1 CEFACLOR 500MG CAP"
+35 ;S ^TMP("BPSSCR",$J,"VALM",3,0)=" 2.2 AMPICILLIN 250MG CAP"
+36 ;S ^TMP("BPSSCR",$J,"VALM","LMIND",2,437272,7008776.00001,0)=""
+37 ;S ^TMP("BPSSCR",$J,"VALM","LMIND",2.1,437272,7008778.00011,1)=""
+38 ;S ^TMP("BPSSCR",$J,"VALM","LMIND",2.2,437272,7009457.00001,2)=""
LMARRAY(BPTMPGL,BPARR) ;*/
+1 NEW BPSRTVAL,BP59,BPSORT,BPLN,BPLM,BPSTR1,BPCLM,BPPREV
+2 ;patient_AND_insurance level counter
SET BPLM=0
+3 ;claim level counter
SET BPCLM=0
+4 SET BP59=0
+5 ;line counter for List manager array to display on the screen
SET BPLN=1
+6 ;to store data from previous patient group
SET BPPREV=0
+7 ;sort type:
+8 ;'T' FOR TRANSACTION DATE
+9 ;'D' FOR DIVISION (ECME pharmacy)
+10 ;'I' FOR INSURANCE
+11 ;'C' FOR REJECT CODE
+12 ;'P' FOR PATIENT NAME
+13 ;'N' FOR DRUG NAME
+14 ;'B' FOR BILL TYPE (BB/P2/RT/RS)
+15 ;'L' FOR FILL LOCATION (Windows/Mail/CMOP)
+16 ;'R' FOR RELEASED/NON-RELEASED RX
+17 ;'A' FOR ACTIVE/DISCONTINUED RX
+18 SET BPSORT=$GET(BPARR(1.12))
+19 ;default
if BPSORT=""
SET BPSORT="T"
+20 ;a value that "makes" an order, can be a string
SET BPSRTVAL=""
+21 FOR
SET BPSRTVAL=$ORDER(@BPTMPGL@("SORT",BPSORT,BPSRTVAL))
if BPSRTVAL=""
QUIT
Begin DoDot:1
+22 IF BPSORT="D"
Begin DoDot:2
+23 SET BPSTR1="---- Division: "_$$DIVNAME^BPSSCRDS(+$PIECE(BPSRTVAL,U,2))_" "
+24 DO SET^VALM10(BPLN,BPSTR1_$$LINE^BPSSCRU3(79-$LENGTH(BPSTR1),"-"),0)
+25 SET BPLN=BPLN+1
End DoDot:2
+26 IF BPSORT="C"
Begin DoDot:2
+27 SET BPSTR1=$EXTRACT("---- Reject code: "_$$GETRJNAM^BPSSCRU3(BPSRTVAL)_" ",1,79)
+28 DO SET^VALM10(BPLN,BPSTR1_$$LINE^BPSSCRU3(79-$LENGTH(BPSTR1),"-"),0)
+29 SET BPLN=BPLN+1
End DoDot:2
+30 SET BP59=0
+31 FOR
SET BP59=+$ORDER(@BPTMPGL@("SORT",BPSORT,BPSRTVAL,BP59))
if +BP59=0
QUIT
Begin DoDot:2
+32 IF BP59'=0
DO MKARRELM^BPSSCR02(.BPLN,VALMAR,BP59,.BPLM,.BPCLM,.BPPREV)
End DoDot:2
End DoDot:1
+33 DO UPDPREV^BPSSCR02(VALMAR,BPLM,BPPREV)
+34 QUIT BPLN
+35 ;
HELP ; -- help code
+1 NEW X
SET X="?"
DO DISP^XQORM1
WRITE !!
+2 QUIT
+3 ;
EXIT ; -- exit code
+1 QUIT
+2 ;
EXPND ; -- expand code
+1 QUIT
+2 ;/**
+3 ;store current view params in VALMAR("VIEWPARAMS") TMP global array
+4 ;to display in the header
+5 ;input:
+6 ; BPARR - array with user profile info to store
SAVEVIEW(BPARR) ; S @VALMAR@("VIEWPARAMS",BPLMIND,BPDFN,BP59,BPLINE)=""
+1 if '$DATA(BPARR)
QUIT
+2 MERGE @VALMAR@("VIEWPARAMS")=BPARR
+3 QUIT
+4 ;
+5 ;/**
+6 ;restore current view params from VALMAR("VIEWPARAMS") TMP global array
+7 ;input:
+8 ; BPARR - array with user profile info to store
RESTVIEW(BPARR) ; S @VALMAR@("VIEWPARAMS",BPLMIND,BPDFN,BP59,BPLINE)=""
+1 if '$DATA(@VALMAR@("VIEWPARAMS"))
QUIT
+2 MERGE BPARR=@VALMAR@("VIEWPARAMS")
+3 QUIT
+4 ;