Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BPSSCRV1

BPSSCRV1.m

Go to the documentation of this file.
  1. BPSSCRV1 ;AITC/PD - ECME SCREEN CHANGE VIEW continued;1/17/2018
  1. ;;1.0;E CLAIMS MGMT ENGINE;**23**;JUN 2004;Build 44
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;USER SCREEN continued
  1. Q
  1. ;****
  1. ;
  1. ; New'ing of BPS* arrays and variables handled in routine BPSSCRCV
  1. ;
  1. BPS201(BPARR) ; FIELD 2.01 - Eligibility Type
  1. BPS201A ;
  1. ;
  1. S BPS201STR=",V,T,C,A,"
  1. S DIR(0)="FO^0:7"
  1. S DIR("A",1)=""
  1. S DIR("A",2)=" Select one of the following:"
  1. S DIR("A",3)=""
  1. S DIR("A",4)=" V VETERAN"
  1. S DIR("A",5)=" T TRICARE"
  1. S DIR("A",6)=" C CHAMPVA"
  1. S DIR("A",7)=" A ALL"
  1. S DIR("A",8)=""
  1. S DIR("A")="Select One or Many Eligibility Types or (A)ll"
  1. S DIR("B")="V"
  1. I $G(BPARR(2.01))'="" S DIR("B")=BPARR(2.01)
  1. S DIR("?",1)="Enter a single response or multiple responses separated by commas."
  1. S DIR("?",2)=" Example:"
  1. S DIR("?",3)=" T"
  1. S DIR("?")=" T,C"
  1. D ^DIR K DIR
  1. ;
  1. I $D(DIRUT) Q 0
  1. ;
  1. ; Loop through user input (returned in variable X).
  1. ; Display warning message if any user input selection is not included
  1. ; in the string of acceptable codes (BPS201STR) and re-prompt question.
  1. ; Assign valid selections to BPS201 array. This array will prevent
  1. ; duplicate entries from being saved to the user's profile.
  1. ;
  1. K BPS201
  1. S X=$TR(X,"vtca","VTCA")
  1. S X=$TR(X," ","")
  1. S BPSERR=0
  1. F BPSX=1:1:$L(X,",") D
  1. . S BPSSEL=$P(X,",",BPSX)
  1. . I BPS201STR'[(","_BPSSEL_",") W !," ",BPSSEL," is not a valid entry." S BPSERR=1 Q
  1. . S BPS201(BPSSEL)=""
  1. ;
  1. I $G(BPSERR)=1 G BPS201A
  1. ;
  1. ; If user included (A)ll as a selection, set profile setting to A.
  1. ;
  1. I $D(BPS201("A")) S BPARR(2.01)="A"
  1. E D ; User did not enter "A".
  1. . ;
  1. . ; At this point user selections are valid and do not include "A".
  1. . ; Loop through valid user selections. Set selections into a
  1. . ; comma delimited string before assigning to BPARR array.
  1. . ;
  1. . S BPSSEL=""
  1. . W !,?2,"Selected:"
  1. . F S BPSSEL=$O(BPS201(BPSSEL)) Q:BPSSEL="" D
  1. . . S BPS201=$G(BPS201)_BPSSEL_","
  1. . . I BPSSEL="C" W !,?10,"CHAMPVA"
  1. . . I BPSSEL="T" W !,?10,"TRICARE"
  1. . . I BPSSEL="V" W !,?10,"VETERAN"
  1. . S BPS201=$E(BPS201,1,($L(BPS201)-1))
  1. . S BPARR(2.01)=BPS201
  1. ;
  1. Q 1
  1. ;
  1. ; ^^^^^^^^^^ End of BPS201 Logic ^^^^^^^^^^
  1. ;
  1. ; ********** Start of BPS101 / BPS116 Logic **********
  1. ;
  1. ; User input will be temporarily stored in BPS116AR for display to user
  1. ; of selected USERS while in CV Action.
  1. ;
  1. ; If U is selected, at least one USER must be selected. If not, selection
  1. ; will default to (A)ll and the current question will be re-prompted.
  1. ;
  1. ; Upon completion of USERs entry, values will be placed into a string
  1. ; delimited by semicolons. e.g. BPARR(1.16)=";12345;56789;"
  1. ;
  1. ; BPS116AR = array containing USER information
  1. ; BPS116AR(BPS116)="" BPS116 = IEN from New Person File #200
  1. ; BPS116AR("B",BPS116NM) BPS116NM = User Name - Index used to display
  1. ; selected USERs in alphabetical order while in CV Action.
  1. ;
  1. BPS101(BPARR) ; Fields 1.01 and 1.16 - User(s)
  1. BPS101A ;
  1. ;
  1. N BPSI
  1. ;
  1. S BPINP=$$EDITFLD^BPSSCRCV(1.01,+BPDUZ7,"S^U:USER;A:ALL","Display One or Many ECME (U)sers or (A)LL","ALL",.BPARR)
  1. I BPINP=-1 Q 0
  1. ;
  1. S BPSERR=0
  1. ;
  1. ; If user selection is U, assign existing entry(s) into BPS116AR array.
  1. ;
  1. I $P(BPINP,U,2)="U" D
  1. . S BPS116=$G(BPARR(1.16))
  1. . I BPS116'="" D
  1. . . S BPSCNT=$L(BPS116,";")
  1. . . I BPSCNT=1 D
  1. . . . S BPS116NM=$$GET1^DIQ(200,BPS116,.01)
  1. . . . I $G(BPS116NM)'="" S BPS116AR(BPS116)="",BPS116AR("B",BPS116NM)=""
  1. . . I +BPSCNT>2 D
  1. . . . F BPSI=2:1:BPSCNT-1 D
  1. . . . . S BPS116X=$P(BPS116,";",BPSI),BPS116NM=$$GET1^DIQ(200,BPS116X,.01)
  1. . . . . I $G(BPS116NM)'="" S BPS116AR(BPS116X)="",BPS116AR("B",BPS116NM)=""
  1. . ;
  1. . ; Display existing entry(s) to user.
  1. . ;
  1. . I $D(BPS116AR) D
  1. . . W !,?2,"Selected:"
  1. . . S BPS116NM="" F S BPS116NM=$O(BPS116AR("B",BPS116NM)) Q:BPS116NM="" W !,?10,BPS116NM
  1. . ;
  1. . W !!,"Enter a user to select."
  1. . W !,"Once all users are selected, hit enter without making a selection.",!
  1. . ;
  1. . S BPS116="" F D Q:BPS116=-1
  1. . . S DIR0="P^VA(200,"
  1. . . S PRMTMSG="Select User"
  1. . . S DFLTVAL=""
  1. . . S BPS116=$$PROMPT^BPSSCRCV(DIR0,PRMTMSG,DFLTVAL)
  1. . . ;
  1. . . ; Exit 'Select User' loop if user entered nil.
  1. . . ;
  1. . . I BPS116=-1 Q
  1. . . ;
  1. . . S BPS116NM=$$GET1^DIQ(200,BPS116,.01)
  1. . . ;
  1. . . ; If entry exists in BPS116AR array, prompt user to delete from list.
  1. . . ;
  1. . . I $D(BPS116AR(BPS116)) D
  1. . . . S DIR(0)="S^Y:YES;N:NO"
  1. . . . S DIR("A")="Delete "_BPS116NM_" from your list?"
  1. . . . S DIR("B")="NO"
  1. . . . D ^DIR
  1. . . . I Y="Y" K BPS116AR(BPS116),BPS116AR("B",BPS116NM)
  1. . . . ;
  1. . . E D
  1. . . . ;
  1. . . . ; Set new entry into BPS116AR array.
  1. . . . ;
  1. . . . I $G(BPS116NM)'="" S BPS116AR(BPS116)="",BPS116AR("B",BPS116NM)=""
  1. . . ;
  1. . . ; Display existing entry(s) to user.
  1. . . ;
  1. . . I $D(BPS116AR) D
  1. . . . W !,?2,"Selected:"
  1. . . . S BPS116NM="" F S BPS116NM=$O(BPS116AR("B",BPS116NM)) Q:BPS116NM="" W !,?10,BPS116NM
  1. . ;
  1. . ; If user selected (U)ser but has not selected any users,
  1. . ; set profile setting to ALL and set BPSERR flag to re-prompt question.
  1. .;
  1. . I '$D(BPS116AR) S BPARR(1.01)="A",BPARR(1.16)="" S BPSERR=1 Q
  1. . ;
  1. . ; Loop through selected users, setting selected users into
  1. . ; BPARR array - delimited by semi-colon.
  1. . ;
  1. . S BPARR(1.16)=";"
  1. . S BPS116=0 F S BPS116=$O(BPS116AR(BPS116)) Q:+BPS116=0 S BPARR(1.16)=BPARR(1.16)_BPS116_";"
  1. E D ; User selected ALL
  1. . S BPARR(1.01)="A"
  1. . S BPARR(1.16)=""
  1. ;
  1. ; If BPSERR flag is 1, re-prompt question.
  1. ;
  1. I $G(BPSERR)=1 G BPS101A
  1. ;
  1. Q 1
  1. ;
  1. ; ^^^^^^^^^^ End of BPS101 / BPS116 Logic ^^^^^^^^^^
  1. ;
  1. ; ********** Start of BPS102 / BPS117 Logic **********
  1. ;
  1. ; User input will be temporarily stored in BPS117AR for display to user
  1. ; of selected PATIENTS while in CV Action.
  1. ;
  1. ; If P is selected, at least one PATIENT must be selected. If not, selection
  1. ; will default to (A)ll and the current question will be re-prompted.
  1. ;
  1. ; Upon completion of PATIENTs entry, values will be placed into a string
  1. ; delimited by semicolons. e.g. BPARR(1.17)=";12345;56789;"
  1. ;
  1. ; BPS117AR = array containing PATIENT information
  1. ; BPS117AR(BPS117)="" BPS117 = IEN from Patient File ^DPT
  1. ; BPS117AR("B",BPS117M) BPS117NM = Patient Name - Index used to display
  1. ; selected PATIENTs in alphabetical order while in CV Action.
  1. ;
  1. BPS102(BPARR) ; Fields 1.02 and 1.17 - Patient(s)
  1. BPS102A ;
  1. ;
  1. N BPSI
  1. ;
  1. S BPINP=$$EDITFLD^BPSSCRCV(1.02,+BPDUZ7,"S^P:PATIENT;A:ALL","Display One or Many (P)atients or (A)LL","ALL",.BPARR)
  1. I BPINP=-1 Q 0
  1. ;
  1. S BPSERR=0
  1. ;
  1. ; If user selection is P, assign existing entry(s) into BPS117AR array.
  1. ;
  1. I $P(BPINP,U,2)="P" D
  1. . S BPS117=$G(BPARR(1.17))
  1. . I BPS117'="" D
  1. . . S BPSCNT=$L(BPS117,";")
  1. . . I BPSCNT=1 D
  1. . . . S BPS117NM=$$GET1^DIQ(2,BPS117,.01)
  1. . . . I $G(BPS117NM)'="" S BPS117AR(BPS117)="",BPS117AR("B",BPS117NM)=""
  1. . . I +BPSCNT>2 D
  1. . . . F BPSI=2:1:BPSCNT-1 D
  1. . . . . S BPS117X=$P(BPS117,";",BPSI),BPS117NM=$$GET1^DIQ(2,BPS117X,.01)
  1. . . . . I $G(BPS117NM)'="" S BPS117AR(BPS117X)="",BPS117AR("B",BPS117NM)=""
  1. . ;
  1. . ; Display existing entry(s) to user.
  1. . ;
  1. . I $D(BPS117AR) D
  1. . . W !,?2,"Selected:"
  1. . . S BPS117NM="" F S BPS117NM=$O(BPS117AR("B",BPS117NM)) Q:BPS117NM="" W !,?10,BPS117NM
  1. . ;
  1. . W !!,"Enter a patient to select."
  1. . W !,"Once all patients are selected, hit enter without making a selection.",!
  1. . ;
  1. . S BPS117="" F D Q:BPS117=-1
  1. . . S DIR0="P^DPT("
  1. . . S PRMTMSG="Select Patient"
  1. . . S DFLTVAL=""
  1. . . S BPS117=$$PROMPT^BPSSCRCV(DIR0,PRMTMSG,DFLTVAL)
  1. . . ;
  1. . . ; Exit 'Select Patient' loop if user entered nil.
  1. . . ;
  1. . . I BPS117=-1 Q
  1. . . ;
  1. . . S BPS117NM=$$GET1^DIQ(2,BPS117,.01)
  1. . . ;
  1. . . ; If entry exists in BPS117AR array, prompt user to delete from list.
  1. . . ;
  1. . . I $D(BPS117AR(BPS117)) D
  1. . . . S DIR(0)="S^Y:YES;N:NO"
  1. . . . S DIR("A")="Delete "_BPS117NM_" from your list?"
  1. . . . S DIR("B")="NO"
  1. . . . D ^DIR
  1. . . . I Y="Y" K BPS117AR(BPS117),BPS117AR("B",BPS117NM)
  1. . . . ;
  1. . . E D
  1. . . . ;
  1. . . . ; Set new entry into BPS117AR array.
  1. . . . ;
  1. . . . I $G(BPS117NM)'="" S BPS117AR(BPS117)="",BPS117AR("B",BPS117NM)=""
  1. . . ;
  1. . . ; Display existing entry(s) to user.
  1. . . ;
  1. . . I $D(BPS117AR) D
  1. . . . W !,?2,"Selected:"
  1. . . . S BPS117NM="" F S BPS117NM=$O(BPS117AR("B",BPS117NM)) Q:BPS117NM="" W !,?10,BPS117NM
  1. . ;
  1. . ; If user selected (P)atient but has not selected any patients,
  1. . ; set profile setting to ALL and re-prompt question.
  1. . ;
  1. . I '$D(BPS117AR) S BPARR(1.02)="A",BPARR(1.17)="" S BPSERR=1 Q
  1. . ;
  1. . ; Loop through selected patients, setting selected patients into
  1. . ; BPARR array - delimited by semi-colon.
  1. . ;
  1. . S BPARR(1.17)=";"
  1. . S BPS117=0 F S BPS117=$O(BPS117AR(BPS117)) Q:+BPS117=0 S BPARR(1.17)=BPARR(1.17)_BPS117_";"
  1. E D ; User selected ALL
  1. . S BPARR(1.02)="A"
  1. . S BPARR(1.17)=""
  1. ;
  1. ; If BPSERR flag is 1, re-prompt question.
  1. ;
  1. I $G(BPSERR)=1 G BPS102A
  1. ;
  1. Q 1
  1. ;
  1. ; ^^^^^^^^^^ End of BPS102 / BPS117 Logic ^^^^^^^^^^
  1. ;
  1. ; ********** Start of BPS103 / BPS118 Logic **********
  1. ;
  1. ; User input will be temporarily stored in BPS118AR for display to user
  1. ; of selected RXs while in CV Action.
  1. ;
  1. ; If R is selected, at least one RX must be selected. If not, selection
  1. ; will default to (A)ll and the current question will be re-prompted.
  1. ;
  1. ; Upon completion of RXs entry, values will be placed into a string
  1. ; delimited by semicolons. e.g. BPARR(1.18)=";12345;56789;"
  1. ;
  1. ; BPS118AR = array containing RX information
  1. ; BPS118AR(BPS118)="" BPS118 = IEN from Prescription File #52
  1. ; BPS118AR("B",BPSRXN) BPSRXN = RX Number - Index used to display
  1. ; selected RXs in numerical order while in CV Action.
  1. ;
  1. BPS103(BPARR) ; Fields 1.03 and 1.18 - Rx(s)
  1. BPS103A ;
  1. ;
  1. N BPSI
  1. ;
  1. S BPINP=$$EDITFLD^BPSSCRCV(1.03,+BPDUZ7,"S^R:RX;A:ALL","Display One or Many (R)x or (A)LL","ALL",.BPARR)
  1. I BPINP=-1 Q 0
  1. ;
  1. S BPSERR=0
  1. ;
  1. ; If user selection is R, assign existing entry(s) into BPS118AR array.
  1. ;
  1. I $P(BPINP,U,2)="R" D
  1. . S BPS118=$G(BPARR(1.18))
  1. . I BPS118'="" D
  1. . . S BPSCNT=$L(BPS118,";")
  1. . . I BPSCNT=1 D
  1. . . . S DIC=52
  1. . . . S DR=".01;6"
  1. . . . S DA=BPS118
  1. . . . S DIQ="BPSRXD"
  1. . . . S DIQ(0)="E"
  1. . . . D DIQ^PSODI(52,DIC,DR,DA,.DIQ) ; ICR 4858
  1. . . . ;
  1. . . . S BPSRXN=$G(BPSRXD(52,DA,.01,"E"))
  1. . . . S BPSDRUG=$G(BPSRXD(52,DA,6,"E"))
  1. . . . ;
  1. . . . S BPS118AR(BPS118)="",BPS118AR("B",BPSRXN)=BPSDRUG
  1. . . . ;
  1. . . I +BPSCNT>2 D
  1. . . . F BPSI=2:1:BPSCNT-1 D
  1. . . . . S BPS118X=$P(BPS118,";",BPSI)
  1. . . . . S DIC=52
  1. . . . . S DR=".01;6"
  1. . . . . S DA=BPS118X
  1. . . . . S DIQ="BPSRXD"
  1. . . . . S DIQ(0)="E"
  1. . . . . D DIQ^PSODI(52,DIC,DR,DA,.DIQ) ; ICR 4858
  1. . . . . ;
  1. . . . . S BPSRXN=$G(BPSRXD(52,DA,.01,"E"))
  1. . . . . S BPSDRUG=$G(BPSRXD(52,DA,6,"E"))
  1. . . . . ;
  1. . . . . S BPS118AR(BPS118X)="",BPS118AR("B",BPSRXN)=BPSDRUG
  1. . ;
  1. . ; Display existing entry(s) to user.
  1. . ;
  1. . I $D(BPS118AR) D
  1. . . W !,?2,"Selected:"
  1. . . S BPSRXN="" F S BPSRXN=$O(BPS118AR("B",BPSRXN)) Q:BPSRXN="" W !,?10,BPSRXN,?30,BPS118AR("B",BPSRXN)
  1. . ;
  1. . W !!,"Enter a prescription to select."
  1. . W !,"Once all prescriptions are selected, hit enter without making a selection.",!
  1. . ;
  1. . S BPS118="" F D Q:BPS118=-1
  1. . . S PRMTMSG="Select RX"
  1. . . S DFLTVAL=""
  1. . . S BPS118=$$PROMPTRX^BPSUTIL1(PRMTMSG,DFLTVAL)
  1. . . ;
  1. . . ; Exit 'Select RX' loop if user entered nil.
  1. . . ;
  1. . . I BPS118=-1 Q
  1. . . ;
  1. . . S DIC=52
  1. . . S DR=".01;6"
  1. . . S DA=BPS118
  1. . . S DIQ="BPSRXD"
  1. . . S DIQ(0)="E"
  1. . . D DIQ^PSODI(52,DIC,DR,DA,.DIQ) ; ICR 4858
  1. . . ;
  1. . . S BPSRXN=$G(BPSRXD(52,DA,.01,"E"))
  1. . . S BPSDRUG=$G(BPSRXD(52,DA,6,"E"))
  1. . .
  1. . . ;
  1. . . ; If entry exists in BPS118AR array, prompt user to delete from list.
  1. . . ;
  1. . . I $D(BPS118AR(BPS118)) D
  1. . . . S DIR(0)="S^Y:YES;N:NO"
  1. . . . S DIR("A")="Delete "_BPSRXN_" from your list?"
  1. . . . S DIR("B")="NO"
  1. . . . D ^DIR
  1. . . . I Y="Y" K BPS118AR(BPS118),BPS118AR("B",BPSRXN)
  1. . . . ;
  1. . . E D
  1. . . . ; Set new entry into BPS118AR array.
  1. . . . ;
  1. . . . S BPS118AR(BPS118)="",BPS118AR("B",BPSRXN)=BPSDRUG
  1. . . ;
  1. . . ; Display existing entry(s) to user.
  1. . . ;
  1. . . I $D(BPS118AR) D
  1. . . . W !,?2,"Selected:"
  1. . . . S BPSRXN="" F S BPSRXN=$O(BPS118AR("B",BPSRXN)) Q:BPSRXN="" W !,?10,BPSRXN,?30,BPS118AR("B",BPSRXN)
  1. . ;
  1. . ; If user selected (R)x but has not selected any RXs,
  1. . ; set profile setting to ALL and set BPSERR flag to re-prompt question.
  1. . ;
  1. . I '$D(BPS118AR) S BPARR(1.03)="A",BPARR(1.18)="" S BPSERR=1 Q
  1. . ;
  1. . ; Loop through selected RXs, setting selected RXs into
  1. . ; BPARR array - delimited by semi-colon.
  1. . ;
  1. . S BPARR(1.18)=";"
  1. . S BPS118=0 F S BPS118=$O(BPS118AR(BPS118)) Q:+BPS118=0 S BPARR(1.18)=BPARR(1.18)_BPS118_";"
  1. E D ; User selected ALL
  1. . S BPARR(1.03)="A"
  1. . S BPARR(1.18)=""
  1. ;
  1. ; If BPSERR flag is 1, re-prompt question.
  1. ;
  1. I $G(BPSERR)=1 G BPS103A
  1. ;
  1. Q 1
  1. ;
  1. ; ^^^^^^^^^^ End of BPS103 / BPS118 Logic ^^^^^^^^^^
  1. ;
  1. Q