BPSRPT3A ;AITC/CKB - ECME REPORTS ;9/28/2017
;;1.0;E CLAIMS MGMT ENGINE;**23,24,28**;JUN 2004;Build 22
;;Per VA Directive 6402, this routine should not be modified.
;
Q
;
SELPR(DFLT) ;
;
; Display (P)rescribers or (A)ll
;
; Input Variable -> DFLT = ALL
;
; Return Value -> 1 = Prescribers
; 0 = ALL
; ^ = Exit
;
N DIR,DIRUT,DTOUT,DUOUT,X,Y
;
;Select to include (S)pecific Prescriber or (A)ll Prescribers
;
S DIR(0)="S^S:SPECIFIC PRESCRIBER(S);A:ALL PRESCRIBERS"
S DIR("A")="Select Specific Prescriber(s) or include ALL Prescribers"
S DIR("B")="A"
S DIR("L",1)="Select one of the following:"
S DIR("L",2)=""
S DIR("L",3)=" S Specific Prescriber(s)"
S DIR("L",4)=" A ALL Prescribers"
D ^DIR
I ($G(DUOUT)=1)!($G(DTOUT)=1) S Y="^"
S Y=$S(Y="A":0,Y="S":1,1:Y)
Q Y
;
SELPRESC() ;
; Allow user to select a single or multiple PRESCRIBERS(s).
;
; If the users selected one or more PRESCRIBERs, the selection will be stored
; in BPARR("PRESC")separated by a comma. e.g. BPARR("PRESC")= ien1 , ien2
;
BPPRESC ;
N DIR,DIRUT,DTOUT,DUOUT,X,Y
N BPARR,BPSARRAY,BPSIEN
;
S BPARR("PRESC")=""
;
; The SEL tag prompts user to 'Select Prescriber' and validates the selection against file #200.
D SEL("Prescriber","^VA(200,",.BPSARRAY)
;
; If the user entered "^" quit, no longer prompting the user to 'Select Prescriber'
I $G(BPSARRAY)="^" Q "^"
;
; If no Prescriber was selected, return the user to 'Display Selected (P)rescribers or (A)LL'
I $G(BPSARRAY)=0 Q 0
;
M BPARR("PRESC")=BPSARRAY
;
; Creates a string of all the Prescriber ien's selected separated by a comma.
S BPSIEN=""
F S BPSIEN=$O(BPARR("PRESC",BPSIEN)) Q:BPSIEN="" I BPSIEN'="B" D
. I BPARR("PRESC")'="" S BPARR("PRESC")=BPARR("PRESC")_","
. S BPARR("PRESC")=BPARR("PRESC")_BPSIEN
. Q
;
Q BPARR("PRESC")
;
SELPA(DFLT) ;
;
; Display (P)atients or (A)ll
;
; Input Variable -> DFLT = ALL
;
; Return Value -> 1 = Patients
; 0 = ALL
; ^ = Exit
;
N DIR,DIRUT,DTOUT,DUOUT,X,Y
S DFLT="ALL"
S DIR(0)="S^P:Patient;A:ALL"
S DIR("A")="Display Selected (P)atients or (A)LL"
S DIR("B")=DFLT
D ^DIR
I ($G(DUOUT)=1)!($G(DTOUT)=1) S Y="^"
S Y=$S(Y="A":0,Y="P":1,1:Y)
Q Y
;
SELPAT() ;
; Allow user to select a single or multiple PATIENT(s).
;
; If the users selected one or more PATIENTs, the selection will be stored
; in BPARR("PATIENT")separated by a comma. e.g. BPARR("PATIENT")= patient ien1 , patient ien2
;
BPPAT ;
N DIR,DIRUT,DTOUT,DUOUT,X,Y
N BPARR,BPSARRAY,BPSIEN
;
S BPARR("PATIENT")=""
;
; The SEL tag prompts user to 'Select Patient' and validates the selection against the PATIENT file.
D SEL("Patient","^DPT(",.BPSARRAY)
;
; If the user entered "^" quit, no longer prompting the user to 'Select Patient'
I $G(BPSARRAY)="^" Q "^"
;
; If no Patient was selected, return the user to 'Display Selected (P)atients or (A)LL'
I $G(BPSARRAY)=0 Q 0
;
M BPARR("PATIENT")=BPSARRAY
;
; Creates a string of all the patient ien's selected separated by a comma.
S BPSIEN=""
F S BPSIEN=$O(BPARR("PATIENT",BPSIEN)) Q:BPSIEN="" I BPSIEN'="B" D
. I BPARR("PATIENT")'="" S BPARR("PATIENT")=BPARR("PATIENT")_","
. S BPARR("PATIENT")=BPARR("PATIENT")_BPSIEN
. Q
;
Q BPARR("PATIENT")
;
SELBAMT() ;
;
; Select (R)ange for Billed Amount or (A)ll
;
; Input Variable -> DFLT = ALL
;
; Return Value -> 1 = Billed Amt Range
; 0 = ALL
; ^ = Exit
;
N DIR,DIRUT,DTOUT,DUOUT,X,Y
S DFLT="ALL"
S DIR(0)="S^R:Range;A:ALL"
S DIR("A")="Select (R)ange for Billed Amount or (A)LL"
S DIR("B")=DFLT
D ^DIR
I ($G(DUOUT)=1)!($G(DTOUT)=1) S Y="^"
S Y=$S(Y="A":0,Y="R":1,1:Y)
Q Y
;
SELBMIN() ;
N DIR,DIRUT,DTOUT,DUOUT,X,Y
;
S DIR("A")=" Minimum Billed Amount: "
S DIR("B")=0
S DIR(0)="NA^0:999999"
S DIR("?",1)="Enter the minimum billed amount OR press"
S DIR("?",2)="return for a minimum billed amount of zero (0)."
S DIR("?")=" Example: 500 - no decimal digits"
D ^DIR
I ($G(DUOUT)=1)!($G(DTOUT)=1) Q "^"
Q Y
;
SELBMAX() ;
N DIR,DIRUT,DTOUT,DUOUT,X,Y
;
S DIR("A")=" Maximum Billed Amount: "
S DIR("B")=999999
S DIR(0)="NA^0:999999^I X'>$G(BPMIN) W !,""The Maximum Billed Amount must be greater than the Minimum Billed Amount."" K X"
S DIR("?",1)="Enter the maximum billed amount. The amount"
S DIR("?",2)="entered must be greater than the minimum billed."
S DIR("?")=" Example: 1500 - no decimal digits"
D ^DIR
I ($G(DUOUT)=1)!($G(DTOUT)=1) Q "^"
Q Y
;
SELDRG1() ;
;
; Allow user to select a single or multiple DRUGS.
;
; The users selection is stored in BPARR("DRUG") separated by a comma.
; BPARR("DRUG")=drug ien1,drug ien2
;
DRG1 ;
N BPARR,BPSIEN,BPSDRGARR
S BPARR("DRUG")=""
;
; The SEL tag prompts user to 'Select Drug' and validates the selection against the DRUG file.
D SEL("Drug","^PSDRUG(",.BPSDRGARR)
;
; If the user entered "^" quit, no longer prompting the user to 'Select Drug'
I $G(BPSDRGARR)="^" Q "^"
;
; If no drug was selected, return "0" so the user will be returned to the Drug or Drug Class or All prompt.
I $G(BPSDRGARR)=0 Q 0
;
M BPARR("DRUG")=BPSDRGARR
;
; Creates a string of all the drug ien's selected separated by a comma.
S BPSIEN=""
F S BPSIEN=$O(BPARR("DRUG",BPSIEN)) Q:BPSIEN="" I BPSIEN'="B" D
. I BPARR("DRUG")'="" S BPARR("DRUG")=BPARR("DRUG")_","
. S BPARR("DRUG")=BPARR("DRUG")_BPSIEN
. Q
;
Q BPARR("DRUG")
;
SELDC() ;
;
; Allow user to select a single or multiple DRUG CLASSes,
;
; The users selection is stored in BPARR("DRUG CLASS") separated by a semi colon.
; BPARR("DRUG CLASS")=dc name ien ; dc name ien
;
DRGCL ;
N BPARR,BPSIEN,BPSDCARR
S BPARR("DRUG CLASS")=""
;
; The SEL tag prompts user and validates the selection against the DRUG CLASS file.
D DCSEL("Drug Class","^PS(50.605,",.BPSDCARR)
;
; If the user entered "^" quit, no longer prompting the user to 'Select Drug Class'
I $G(BPSDCARR)="^" Q "^"
;
; If no drug class was selected, return "0" so the user will be returned to the Drug or Drug Class or All prompt.
I $G(BPSDCARR)=0 Q 0
;
M BPARR("DRUG CLASS")=BPSDCARR
;
; Creates a string of all the drug class ien's selected separated by a comma.
S BPSIEN=""
F S BPSIEN=$O(BPARR("DRUG CLASS",BPSIEN)) Q:BPSIEN="" I BPSIEN'="B" D
. I BPARR("DRUG CLASS")'="" S BPARR("DRUG CLASS")=BPARR("DRUG CLASS")_";"
. S BPARR("DRUG CLASS")=BPARR("DRUG CLASS")_$$GET1^DIQ(50.605,BPSIEN,1)
. Q
;
Q BPARR("DRUG CLASS")
;
SEL(FIELD,FILE,BPSARRAY,DEFAULT) ;
; Provides selection of one or many Drug, Prescriber and Patients.
; Note: if you to make changes to this subroutine you need to check DCSEL, RCSEL^BPSRPT4, CCRSEL^BPSRPT4
; they might require the same changes.
N DIC,DTOUT,DUOUT,QT,Y,X
N BPSARR
;
S DIC=FILE,DIC(0)="QEZAM",DIC("A")="Select "_FIELD_": "
I FIELD="Prescriber" S DIC("S")="I +$G(^VA(200,Y,""PS""))"
I $G(DEFAULT)'="" S DIC("B")=DEFAULT
;
F D ^DIC Q:X="" D Q:$G(QT)
. ; Check for "^" or timeout, if found set BPSARRAY="^" and quit.
. I $D(DTOUT)!$D(DUOUT) K BPSARRAY S BPSARRAY="^",QT=1 Q
. ;
. ; If selection already exists in BPSARRAY, ask user if they
. ; want to Delete the entry
. I $D(BPSARRAY(+Y)) D Q
. . N P
. . S P=Y ;Save Original Value
. . S DIR(0)="S^Y:YES;N:NO"
. . S DIR("A")="Delete "_$P(P,U,2)_" from your list?"
. . S DIR("B")="NO" D ^DIR
. . I Y="Y" K BPSARRAY(+P),BPSARRAY("B",$P(P,U,2),+P)
. . ; Display a list of current selections
. . I $D(BPSARRAY) D
. . . N X
. . . W !,?2,"Selected:"
. . . S X="" F S X=$O(BPSARRAY("B",X)) Q:X="" W ?12,X,!
. E D
. . ;Define new entries in BPSCCR array
. . S BPSARRAY(+Y)=$P(Y,U,2)
. . S BPSARRAY("B",$P(Y,U,2),+Y)=""
. ;
. ;Display a list of current selections
. N X
. W !,?2,"Selected:"
. S X="" F S X=$O(BPSARRAY("B",X)) Q:X="" W ?12,X,!
. K DIC("B")
;
; If nothing was selected set BPSARRAY=0
I '$D(BPSARRAY) S BPSARRAY=0
Q
;
DCSEL(FIELD,FILE,BPSARRAY,DEFAULT) ;
; Provides selection of one or many for Drug Classes.
N BPSARR,DIC,DTOUT,DUOUT,QT,Y,X
;
S DIC=FILE,DIC(0)="QEZAM",DIC("A")="Select "_FIELD_": "
I $G(DEFAULT)'="" S DIC("B")=DEFAULT
;
F D ^DIC Q:X="" D Q:$G(QT)
. ;
. ; Check for "^" or timeout, if found set BPSARRAY="^" and quit.
. I $D(DTOUT)!$D(DUOUT) K BPSARRAY S BPSARRAY="^",QT=1 Q
. ;
. ; If selection already exists in BPSARRAY, ask user if they
. ; want to Delete the entry
. I $D(BPSARRAY(+Y)) D Q
. . N P
. . S P=Y ;Save Original Value
. . S DIR(0)="S^Y:YES;N:NO"
. . S DIR("A")="Delete "_$$GET1^DIQ(50.605,+P,1)_" "_$$GET1^DIQ(50.605,+P,.01)_" from your list?"
. . S DIR("B")="NO"
. . D ^DIR
. . I Y="Y" K BPSARRAY(+P),BPSARRAY("B",$P(P,U,2),+P)
. . ; Display list of current selections
. . I $D(BPSARRAY) D
. . . N X
. . . W !,?2,"Selected:"
. . . S X="" F S X=$O(BPSARRAY(X)) Q:(X="")!(X="B") W ?12,$$GET1^DIQ(50.605,X,1)," ",$$GET1^DIQ(50.605,X,.01),!
. E D
. . ;Define new entries in BPSCCR array
. . S BPSARRAY(+Y)=$P(Y,U,2)
. . S BPSARRAY("B",$P(Y,U,2),+Y)=""
. ;
. ;Display a list of current selections
. N X
. W !,?2,"Selected:"
. S X="" F S X=$O(BPSARRAY(X)) Q:(X="")!(X="B") W ?12,$$GET1^DIQ(50.605,X,1)," ",$$GET1^DIQ(50.605,X,.01),!
. K DIC("B")
;
; If nothing was selected set BPSARRAY=0
I '$D(BPSARRAY) S BPSARRAY=0
Q
;
SELDUP() ;
; Select one or more Duplicate Claim types
;
; Return value -> BPDUP("DUP") = 0 - User Entered 'ALL'
; = 1 - contain the entries separated by comma's
; = "^" - User quit
BPSDUP ;
K BPDUP
N DIR,DTOUT,DUOUT,DIRUT,DIROUT,X,Y,P
N BPDUP,BPDUPSTR,BPSERR,BPSSEL,BPSX,I
;
S BPDUPSTR=",D,Q,S,A,"
S DIR(0)="FO^0:7"
S DIR("A",1)=""
S DIR("A",2)="Select one or more of the following:"
S DIR("A",3)=""
S DIR("A",4)=" S DUPLICATE OF APPROVED"
S DIR("A",5)=" D DUPLICATE OF PAID"
S DIR("A",6)=" Q DUPLICATE OF CAPTURED"
S DIR("A",7)=" A ALL"
S DIR("A",8)=""
S DIR("A")="Display (S)Dup of Approved or (D)Dup of Paid or (Q)Dup of Capture or (A)LL"
S DIR("B")="A"
S DIR("?",1)="Enter a single response or multiple responses separated by commas."
S DIR("?",2)=" Example:"
S DIR("?",3)=" D"
S DIR("?")=" D,S"
D ^DIR K DIR
I ($G(DUOUT)=1)!($G(DTOUT)=1)!($D(DIRUT)) Q "^"
;
;Convert any lower case to upper case
S X=$TR(X,BPSLC,BPSUC)
S BPDUP("DUP")=X
;
;If 'A' was one of the selections, return 0 - ALL selected
I X["A" S BPDUP("DUP")=0 G SELDUPEX
;
; Loop through user input (returned in variable X).
; Display warning message if any user input selection is not included
; in the string of acceptable codes (BPDUPSTR) and re-prompt question.
; Assign valid selections to BPDUP array. This array will prevent
; duplicate entries from being saved to the user's profile.
;
; Check for Invalid entries, if found set BPSERR=1
S BPSERR=0
F I=1:1:$L(X,",") D
. S BPSSEL=$P(X,",",I)
. I BPDUPSTR'[(","_BPSSEL_",") W !," ",BPSSEL," is not a valid entry." S BPSERR=1 Q
; Invalid entry found prompt again
I BPSERR=1 G BPSDUP
;
;User selected one or more duplicate types, display the user selections
N I F I=1:1:$L(X,",") S BPSX=$P(X,",",I) D
. W !,?5,$S(BPSX="D":"DUPLICATE OF PAID",BPSX="Q":"DUPLICATE OF CAPTURED",BPSX="S":"DUPLICATE OF APPROVED",1:"")
;
SELDUPEX ;
Q BPDUP("DUP")
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HBPSRPT3A 11935 printed Oct 16, 2024@17:53:31 Page 2
BPSRPT3A ;AITC/CKB - ECME REPORTS ;9/28/2017
+1 ;;1.0;E CLAIMS MGMT ENGINE;**23,24,28**;JUN 2004;Build 22
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;
SELPR(DFLT) ;
+1 ;
+2 ; Display (P)rescribers or (A)ll
+3 ;
+4 ; Input Variable -> DFLT = ALL
+5 ;
+6 ; Return Value -> 1 = Prescribers
+7 ; 0 = ALL
+8 ; ^ = Exit
+9 ;
+10 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+11 ;
+12 ;Select to include (S)pecific Prescriber or (A)ll Prescribers
+13 ;
+14 SET DIR(0)="S^S:SPECIFIC PRESCRIBER(S);A:ALL PRESCRIBERS"
+15 SET DIR("A")="Select Specific Prescriber(s) or include ALL Prescribers"
+16 SET DIR("B")="A"
+17 SET DIR("L",1)="Select one of the following:"
+18 SET DIR("L",2)=""
+19 SET DIR("L",3)=" S Specific Prescriber(s)"
+20 SET DIR("L",4)=" A ALL Prescribers"
+21 DO ^DIR
+22 IF ($GET(DUOUT)=1)!($GET(DTOUT)=1)
SET Y="^"
+23 SET Y=$SELECT(Y="A":0,Y="S":1,1:Y)
+24 QUIT Y
+25 ;
SELPRESC() ;
+1 ; Allow user to select a single or multiple PRESCRIBERS(s).
+2 ;
+3 ; If the users selected one or more PRESCRIBERs, the selection will be stored
+4 ; in BPARR("PRESC")separated by a comma. e.g. BPARR("PRESC")= ien1 , ien2
+5 ;
BPPRESC ;
+1 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+2 NEW BPARR,BPSARRAY,BPSIEN
+3 ;
+4 SET BPARR("PRESC")=""
+5 ;
+6 ; The SEL tag prompts user to 'Select Prescriber' and validates the selection against file #200.
+7 DO SEL("Prescriber","^VA(200,",.BPSARRAY)
+8 ;
+9 ; If the user entered "^" quit, no longer prompting the user to 'Select Prescriber'
+10 IF $GET(BPSARRAY)="^"
QUIT "^"
+11 ;
+12 ; If no Prescriber was selected, return the user to 'Display Selected (P)rescribers or (A)LL'
+13 IF $GET(BPSARRAY)=0
QUIT 0
+14 ;
+15 MERGE BPARR("PRESC")=BPSARRAY
+16 ;
+17 ; Creates a string of all the Prescriber ien's selected separated by a comma.
+18 SET BPSIEN=""
+19 FOR
SET BPSIEN=$ORDER(BPARR("PRESC",BPSIEN))
if BPSIEN=""
QUIT
IF BPSIEN'="B"
Begin DoDot:1
+20 IF BPARR("PRESC")'=""
SET BPARR("PRESC")=BPARR("PRESC")_","
+21 SET BPARR("PRESC")=BPARR("PRESC")_BPSIEN
+22 QUIT
End DoDot:1
+23 ;
+24 QUIT BPARR("PRESC")
+25 ;
SELPA(DFLT) ;
+1 ;
+2 ; Display (P)atients or (A)ll
+3 ;
+4 ; Input Variable -> DFLT = ALL
+5 ;
+6 ; Return Value -> 1 = Patients
+7 ; 0 = ALL
+8 ; ^ = Exit
+9 ;
+10 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+11 SET DFLT="ALL"
+12 SET DIR(0)="S^P:Patient;A:ALL"
+13 SET DIR("A")="Display Selected (P)atients or (A)LL"
+14 SET DIR("B")=DFLT
+15 DO ^DIR
+16 IF ($GET(DUOUT)=1)!($GET(DTOUT)=1)
SET Y="^"
+17 SET Y=$SELECT(Y="A":0,Y="P":1,1:Y)
+18 QUIT Y
+19 ;
SELPAT() ;
+1 ; Allow user to select a single or multiple PATIENT(s).
+2 ;
+3 ; If the users selected one or more PATIENTs, the selection will be stored
+4 ; in BPARR("PATIENT")separated by a comma. e.g. BPARR("PATIENT")= patient ien1 , patient ien2
+5 ;
BPPAT ;
+1 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+2 NEW BPARR,BPSARRAY,BPSIEN
+3 ;
+4 SET BPARR("PATIENT")=""
+5 ;
+6 ; The SEL tag prompts user to 'Select Patient' and validates the selection against the PATIENT file.
+7 DO SEL("Patient","^DPT(",.BPSARRAY)
+8 ;
+9 ; If the user entered "^" quit, no longer prompting the user to 'Select Patient'
+10 IF $GET(BPSARRAY)="^"
QUIT "^"
+11 ;
+12 ; If no Patient was selected, return the user to 'Display Selected (P)atients or (A)LL'
+13 IF $GET(BPSARRAY)=0
QUIT 0
+14 ;
+15 MERGE BPARR("PATIENT")=BPSARRAY
+16 ;
+17 ; Creates a string of all the patient ien's selected separated by a comma.
+18 SET BPSIEN=""
+19 FOR
SET BPSIEN=$ORDER(BPARR("PATIENT",BPSIEN))
if BPSIEN=""
QUIT
IF BPSIEN'="B"
Begin DoDot:1
+20 IF BPARR("PATIENT")'=""
SET BPARR("PATIENT")=BPARR("PATIENT")_","
+21 SET BPARR("PATIENT")=BPARR("PATIENT")_BPSIEN
+22 QUIT
End DoDot:1
+23 ;
+24 QUIT BPARR("PATIENT")
+25 ;
SELBAMT() ;
+1 ;
+2 ; Select (R)ange for Billed Amount or (A)ll
+3 ;
+4 ; Input Variable -> DFLT = ALL
+5 ;
+6 ; Return Value -> 1 = Billed Amt Range
+7 ; 0 = ALL
+8 ; ^ = Exit
+9 ;
+10 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+11 SET DFLT="ALL"
+12 SET DIR(0)="S^R:Range;A:ALL"
+13 SET DIR("A")="Select (R)ange for Billed Amount or (A)LL"
+14 SET DIR("B")=DFLT
+15 DO ^DIR
+16 IF ($GET(DUOUT)=1)!($GET(DTOUT)=1)
SET Y="^"
+17 SET Y=$SELECT(Y="A":0,Y="R":1,1:Y)
+18 QUIT Y
+19 ;
SELBMIN() ;
+1 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+2 ;
+3 SET DIR("A")=" Minimum Billed Amount: "
+4 SET DIR("B")=0
+5 SET DIR(0)="NA^0:999999"
+6 SET DIR("?",1)="Enter the minimum billed amount OR press"
+7 SET DIR("?",2)="return for a minimum billed amount of zero (0)."
+8 SET DIR("?")=" Example: 500 - no decimal digits"
+9 DO ^DIR
+10 IF ($GET(DUOUT)=1)!($GET(DTOUT)=1)
QUIT "^"
+11 QUIT Y
+12 ;
SELBMAX() ;
+1 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+2 ;
+3 SET DIR("A")=" Maximum Billed Amount: "
+4 SET DIR("B")=999999
+5 SET DIR(0)="NA^0:999999^I X'>$G(BPMIN) W !,""The Maximum Billed Amount must be greater than the Minimum Billed Amount."" K X"
+6 SET DIR("?",1)="Enter the maximum billed amount. The amount"
+7 SET DIR("?",2)="entered must be greater than the minimum billed."
+8 SET DIR("?")=" Example: 1500 - no decimal digits"
+9 DO ^DIR
+10 IF ($GET(DUOUT)=1)!($GET(DTOUT)=1)
QUIT "^"
+11 QUIT Y
+12 ;
SELDRG1() ;
+1 ;
+2 ; Allow user to select a single or multiple DRUGS.
+3 ;
+4 ; The users selection is stored in BPARR("DRUG") separated by a comma.
+5 ; BPARR("DRUG")=drug ien1,drug ien2
+6 ;
DRG1 ;
+1 NEW BPARR,BPSIEN,BPSDRGARR
+2 SET BPARR("DRUG")=""
+3 ;
+4 ; The SEL tag prompts user to 'Select Drug' and validates the selection against the DRUG file.
+5 DO SEL("Drug","^PSDRUG(",.BPSDRGARR)
+6 ;
+7 ; If the user entered "^" quit, no longer prompting the user to 'Select Drug'
+8 IF $GET(BPSDRGARR)="^"
QUIT "^"
+9 ;
+10 ; If no drug was selected, return "0" so the user will be returned to the Drug or Drug Class or All prompt.
+11 IF $GET(BPSDRGARR)=0
QUIT 0
+12 ;
+13 MERGE BPARR("DRUG")=BPSDRGARR
+14 ;
+15 ; Creates a string of all the drug ien's selected separated by a comma.
+16 SET BPSIEN=""
+17 FOR
SET BPSIEN=$ORDER(BPARR("DRUG",BPSIEN))
if BPSIEN=""
QUIT
IF BPSIEN'="B"
Begin DoDot:1
+18 IF BPARR("DRUG")'=""
SET BPARR("DRUG")=BPARR("DRUG")_","
+19 SET BPARR("DRUG")=BPARR("DRUG")_BPSIEN
+20 QUIT
End DoDot:1
+21 ;
+22 QUIT BPARR("DRUG")
+23 ;
SELDC() ;
+1 ;
+2 ; Allow user to select a single or multiple DRUG CLASSes,
+3 ;
+4 ; The users selection is stored in BPARR("DRUG CLASS") separated by a semi colon.
+5 ; BPARR("DRUG CLASS")=dc name ien ; dc name ien
+6 ;
DRGCL ;
+1 NEW BPARR,BPSIEN,BPSDCARR
+2 SET BPARR("DRUG CLASS")=""
+3 ;
+4 ; The SEL tag prompts user and validates the selection against the DRUG CLASS file.
+5 DO DCSEL("Drug Class","^PS(50.605,",.BPSDCARR)
+6 ;
+7 ; If the user entered "^" quit, no longer prompting the user to 'Select Drug Class'
+8 IF $GET(BPSDCARR)="^"
QUIT "^"
+9 ;
+10 ; If no drug class was selected, return "0" so the user will be returned to the Drug or Drug Class or All prompt.
+11 IF $GET(BPSDCARR)=0
QUIT 0
+12 ;
+13 MERGE BPARR("DRUG CLASS")=BPSDCARR
+14 ;
+15 ; Creates a string of all the drug class ien's selected separated by a comma.
+16 SET BPSIEN=""
+17 FOR
SET BPSIEN=$ORDER(BPARR("DRUG CLASS",BPSIEN))
if BPSIEN=""
QUIT
IF BPSIEN'="B"
Begin DoDot:1
+18 IF BPARR("DRUG CLASS")'=""
SET BPARR("DRUG CLASS")=BPARR("DRUG CLASS")_";"
+19 SET BPARR("DRUG CLASS")=BPARR("DRUG CLASS")_$$GET1^DIQ(50.605,BPSIEN,1)
+20 QUIT
End DoDot:1
+21 ;
+22 QUIT BPARR("DRUG CLASS")
+23 ;
SEL(FIELD,FILE,BPSARRAY,DEFAULT) ;
+1 ; Provides selection of one or many Drug, Prescriber and Patients.
+2 ; Note: if you to make changes to this subroutine you need to check DCSEL, RCSEL^BPSRPT4, CCRSEL^BPSRPT4
+3 ; they might require the same changes.
+4 NEW DIC,DTOUT,DUOUT,QT,Y,X
+5 NEW BPSARR
+6 ;
+7 SET DIC=FILE
SET DIC(0)="QEZAM"
SET DIC("A")="Select "_FIELD_": "
+8 IF FIELD="Prescriber"
SET DIC("S")="I +$G(^VA(200,Y,""PS""))"
+9 IF $GET(DEFAULT)'=""
SET DIC("B")=DEFAULT
+10 ;
+11 FOR
DO ^DIC
if X=""
QUIT
Begin DoDot:1
+12 ; Check for "^" or timeout, if found set BPSARRAY="^" and quit.
+13 IF $DATA(DTOUT)!$DATA(DUOUT)
KILL BPSARRAY
SET BPSARRAY="^"
SET QT=1
QUIT
+14 ;
+15 ; If selection already exists in BPSARRAY, ask user if they
+16 ; want to Delete the entry
+17 IF $DATA(BPSARRAY(+Y))
Begin DoDot:2
+18 NEW P
+19 ;Save Original Value
SET P=Y
+20 SET DIR(0)="S^Y:YES;N:NO"
+21 SET DIR("A")="Delete "_$PIECE(P,U,2)_" from your list?"
+22 SET DIR("B")="NO"
DO ^DIR
+23 IF Y="Y"
KILL BPSARRAY(+P),BPSARRAY("B",$PIECE(P,U,2),+P)
+24 ; Display a list of current selections
+25 IF $DATA(BPSARRAY)
Begin DoDot:3
+26 NEW X
+27 WRITE !,?2,"Selected:"
+28 SET X=""
FOR
SET X=$ORDER(BPSARRAY("B",X))
if X=""
QUIT
WRITE ?12,X,!
End DoDot:3
End DoDot:2
QUIT
+29 IF '$TEST
Begin DoDot:2
+30 ;Define new entries in BPSCCR array
+31 SET BPSARRAY(+Y)=$PIECE(Y,U,2)
+32 SET BPSARRAY("B",$PIECE(Y,U,2),+Y)=""
End DoDot:2
+33 ;
+34 ;Display a list of current selections
+35 NEW X
+36 WRITE !,?2,"Selected:"
+37 SET X=""
FOR
SET X=$ORDER(BPSARRAY("B",X))
if X=""
QUIT
WRITE ?12,X,!
+38 KILL DIC("B")
End DoDot:1
if $GET(QT)
QUIT
+39 ;
+40 ; If nothing was selected set BPSARRAY=0
+41 IF '$DATA(BPSARRAY)
SET BPSARRAY=0
+42 QUIT
+43 ;
DCSEL(FIELD,FILE,BPSARRAY,DEFAULT) ;
+1 ; Provides selection of one or many for Drug Classes.
+2 NEW BPSARR,DIC,DTOUT,DUOUT,QT,Y,X
+3 ;
+4 SET DIC=FILE
SET DIC(0)="QEZAM"
SET DIC("A")="Select "_FIELD_": "
+5 IF $GET(DEFAULT)'=""
SET DIC("B")=DEFAULT
+6 ;
+7 FOR
DO ^DIC
if X=""
QUIT
Begin DoDot:1
+8 ;
+9 ; Check for "^" or timeout, if found set BPSARRAY="^" and quit.
+10 IF $DATA(DTOUT)!$DATA(DUOUT)
KILL BPSARRAY
SET BPSARRAY="^"
SET QT=1
QUIT
+11 ;
+12 ; If selection already exists in BPSARRAY, ask user if they
+13 ; want to Delete the entry
+14 IF $DATA(BPSARRAY(+Y))
Begin DoDot:2
+15 NEW P
+16 ;Save Original Value
SET P=Y
+17 SET DIR(0)="S^Y:YES;N:NO"
+18 SET DIR("A")="Delete "_$$GET1^DIQ(50.605,+P,1)_" "_$$GET1^DIQ(50.605,+P,.01)_" from your list?"
+19 SET DIR("B")="NO"
+20 DO ^DIR
+21 IF Y="Y"
KILL BPSARRAY(+P),BPSARRAY("B",$PIECE(P,U,2),+P)
+22 ; Display list of current selections
+23 IF $DATA(BPSARRAY)
Begin DoDot:3
+24 NEW X
+25 WRITE !,?2,"Selected:"
+26 SET X=""
FOR
SET X=$ORDER(BPSARRAY(X))
if (X="")!(X="B")
QUIT
WRITE ?12,$$GET1^DIQ(50.605,X,1)," ",$$GET1^DIQ(50.605,X,.01),!
End DoDot:3
End DoDot:2
QUIT
+27 IF '$TEST
Begin DoDot:2
+28 ;Define new entries in BPSCCR array
+29 SET BPSARRAY(+Y)=$PIECE(Y,U,2)
+30 SET BPSARRAY("B",$PIECE(Y,U,2),+Y)=""
End DoDot:2
+31 ;
+32 ;Display a list of current selections
+33 NEW X
+34 WRITE !,?2,"Selected:"
+35 SET X=""
FOR
SET X=$ORDER(BPSARRAY(X))
if (X="")!(X="B")
QUIT
WRITE ?12,$$GET1^DIQ(50.605,X,1)," ",$$GET1^DIQ(50.605,X,.01),!
+36 KILL DIC("B")
End DoDot:1
if $GET(QT)
QUIT
+37 ;
+38 ; If nothing was selected set BPSARRAY=0
+39 IF '$DATA(BPSARRAY)
SET BPSARRAY=0
+40 QUIT
+41 ;
SELDUP() ;
+1 ; Select one or more Duplicate Claim types
+2 ;
+3 ; Return value -> BPDUP("DUP") = 0 - User Entered 'ALL'
+4 ; = 1 - contain the entries separated by comma's
+5 ; = "^" - User quit
BPSDUP ;
+1 KILL BPDUP
+2 NEW DIR,DTOUT,DUOUT,DIRUT,DIROUT,X,Y,P
+3 NEW BPDUP,BPDUPSTR,BPSERR,BPSSEL,BPSX,I
+4 ;
+5 SET BPDUPSTR=",D,Q,S,A,"
+6 SET DIR(0)="FO^0:7"
+7 SET DIR("A",1)=""
+8 SET DIR("A",2)="Select one or more of the following:"
+9 SET DIR("A",3)=""
+10 SET DIR("A",4)=" S DUPLICATE OF APPROVED"
+11 SET DIR("A",5)=" D DUPLICATE OF PAID"
+12 SET DIR("A",6)=" Q DUPLICATE OF CAPTURED"
+13 SET DIR("A",7)=" A ALL"
+14 SET DIR("A",8)=""
+15 SET DIR("A")="Display (S)Dup of Approved or (D)Dup of Paid or (Q)Dup of Capture or (A)LL"
+16 SET DIR("B")="A"
+17 SET DIR("?",1)="Enter a single response or multiple responses separated by commas."
+18 SET DIR("?",2)=" Example:"
+19 SET DIR("?",3)=" D"
+20 SET DIR("?")=" D,S"
+21 DO ^DIR
KILL DIR
+22 IF ($GET(DUOUT)=1)!($GET(DTOUT)=1)!($DATA(DIRUT))
QUIT "^"
+23 ;
+24 ;Convert any lower case to upper case
+25 SET X=$TRANSLATE(X,BPSLC,BPSUC)
+26 SET BPDUP("DUP")=X
+27 ;
+28 ;If 'A' was one of the selections, return 0 - ALL selected
+29 IF X["A"
SET BPDUP("DUP")=0
GOTO SELDUPEX
+30 ;
+31 ; Loop through user input (returned in variable X).
+32 ; Display warning message if any user input selection is not included
+33 ; in the string of acceptable codes (BPDUPSTR) and re-prompt question.
+34 ; Assign valid selections to BPDUP array. This array will prevent
+35 ; duplicate entries from being saved to the user's profile.
+36 ;
+37 ; Check for Invalid entries, if found set BPSERR=1
+38 SET BPSERR=0
+39 FOR I=1:1:$LENGTH(X,",")
Begin DoDot:1
+40 SET BPSSEL=$PIECE(X,",",I)
+41 IF BPDUPSTR'[(","_BPSSEL_",")
WRITE !," ",BPSSEL," is not a valid entry."
SET BPSERR=1
QUIT
End DoDot:1
+42 ; Invalid entry found prompt again
+43 IF BPSERR=1
GOTO BPSDUP
+44 ;
+45 ;User selected one or more duplicate types, display the user selections
+46 NEW I
FOR I=1:1:$LENGTH(X,",")
SET BPSX=$PIECE(X,",",I)
Begin DoDot:1
+47 WRITE !,?5,$SELECT(BPSX="D":"DUPLICATE OF PAID",BPSX="Q":"DUPLICATE OF CAPTURED",BPSX="S":"DUPLICATE OF APPROVED",1:"")
End DoDot:1
+48 ;
SELDUPEX ;
+1 QUIT BPDUP("DUP")
+2 ;