17. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 4/17/2018 8:06:46 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

17.1 Files compared

# Location File Last Modified
1 MCCF EDI TAS ePharmacy 031218.zip\MCCF EDI TAS ePharmacy 031218 TAS+ePhm+SDD+US572+v1.02.docx Wed Dec 13 12:48:51 2017 UTC
2 MCCF EDI TAS ePharmacy 031218.zip\MCCF EDI TAS ePharmacy 031218 TAS+ePhm+SDD+US572+v1.02.docx Wed Apr 18 00:08:39 2018 UTC

17.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 1 4348
Changed 0 0
Inserted 0 0
Removed 0 0

17.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

17.4 Active regular expressions

No regular expressions were active.

17.5 Comparison detail

  1   MCCF EDI T AS US572
  2   System Des ign Docume nt
  3  
  4  
  5  
  6  
  7  
  8   Department  of Vetera ns Affairs
  9   October 20 17
  10   Version 1. 02
  11   User Story  Number: U SRX-19
  12   User Story  Name: Imp rove Exist ing Pharma cy Reports
  13   Product Ba cklog ID:  181
  14   Priority:  12
  15   Initial Si zing Estim ate: 
  16   Rational I D: 828280
  17   Rally ID:  US572
  18   Epic Taxon omy: Updat e
  19  
  20   Design – S ummary
  21   The ePharm acy users  need to be  able to s elect one,  multiple  or all for  each filt er questio n when run ning the R ejected Cl aims Repor t and seve ral new fi lters need  to be add ed which w ill result  in additi onal data  displaying  on the re port.
  22  
  23  
  24   List of Co mponents:
  25   Routine: B PSRPT0
  26   Routine: B PSRPT1
  27   Routine: B PSRPT3
  28   Routine: B PSRPT3A
  29   Routine: B PSRPT4
  30   Routine: B PSRPT5
  31   Routine: B PSRPT6
  32   Routine: B PSRPT7
  33   Routine: B PSRPT8
  34  
  35   Design – D etail
  36   This user  story pert ains to th e Rejected  Claims Re port.  In  addition,  a change t o the Elig ibility pr ompt appli es to the  Rejected C laims Repo rt and the  Non-Billa ble Status  Report.
  37  
  38   The change s to the R ejected Cl aims Repor t are as f ollows:
  39   allow the  user to ma ke multipl e selectio ns
  40   add new fi lter quest ions
  41   reword the  Excel cap ture instr uctions
  42   change rep ort format  
  43   change Exc el report  output
  44  
  45  
  46   The change s to allow  the user  to make mu ltiple sel ections an d the new  filter que stions for  the Rejec ted Claims  Report ar e describe d below.
  47  
  48   Subroutine  Name
  49   EN^BPSRPT0
  50   Enhancemen t Category
  51    New
  52    Modify
  53    Delete
  54    No Change
  55   Story
  56   US572
  57   Related Me nu Options  or ListMa n Actions
  58   BPS MENU R PT CLAIM S TATUS
  59   Related Ro utines
  60   This Subro utine is C alled By
  61   This Subro utine Call s
  62  
  63   BPS MENU R PT CLAIM S TATUS
  64   NOW^%DTC,  DD^%DT,
  65   $$SELPHARM ^BPSRPT3,
  66   $$SELSMDET ^BPSPRT3,
  67   $$INSURSEL ^BPSSCRCU,
  68   $$SELMWC^B PSRPT3,
  69   $$SELMWC1^ BPSRPT3,
  70   $$SELRTBCK ^BPSRPT3,
  71   $$SELRBPS^ BPSRPT3,
  72   $$SELDRGAL ^BPSRPT3,
  73   $$SELDRG^B PSRPT3,
  74   $$SELDRG1^ BPSRPT3A,
  75   $$SELDRGLC ^BPSRPT3, 
  76   $$SELDC^BP SRPT3A,
  77   $$SELDATE^ BPSRPT3,
  78   $$SELRLNRL ^BPSRPT4,
  79   $$SELREJCD ^BPSRPT4,
  80   $$SELAUREV ^BPSRPT4,
  81   $$SELACREJ ^BPSRPT4,
  82   $$SELCCRSN ^BPSRPT4,
  83   $$SELELIG^ BPSRPT3,
  84   $$SELOPCL^ BPSRPT3,
  85   $$SELALRC^ BPSRPT3,
  86   $$SELELIG1 ^BPSRPT3,
  87   $$SELPRESC ^BPSRPT3A,
  88   $$SELPA^BP SRPT3A,
  89   $$SELPAT^B PSRPT3A,
  90   $$SELBAMT^ BPSRPT3A,
  91   $$SELBMIN^ BPSRPT3A,
  92   $SELBMAX^B PSRPT3A,
  93   $$SELNBSTS ^BPSRPT3,
  94   $$SELEXCEL ^BPSRPT4,
  95   DEVICE, RU N,
  96   PAUSE2^BPS RPT1
  97   Related In tegration  Control Re gistration s (ICRs)
  98   n/a
  99   Data Passi ng
  100    Parameter  Input
  101    Parameter  Output
  102    Function  Return Val ue
  103    Global Mo dified
  104   Input Attr ibute Name  and Defin ition
  105   Name: BPRT YPE
  106   Definition : report n umber (1-9 )
  107    New       Modify       Delete       No Cha nge
  108   Output Att ribute Nam e and Defi nition
  109   Name: n/a
  110   Definition
  111    New       Modify       Delete       No Cha nge
  112   Current Lo gic
  113  
  114   BPSRPT0 ;B HAM ISC/BE E - ECME R EPORTS ;14 -FEB-05
  115    ;;1.0;E C LAIMS MGMT  ENGINE;** 1,5,7,10,1 1,19,20**; JUN 2004;B uild 27
  116    ;;Per VA  Directive  6402, this  routine s hould not  be modifie d.
  117    ;
  118    Q
  119    ;
  120    ; Front E nd for ECM E Reports
  121    ; 
  122    ; Input v ariable: B PRTYPE ->  1 = Payabl e Claims
  123    ;                            2  = Rejected  Claims
  124    ;                            3  = Claims S ubmitted,  Not Yet Re leased
  125    ;                            4  = Reversed  Claims
  126    ;                            5  = Recent T ransaction s
  127    ;                            6  = Totals B y Date
  128    ;                            7  = Closed C laims
  129    ;                            8  = Spending  Account R eport
  130    ;                            9  = ECME RXs  with Non- Billable S tatus
  131    ;                            
  132    ; Passed  variables  - The foll owing loca l variable s are pass ed around  the BPSRPT * routines
  133    ;                      and are  not passed  as parame ters but a re assumed  to be def ined:
  134    ;                      BPACREJ, BPAUTREV,B PBEGDT,BPB LINE,BPCCR SN,BPDRGCL ,BPDRUG,BP ENDDT,BPEX CEL,
  135    ;                      BPINSINF ,BPGRPLN,B PMWC,BPNOW ,BPPAGE,BP PHARM,BPQ, BPQSTDRG,
  136    ;                      BPRLNRL, BPRTBCK,BP SDATA,BPSU MDET,BPRTY PE,BPNBSTS ,BPALRC,BP ELIG1
  137    ;                            
  138   EN(BPRTYPE ) N %,BPAC REJ,BPAUTR EV,BPBEGDT ,BPCCRSN,B PDRGCL,BPD RUG,BPENDD T,BPEXCEL, BPNOW,BPPH ARM,BPINSI NF,BPMWC,B PQ,BPQSTDR G
  139    N BPREJCD ,BPRLNRL,B PRPTNAM,BP RTBCK,BPSC R,BPSUMDET ,CODE,POS, STAT,X,Y,B PINS,BPARR ,BPELIG,BP OPCL
  140    N BPNBSTS ,BPALRC,BP ELIG1
  141    ;
  142    ;Verify t hat a vali d report h as been re quested
  143    I ",1,2,3 ,4,5,6,7,8 ,9,"'[("," _$G(BPRTYP E)_",") W  "<Invalid  Menu Defin ition - Re port Undef ined>" H 3  Q
  144    S BPRPTNA M=$P("PAYA BLE CLAIMS ^REJECTED  CLAIMS^SUB MIT,NOT RE LEASED CLA IMS^REVERS ED CLAIMS^ RECENT TRA NSACTIONS^ TOTALS^CLO SED CLAIMS ^SPENDING  ACCOUNT RE PORT^RXS W ITH NON-BI LLABLE STA TUS","^",B PRTYPE)
  145    ;
  146    ;Get curr ent Date/T ime
  147    D NOW^%DT C S Y=% D  DD^%DT S B PNOW=Y
  148    ;
  149    ;Prompt f or ECME Ph armacy Div ision(s) ( No Default )
  150    ;Sets up  BPPHARM va riable and  array, BP PHARM =0 A LL or BPPH ARM=1,BPPH ARM(ptr) f or list
  151    S X=$$SEL PHARM^BPSR PT3() I X= "^" G EXIT
  152    ;
  153    ;Prompt t o Display  Summary or  Detail Fo rmat (Defa ult to Det ail)
  154    ;Returns  1 for Summ ary, 0 for  Detail
  155    S BPSUMDE T=$$SELSMD ET^BPSRPT3 (2) I BPSU MDET="^" G  EXIT
  156    ;
  157    ;Prompt t o allow se lection of  Multiple  Insurances  or All (D efault to  ALL)
  158    ;See desc ription fo r $$INSURS EL^BPSSCRC U
  159    S BPINS=$ $INSURSEL^ BPSSCRCU(. BPARR,DUZ)  I BPINS<1  G EXIT
  160    S BPINSIN F=$S(BPARR (1.11)="I" :BPARR("IN S"),1:0)
  161    ;
  162    ;Prompt t o Display  (C)MOP or  (M)ail or  (W)indow o r (A)LL (D efault to  ALL)
  163    ;Returns  (A-ALL,M-M ail,W-Wind ow,C-CMOP)
  164    S BPMWC=$ $SELMWC^BP SRPT3("A")  I BPMWC=" ^" G EXIT
  165    ;
  166    ;Prompt t o Display  (R)ealTime  Fills or  (B)ackbill s or (P)RO  Option or  Re(S)ubmi ssion or ( A)LL (Defa ult to ALL )
  167    ;Returns  (1-ALL,2-R ealTime Fi lls,3-Back bills,4-PR O Option,5 -Resubmiss ion)
  168    S BPRTBCK =1
  169    I BPRTYPE '=9 S BPRT BCK=$$SELR TBCK^BPSRP T3(1) I BP RTBCK="^"  G EXIT
  170    ;
  171    ;Prompt t o Display  Specific ( D)rug or D rug (C)las s or (A)ll  (Default  to ALL)
  172    ;Returns  (1-ALL,2-D rug,3-Drug  Class)
  173    S BPQSTDR G=$$SELDRG AL^BPSRPT3 (1) I BPQS TDRG="^" Q
  174    ;
  175    ;Prompt t o Select D rug (No De fault)
  176    S BPDRUG= 0 I BPQSTD RG=2 S BPD RUG=$$SELD RG^BPSRPT3 () I BPDRU G="^" G EX IT
  177    ;
  178    ;Prompt t o Select D rug Class  (No Defaul t)
  179    S BPDRGCL =0 I BPQST DRG=3 S BP DRGCL=$$SE LDRGCL^BPS RPT3() I B PDRGCL="^"  G EXIT
  180    ;
  181    ;Report S pecific Pr ompts
  182    ;
  183    ;Prompt t o select D ate Range
  184    ;Returns  (Start Dat e^End Date )
  185    I (",1,2, 3,4,5,6,7, 8,9,")[BPR TYPE S BPB EGDT=$$SEL DATE^BPSRP T3(BPRTYPE ) D  I BPB EGDT="^" G  EXIT
  186    .I BPBEGD T="^" Q
  187    .S BPENDD T=$P(BPBEG DT,U,2)
  188    .S BPBEGD T=$P(BPBEG DT,U)
  189    ;
  190    ;Prompt t o Include  (R)ELEASED  or (N)OT  RELEASED o r (A)LL (D efault to  RELEASED)
  191    ;Returns  (1-ALL,2-R ELEASED,3- NOT RELEAS ED)
  192    S BPRLNRL =$S(BPRTYP E=3:3,1:1)  I (",1,2, 4,6,7,8,9, ")[BPRTYPE  S BPRLNRL =$$SELRLNR L^BPSRPT4( $S(BPRTYPE =9:1,1:2))  I BPRLNRL ="^" G EXI T
  193    ;
  194    ;Prompt t o Include  (S)pecific  Reject Co de or (A)L L (Default  to ALL)
  195    ;Returns  (0-ALL,ptr -Pointer t o Selected  Reject Co de in #900 2313.93)
  196    S BPREJCD =0 I (",2, ")[BPRTYPE  S BPREJCD =$$SELREJC D^BPSRPT4( 0) I BPREJ CD="^" G E XIT
  197    ;
  198    ;Prompt t o Include  Auto(R)eve rsed or (A )LL (Defau lt to ALL)
  199    ;Returns  (0-All,1-A utoReverse d)
  200    S BPAUTRE V=0 I (",4 ,")[BPRTYP E S BPAUTR EV=$$SELAU REV^BPSRPT 4(0) I BPA UTREV="^"  G EXIT
  201    ;
  202    ;Prompt t o Include  A(C)cepted  or (R)eje cted or (A )LL (Defau lt to REJE CTED)
  203    ;Returns  (0-All,1-R ejected,2- Accepted)
  204    S BPACREJ =0 I (",4, ")[BPRTYPE  S BPACREJ =$$SELACRE J^BPSRPT4( 1) I BPACR EJ="^" G E XIT
  205    ;
  206    ;Prompt t o Include  (S)pecific  Close Cla im Reason  or (A)ll ( Default to  All)
  207    ;Returns  (0-All,ptr -Pointer t o #356.8)
  208    S BPCCRSN =0 I (",7, ")[BPRTYPE  S BPCCRSN =$$SELCCRS N^BPSRPT4( 0) I BPCCR SN="^" G E XIT
  209    ;
  210    ;Prompt f or Eligibi lity Indic ator for p ayable, re jected, re versed and  closed cl aims repor t
  211    ;Returns  (V=VETERAN ,T=TRICARE ,C=CHAMPVA ,0=All)
  212    S BPELIG= 0 I (",1,2 ,4,7,")[BP RTYPE S BP ELIG=$$SEL ELIG^BPSRP T3(1) I BP ELIG="^" G  EXIT
  213    ;
  214    ;Prompt f or Open/Cl osed/All c laims
  215    ;Returns  (1=Closed, 2=Open,0=A ll)
  216    S BPOPCL= 0 I (",2," )[BPRTYPE  S BPOPCL=$ $SELOPCL^B PSRPT3(2)  I BPOPCL=" ^" G EXIT
  217    ;
  218    ;Prompt f or All or  Most Recen t (Non-Bil lable Stat us Report  only)
  219    ;Returns  A - All, R  - Most Re cent
  220    S BPALRC= 0 I (",9," )[BPRTYPE  S BPALRC=$ $SELALRC^B PSRPT3() I  BPALRC="^ " G EXIT
  221    ;
  222    ;Prompt f or multipl e Eligibil ity Indica tor for No n-Billable  Status Re port
  223    ;Sets up  BPELIG1 va riable and  array, BP ELIG1=0 AL L or BPELI G1=1,BPELI G1(xx) for  list
  224    S BPELIG1 =0 I (",9, ")[BPRTYPE  S BPELIG1 =$$SELELIG 1^BPSRPT3( ) I BPELIG 1="^" G EX IT
  225    ;
  226    ;Prompt f or Non-Bil lable Stat us (Non-Bi llable Sta tus Report  only)
  227    ;Sets up  BPNBSTS va riable and  array, BP NBSTS=0 AL L or BPNBS TS=1,BPNBS TS(xx) for  list
  228    S BPNBSTS =0 I (",9, ")[BPRTYPE  S BPNBSTS =$$SELNBST S^BPSRPT3( ) I BPNBST S="^" G EX IT
  229    ;
  230    ;Prompt f or Excel C apture (De tail Only)
  231    S BPEXCEL =0 I 'BPSU MDET S BPE XCEL=$$SEL EXCEL^BPSR PT4() I BP EXCEL="^"  G EXIT
  232    ;
  233    ;Prompt f or the Dev ice
  234    I 'BPEXCE L D
  235    .W !!,"WA RNING - TH IS REPORT  REQUIRES T HAT A DEVI CE WITH 13 2 COLUMN W IDTH BE US ED."
  236    .W !,"IT  WILL NOT D ISPLAY COR RECTLY USI NG 80 COLU MN WIDTH D EVICES",!
  237    S BPQ=0 D  DEVICE(BP RPTNAM) Q: BPQ
  238    ;
  239    ;Compile  and Run th e Report
  240    D RUN(BPE XCEL,BPRPT NAM,BPSUMD ET)
  241    I 'BPQ D  PAUSE2^BPS RPT1
  242    ;
  243   EXIT Q
  244  
  245   Modified L ogic (Chan ges are hi ghlighted)
  246  
  247   BPSRPT0 ;B HAM ISC/BE E - ECME R EPORTS ;14 -FEB-05
  248    ;;1.0;E C LAIMS MGMT  ENGINE;** 1,5,7,10,1 1,19,20,23 **;JUN 200 4;Build 27
  249    ;;Per VA  Directive  6402, this  routine s hould not  be modifie d.
  250    ;
  251    Q
  252    ;
  253    ; Front E nd for ECM E Reports
  254    ; 
  255    ; Input v ariable: B PRTYPE ->  1 = Payabl e Claims
  256    ;                            2  = Rejected  Claims
  257    ;                            3  = Claims S ubmitted,  Not Yet Re leased
  258    ;                            4  = Reversed  Claims
  259    ;                            5  = Recent T ransaction s
  260    ;                            6  = Totals B y Date
  261    ;                            7  = Closed C laims
  262    ;                            8  = Spending  Account R eport
  263    ;                            9  = ECME RXs  with Non- Billable S tatus
  264    ;                            
  265    ; Passed  variables  - The foll owing loca l variable s are pass ed around  the BPSRPT * routines
  266    ;                      and are  not passed  as parame ters but a re assumed  to be def ined:
  267    ;                      BPACREJ, BPAUTREV,B PBEGDT,BPB LINE,BPCCR SN,BPDRGCL ,BPDRUG,BP ENDDT,BPEX CEL,
  268    ;                      BPINSINF ,BPGRPLN,B PMWC,BPNOW ,BPPAGE,BP PHARM,BPQ, BPQSTDRG,
  269    ;                      BPRLNRL, BPRTBCK,BP SDATA,BPSU MDET,BPRTY PE,BPNBSTS ,BPALRC,BP ELIG1
  270    ; Passed  variables:
  271    ;  The fo llowing lo cal variab les are se t in BPSPR T0 and are  passed th roughout
  272    ;  the BP SRPT* rout ines. They  are used  during the  looping/f iltering o f transact ions
  273    ;  and wh en creatin g the repo rts.
  274    ;  These  local vari able are n ot passed  as paramet ers but as sumed to b e defined.
  275    ; 
  276    ;    BPRT YPE -  rep ort number  (1-9) 
  277    ;      1  = Payable  Claims, 2  = Rejected  Claims, 3  = Claims  Submitted,  Not Yet R eleased, 
  278    ;      4  = Reversed  Claims, 5  = Recent  Transactio ns, 6 = To tals By Da te,
  279    ;      7  = Closed C laims, 8 =  Spending  Account Re port, 9 =  ECME RXs w ith Non-Bi llable Sta tus
  280    ;    BPRP TNAM – rep ort name 
  281    ;      1- PAYABLE CL AIMS, 2-RE JECTED CLA IMS, 3-SUB MIT,NOT RE LEASED CLA IMS,
  282    ;      4- REVERSED C LAIMS, 5-R ECENT TRAN SACTIONS,  6-TOTALS,  7-CLOSED C LAIMS,
  283    ;      8- SPENDING A CCOUNT REP ORT, 9-RXS  WITH NON- BILLABLE S TATUS
  284    ;    BPSL C - all lo wer case l etters (us ed to conv ert from l ower to up per) ;     BPSUC - al l upper ca se letters  (used to  convert fr om lower t o upper)
  285    ;    BPPH ARM - Phar macy Divis ions or AL L
  286    ;      BP PHARM=0 –  ALL
  287    ;         if Pharmac y Division s was sele cted, retu rns BPPHAR M variable  and an ar ray
  288    ;      BP PHARM=1
  289    ;      BP PHARM(ptr)  for each  selection  – Pointer  to BPS PHA RMACIES 
  290    ;    BPSU MDET – 1=D isplay Sum mary  or 0 =Detail Fo rmat 
  291    ;    BPIN S – allow  selection  of Insuran ce or ALL,  returns B PINS varia ble and BP ARR array
  292    ;      0= ”^” Exit
  293    ;      1= if ALL - B PARR(1.11) =”A”,BPARR (2.04)=””, BPARR(“INS ”)=””
  294    ;      1= if INSURAN CE
  295    ;         BPARR(1.11 )=”I”,
  296    ;         BPARR(2.04 )=”;1;ptr; ”   if mul tiple entr ies - BPAR R(2.04)=”; ptr;ptr;…”
  297    ;         BPARR(“INS ”)=”;1;ptr ;”  if mul tiple entr ies - BPAR R(“INS”)=” ;ptr;ptr;…
  298    ;      pt r – Pointe r to the I NSURANCE f ile
  299    ;    BPIN SINF – BPI NSINF=0 -  if ALL Ins urances wa s selected  above
  300    ;      BP INSINF=BPA RR(“INS”) 
  301    ;    BPMW C – Fill l ocation C- CMOP, W-WI NDOW, M-MA IL
  302    ;      BP MWC=A-ALL,  ^-Exit
  303    ;      BP MWC=(C,W,M )
  304    ;       i f multiple  entries -  BPMWC=(a  comma deli mited stri ng of user s selectio n, e.g. "C ,M")
  305    ;    BPRT BCK – Fill  Type - 2- RealTime F ills, 3-Ba ckbills, 4 -PRO Optio n, 5-Resub mission
  306    ;      BP RTBCK=1-AL L,^-exit
  307    ;      BP RTBCK=(2,3 ,4,5)
  308    ;       i f multiple  entries -  BPRTBCK=( a comma de limited st ring of us ers select ion, e.g.  "3,5")
  309    ;    BPQS TDRG – Dru g-2 or Dru g Class-3  or All-1 o r Exit-^
  310    ;      BP QSTDRG=(1, 2,3,^)
  311    ;    BPDR UG – selec t Drug – p tr=Pointer  to the DR UG file #5 0
  312    ;      BP DRUG= ptr  - if multi ple entrie s - BPDRUG =”ptr,ptr, …”
  313    ;    BPDR GCL – sele ct Drug –  ptr= Point er to the  DRUG CLASS  file #50. 5
  314    ;      BP DRGCL= ptr  - if mult iple entri es - BPDRG CL= ptr,pt r,…
  315    ;    BPBE GDT – Date  Range
  316    ;      BP BEGDT=^-Ex it
  317    ;      BP BEGDT= beg inning dat e ^ ending  date
  318    ;      BP BEGDT=$P(B PBEGDT,U)  - beginnin g date
  319    ;      BP ENDDT=$P(B PBEGDT,U,2 ) - ending  date
  320    ;    BPRL NRL – 2-Re leased, 3- Not Releas ed or 1-Al l
  321    ;      BP RLNRL=(1,2 ,3,^) ^=ex it
  322    ;    BPRE JCD – Spec ific Rejec t Code or  All
  323    ;      BP REJCD=0-AL L, ^-Exit
  324    ;      BP REJCD=ptr  - if multi ple entrie s – BPREJC D=ptr,ptr,
  325    ;       p tr=Pointer  to Reject  Code in # 9002313.93
  326    ;    BPAU TREV - Aut oReversed- 1 or All-0
  327    ;      BP AUTREV=(0, 1,^)
  328    ;    BPAC REJ – Acce pted-2, Re jected-1 o r All-0
  329    ;      BP ACREJ=(0,1 ,2,^)
  330    ;    BPCC RSN – Spec ific Close  Claim Rea son-ptr or  All-0
  331    ;      BP CCRSN=(0,p tr) – ptr= Pointer to  #356.8
  332    ;    BPEL IG – Eligi bility V-V eteran, T- Tricare, C -Champva o r 0-All
  333    ;      BP ELIG=(V,T, C,0,^)
  334    ;    BPEL IG1 – mult iple Eligi bilities o r All-0 
  335    ;      BP ELIG1=(0,^ )
  336    ;      BP ELIG1=(V,T ,C)   V-Ve teran, T-T ricare, C- Champva
  337    ;       i f multiple  entries B PELIG1=(a  comma deli mited stri ng of user s selectio n, e.g. "C ,T")
  338    ;    BPOP CL – Open- 2, Closed- 1 or All-0
  339    ;      BP OPCL=(0,1, 2,^)
  340    ;    BPRE SC – Selec ted Prescr iber-ptr o r All-0 -  ptr=Pointe r to file  #200
  341    ;      BP RESC=(0,^)
  342    ;      BP RESC=ptr -  if multip le entries  – BPRESC= ptr,ptr,…
  343    ;    BPQS TPAT – sel ect Patien ts-1 or Al l-0
  344    ;      BP QSTPAT=(0, 1,^)
  345    ;    BPPA T – if Pat ients=1 wa s selected  above
  346    ;      BP PAT=ptr –  if multipl e entries  – BPPAT=pt r,ptr  ptr =Pointer t o file #2
  347    ;    BPBI LL – Range  of Billed  Amount-1  or All-0
  348    ;      BP BILL=(0,1, ^) 
  349    ;    BPMI N – if BPB ILL=1 ente r minimum  billed amo unt
  350    ;      BP MIN=amount  entered,  default is  0
  351    ;    BPMA X – if BPB ILL=1 ente r maximum  billed amo unt
  352    ;      BP MAX=amount  entered,  default is  999999
  353    ;    BPAL RC – All-A  or Most R ecent-R (N on-Billabl e Status r eport only , BPRTYPE= 9)
  354    ;      BP ALRC=(A,R, ^)
  355    ;    BPNB STS – Non- Billable S tatus (Non -Billable  Status rep ort only,  BPRTYPE=9)
  356    ;      BP NBSTS=(0–A ll,1–certa in Non-bil lable stat us,^)
  357    ;       i f BPNBSTS= 1 there is  a BPNBSTS  array for  each stat us selecte d
  358    ;      BP NBSTS(ptr) =status  -  for each  status sel ected
  359    ;       p tr=Pointer  to file # 366.17 - s tatus=non- billable r eason from  file #366 .17 field  #.01
  360    ;    BPEX CEL – Exce l capture- detail onl y, if BPSU MDET=0 (de tail forma t)
  361    ;      BP EXCEL=(0-N o, 1-Yes,  ^)
  362    ;    BPQ  – device v ariable -  I POP S BP Q=1 otherw ise BPQ=0
  363    ;
  364    ; The fol lowing loc al variabl es are not  set in BP SRPT0 howe ver they a re used in  several
  365    ; BPSRPT*  routines.   They are  not passe d as param eters but  assumed to  be define d.
  366    ;    BPBL INE – blan k line ind icator, 1- print blan k line
  367    ;    BPGR PLAN – ins urance pla n name
  368    ;    BPSD ATA – tell s whether  data has b een displa yed to the  screen (0 -No,1-Yes)
  369    ;                            
  370   EN(BPRTYPE ) N %,BPAC REJ,BPAUTR EV,BPBEGDT ,BPCCRSN,B PDRGCL,BPD RUG,BPENDD T,BPEXCEL, BPNOW,BPPH ARM,BPINSI NF,BPMWC,B PQ,BPQSTDR G
  371    N BPREJCD ,BPRLNRL,B PRPTNAM,BP RTBCK,BPSC R,BPSUMDET ,CODE,POS, STAT,X,Y,B PINS,BPARR ,BPELIG,BP OPCL
  372    N BPNBSTS ,BPALRC,BP ELIG1,BPRE SC,BPPAT,B PQSTPAT,BP BILL,BPMIN ,BPMAX,BPS LC,BPSUC
  373    ;
  374    ;Verify t hat a vali d report h as been re quested
  375    I ",1,2,3 ,4,5,6,7,8 ,9,"'[("," _$G(BPRTYP E)_",") W  "<Invalid  Menu Defin ition - Re port Undef ined>" H 3  Q
  376    S BPRPTNA M=$P("PAYA BLE CLAIMS ^REJECTED  CLAIMS^SUB MIT,NOT RE LEASED CLA IMS^REVERS ED CLAIMS^ RECENT TRA NSACTIONS^ TOTALS^CLO SED CLAIMS ^SPENDING  ACCOUNT RE PORT^RXS W ITH NON-BI LLABLE STA TUS","^",B PRTYPE)
  377    ;
  378    ;Get curr ent Date/T ime
  379    D NOW^%DT C S Y=% D  DD^%DT S B PNOW=Y
  380    ;
  381    ;Prompt f or ECME Ph armacy Div ision(s) ( No Default )
  382    ;Sets up  BPPHARM va riable and  array, BP PHARM =0 A LL or BPPH ARM=1,BPPH ARM(ptr) f or list
  383    S X=$$SEL PHARM^BPSR PT3() I X= "^" G EXIT
  384    ;
  385    ;Prompt t o Display  Summary or  Detail Fo rmat (Defa ult to Det ail)
  386    ;Returns  1 for Summ ary, 0 for  Detail
  387    S BPSUMDE T=$$SELSMD ET^BPSRPT3 (2) I BPSU MDET="^" G  EXIT
  388    ;
  389    ;Prompt t o allow se lection of  Multiple  Insurances  or All (D efault to  ALL)
  390    ;See desc ription fo r $$INSURS EL^BPSSCRC U
  391    S BPINS=$ $INSURSEL^ BPSSCRCU(. BPARR,DUZ)  I BPINS<1  G EXIT
  392    S BPINSIN F=$S(BPARR (1.11)="I" :BPARR("IN S"),1:0)
  393    ;If Multi ple Insura nces was s elected "I " and the  the user e ntered "^"  or ;the u ser hit re turn there fore not s electing a  Insurance  return to  the menu  I BPINSINF =";" G EXI T
  394    ;
  395    ;Prompt t o Display  (C)MOP or  (M)ail or  (W)indow o r (A)LL (D efault to  ALL)
  396    ;Returns  (A-ALL,M-M ail,W-Wind ow,C-CMOP)
  397    I (",2,") '[BPRTYPE  S BPMWC=$$ SELMWC^BPS RPT3("A")  I BPMWC="^ " G EXIT
  398    I (",2,") [BPRTYPE S  BPMWC=$$S ELMWC1^BPS RPT3("A")  I BPMWC="^ " G EXIT
  399    ;
  400    ;Prompt t o Display  (R)ealTime  Fills or  (B)ackbill s or (P)RO  Option or  Re(S)ubmi ssion or ( A)LL (Defa ult to ALL )
  401    ;Returns  (1-ALL,2-R ealTime Fi lls,3-Back bills,4-PR O Option,5 -Resubmiss ion)
  402    S BPRTBCK =1
  403    I (",2,9, ")'[BPRTYP E S BPRTBC K=$$SELRTB CK^BPSRPT3 (1) I BPRT BCK="^" G  EXIT
  404    I (",2,") [BPRTYPE S  BPRTBCK=$ $SELRBPS^B PSRPT3() I  BPRTBCK=" ^" G EXIT
  405    ;
  406    ;Prompt t o Display  Specific ( D)rug or D rug (C)las s or (A)ll  (Default  to ALL)
  407    ;Returns  (1-ALL,2-D rug,3-Drug  Class)
  408    S BPQSTDR G=$$SELDRG AL^BPSRPT3 (1) I BPQS TDRG="^" Q
  409    ;
  410    ;Prompt t o Select D rug (No De fault)
  411    S BPDRUG= 0 I BPQSTD RG=2 D  I  BPDRUG=”^”  G EXIT
  412    . I (",2, ")’[BPRTYP E S BPDRUG =$$SELDRG^ BPSRPT3()
  413    . I (",2, ")[BPRTYPE  S BPDRUG= $$SELDRG1^ BPSRPT3A()
  414    ;
  415    ;Prompt t o Select D rug Class  (No Defaul t)
  416    S BPDRGCL =0 I BPQST DRG=3 D  I  BPDRGCL=” ^” G EXIT
  417    . I (",2, ")’[BPRTYP E S BPDRGC L=$$SELDRG CL^BPSRPT3 ()
  418    . I (",2, ")[BPRTYPE  S BPDRGCL =$$SELDC^B PSRPT3A()
  419    ;
  420    ;Report S pecific Pr ompts
  421    ;
  422    ;Prompt t o select D ate Range
  423    ;Returns  (Start Dat e^End Date )
  424    I (",1,2, 3,4,5,6,7, 8,9,")[BPR TYPE S BPB EGDT=$$SEL DATE^BPSRP T3(BPRTYPE ) D  I BPB EGDT="^" G  EXIT
  425    .I BPBEGD T="^" Q
  426    .S BPENDD T=$P(BPBEG DT,U,2)
  427    .S BPBEGD T=$P(BPBEG DT,U)
  428    ;
  429    ;Prompt t o Include  (R)ELEASED  or (N)OT  RELEASED o r (A)LL (D efault to  RELEASED)
  430    ;Returns  (1-ALL,2-R ELEASED,3- NOT RELEAS ED)
  431    S BPRLNRL =$S(BPRTYP E=3:3,1:1)  I (",1,2, 4,6,7,8,9, ")[BPRTYPE  S BPRLNRL =$$SELRLNR L^BPSRPT4( $S(BPRTYPE =9:1,1:2))  I BPRLNRL ="^" G EXI T
  432    ;
  433    ;Prompt t o Include  (S)pecific  Reject Co de or (A)L L (Default  to ALL)
  434    ;If (S)pe cific is s elected th e user wil l be promp ted to ent er one or  more Rejec t Codes
  435    ;Returns:  0=ALL
  436    ;          ^=if user  entered “ ^”
  437    ;       p tr=string  of ptr’s d elimited w ith a comm a  e.g. BP REJCD=”95, 100,”
  438    ;         (ptr is th e Pointer  to the sel ected Reje ct Code in  #9002313. 93)
  439    S BPREJCD =0 I (",2, ")[BPRTYPE  S BPREJCD =$$SELREJC D^BPSRPT4( 0) I BPREJ CD="^" G E XIT
  440    ;
  441    ;Prompt t o Include  Auto(R)eve rsed or (A )LL (Defau lt to ALL)
  442    ;Returns  (0-All,1-A utoReverse d)
  443    S BPAUTRE V=0 I (",4 ,")[BPRTYP E S BPAUTR EV=$$SELAU REV^BPSRPT 4(0) I BPA UTREV="^"  G EXIT
  444    ;
  445    ;Prompt t o Include  A(C)cepted  or (R)eje cted or (A )LL (Defau lt to REJE CTED)
  446    ;Returns  (0-All,1-R ejected,2- Accepted)
  447    S BPACREJ =0 I (",4, ")[BPRTYPE  S BPACREJ =$$SELACRE J^BPSRPT4( 1) I BPACR EJ="^" G E XIT
  448    ;
  449    ;Prompt t o Include  (S)pecific  Close Cla im Reason  or (A)ll ( Default to  All)
  450    ;Returns  (0-All,ptr -Pointer t o #356.8)
  451    S BPCCRSN =0 I (",7, ")[BPRTYPE  S BPCCRSN =$$SELCCRS N^BPSRPT4( 0) I BPCCR SN="^" G E XIT
  452    ;
  453    ;Prompt f or Eligibi lity Indic ator for p ayable, re jected, re versed and  closed cl aims repor t
  454    ;Returns  (V=VETERAN ,T=TRICARE ,C=CHAMPVA ,0=All)
  455    S BPELIG= 0 I (",1,2 ,4,7,")[BP RTYPE S BP ELIG=$$SEL ELIG^BPSRP T3(1) I BP ELIG="^" G  EXIT
  456    ;
  457    ;Prompt f or Open/Cl osed/All c laims
  458    ;Returns  (1=Closed, 2=Open,0=A ll)
  459    S BPOPCL= 0 I (",2," )[BPRTYPE  S BPOPCL=$ $SELOPCL^B PSRPT3(2)  I BPOPCL=" ^" G EXIT
  460    ;
  461    ;Prompt f or All or  Most Recen t (Non-Bil lable Stat us Report  only)
  462    ;Returns  A - All, R  - Most Re cent
  463    S BPALRC= 0 I (",9," )[BPRTYPE  S BPALRC=$ $SELALRC^B PSRPT3() I  BPALRC="^ " G EXIT
  464    ;
  465    ;Prompt f or multipl e Eligibil ity Indica tor for No n-Billable  Status an d Rejected  Claims Re port
  466    ;Sets up  BPELIG1 va riable, re turns 0 if  (A)ll was  selected  or 1.  If  BPELIG1=1  then the a rray
  467    ; BPARR(“ ELIG”)is s et, BPARR( “ELIG”,xx)  for each  eligibilit y selected  – xx=”V”,  “T” or “C
  468    S BPELIG1 =0 I (",2, 9,")[BPRTY PE S BPELI G1=$$SELEL IG1^BPSRPT 3() I BPEL IG1="^" G  EXIT
  469    ;
  470    ;Prompt f or Open/Cl osed/All c laims
  471    ;Returns  (1=Closed, 2=Open,0=A ll)
  472    S BPOPCL= 0 I (",2," )[BPRTYPE  S BPOPCL=$ $SELOPCL^B PSRPT3(2)  I BPOPCL=" ^" G EXIT
  473    ;
  474    ;Prompt t o select S PECIFIC PR ESCRIBER(S ) or (A)ll  Prescribe rs
  475    ;Returns:  0=ALL,^=e xit
  476    ;if Speci fic Prescr iber was s elected
  477    ;Returns:  BPRESC=a  string of  prescriber  ien’s sep arated by  a comma
  478    S BPRESC= 0 I (",2," )[BPRTYPE  S BPRESC=$ $SELPRESC^ BPSRPT3A()  I BPRESC= "^" G EXIT
  479    ;   
  480    ;Prompt t o select ( P)atients  or (A)LL P atients
  481    ;Returns:  (0=ALL,1= Patient,^= exit)
  482    S BPQSTPA T=0 I (",2 ,")[BPRTYP E S BPQSTP AT=$$SELPA ^BPSRPT3A( ) I BPQSTP AT=”^” G E XIT
  483    ;
  484    ;If (P)at ients was  selected,  prompt for  one or mo re patient s
  485    ;Returns:  BPPAT=a s tring of p atient ien ’s separat ed by a co mma
  486    I BPQSTPA T=1 S BPPA T=$$SELPAT ^BPSRPT3A( ) I BPPAT= ”^” G EXIT
  487    ;
  488    ;Prompt t o select(R )ange for  Billed Amo unt or (A) LL
  489    ;Returns:  (0=ALL,1= Range,^=ex it)
  490    S BPBILL= 0 I (",2," )[BPRTYPE  S BPBILL=$ $SELBAMT^B PSRPT3A()  I BPBILL=” ^” G EXIT
  491    ;If Range  of Billed  Amount wa s selected  prompt fo r Minimum  and Maximu m
  492    ;Returns:  BPMIN=min imum amoun t entered,  BPMAX=max imum amoun t entered
  493    S (BPMIN, BPMAX)=0
  494    I BPBILL= 1 W !,”Ran ge for Bil led Amount ” D  I (BP MIN=”^”)!( BPMAX=”^”)  G EXIT
  495    . S BPMIN =$$SELBMIN ^BPSRPT3A( ) I BPMIN= ”^” Q
  496    . S BPMAX =$$SELBMAX ^BPSRPT3A( )
  497    ;
  498    ;Prompt f or Non-Bil lable Stat us (Non-Bi llable Sta tus Report  only)
  499    ;Sets up  BPNBSTS va riable and  array, BP NBSTS=0 AL L or BPNBS TS=1,BPNBS TS(xx) for  list
  500    S BPNBSTS =0 I (",9, ")[BPRTYPE  S BPNBSTS =$$SELNBST S^BPSRPT3( ) I BPNBST S="^" G EX IT
  501    ;
  502    ;Prompt f or Excel C apture (De tail Only)
  503    S BPEXCEL =0 I 'BPSU MDET S BPE XCEL=$$SEL EXCEL^BPSR PT4() I BP EXCEL="^"  G EXIT
  504    ;
  505    ;Prompt f or the Dev ice
  506    I 'BPEXCE L D
  507    .W !!,"WA RNING - TH IS REPORT  REQUIRES T HAT A DEVI CE WITH 13 2 COLUMN W IDTH BE US ED."
  508    .W !,"IT  WILL NOT D ISPLAY COR RECTLY USI NG 80 COLU MN WIDTH D EVICES",!
  509    S BPQ=0 D  DEVICE(BP RPTNAM) Q: BPQ
  510    ;
  511    ;Compile  and Run th e Report
  512    D RUN(BPE XCEL,BPRPT NAM,BPSUMD ET)
  513    I 'BPQ D  PAUSE2^BPS RPT1
  514    ;
  515   EXIT Q 
  516     
  517  
  518   Modify the  subroutin e to allow  the user  to select  one, multi ple or all  reject co des. Multi ple select ions will  be returne d in a str ing separa ted by a c omma.  
  519  
  520   Subroutine  Name
  521   SELREJCD^B PSRPT4
  522   Enhancemen t Category
  523    New
  524    Modify
  525    Delete
  526    No Change
  527   Story
  528   US572
  529   Related Me nu Options  or ListMa n Actions
  530   BPS MENU R PT CLAIM S TATUS
  531   Related Ro utines
  532   This Subro utine is C alled By
  533   This Subro utine Call s
  534  
  535   EN^BPSRPT0
  536   DIR, 
  537   DIC
  538   Related In tegration  Control Re gistration s (ICRs)
  539   n/a
  540   Data Passi ng
  541    Parameter  Input
  542    Parameter  Output
  543    Function  Return Val ue
  544    Global Mo dified
  545   Input Attr ibute Name  and Defin ition
  546   Name: DFLT
  547   Definition : default  value
  548    New       Modify       Delete       No Cha nge
  549   Output Att ribute Nam e and Defi nition
  550   Name: $$SE LREJCD
  551   Definition : 0=ALL, ^ =exit OR s tring of r eject code s selected  delimited  by a comm a
  552    New       Modify       Delete       No Cha nge
  553   Current Lo gic
  554  
  555   BPSRPT4 ;B HAM ISC/BE E - ECME R EPORTS (CO NT) ;14-FE B-05
  556    ;;1.0;E C LAIMS MGMT  ENGINE;** 1,5,7,8,10 ,11,19**;J UN 2004;Bu ild 18
  557   ...
  558  
  559   ; Select t o Include  (S)pecific  Reject Co de or (A)l l
  560    ;
  561    ; Input V ariable ->  DFLT = 1  Specific R eject Code
  562    ;                            0  All Reject  Codes
  563    ;                            
  564    ; Return  Value ->    ptr = poi nter to BP S NCPDP RE JECT CODES  (#9002313 .93)
  565    ;                       0 = All  Reject Co des
  566    ;                       ^ = Exi t
  567    ;
  568   SELREJCD(D FLT) N DIC ,DIR,DIRUT ,DUOUT,REJ ,X,Y
  569    ;
  570    S DFLT=$S ($G(DFLT)= 1:"Specifi c Reject C ode",1:"AL L")
  571    S DIR(0)= "S^S:Speci fic Reject  Code;A:AL L"
  572    S DIR("A" )="Include  (S)pecifi c Reject C ode or (A) LL",DIR("B ")=DFLT
  573    D ^DIR
  574    I ($G(DUO UT)=1)!($G (DTOUT)=1)  S Y="^"
  575    S REJ=$S( Y="S":1,Y= "A":0,1:Y)
  576    ;
  577    ;Check fo r "^" or t imeout
  578    I ($G(DUO UT)=1)!($G (DTOUT)=1)  S (REJ,Y) ="^"
  579    ;
  580    ;If Speci fic Reject  Code sele cted, ask  prompt
  581    I $G(REJ) =1 D
  582    .;
  583    .;Prompt  for entry
  584    .K X S DI C(0)="QEAM ",DIC=9002 313.93,DIC ("A")="Sel ect Reject  Code: "
  585    .W ! D ^D IC
  586    .;
  587    .;Check f or "^", ti meout, or  blank entr y
  588    .I ($G(DU OUT)=1)!($ G(DTOUT)=1 )!($G(X)=" ") S (REJ, Y)="^" Q
  589    .;
  590    .;If vali d entry, s etup REJ
  591    .I +Y>0 S  REJ=+Y
  592    ;
  593    Q REJ
  594    ;
  595  
  596   Modified L ogic (Chan ges are hi ghlighted)
  597  
  598   BPSRPT4 ;B HAM ISC/BE E - ECME R EPORTS (CO NT) ;14-FE B-05
  599    ;;1.0;E C LAIMS MGMT  ENGINE;** 1,5,7,8,10 ,11,19,23* *;JUN 2004 ;Build 18
  600   ...
  601  
  602   ; Select t o Include  (S)pecific  Reject Co de or (A)l l
  603    ;
  604   ; Return V alue ->    ptr = poin ter to BPS  NCPDP REJ ECT CODES  (#9002313. 93)
  605    ;  if mor e than 1 R eject Code  is select ed, a stri ng of poin ters separ ated by co mmas is re turned.
  606    ;             ptr,pt r,...= poi nters to B PS NCPDP R EJECT CODE S (#900231 3.93)
  607    ;                       0 = All  Reject Co des
  608    ;                       ^ = Exi t
  609    ;
  610   SELREJCD(D FLT) ; ; U ser input  will be te mporarily  stored in  BPSRCAR fo r display  to user  ;  of select ed REJECT  CODES. ;   ; If 'S' i s selected , at least  one REJEC T CODE mus t be selec ted. If no  selection   ; was ma de the use r will be  re-prompte d to selec t a reject  code. ;   ; Upon com pletion of  REJECT CO DE(s) entr y, values  will be pl aced into  a string   ; delimite d by comma s. e.g. BP ARR("REJ") ="50,60,"  ;  ; BPSRC AR = array  containin g REJECT C ODE inform ation ; BP SRCAR(BPSR C)=BPSRCE  ; BPSRC =  IEN from F ile #90023 13.93 / BP SRCE = Rej ect Code E xplanation   ; N BPSR EJ,DIR,DIR UT,DTOUT,D UOUT,X,Y ;  ; BPSREJ  = 1^S - Sp ecific Rej ect Code ;            1^A - ALL  ;            -1 - if  user enter ed "^" ; S  BPSREJ=$$ EDITFLD^BP SSCRCV(1.1 ,DUZ,"S^S: Specific R eject Code ;A:ALL","I nclude (S) pecific Re ject Code  or (A)LL", "ALL",.BPA RR) ; ;If  (A)LL was  selected,  return 0 ( zero) I BP SREJ["A" Q  0 ;If use r entered  "^" to exi t, return  "^" I BPSR EJ=-1 Q "^ " ;BPSREJC D ; N BPAR R,BPSCNT,B PSRC,BPSRC AR,BPSRCC, BPSRCE,BPS RCX N DFLT VAL,DIR0,P RMTMSG ; ; If (S)peci fic Reject  Code was  selected,  assign exi sting entr y(s) into  BPS115AR a rray. I $P (BPSREJ,U, 2)="S" D .  ;Prompt u ser to ent er one or  multiple R eject Code s . S BPSR C="" F  D   Q:BPSRC=- 1 . . S DI R0="P^BPSF (9002313.9 3," . . S  PRMTMSG="S elect Reje ct Code" .  . S DFLTV AL="" . .  S BPSRC=$$ PROMPT^BPS SCRCV(DIR0 ,PRMTMSG,D FLTVAL) .  . ; . . ;  If user di dn't make  a selectio n . . I BP SRC=-1 Q .  . ; . . ;  Get the C ode and Ex planation  for the Re ject Code  selected .  . S BPSRC C=$$GET1^D IQ(9002313 .93,BPSRC, .01) . . S  BPSRCE=$$ GET1^DIQ(9 002313.93, BPSRC,.02)  . . ; . .  ; If entr y doesn't  exist, add  new entry  into BPSR CAR array.  . . I '$D (BPSRCAR(B PSRC)) S B PSRCAR(BPS RC)=BPSRCC _U_BPSRCE  . . ; . .  ; Display  existing e ntry(s) to  user. . .  I $D(BPSR CAR) D . .  . S BPSRC ="" F  S B PSRC=$O(BP SRCAR(BPSR C)) Q:BPSR C=""  W !, ?3,$P(BPSR CAR(BPSRC) ,U),?13,$P (BPSRCAR(B PSRC),U,2)  . ; . ; I f user sel ected (S)p ecific Rej ect Code,  return "^"  in order  for the us er to retu rn to the  menu . I ' $D(BPSRCAR ) S BPARR( "REJCD")=" ^" Q . ; .  ; Loop th rough sele cted rejec t codes, s et selecte d reject c odes into  BPARR("REJ CD") delim ited by co mma.  . S  BPARR("REJ CD")="" .  S BPSRC=""  F  S BPSR C=$O(BPSRC AR(BPSRC))  Q:BPSRC=" "  S BPARR ("REJCD")= BPARR("REJ CD")_BPSRC _"," ;SELR CX ; Q BPA RR("REJCD" )
  611   ;   
  612  
  613   Modify the  subroutin e to allow  the user  to select  one, multi ple or all  Eligibili ties for t he Rejecte d Claims R eport and  the Non-Bi llable Sta tus Report .  Multipl e selectio ns will be  returned  in a strin g separate d by a com ma.
  614   Subroutine  Name
  615   SELELIG1^B PSRPT3
  616   Enhancemen t Category
  617    New
  618    Modify
  619    Delete
  620    No Change
  621   Story
  622   US572
  623   Related Me nu Options  or ListMa n Actions
  624   BPS MENU R PT CLAIM S TATUS
  625   Related Ro utines
  626   This Subro utine is C alled By
  627   This Subro utine Call s
  628  
  629   EN^BPSRPT0
  630   DIR
  631   Related In tegration  Control Re gistration s (ICRs)
  632   n/a
  633   Data Passi ng
  634    Parameter  Input
  635    Parameter  Output
  636    Function  Return Val ue
  637    Global Mo dified
  638   Input Attr ibute Name  and Defin ition
  639   Name: n/a
  640   Definition
  641    New       Modify       Delete       No Cha nge
  642   Output Att ribute Nam e and Defi nition
  643   Name: $$SE LELIG1
  644   Definition : one or m ore eligib ilities se lected, se parated by  a comma
  645    New       Modify       Delete       No Cha nge
  646   Current Lo gic
  647  
  648   SELELIG1()  ; ; Selec t multiple  Eligibili ties ;  ;  Input Vari able -> no ne ; Retur n Value ->  0: All, 1 : Selected  Eligibili ties; '^'  = Exit ;   ; Output V ariable ->  BPELIG1 =  1 - One o r More Pha rmacies Se lected ; =  0 - User  Entered 'A LL' ; = "^ " - User q uit ;  ; I f BPELIG1  = 1 then t he BPELIG1  array wil l be defin ed where:  ; BPELIG1( "C")="CHAM PVA" ; BPE LIG1("T")= "TRICARE"  ; BPELIG1( "V")="VETE RAN" ; ; ; Reset BPEL IG1 array  K BPELIG1  N DIR,DTOU T,DUOUT,DI RUT,DIROUT ,X,Y,P ; ; First see  if they wa nt to ente r individu al eligibi lities or  ALL S DIR( 0)="S^E:EL IGIBILITY; A:ALL" S D IR("A")="S elect Cert ain (E)lig ibilities  or (A)LL"  S DIR("B") ="ALL" S D IR("L",1)= "Select on e of the f ollowing:"  S DIR("L" ,2)="" S D IR("L",3)= " E ELIGIB ILITY" S D IR("L",4)= " A ALL" D  ^DIR K DI R ; ;Check  for "^" o r timeout  I ($G(DUOU T)=1)!($G( DTOUT)=1)  S Y="^" ;  ; Set BPEL IG1 and qu it unless  user wants  to select  individua l eligibil ities S BP ELIG1=$S(Y ="A":0,Y=" ^":"^",1:1 ) I BPELIG 1'=1 Q BPE LIG1 ; ;Al low user t o select m ultiple el igibilitie s F  D  Q: Y="^"!(Y=" ") .; .;Pr ompt for e ntry .K DI R .S DIR(0 )="SO^C:CH AMPVA;T:TR ICARE;V:VE TERAN" .S  DIR("A")=" Select Eli gibility"  .D ^DIR .I  ($G(DUOUT )=1)!($G(D TOUT)=1) S  Y="^" Q . ; .;Check  for blank  entry, qui t if no pr evious sel ections .I  $G(Y)=""  S Y=$S($D( BPELIG1)>9 :"",1:"^")  Q .; .; A dd entry t o array or  handle du plicate en tries .I ' $D(BPELIG1 (Y)) S BPE LIG1(Y)=Y( 0),BPELIG1 ("B",Y(0), Y)="" .E   D  I Y="^"  Q ..;Alre ady in the  array, so  ask wheth er to dele te ..N P . .S P=Y_"^" _Y(0) ;Sav e Original  Value ..S  DIR(0)="S ^Y:YES;N:N O",DIR("A" )="Delete  "_$P(P,U,2 )_" from y our list?"  ..S DIR(" B")="NO" . .D ^DIR .. I ($G(DUOU T)=1)!($G( DTOUT)=1)  S Y="^" Q  ..I Y="Y"  K BPELIG1( $P(P,U,1)) ,BPELIG1(" B",$P(P,U, 2),$P(P,U, 1)) ..S Y= P  ;Restor e Original  Value ..K  P .; .;Di splay a li st of sele cted eligi bilities . I $D(BPELI G1)>9 D .. N X ..W !, ?2,"Select ed:" ..S X ="" F  S X =$O(BPELIG 1("B",X))  Q:X=""  W  !,?10,X .. K X .Q ; ;  Reset BPE LIG1 array  if user e xited I Y= "^" K BPEL IG1 S BPEL IG1="^" Q  "^" ; ; De leted 'x-r ef' as we  don't need  to return  that K BP ELIG1("B")  ;  Q 1
  649  
  650   Modified L ogic (Chan ges are hi ghlighted)
  651  
  652   SELELIG1()  ;  ; Sele ct multipl e Eligibil ities ;  ;  Input Var iable -> n one ; Retu rn Value - > 0: All,  1: Selecte d one or m ore Eligib ilities; ' ^' = Exit  ;  ; Outpu t Variable  -> BPELIG 1 = 1 - On e or More  Eligibilit ies Select ed ; = 0 -  User Ente red 'ALL'  ; = "^" -  User quit  ;  ; If BP ELIG1 = 1  then the B PELIG1 arr ay will be  defined w here for t he user se lections:  ; BPELIG1( "C")="CHAM PVA" ; BPE LIG1("T")= "TRICARE"  ; BPELIG1( "V")="VETE RAN" ; ; B PSELIG1 ;  ;Reset BPE LIG1 array  K BPELIG1  N DIR,DTO UT,DUOUT,D IRUT,X,Y,P  N BPSVTC, BPSERR,BPS VTCSTR,BPS SEL,BPSX ;  S BPSVTCS TR=",V,T,C ,A," S DIR (0)="FO^0: 7" S DIR(" A",1)=""
  653    S DIR("A" ,2)="Selec t one or m ore of the  following :"
  654    S DIR("A" ,3)=""
  655    S DIR("A" ,4)="      V          VETERAN"
  656    S DIR("A" ,5)="      T          TRICARE"
  657    S DIR("A" ,6)="      C          CHAMPVA"
  658    S DIR("A" ,7)="      A          ALL" S DIR ("A",8)=""  S DIR("A" )="Display  (V)ETERAN  or (T)RIC ARE or (C) HAMPVA or  (A)LL" S D IR("B")="A " S:$G(BPA RR("ELIG") )'="" DIR( "B")=BPARR ("ELIG") S  DIR("?",1 )="Enter a  single re sponse or  multiple r esponses s eparated b y commas."  S DIR("?" ,2)=" Exam ple:" S DI R("?",3)="  T" S DIR( "?")=" T,C " D ^DIR K  DIR I ($G (DUOUT)=1) !($G(DTOUT )=1)!($D(D IRUT)) Q " ^" ;
  659    ;Convert  any lower  case to up per case S  X=$TR(X,B PSLC,BPSUC )
  660    ; ; Loop  through us er input ( returned i n variable  X). ; Dis play warni ng message  if any us er input s election i s not incl uded ; in  the string  of accept able codes  (BPSVTCST R) and re- prompt que stion. ; A ssign vali d selectio ns to BPSV TC array.  This array  will prev ent ; dupl icate entr ies from b eing saved  to the us er's profi le. ; K BP SVTC S BPS ERR="" F B PSX=1:1:$L (X,",") D  . S BPSSEL =$P(X,",", BPSX) . I  BPSVTCSTR' [(","_BPSS EL_",") W  !," ",BPSS EL," is no t a valid  entry." S  BPSERR=1 Q  . ; if Al l was sele cted don't  include i n array .    I BPSSEL '="A" S BP ELIG1(BPSS EL)=$S(BPS SEL="V":"V ETERAN",BP SSEL="T":" TRICARE",B PSSEL="C": "CHAMPVA", 1:"") ; I  $G(BPSERR) =1 G BPSEL IG1 ; ; AL L was sele cted I X=" A" S BPELI G1=0 E  D   ;  . ;Use r selected  one or mo re eligibi lities . S  BPELIG1=1  . ; . ; D isplay the  user sele ctions . ;  . S BPSSE L="" . F   S BPSSEL=$ O(BPELIG1( BPSSEL)) Q :BPSSEL=""   W !,?10, BPELIG1(BP SSEL)  ; Q  BPELIG1
  661      
  662  
  663   A new subr outine wil l be creat ed that al lows the u ser to sel ect one, m ultiple or  all Fill  Locations.   Multiple  selection s will be  returned i n a string  separated  by a comm a.
  664  
  665   Subroutine  Name
  666   SELMWC1^BP SRPT3
  667   Enhancemen t Category
  668    New
  669    Modify
  670    Delete
  671    No Change
  672   Story
  673   US572
  674   Related Me nu Options  or ListMa n Actions
  675   BPS MENU R PT CLAIM S TATUS
  676   Related Ro utines
  677   This Subro utine is C alled By
  678   This Subro utine Call s
  679  
  680   EN^BPSRPT0
  681   DIR
  682   Related In tegration  Control Re gistration s (ICRs)
  683   n/a
  684   Data Passi ng
  685    Parameter  Input
  686    Parameter  Output
  687    Function  Return Val ue
  688    Global Mo dified
  689   Input Attr ibute Name  and Defin ition
  690   Name: DFLT
  691   Definition : Default  value
  692    New       Modify       Delete       No Cha nge
  693   Output Att ribute Nam e and Defi nition
  694   Name: $$SE LMWC1
  695   Definition : users se lections d elimited b y a comma
  696    New       Modify       Delete       No Cha nge
  697   Current Lo gic
  698  
  699   n/a – new  subroutine
  700  
  701   Modified L ogic (Chan ges are hi ghlighted)
  702  
  703   SELMWC1(DF LT) ; ; Up on complet ion of pro mpt, value s will be  placed int o a string  delimited  ; by comm as. e.g. C ,M ;  ; If  user incl udes (A)ll  as a code , "A" will  be stored  in BPARR  ; array. e .g. Entry  of C,M,A w ill save a s BPARR("M WC")="A" ;   ; User i nput value s are temp orary stor ed in arra y BPSMWC t o eliminat e duplicat e  ; entri es. e.g. E ntry of C, M,C will s ave as BPA RR("MWC")= "C,M" ; BP SMWC ; N D IR,DIRUT,D TOUT,DUOUT ,X,Y
  704    N BPARR,B PSMWC,BPSE RR,BPSMWCS TR,BPSSEL, BPSX
  705    ; S BPSMW CSTR=",C,M ,W,A," S D IR(0)="FO^ 0:7" S DIR ("A",1)=""  S DIR("A" ,2)="      Select one  or more o f the foll owing:" S  DIR("A",3) ="" S DIR( "A",4)="           C          CM OP" S DIR( "A",5)="           M          Ma il" S DIR( "A",6)="           W          Wi ndow" S DI R("A",7)="            A          ALL" S DIR ("A",8)=""  S DIR("A" )="Display  (C)MOP or  (M)ail or  (W)indow  or (A)ll"  S DIR("B") ="A" S:$G( BPARR("MWC "))'="" DI R("B")=BPA RR("MWC")  S DIR("?", 1)="Enter  a single r esponse or  multiple  responses  separated  by commas. " S DIR("? ",2)=" Exa mple:" S D IR("?",3)= " C" S DIR ("?")=" C, M" D ^DIR  K DIR I ($ G(DUOUT)=1 )!($G(DTOU T)=1)!($D( DIRUT)) Q  "^" ;
  706    ;Convert  any lower  case to up per case S  X=$TR(X,B PSLC,BPSUC )
  707    ; ; Loop  through us er input ( returned i n variable  X). ; Dis play warni ng message  if any us er input s election i s not incl uded ; in  the string  of accept able codes  (BPSMWCST R) and re- prompt que stion. ; A ssign vali d selectio ns to BPSM WC array.  This array  will prev ent ; dupl icate entr ies from b eing saved  to the us er's profi le. ; K BP SMWC S BPS ERR="" F B PSX=1:1:$L (X,",") D  . S BPSSEL =$P(X,",", BPSX) . I  BPSMWCSTR' [(","_BPSS EL_",") W  !," ",BPSS EL," is no t a valid  entry." S  BPSERR=1 Q  . S BPSMW C(BPSSEL)= "" ; I $G( BPSERR)=1  G BPSMWC ;  ; If user  included  (A)ll as a  selection , set prof ile settin g to "A".  ; I $D(BPS MWC("A"))  S BPARR("M WC")="A" E   D  ; Use r did not  enter "A".  . ; . ; A t this poi nt user se lections a re valid,  do not inc lude "A".  . ; Loop t hrough and  set selec tions into  a comma d elimited .  ; string  before ass igning to  BPARR arra y. . ; . S  BPSSEL=""  . F  S BP SSEL=$O(BP SMWC(BPSSE L)) Q:BPSS EL=""  D .  . ; Displ ay the use r selectio ns . . W ! ,?10,$S(BP SSEL="C":" CMOP",BPSS EL="M":"MA IL",BPSSEL ="W":"WIND OW",1:"")  . . S BPSM WC=$G(BPSM WC)_BPSSEL _"," . S B PSMWC=$E(B PSMWC,1,($ L(BPSMWC)- 1)) . S BP ARR("MWC") =BPSMWC ;  Q BPARR("M WC")
  708      
  709  
  710   A new subr outine wil l be creat ed that al lows the u ser to sel ect one, m ultiple or  all Fill  types. Mul tiple sele ctions wil l be retur ned in a s tring sepa rated by a  comma.
  711  
  712   Subroutine  Name
  713   SELRBPS^BP SRPT3
  714   Enhancemen t Category
  715    New
  716    Modify
  717    Delete
  718    No Change
  719   Story
  720   US572
  721   Related Me nu Options  or ListMa n Actions
  722   BPS MENU R PT CLAIM S TATUS
  723   Related Ro utines
  724   This Subro utine is C alled By
  725   This Subro utine Call s
  726  
  727   EN^BPSRPT0
  728   DIR
  729   Related In tegration  Control Re gistration s (ICRs)
  730   n/a
  731   Data Passi ng
  732    Parameter  Input
  733    Parameter  Output
  734    Function  Return Val ue
  735    Global Mo dified
  736   Input Attr ibute Name  and Defin ition
  737   Name: DFLT
  738   Definition : default  value
  739    New       Modify       Delete       No Cha nge
  740   Output Att ribute Nam e and Defi nition
  741   Name: $$SE LRBPS
  742   Definition : user sel ections in  a comma d elimited s tring
  743    New       Modify       Delete       No Cha nge
  744   Current Lo gic
  745  
  746   n/a – new  subroutine
  747  
  748   Modified L ogic (Chan ges are hi ghlighted)
  749   SELRBPS()  ; ; ; BPSR BSTR = str ing of val id codes ;  ; Upon co mpletion o f prompt,  values wil l be place d into a s tring deli mited ; by  commas. e .g. P,R ;  ; If user  selected ( A)ll then  1 will be  stored in  BPARR ; ;  User input  values ar e temporar y stored i n array BP SRBPS to e liminate d uplicate   ; entries.  ;BPRBPS ;  Realtime  / Backbill s / Pro Op tion / Res ubmission  / All N BP ARR,BPSRBP S,BPSERR,B PSRBSTR,BP SSEL,BPSX  N DIR,DIRU T,DTOUT,DU OUT,X,Y ;  S BPSRBSTR =",R,B,P,S ,A," S DIR (0)="FO^0: 7" S DIR(" A",1)="" S  DIR("A",2 )=" Select  one or mo re of the  following: " S DIR("A ",3)="" S  DIR("A",4) =" R Real  Time Fills " S DIR("A ",5)=" B B ackbill" S  DIR("A",6 )=" P PRO  Option" S  DIR("A",7) =" S ReSub mission" S  DIR("A",8 )=" A ALL"  S DIR("A" ,9)="" S D IR("A")="D isplay (R) ealTime, ( B)ackbills , (P)RO Op tion, Re(S )ubmission  or (A)ll"  S DIR("B" )="A" S:$G (BPARR("RB PS"))'=""  DIR("B")=B PARR("RBPS ") S DIR(" ?",1)="Ent er a singl e response  or multip le respons es separat ed by comm as." S DIR ("?",2)="  Example:"  S DIR("?", 3)=" B" S  DIR("?")="  B,P" D ^D IR K DIR ;  I ($G(DUO UT)=1)!($G (DTOUT)=1) !($D(DIRUT )) Q "^" ;  ;Convert  any lower  case to up per case S  X=$TR(X,B PSLC,BPSUC ) ; ; Loop  through u ser input  (returned  in variabl e X). ; Di splay warn ing messag e if any u ser input  selection  is not inc luded ; in  the strin g of accep table code s (BPSRBST R) and re- prompt que stion. ; A ssign vali d selectio ns to BPRT BCK array.  This arra y will pre vent ; dup licate ent ries from  being save d to the u ser's prof ile. ; K B PSRBPS S ( BPSSEL,BPS ERR)="" F  BPSX=1:1:$ L(X,",") D  . S BPSSE L=$P(X,"," ,BPSX) . I  BPSRBSTR' [(","_BPSS EL_",") W  !," ",BPSS EL," is no t a valid  entry." S  BPSERR=1 Q  . S BPSRB PS(BPSSEL) ="" ; I $G (BPSERR)=1  G BPRBPS  ; ; If use r selected  (A)ll, se t profile  setting to  ALL. I $D (BPSRBPS(" A")) S BPA RR("RBPS") =1 E  D  ;  User did  not enter  "A". . ; .  ; At this  point use r selectio ns are val id and do  not includ e "A". . ;  Loop thro ugh valid  user selec tions. Set  selection s into a .  ; comma d elimited s tring befo re assigni ng to BPAR R array. .  ; . S (BP SSEL,BPSSE LN)="" . F   S BPSSEL =$O(BPSRBP S(BPSSEL))  Q:BPSSEL= ""  D . .  ; Display  the user s elections  . . W !,?1 0,$S(BPSSE L="R":"REA LTIME",BPS SEL="B":"B ACKBILLS", BPSSEL="P" :"PRO OPTI ON",BPSSEL ="S":"RESU BMISSION", 1:"") . .  S BPSRBPS= $G(BPSRBPS )_BPSSEL_" ," . S BPS RBPS=$E(BP SRBPS,1,($ L(BPSRBPS) -1)) ; ; I f ALL wasn 't selecte d convert  BPSRBPS to  numerical  a value,  like exist ing functi onality in  SELRTBCK^ BPSRPT3. I  '$D(BPSRB PS("A")) D  . N RTBCK X,NRTBCK .  S NRTBCK= "" . I $L( BPSRBPS)=1  D . . S N RTBCK=$S(B PSRBPS="R" :2,BPSRBPS ="B":3,BPS RBPS="P":4 ,BPSRBPS=" S":5,1:"")  . . S BPA RR("RBPS") =NRTBCK .  E  D . . F  I=1:1:($L (BPSRBPS)- 1) S RTBCK X=$P(BPSRB PS,",",I), NRTBCK=NRT BCK_$S(RTB CKX="R":2, RTBCKX="B" :3,RTBCKX= "P":4,RTBC KX="S":5,1 :"")_"," .  . S BPARR ("RBPS")=$ E(NRTBCK,1 ,$L(NRTBCK )-1) ; Q B PARR("RBPS ")
  750     
  751  
  752   A new subr outine wil l be creat ed that al lows the s election o f one or m ultiple Dr ugs.  Mult iple selec tions will  be return ed in a st ring separ ated by a  comma.
  753  
  754   Subroutine  Name
  755   SELDRG1^BP SRPT3A
  756   Enhancemen t Category
  757    New
  758    Modify
  759    Delete
  760    No Change
  761   Story
  762   US572
  763   Related Me nu Options  or ListMa n Actions
  764   BPS MENU R PT CLAIM S TATUS
  765   Related Ro utines
  766   This Subro utine is C alled By
  767   This Subro utine Call s
  768  
  769   EN^BPSRPT0
  770   SEL^BPSRPT 3A
  771   Related In tegration  Control Re gistration s (ICRs)
  772   n/a
  773   Data Passi ng
  774    Parameter  Input
  775    Parameter  Output
  776    Function  Return Val ue
  777    Global Mo dified
  778   Input Attr ibute Name  and Defin ition
  779   Name: n/a
  780   Definition
  781    New       Modify       Delete       No Cha nge
  782   Output Att ribute Nam e and Defi nition
  783   Name: $$SE LDRG1
  784   Definition : user sel ections st ored in a  comma deli mited stri ng
  785    New       Modify       Delete       No Cha nge
  786   Current Lo gic
  787  
  788   n/a – new  subroutine
  789  
  790   Modified L ogic (Chan ges are hi ghlighted)
  791  
  792   SELDRG1()  ; ; ; Allo w user to  select a s ingle or m ultiple DR UGS. ; ; T he users s election i s stored i n BPARR("D RUG") sepa rated by a  comma. ;  BPARR("DRU G")=drug i en1,drug i en2 ;DRG1  ; N BPARR, BPSIEN,BPS DRGARR S B PARR("DRUG ")="" ; ;  The SEL ta g prompts  user to 'S elect Drug ' and vali dates the  selection  against th e DRUG fil e. D SEL(" Drug","^PS DRUG(",.BP SDRGARR) ;  ; If the  user enter ed "^" qui t, no long er prompti ng the use r to 'Sele ct Drug' I  $G(BPSDRG ARR)="^" Q  "^" ; ; I f no drug  was select ed, return  "^" so th e user wil l return t o the menu  I $G(BPSD RGARR)=0 Q  "^" ; M B PARR("DRUG ")=BPSDRGA RR ; ; Cre ates a str ing of all  the drug  ien's sele cted separ ated by a  comma. S B PSIEN="" F   S BPSIEN =$O(BPARR( "DRUG",BPS IEN)) Q:BP SIEN=""  D  . I BPARR ("DRUG")'= "" S BPARR ("DRUG")=B PARR("DRUG ")_"," . S  BPARR("DR UG")=BPARR ("DRUG")_B PSIEN . Q  ; Q BPARR( "DRUG")
  793  
  794  
  795   A new subr outine wil l be creat ed that al lows the s election o f one or m ultiple Dr ug Classes . Multiple  selection s will be  returned i n a string  separated  by a comm a.
  796  
  797   Subroutine  Name
  798   SELDC^BPSR PT3A
  799   Enhancemen t Category
  800    New
  801    Modify
  802    Delete
  803    No Change
  804   Story
  805   US572
  806   Related Me nu Options  or ListMa n Actions
  807   BPS MENU R PT CLAIM S TATUS
  808   Related Ro utines
  809   This Subro utine is C alled By
  810   This Subro utine Call s
  811  
  812   EN^BPSRPT0
  813   SEL^BPSRPT 3A
  814   Related In tegration  Control Re gistration s (ICRs)
  815   n/a
  816   Data Passi ng
  817    Parameter  Input
  818    Parameter  Output
  819    Function  Return Val ue
  820    Global Mo dified
  821   Input Attr ibute Name  and Defin ition
  822   Name: n/a
  823   Definition
  824    New       Modify       Delete       No Cha nge
  825   Output Att ribute Nam e and Defi nition
  826   Name: $$SE LDC
  827   Definition : user sel ections in  a comma d elimited s tring
  828    New       Modify       Delete       No Cha nge
  829   Current Lo gic
  830  
  831   n/a – new  subroutine
  832  
  833   Modified L ogic (Chan ges are hi ghlighted)
  834  
  835   SELDC() ;  ; ; Allow  user to se lect a sin gle or mul tiple DRUG  CLASSes,  ; ; The us ers select ion is sto red in BPA RR("DRUG C LASS") sep arated by  a semi col on. ; BPAR R("DRUG CL ASS")=dc n ame ien ;  dc name ie n ;DRGCL ;  N BPARR,B PSIEN,BPSD CARR S BPA RR("DRUG C LASS")=""  ; ; The SE L tag prom pts user a nd validat es the sel ection aga inst the D RUG CLASS  file. D SE L("Drug Cl ass","^PS( 50.605,",. BPSDCARR)  ; ; If the  user ente red "^" qu it, no lon ger prompt ing the us er to 'Sel ect Drug C lass' I $G (BPSDCARR) ="^" Q "^"  ; ; If no  drug was  selected,  return "^"  so the us er will re turn to th e menu I $ G(BPSDCARR )=0 Q "^"  ; M BPARR( "DRUG CLAS S")=BPSDCA RR ; ; Cre ates a str ing of all  the drug  class ien' s selected  separated  by a comm a.  S BPSI EN="" F  S  BPSIEN=$O (BPARR("DR UG CLASS", BPSIEN)) Q :BPSIEN=""   D . I BP ARR("DRUG  CLASS")'=" " S BPARR( "DRUG CLAS S")=BPARR( "DRUG CLAS S")_";" .  S BPARR("D RUG CLASS" )=BPARR("D RUG CLASS" )_$$GET1^D IQ(50.605, BPSIEN,1)  . Q ; Q BP ARR("DRUG  CLASS")
  836     
  837  
  838   A new subr outine wil l be creat ed that al lows the u ser to sel ect for on e or more  entries in  a specifi c field in  a specifi c file. Th e user’s s election i s returned  in an arr ay.  The f ield, file , array an d default  will be pa ssed in.
  839  
  840   Subroutine  Name
  841   SEL^BPSRPT 3A
  842   Enhancemen t Category
  843    New
  844    Modify
  845    Delete
  846    No Change
  847   Story
  848   US572
  849   Related Me nu Options  or ListMa n Actions
  850   BPS MENU R PT CLAIM S TATUS
  851   Related Ro utines
  852   This Subro utine is C alled By
  853   This Subro utine Call s
  854  
  855   SELDRG1^BP SRPT3A, SE LDC^BPSRPT 3A, SELPAT ^BPSRPT3A
  856   DIC
  857   Related In tegration  Control Re gistration s (ICRs)
  858   n/a
  859   Data Passi ng
  860    Parameter  Input
  861    Parameter  Output
  862    Function  Return Val ue
  863    Global Mo dified
  864   Input Attr ibute Name  and Defin ition
  865   Name: FIEL D
  866   Definition : specific  field tha t is being  used for  selection
  867    New       Modify       Delete       No Cha nge
  868   Name: FILE
  869   Definition : VistA fi le that is  being use d for sele ction
  870    New       Modify       Delete       No Cha nge
  871   Name: DEFA ULT
  872   Definition : default  value 
  873    New       Modify       Delete       No Cha nge
  874   Output Att ribute Nam e and Defi nition
  875   Name: ARRA Y
  876   Definition : array co ntaining t he user’s  selection
  877    New       Modify       Delete       No Cha nge
  878   Current Lo gic
  879  
  880   n/a – new  subroutine
  881  
  882   Modified L ogic (Chan ges are hi ghlighted)
  883  
  884   SEL(FIELD, FILE,BPSAR RAY,DEFAUL T) ; ; Pro vides fiel d selectio n for One  or More N  DIC,DTOUT, DUOUT,QT,Y ,X N BPSAR R ; S DIC= FILE,DIC(0 )="QEZAM", DIC("A")=" Select "_F IELD_": "  I $G(DEFAU LT)'="" S  DIC("B")=D EFAULT F   D ^DIC Q:X =""  D  Q: $G(QT) . ;  Check for  "^" or ti meout, if  found set  BPSARRAY=" ^" and qui t. . I $D( DTOUT)!$D( DUOUT) K B PSARRAY S  BPSARRAY=" ^",QT=1 Q  . ; . ; If  selection  already e xists in B PSARRAY, t hen displa y message  . ; "(alre ady select ed)" and p rompt for  next selec tion. . I  $D(BPSARRA Y(+Y)) W "  (already  selected)"  . S BPSAR RAY(+Y)=$P (Y,"^",2)  . W " ",$P (Y,"^",2), ! . ; . S  DIC("A")=" Select "_F IELD_": "  . ; . ; di splay a li st of curr ent select ions . I F IELD="Drug  Class" D  . . S BPSA RR="" . .  F  S BPSAR R=$O(BPSAR RAY(BPSARR )) Q:'BPSA RR  I BPSA RR'=+Y W ? 3,$$GET1^D IQ(50.605, BPSARR,1), " ",$$GET1 ^DIQ(50.60 5,BPSARR,. 01),! . ;  . I $D(BPS ARRAY),FIE LD'="Drug  Class" D .  . S BPSAR R="" F  S  BPSARR=$O( BPSARRAY(B PSARR)) Q: 'BPSARR  W  ?10,BPSAR RAY(BPSARR ),! . K DI C("B") ; ;  If nothin g was sele cted set B PSARRAY=0  I '$D(BPSA RRAY) S BP SARRAY=0 Q
  885    ;
  886    
  887  
  888   A new subr outine wil l be creat ed that al lows the u ser to sel ect one, m ultiple or  all presc ribers eit her by the  Prescribe r’s name o r ID.  Mul tiple sele ctions wil l be retur ned in a s tring sepa rated by a  comma.
  889   Subroutine  Name
  890   SELPRESC^B PSRPT3A
  891   Enhancemen t Category
  892    New
  893    Modify
  894    Delete
  895    No Change
  896   Story
  897   US572
  898   Related Me nu Options  or ListMa n Actions
  899   BPS MENU R PT CLAIM S TATUS
  900   Related Ro utines
  901   This Subro utine is C alled By
  902   This Subro utine Call s
  903  
  904   EN^BPSRPT0
  905   ^DIR
  906   Related In tegration  Control Re gistration s (ICRs)
  907   n/a
  908   Data Passi ng
  909    Parameter  Input
  910    Parameter  Output
  911    Function  Return Val ue
  912    Global Mo dified
  913   Input Attr ibute Name  and Defin ition
  914   Name: n/a
  915   Definition
  916    New       Modify       Delete       No Cha nge
  917   Output Att ribute Nam e and Defi nition
  918   Name: $$SE LPRESC
  919   Definition : string o f prescrib er ien’s s eparated b y a comma
  920    New       Modify       Delete       No Cha nge
  921   Current Lo gic
  922  
  923   n/a – new  subroutine
  924  
  925   Modified L ogic (Chan ges are hi ghlighted)
  926  
  927   SELPRESC()  ; N DIR,D IRUT,DTOUT ,DUOUT,X,Y  ; ;Select  to includ e (S)pecif ic Prescri ber or (A) ll Prescri bers ; S D IR(0)="S^S :SPECIFIC  PRESCRIBER (S);A:ALL  PRESCRIBER S" S DIR(" A")="Selec t Specific  Prescribe r(s) or in clude ALL  Prescriber s" S DIR(" B")="ALL"  S DIR("L", 1)="Select  one of th e followin g:" S DIR( "L",2)=""  S DIR("L", 3)=" S Spe cific Pres criber(s)"  S DIR("L" ,4)=" A AL L Prescrib ers" D ^DI R K DIR ;  ;If (A)LL  was select ed, return  0 (zero)  I Y="A" Q  0 ;If "^"  was entere d or there  was a Tim eout, retu rn "^" I ( Y="^")!($G (DUOUT)=1) !($G(DTOUT )=1)!($D(D IRUT)) Q " ^" W ! ;BP PRESC ; ;U ser select ed (S)peci fic Prescr iber, allo w user to  select one  or multip le Prescri bers. N DI C,DIRUT,DT OUT,DUOUT, X,Y N ARR, BPSARRAY,B PSRESCAR K  DIC,X,Y ;  S DIC(0)= "QEAM",DIC ="^VA(200, ",DIC("A") ="Select P rescriber:  " S DIC(" S")="I +$G (^VA(200,Y ,""PS""))"  F  D ^DIC  Q:X=""  D   Q:$G(BPS ARRAY)="^"  . ; Check  for "^" o r a timeou t, if foun d set BPSA RRAY="^" a nd quit. .  I $D(DUOU T)!$D(DTOU T)!($D(DIR UT)) S BPS ARRAY="^"  Q . ; . ;  Add select ion to BPS ARRAY and  display Pr escriber's  Name. . S  BPSARRAY( +Y)=$P(Y,U ,2) . W "  ",$P(Y,"^" ,2),! . ;  . ; Displa y a list o f current  selections . . I $D(B PSARRAY) D  . . S ARR ="" F  S A RR=$O(BPSA RRAY(ARR))  Q:'ARR  W  ?10,BPSAR RAY(ARR),!  ; ; If BP SARRAY="^"  quit and  return "^" . I $G(BPS ARRAY)="^"  Q "^" ; ;  If nothin g was sele cted, retu rn "^" so  the user w ill return  to the me nu  I '$D( BPSARRAY)  Q "^" ; ;  Create a c omma delim ited strin g BPSRESCA R that con tains the  selected P rescribers  ien's. S  BPSRESCAR= "" S ARR=" " F  S ARR =$O(BPSARR AY(ARR)) Q :'ARR  S B PSRESCAR=B PSRESCAR_A RR_"," ; Q  BPSRESCAR
  928  
  929  
  930  
  931   A new subr outine wil l be creat ed that al lows the u ser to “Se lect (P)at ients or ( A)LL”.
  932  
  933   Subroutine  Name
  934   SELPA^BPSR PT3A
  935   Enhancemen t Category
  936    New
  937    Modify
  938    Delete
  939    No Change
  940   Story
  941   US572
  942   Related Me nu Options  or ListMa n Actions
  943   BPS MENU R PT CLAIM S TATUS
  944   Related Ro utines
  945   This Subro utine is C alled By
  946   This Subro utine Call s
  947  
  948   EN^BPSRPT0
  949   DIR
  950   Related In tegration  Control Re gistration s (ICRs)
  951   n/a
  952   Data Passi ng
  953    Parameter  Input
  954    Parameter  Output
  955    Function  Return Val ue
  956    Global Mo dified
  957   Input Attr ibute Name  and Defin ition
  958   Name: DFLT
  959   Definition : default  value – ‘A LL’
  960    New       Modify       Delete       No Cha nge
  961   Output Att ribute Nam e and Defi nition
  962   Name: $$SE LPA
  963   Definition : 1=Patien ts, 0=ALL,  ^=exit
  964    New       Modify       Delete       No Cha nge
  965   Current Lo gic
  966  
  967   n/a – new  subroutine
  968  
  969   Modified L ogic (Chan ges are hi ghlighted)
  970  
  971   SELPA() ;  ; ; Displa y (P)atien ts or (A)l l ;  ; Ret urn Value  -> 1 = Pat ients ; 0  = ALL ; ^  = Exit ;   N DIR,DIRU T,DTOUT,DU OUT,X,Y S  DIR(0)="S^ P:Patient; A:ALL" S D IR("A")="D isplay sel ected (P)a tients or  (A)LL"
  972    S DIR("B" )="ALL" D  ^DIR I ($G (DUOUT)=1) !($G(DTOUT )=1) S Y=" ^" S Y=$S( Y="A":0,Y= "P":1,1:Y)  Q Y ;
  973      
  974  
  975   A new subr outine wil l be creat ed that al lows the u ser to sel ect one or  multiple  patients.   Multiple  selections  will be r eturned in  a string  separated  by a comma .
  976  
  977   Subroutine  Name
  978   SELPAT^BPS RPT3A
  979   Enhancemen t Category
  980    New
  981    Modify
  982    Delete
  983    No Change
  984   Story
  985   US572
  986   Related Me nu Options  or ListMa n Actions
  987   BPS MENU R PT CLAIM S TATUS
  988   Related Ro utines
  989   This Subro utine is C alled By
  990   This Subro utine Call s
  991  
  992   EN^BPSRPT0
  993   SEL^BPSRPT 3
  994   Related In tegration  Control Re gistration s (ICRs)
  995   n/a
  996   Data Passi ng
  997    Parameter  Input
  998    Parameter  Output
  999    Function  Return Val ue
  1000    Global Mo dified
  1001   Input Attr ibute Name  and Defin ition
  1002   Name: n/a
  1003   Definition
  1004    New       Modify       Delete       No Cha nge
  1005   Output Att ribute Nam e and Defi nition
  1006   Name: $$SE LPAT
  1007   Definition : a string  of patien t ien’s se parated by  a comma
  1008    New       Modify       Delete       No Cha nge
  1009   Current Lo gic
  1010  
  1011   n/a – new  subroutine
  1012  
  1013   Modified L ogic (Chan ges are hi ghlighted)
  1014  
  1015   SELPAT() ;  ; Allow u ser to sel ect a sing le or mult iple PATIE NT(s). ; ;  If the us ers select ed one or  more PATIE NTs, the s election w ill be sto red ; in B PARR("PATI ENT")separ ated by a  comma. e.g . BPARR("P ATIENT")=  patient ie n1 , patie nt ien2 ;B PPAT ; N D IR,DIRUT,D TOUT,DUOUT ,X,Y N BPA RR,BPSARRA Y,BPSIEN ;  S BPARR(" PATIENT")= "" ; ; The  SEL tag p rompts use r to 'Sele ct Patient ' and vali dates the  selection  against th e PATIENT  file. D SE L("Patient ","^DPT(", .BPSARRAY)  ; ; If th e user ent ered "^" q uit, no lo nger promp ting the u ser to 'Se lect Patie nt' I $G(B PSARRAY)=" ^" Q "^" ;  ; If no P atient was  selected,  return "^ " so the u ser will r eturn to t he menu  I  $G(BPSARR AY)=0 Q "^ " ; M BPAR R("PATIENT ")=BPSARRA Y ; ; Crea tes a stri ng of all  the patien t ien's se lected sep arated by  a comma. S  BPSIEN=""  F  S BPSI EN=$O(BPAR R("PATIENT ",BPSIEN))  Q:BPSIEN= ""  D . I  BPARR("PAT IENT")'=""  S BPARR(" PATIENT")= BPARR("PAT IENT")_","  . S BPARR ("PATIENT" )=BPARR("P ATIENT")_B PSIEN . Q  ; Q BPARR( "PATIENT")
  1016    
  1017  
  1018   A new subr outine wil l be creat ed that al lows the u ser to sel ect a Rang e or All B illed Amou nts.
  1019  
  1020   Subroutine  Name
  1021   SELBAMT^BP SRPT3A
  1022   Enhancemen t Category
  1023    New
  1024    Modify
  1025    Delete
  1026    No Change
  1027   Story
  1028   US572
  1029   Related Me nu Options  or ListMa n Actions
  1030   BPS MENU R PT CLAIM S TATUS
  1031   Related Ro utines
  1032   This Subro utine is C alled By
  1033   This Subro utine Call s
  1034  
  1035   EN^BPSRPT0
  1036   ^DIR
  1037   Related In tegration  Control Re gistration s (ICRs)
  1038   n/a
  1039   Data Passi ng
  1040    Parameter  Input
  1041    Parameter  Output
  1042    Function  Return Val ue
  1043    Global Mo dified
  1044   Input Attr ibute Name  and Defin ition
  1045   Name: DFLT
  1046   Definition : default  value
  1047    New       Modify       Delete       No Cha nge
  1048   Output Att ribute Nam e and Defi nition
  1049   Name: $$SE LBAMT
  1050   Definition : 2=Bill A mt Range,  1=ALL, ^=E xit
  1051    New       Modify       Delete       No Cha nge
  1052   Current Lo gic
  1053  
  1054   n/a – new  subroutine
  1055  
  1056   Modified L ogic (Chan ges are hi ghlighted)
  1057  
  1058   SELBAMT()  ; ; ; Sele ct (R)ange  for Bille d Amount o r (A)ll ;   ; Input V ariable ->  DFLT = AL L ;  ; Ret urn Value  -> 1 = Bil led Amt Ra nge ; 0 =  ALL ; ^ =  Exit ;  N  DIR,DIRUT, DTOUT,DUOU T,X,Y S DF LT="ALL" S  DIR(0)="S ^R:Range;A :ALL" S DI R("A")="Se lect (R)an ge for Bil led 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 ;
  1059     
  1060  
  1061   A new subr outine wil l be creat ed to prom pt the use r for a mi nimum bill ed amount  if the use r selected  a Range f or Billed  Amount.
  1062  
  1063   Subroutine  Name
  1064   SELBMIN^BP SRPT3A
  1065   Enhancemen t Category
  1066    New
  1067    Modify
  1068    Delete
  1069    No Change
  1070   Story
  1071   US572
  1072   Related Me nu Options  or ListMa n Actions
  1073   BPS MENU R PT CLAIM S TATUS
  1074   Related Ro utines
  1075   This Subro utine is C alled By
  1076   This Subro utine Call s
  1077  
  1078   EN^BPSRPT0
  1079   ^DIR
  1080   Related In tegration  Control Re gistration s (ICRs)
  1081   n/a
  1082   Data Passi ng
  1083    Parameter  Input
  1084    Parameter  Output
  1085    Function  Return Val ue
  1086    Global Mo dified
  1087   Input Attr ibute Name  and Defin ition
  1088   Name: n/a
  1089   Definition
  1090    New       Modify       Delete       No Cha nge
  1091   Output Att ribute Nam e and Defi nition
  1092   Name: $$SE LBMIN
  1093   Definition : minimum  amount  en tered, def ault will  be 0 (zero )
  1094    New       Modify       Delete       No Cha nge
  1095   Current Lo gic
  1096  
  1097   n/a – new  subroutine
  1098  
  1099   Modified L ogic (Chan ges are hi ghlighted)
  1100  
  1101   SELBMIN()  ; N DIR,DI RUT,DTOUT, DUOUT,X,Y  ; S DIR("A ")=" Minim um Billed  Amount: "  S DIR("B") =0 S DIR(0 )="NA^0:99 9999" S DI R("?",1)=" Enter the  minimum bi lled amoun t OR press " S DIR("? ",2)="retu rn for a m inimum bil led amount  of zero ( 0)." S DIR ("?")=" Ex ample: 500  - no deci mal digits " D ^DIR I  ($G(DUOUT )=1)!($G(D TOUT)=1) Q  "^" Q Y
  1102     
  1103  
  1104   A new subr outine wil l be creat ed to prom pt the use r for a ma ximum bill ed amount  if the use r selected  a Range f or Billed  Amount.
  1105  
  1106   Subroutine  Name
  1107   SELBMAX^BP SRPT3A
  1108   Enhancemen t Category
  1109    New
  1110    Modify
  1111    Delete
  1112    No Change
  1113   Story
  1114   US572
  1115   Related Me nu Options  or ListMa n Actions
  1116   BPS MENU R PT CLAIM S TATUS
  1117   Related Ro utines
  1118   This Subro utine is C alled By
  1119   This Subro utine Call s
  1120  
  1121   EN^BPSRPT0
  1122   ^DIR
  1123   Related In tegration  Control Re gistration s (ICRs)
  1124   n/a
  1125   Data Passi ng
  1126    Parameter  Input
  1127    Parameter  Output
  1128    Function  Return Val ue
  1129    Global Mo dified
  1130   Input Attr ibute Name  and Defin ition
  1131   Name: n/a
  1132   Definition
  1133    New       Modify       Delete       No Cha nge
  1134   Output Att ribute Nam e and Defi nition
  1135   Name: $$SE LBMAX
  1136   Definition : maximum  amount  en tered, def ault will  be 999999
  1137    New       Modify       Delete       No Cha nge
  1138   Current Lo gic
  1139  
  1140   n/a – new  subroutine
  1141  
  1142   Modified L ogic (Chan ges are hi ghlighted)
  1143  
  1144   SELBMAX()  ; N DIR,DI RUT,DTOUT, DUOUT,X,Y  ; S DIR("A ")=" Maxim um Billed  Amount: "  S DIR("B") =999999 S  DIR(0)="NA ^0:999999^ I X'>$G(BP MIN) W !," "The Maxim um Billed  Amount mus t be great er than th e Minimum  Billed Amo unt."" K X " S DIR("? ",1)="Ente r the maxi mum billed  amount. T he amount"  S DIR("?" ,2)="enter ed must be  greater t han the mi nimum bill ed." S DIR ("?")=" Ex ample: 150 0 - no dec imal digit s" D ^DIR  I ($G(DUOU T)=1)!($G( DTOUT)=1)  Q "^" Q Y
  1145      
  1146  
  1147   Modify the  subroutin e to allow  for multi ple user s elections  and for th e new ques tions.  Th is subrout ine loops  through th e BPS TRAN SACTION fi le and che cks to see  if the tr ansaction  meets the  criteria t hat the us er selecte d.
  1148  
  1149   Subroutine  Name
  1150   PROCESS^BP SRPT1
  1151   Enhancemen t Category
  1152    New
  1153    Modify
  1154    Delete
  1155    No Change
  1156   Story
  1157   US572
  1158   Related Me nu Options  or ListMa n Actions
  1159   BPS MENU R PT CLAIM S TATUS
  1160   Related Ro utines
  1161   This Subro utine is C alled By
  1162   This Subro utine Call s
  1163  
  1164   COLLECT^BP SRPT1
  1165   $$MWC^BPSR PT6, $$GET DRUG^BPSRP T6, $$DRGC LNAM^BPSRP T6, $$GETD RGCL^BPSRP T6, $$CLRS N^BPSRPT7,  $$CKREJ,  $$ELIGCODE ^BPSSCR05,  $$CLOSED0 2^BPSSCR03 , SETTMP^B PSRPT2, $$ CKPRESC, $ $GET1^DIQ 
  1166   Related In tegration  Control Re gistration s (ICRs)
  1167   n/a
  1168   Data Passi ng
  1169    Parameter  Input
  1170    Parameter  Output
  1171    Function  Return Val ue
  1172    Global Mo dified
  1173   Input Attr ibute Name  and Defin ition
  1174   Name: BP59
  1175   Definition : ptr to B PS TRANSAC TIONS
  1176    New       Modify       Delete       No Cha nge
  1177   Output Att ribute Nam e and Defi nition
  1178   Name: n/a
  1179   Definition
  1180    New       Modify       Delete       No Cha nge
  1181   Current Lo gic
  1182  
  1183   PROCESS(BP 59) ;
  1184    N BPBCK,B PDFN,BPREF ,BPPAYBL,B PPLAN,BPRE J,BPRLSDT, BPRX,BPRXD RG,BPSTATU S,BPSEQ,BP STOP ;
  1185  
  1186   ...
  1187  
  1188    ;Realtime /Backbill/ PRO Option /Resubmiss ion Check  S BPBCK=$$ RTBCK(BP59 ) ; BPBCK= 1 Backbill  / BPBCK=2  PRO / BPB CK=5 Resub  / BPBCK=0  Realtime  ; ; If use r doesn't  want all t ransmissio n types (B PRTBCK'=1) , then fig ure out if  this tran saction is  OK  S BPS TOP=0 I BP RTBCK'=1 D   I BPSTOP  G XPROC .  I BPRTBCK =2,BPBCK'= 0 S BPSTOP =1 Q    ;  Realtime c heck . I B PRTBCK=3,B PBCK'=1 S  BPSTOP=1 Q     ; Back bill check  . I BPRTB CK=4,BPBCK '=2 S BPST OP=1 Q     ; PRO opti on check .  I BPRTBCK =5,BPBCK'= 5 S BPSTOP =1 Q    ;  Resubmissi on check .  Q ; 
  1189    ;Check fo r MAIL/WIN DOW/CMOP/A LL I BPMWC '="A",$$MW C^BPSRPT6( BPRX,BPREF )'=BPMWC G  XPROC
  1190    ; ;Check  for select ed insuran ce S BPPLA N=$$INSNAM ^BPSRPT6(B P59) I BPI NSINF'=0,' $$CHKINS^B PSSCRCU($P (BPPLAN,U, 1),BPINSIN F) G XPROC  S BPPLAN= $P(BPPLAN, U,2) ;
  1191    ;Check fo r selected  drug S BP RXDRG=$$GE TDRUG^BPSR PT6(BPRX)  I BPRXDRG= 0 G XPROC  I BPDRUG,B PDRUG'=BPR XDRG G XPR OC ; ;Chec k for sele cted drug  classes I  BPDRGCL'=0 ,BPDRGCL'= $$DRGCLNAM ^BPSRPT6($ $GETDRGCL^ BPSRPT6(BP RXDRG),99)  G XPROC ;  ;Check fo r selected  Close Rea son I BPCC RSN,BPCCRS N'=$P($$CL RSN^BPSRPT 7(BP59),U)  G XPROC ;  ;Check fo r Accepted /Rejected  I BPACREJ= 1,BPSTATUS '["REJECTE D" G XPROC  I BPACREJ =2,BPSTATU S'["ACCEPT ED" G XPRO C ;
  1192    ;Check fo r Specific  Reject Co de I BPREJ CD'=0,'$$C KREJ(BP59, BPREJCD) G  XPROC ; ; Check for  Eligibilit y Code I B PELIG'=0,B PELIG'=$$E LIGCODE^BP SSCR05(BP5 9) G XPROC  ;
  1193    ;Check Op en/Closed  claim I BP OPCL'=0,(( BPOPCL=2)& ($$CLOSED0 2^BPSSCR03 ($P(^BPST( BP59,0),U, 4))=1))!(( BPOPCL=1)& ($$CLOSED0 2^BPSSCR03 ($P(^BPST( BP59,0),U, 4))'=1)) G  XPROC ; ; Save Entry  for Repor t D SETTMP ^BPSRPT2(B PGLTMP,BPD FN,BPRX,BP REF,BP59,B PBEGDT,BPE NDDT,.BPPH ARM,BPSUMD ET,BPPLAN, BPRLSDT,BP PAYBL,BPRE J,BPRXDRG, $P(BPSTATU S,U)) ;XPR OC Q
  1194  
  1195   Modified L ogic (Chan ges are hi ghlighted)
  1196  
  1197   PROCESS(BP 59) ;
  1198    N BPBILLE D,BPBCK,BP BCKX,BPDFN ,BPREF,BPP AYBL,BPPLA N,BPREJ,BP RLSDT,BPRX ,BPRXDC,BP RXDRG,BPST ATUS,BPSEQ ,BPSTOP ;
  1199   ...
  1200  
  1201    ;Realtime /Backbill/ PRO Option /Resubmiss ion Check  S BPBCK=$$ RTBCK(BP59 ) ; BPBCK= 1 Backbill  / BPBCK=2  PRO / BPB CK=5 Resub  / BPBCK=0  Realtime
  1202    ;
  1203    ; BPBCK    = 1 Backb ill / 2 PR O / 5 Resu b / 0 Real time
  1204    ; BPRTBCK  = 3 Backb ill / 4 PR O / 5 Resu b / 2 Real time
  1205    ;
  1206    S BPBCKX= $S(BPBCK=1 :3,BPBCK=2 :4,BPBCK=5 :5,BPBCK=0 :2,1:"") ; convert to  BPRTBCK v alue
  1207    ; ; If us er doesn't  want all  transmissi on types ( BPRTBCK'=1 ),
  1208    ; then fi gure out i f this tra nsaction i s OK
  1209    S BPSTOP= 0 I BPRTBC K'=1 D  I  BPSTOP G X PROC . I B PRTBCK=2,B PBCK'=0 S  BPSTOP=1 Q     ; Real time check  . I BPRTB CK=3,BPBCK '=1 S BPST OP=1 Q     ; Backbill  check . I  BPRTBCK=4 ,BPBCK'=2  S BPSTOP=1  Q    ; PR O option c heck . I B PRTBCK=5,B PBCK'=5 S  BPSTOP=1 Q     ; Resu bmission c heck . Q I  BPRTBCK’= 1,BPRTBCK' [BPBCKX G  XPROC
  1210    ;
  1211    ;Check fo r MAIL/WIN DOW/CMOP/A LL
  1212    I BPMWC'= "A",BPMWC' [$$MWC^BPS RPT6(BPRX, BPREF)G XP ROC
  1213    ;
  1214    ;Check fo r selected  insurance  S BPPLAN= $$INSNAM^B PSRPT6(BP5 9) I BPINS INF'=0,'$$ CHKINS^BPS SCRCU($P(B PPLAN,U,1) ,BPINSINF)  G XPROC S  BPPLAN=$P (BPPLAN,U, 2) ;
  1215    ;Check fo r selected  drug S BP RXDRG=$$GE TDRUG^BPSR PT6(BPRX)  I BPRXDRG= 0 G XPROC  I BPDRUG,B PDRUG'[BPR XDRG G XPR OC ; ;Chec k for sele cted drug  classes I  BPDRGCL'=0  S BPRXDC= $$DRGCLNAM ^BPSRPT6($ $GETDRGCL^ BPSRPT6(BP RXDRG),99)  D  I BPST OP=0 G XPR OC . S BPS TOP=0 . F  I=1:1:$L(B PDRGCL,";" ) I BPRXDC =$P(BPDRGC L,";",I) S  BPSTOP=1  Q ;
  1216    ;Check fo r selected  Close Rea son I BPCC RSN,BPCCRS N'=$P($$CL RSN^BPSRPT 7(BP59),U)  G XPROC ;  ;Check fo r Accepted /Rejected  I BPACREJ= 1,BPSTATUS '["REJECTE D" G XPROC  I BPACREJ =2,BPSTATU S'["ACCEPT ED" G XPRO C ;
  1217    ;Check fo r Specific  Reject Co de I BPREJ CD'=0 D  I  BPSTOP=0  G XPROC
  1218    . S BPSTO P=0
  1219    . F I=1:1 :($L(BPREJ CD,",")-1)  I $$CKREJ (BP59,$P(B PREJCD,"," ,I)) S BPS TOP=1 Q
  1220    ; ;Check  for Eligib ility Code  I BPELIG' =0,BPELIG' =$$ELIGCOD E^BPSSCR05 (BP59) G X PROC ;
  1221    ;Check fo r Eligibil ity Codes,  when one  or more is  selected  (BPELIG1=1 ) I (",2,9 ,")[BPRTYP E,BPELIG1' =0 S ELIG= $$ELIGCODE ^BPSSCR05( BP59) I '$ D(BPELIG1( ELIG)) G X PROC ; ;Ch eck for se lected Pre scribers I  BPRESC'=0  D  I BPST OP=0 G XPR OC . S BPS TOP=0 . F  I=1:1:$L(B PRESC,",") -1 I $$CKP RESC(BP59, $P(BPRESC, ",",I)) S  BPSTOP=1 Q  ; ;Check  for select ed Patient s I BPQSTP AT'=0,$G(B PPAT)'=""  D  I BPSTO P=0 G XPRO C . S BPST OP=0 . F I =1:1:$L(BP PAT,",") I  $P(BPPAT, I)[$$GET1^ DIQ(900231 3.59,BP59, 5,"I") S B PSTOP=1 Q  ; ; Check  for Billed  Amount I  $G(BPBILL) '=0 S BPBI LLED=$$GET 1^DIQ(9002 313.59,BP5 9,505) I ( BPBILLED<B PMIN)!(BPB ILLED>BPMA X) G XPROC  ;
  1222    ;Check Op en/Closed  claim I BP OPCL'=0,(( BPOPCL=2)& ($$CLOSED0 2^BPSSCR03 ($P(^BPST( BP59,0),U, 4))=1))!(( BPOPCL=1)& ($$CLOSED0 2^BPSSCR03 ($P(^BPST( BP59,0),U, 4))'=1)) G  XPROC ; ; Save Entry  for Repor t D SETTMP ^BPSRPT2(B PGLTMP,BPD FN,BPRX,BP REF,BP59,B PBEGDT,BPE NDDT,.BPPH ARM,BPSUMD ET,BPPLAN, BPRLSDT,BP PAYBL,BPRE J,BPRXDRG, $P(BPSTATU S,U)) ;XPR OC Q
  1223  
  1224  
  1225   A new subr outine wil l be creat ed that wi ll check t o see if t he Prescri ber for th is transac tion match es any of  Prescriber ’s the use r selected
  1226   Subroutine  Name
  1227   CKPRESC^BP SRPT1
  1228   Enhancemen t Category
  1229    New
  1230    Modify
  1231    Delete
  1232    No Change
  1233   Story
  1234   US572
  1235   Related Me nu Options  or ListMa n Actions
  1236   BPS MENU R PT CLAIM S TATUS
  1237   Related Ro utines
  1238   This Subro utine is C alled By
  1239   This Subro utine Call s
  1240  
  1241   PROCESS^BP SRPT1
  1242   $$GET1^DIC
  1243   Related In tegration  Control Re gistration s (ICRs)
  1244   n/a
  1245   Data Passi ng
  1246    Parameter  Input
  1247    Parameter  Output
  1248    Function  Return Val ue
  1249    Global Mo dified
  1250   Input Attr ibute Name  and Defin ition
  1251   Name: BP59
  1252   Definition : pointer  to BPS TRA NSACTIONS
  1253    New       Modify       Delete       No Cha nge
  1254   Name: BPRE SC
  1255   Definition : string o f Prescrib er’s selec ted separa ted by a c omma
  1256    New       Modify       Delete       No Cha nge
  1257   Output Att ribute Nam e and Defi nition
  1258   Name: FND
  1259   Definition : 1=select ed Prescri ber is the  Prescribe r for this  transacti on, otherw ise 0 (zer o)
  1260    New       Modify       Delete       No Cha nge
  1261   Current Lo gic
  1262  
  1263   n/a – new  subroutine
  1264  
  1265   Modified L ogic (Chan ges are hi ghlighted)
  1266  
  1267    ;Determin e if the P rescriber  for claim  was one of  the Presc ribers sel ected ; ;  Input Vari ables: BPS 59 - Looku p to BPS T RANSACTION  (#59) ; B PSRESC - s tring of P rescribers  selected  separated  by a comma  ; ; Retur n Value ->  1 = Presc riber is o n the list  of select ed Prescri bers  ; 0  = RX and/o r Prescrib er not fou nd, or the  Prescribe r for this  ; transac tion isn't  one of th e selected  Prescribe rs ;CKPRES C(BPS59,BP SPRESC) ;  ;  N BPSFN D,BPSRX,BP SRXPRSC ;  S BPSFND=0  ; Initial ize to zer o. ; ; get  the presc ription nu mber ien f rom the BP S TRANSACT ION file S  BPSRX=$$G ET1^DIQ(90 02313.59,B PS59,1.11, "I") ; ; i f the pres cription n umber didn 't exist   I BPSRX=""  G CKPRESC X ; ; get  the prescr iber ien f rom the PR ESCRIPTION  file S BP SRXPRSC=$$ GET1^DIQ(5 2,BPSRX,4, "I") ; ; i f the pres criber did n't exist  BPRESC  I  BPSRXPRSC= "" G CKPRE SCX ; ; Th e Prescrib er for thi s transact ion is one  of the Pr escribers  selected I  BPSPRESC[ BPSRXPRSC  S BPSFND=1  ;CKPRESCX  ; Q BPSFN D
  1268      
  1269  
  1270  
  1271   The follow ing modifi cations wi ll need to  be made t o the repo rt header:
  1272   add the Pr escriber a nd Patient  to the he ading on t he last li ne,
  1273   after the  insurance  name add a  dash foll owed by th e BIN
  1274   remove the  Claim ID  and replac e with the  Drug
  1275   put the Pr escriber I D and Name  where the  Drug was  previously
  1276   Eligibilit y will dis play a val ue of ALL  or will di splay the  selections  using the  abbreviat ions VET,  TRI or CVA
  1277   the Insura nce, Rejec t Code, Dr ugs/Classe s, Prescri ber and Pa tient will  have a va lue of ALL  or SELECT ED
  1278  
  1279   Subroutine  Name
  1280   HDR^BPSRPT 7
  1281   Enhancemen t Category
  1282    New
  1283    Modify
  1284    Delete
  1285    No Change
  1286   Story
  1287   US572
  1288   Related Me nu Options  or ListMa n Actions
  1289   BPS MENU R PT CLAIM S TATUS
  1290   Related Ro utines
  1291   This Subro utine is C alled By
  1292   This Subro utine Call s
  1293  
  1294   REPORT^BPS RPT5,
  1295   CHKP^BPSRP T5
  1296   HDR^BPSRPT 8. $$GETDI VS^BPSRPT4 , $$BPINS,  $$GETCLR^ BPSRPT6, $ $DRGNAM^BP SRPT6, $$G ETREJ^BPSR PT4, $$ELI G, $$NBSTS , $$DATTIM ^BPSRPT1,  ULINE^BPSR PT5, HEADL N1^BPSRPT4 , HEADLN2^ BPSRPT4, H EADLN3^BPS RPT4, $$DI VNAME^BPSS CRDS, WRPL AN^BPSRPT5
  1297   Related In tegration  Control Re gistration s (ICRs)
  1298   n/a
  1299   Data Passi ng
  1300    Parameter  Input
  1301    Parameter  Output
  1302    Function  Return Val ue
  1303    Global Mo dified
  1304   Input Attr ibute Name  and Defin ition
  1305   Name: BPRT YPE
  1306   Definition : report n umber (1-9 )
  1307    New       Modify       Delete       No Cha nge
  1308   Name: BPRP TNAM
  1309   Definition : Report N ame
  1310    New       Modify       Delete       No Cha nge
  1311   Name: BPPA GE
  1312   Definition : report p age number
  1313    New       Modify       Delete       No Cha nge
  1314   Output Att ribute Nam e and Defi nition
  1315   Name: n/a
  1316   Definition
  1317    New       Modify       Delete       No Cha nge
  1318   Current Lo gic
  1319  
  1320   BPSRPT7 ;B HAM ISC/BE E - ECME R EPORTS ;14 -FEB-05 ;; 1.0;E CLAI MS MGMT EN GINE;**1,3 ,5,7,8,10, 11,19,20** ;JUN 2004; Build 27
  1321    
  1322   ...
  1323  
  1324    ;Print Re port Heade r ; Input  variables  (defined i n BPSRPT0)  - BPPHARM ,BPSUMDET, BPNOW,BPMW C,BPRTBCK, BPINSINF ;                                             BPREJCD,BP CCRSN,BPAU TREV,BPACR EJ,BPQSTDR G ;                                            BPDRUG, BPDRGCL,BP RLNRL,BPSO RT,BPBEGDT ,BPENDDT ;  Output va riable - B PSDATA ->  Reset to 0  to show n o actual d ata has be en printed  ;                             o n the scre en ;                     BPPAGE  -> First s et in BPSR PT0 ;                     BPBLIN E -> Contr ols whethe r to print  a blank l ine ; HDR( BPRTYPE,BP RPTNAM,BPP AGE) ; ;Di splay Exce l Header I  BPEXCEL D  HDR^BPSRP T8(BPRTYPE ) Q ; ; De fine BPPDA TA - Tells  whether d ata has be en display ed for a s creen S BP SDATA=0 S  BPBLINE=""  S BPPAGE= $G(BPPAGE) +1 W @IOF  W "ECME "_ BPRPTNAM_"  "_$S(BPSU MDET=1:"SU MMARY",1:" DETAIL")_"  REPORT" W  ?89,"Prin t Date: "_ $G(BPNOW)_ " Page:",$ J(BPPAGE,3 ) W !,"DIV ISION(S):  ",$$GETDIV S^BPSRPT4( 72,.BPPHAR M) W ?86," Fill Locat ions: "_$S (BPMWC="A" :"C,M,W",1 :BPMWC) I  BPRTYPE'=9  W ?110,"F ill type:  "_$S(BPRTB CK=2:"RT", BPRTBCK=3: "BB",BPRTB CK=4:"P2", BPRTBCK=5: "RS",1:"RT ,BB,P2,RS" ) W !,"Ins urance: "_ $S(BPINSIN F=0:"ALL", 1:$$BPINS( BPINSINF))  I (",7,") [BPRTYPE W  ?44,"Clos e Reason:  ",$E($$GET CLR^BPSRPT 6(BPCCRSN) ,1,26) I ( ",4,")[BPR TYPE W ?44 ,$J($S(BPA UTREV=0:"A LL",1:"AUT O"),4)," R eversals"  I (",4,")[ BPRTYPE W  ?60,$J($S( BPACREJ=1: "REJECTED" ,BPACREJ=2 :"ACCEPTED ",1:"ALL") ,8)," Retu rned Statu s" W ?87," Drugs/Clas ses: "_$S( BPQSTDRG=2 :$$DRGNAM^ BPSRPT6(BP DRUG,30),B PQSTDRG=3: $E(BPDRGCL ,1,30),1:" ALL") I (" ,2,")[BPRT YPE W !,"R eject Code : ",$E($$G ETREJ^BPSR PT4(BPREJC D),1,28),? 89,"Eligib ility: ",$ S(BPELIG=" V":"VET",B PELIG="T": "TRI",BPEL IG="C":"CV A",1:"ALL" ),?111,"Op en/Closed:  ",$S(BPOP CL=1:"CLOS ED",BPOPCL =2:"OPEN", 1:"ALL") I  (",1,4,7, ")[BPRTYPE  W !,"Elig ibility: " ,$S(BPELIG ="V":"VET" ,BPELIG="T ":"TRI",BP ELIG="C":" CVA",1:"AL L") I (",9 ,")[BPRTYP E D . W !, "Eligibili ties: ",$S (BPELIG1=0 :"ALL",1:$ $ELIG(.BPE LIG1)) . W  !,"NON-BI LLABLE STA TUS: "_$S( BPNBSTS=0: "ALL",1:$$ NBSTS(.BPN BSTS)) W ! ,$S(BPRTYP E=5:"PRESC RIPTIONS", BPRLNRL=2: "RELEASED  PRESCRIPTI ONS",BPRLN RL=3:"PRES CRIPTIONS  (NOT RELEA SED)",1:"A LL PRESCRI PTIONS") W  " BY "_$S (BPRTYPE=7 :"CLOSE",1 :"TRANSACT ION")_" DA TE: " W "F rom "_$$DA TTIM^BPSRP T1(BPBEGDT )_" throug h "_$$DATT IM^BPSRPT1 ($P(BPENDD T,".")) ;  D ULINE^BP SRPT5("=")  Q:$G(BPQ)  D HEADLN1 ^BPSRPT4(B PRTYPE) D  HEADLN2^BP SRPT4(BPRT YPE) D HEA DLN3^BPSRP T4(BPRTYPE ) D ULINE^ BPSRPT5("= ") ; ;Prin t Division  I $G(BPDI V)]"" D .W  !,"DIVISI ON: ",$S(B PDIV=0:"BL ANK",BPDIV ="ALL DIVI SIONS":"AL L DIVISION S",$$DIVNA ME^BPSSCRD S(BPDIV)]" ":$$DIVNAM E^BPSSCRDS (BPDIV),1: BPDIV) .I  BPRTYPE=5! (BPRTYPE=6 )!(BPSUMDE T=1)!(BPGR PLAN="") D  ULINE^BPS RPT5("-")  ; ;Print I nsurance I f Defined  I BPSUMDET =0,$G(BPGR PLAN)]"",$ G(BPGRPLAN )'=0,$G(BP GRPLAN)'=" ~" D WRPLA N^BPSRPT5( BPGRPLAN) 
  1325  
  1326   Modified L ogic (Chan ges are hi ghlighted)
  1327  
  1328   BPSRPT7 ;B HAM ISC/BE E - ECME R EPORTS ;14 -FEB-05 ;; 1.0;E CLAI MS MGMT EN GINE;**1,3 ,5,7,8,10, 11,19,20,2 3**;JUN 20 04;Build 2 7
  1329    
  1330   ...
  1331  
  1332    ;Print Re port Heade r
  1333    ; Input v ariables ( passed in)  – BPRTYPE  -> number  of report
  1334    ;                                - BPRPTNA M -> repor t name
  1335    ;                                - BPPAGE  -> report  page numbe r ; Input  variables  (defined i n BPSRPT0)  - BPPHARM ,BPSUMDET, BPNOW,BPMW C,BPRTBCK, BPINSINF ;                                             BPREJCD,BP CCRSN,BPAU TREV,BPACR EJ,BPQSTDR G
  1336    ;                                            BPDRUG,B PDRGCL,BPR ESC,BPOPCL ,BPRLNRL,
  1337    ;                                            BPSORT,B PBEGDT,BPE NDDT ; Out put variab le - BPSDA TA -> Rese t to 0 to  show no ac tual data  has been p rinted ;                               on t he screen  ;                     BPPAGE ->  First set  in BPSRPT0 , report p age number  ;                     BPBLINE - > Controls  whether t o print a  blank line  ; HDR(BPR TYPE,BPRPT NAM,BPPAGE ) ; ;Displ ay Excel H eader I BP EXCEL D HD R^BPSRPT8( BPRTYPE) Q  ; ; Defin e BPPDATA  - Tells wh ether data  has been  displayed  for a scre en S BPSDA TA=0 S BPB LINE="" S  BPPAGE=$G( BPPAGE)+1  W @IOF W " ECME "_BPR PTNAM_" "_ $S(BPSUMDE T=1:"SUMMA RY",1:"DET AIL")_" RE PORT" I (" ,2,")'[BPR TYPE D   .  W ?89,"Pr int Date:  "_$G(BPNOW )_" Page:" ,$J(BPPAGE ,3) . W !, "DIVISION( S): ",$$GE TDIVS^BPSR PT4(72,.BP PHARM) . W  ?86,"Fill  Locations : "_$S(BPM WC="A":"C, M,W",1:BPM WC) ; I (" ,2,")[BPRT YPE D . W  ?87,"Print  Date: "_$ G(BPNOW)_"  Page:",$J (BPPAGE,3)  . W !,"DI VISION(S):  ",$$GETDI VS^BPSRPT4 (72,.BPPHA RM) . W ?8 4,"Fill Lo cations: " _$S(BPMWC= "A":"C,M,W ",1:BPMWC)  . W ?110, "Fill Type : " . I BP RTBCK=1 W  "RT,BB,P2, RS" Q . F  I=1:1:$L(B PRTBCK,"," ) W:I'=1 " ," S RTBCK X=$P(BPRTB CK,",",I)  W $S(RTBCK X=2:"RT",R TBCKX=3:"B B",RTBCKX= 4:"P2",RTB CKX=5:"RS" ,1:"") ; I  (",2,9,") '[BPRTYPE  W ?110,"Fi ll type: " _$S(BPRTBC K=2:"RT",B PRTBCK=3:" BB",BPRTBC K=4:"P2",B PRTBCK=5:" RS",1:"RT, BB,P2,RS")  ; I (",2, ")[BPRTYPE  W !,"Insu rance: "_$ S(BPINSINF =0:"ALL",1 :"SELECTED ") I (",2, ")'[BPRTYP E W !,"Ins urance: "_ $S(BPINSIN F=0:"ALL", 1:$$BPINS( BPINSINF))  ; I (",7, ")[BPRTYPE  W ?44,"Cl ose Reason : ",$E($$G ETCLR^BPSR PT6(BPCCRS N),1,26) I  (",4,")[B PRTYPE W ? 44,$J($S(B PAUTREV=0: "ALL",1:"A UTO"),4),"  Reversals " I (",4," )[BPRTYPE  W ?60,$J($ S(BPACREJ= 1:"REJECTE D",BPACREJ =2:"ACCEPT ED",1:"ALL "),8)," Re turned Sta tus" ; I ( ",2,")'[BP RTYPE W ?8 7,"Drugs/C lasses: "_ $S(BPQSTDR G=2:$$DRGN AM^BPSRPT6 (BPDRUG,30 ),BPQSTDRG =3:$E(BPDR GCL,1,30), 1:"ALL") I  (",2,")[B PRTYPE D .  W ?85,"Dr ugs/Classe s: "_$S(BP QSTDRG'=1: "SELECTED" ,1:"ALL")  . W !,"Rej ect Code:  ",$S(BPREJ CD'=0:"SEL ECTED",1:" ALL") . W  ?87,"Eligi bility: "  D . . I BP ELIG1=0 W  "CVA,TRI,V ET" Q . .  S (ABVELIG ,LIST,N)=" " F  S N=$ O(BPELIG1( N)) Q:N=""   D . . .  S ABVELIG= $S(N="C":" CVA",N="T" :"TRI",N=" V":"VET",1 :""),LIST= LIST_$G(AB VELIG)_","  . . W $E( LIST,1,$L( LIST)-1) .  W ?113,"O pen/Closed : ",$S(BPO PCL=1:"CLO SED",BPOPC L=2:"OPEN" ,1:"ALL")  . W !,"Pre scriber: " ,$S(BPRESC '=0:"SELEC TED",1:"AL L") . W ?9 1,"Patient : ",$S(BPQ STPAT'=0:" SELECTED", 1:"ALL") ;  I (",1,4, 7,")[BPRTY PE W !,"El igibility:  ",$S(BPEL IG="V":"VE T",BPELIG= "T":"TRI", BPELIG="C" :"CVA",1:" ALL") ; I  (",9,")[BP RTYPE D .  W !,"Eligi bilities:  ",$S(BPELI G1=0:"ALL" ,1:$$ELIG( .BPELIG1))  . W !,"NO N-BILLABLE  STATUS: " _$S(BPNBST S=0:"ALL", 1:$$NBSTS( .BPNBSTS))  ; W !,$S( BPRTYPE=5: "PRESCRIPT IONS",BPRL NRL=2:"REL EASED PRES CRIPTIONS" ,BPRLNRL=3 :"PRESCRIP TIONS (NOT  RELEASED) ",1:"ALL P RESCRIPTIO NS") W " B Y "_$S(BPR TYPE=7:"CL OSE",1:"TR ANSACTION" )_" DATE:  " W "From  "_$$DATTIM ^BPSRPT1(B PBEGDT)_"  through "_ $$DATTIM^B PSRPT1($P( BPENDDT,". ")) ; D UL INE^BPSRPT 5("=") Q:$ G(BPQ) D H EADLN1^BPS RPT4(BPRTY PE) D HEAD LN2^BPSRPT 4(BPRTYPE)  D HEADLN3 ^BPSRPT4(B PRTYPE) D  ULINE^BPSR PT5("=") ;  ;Print Di vision I $ G(BPDIV)]" " D .W !," DIVISION:  ",$S(BPDIV =0:"BLANK" ,BPDIV="AL L DIVISION S":"ALL DI VISIONS",$ $DIVNAME^B PSSCRDS(BP DIV)]"":$$ DIVNAME^BP SSCRDS(BPD IV),1:BPDI V) .I BPRT YPE=5!(BPR TYPE=6)!(B PSUMDET=1) !(BPGRPLAN ="") D ULI NE^BPSRPT5 ("-") ; ;P rint Insur ance If De fined I BP SUMDET=0,$ G(BPGRPLAN )]"",$G(BP GRPLAN)'=0 ,$G(BPGRPL AN)'="~" D  WRPLAN^BP SRPT5(BPGR PLAN) Q
  1338  
  1339  
  1340   Modify thi s subrouti ne to add  the BIN af ter the In surance Na me.
  1341   Subroutine  Name
  1342   WRPLAN^BPS RPT5
  1343   Enhancemen t Category
  1344    New
  1345    Modify
  1346    Delete
  1347    No Change
  1348   Story
  1349   US572
  1350   Related Me nu Options  or ListMa n Actions
  1351   BPS MENU R PT CLAIM S TATUS
  1352   Related Ro utines
  1353   This Subro utine is C alled By
  1354   This Subro utine Call s
  1355  
  1356   HDR^BPSRPT 7, REPORT^ BPSRPT5
  1357   $$CHKP,
  1358   ULINE,
  1359   $$GET1^DIQ
  1360   Related In tegration  Control Re gistration s (ICRs)
  1361   n/a
  1362   Data Passi ng
  1363    Parameter  Input
  1364    Parameter  Output
  1365    Function  Return Val ue
  1366    Global Mo dified
  1367   Input Attr ibute Name  and Defin ition
  1368   Name: BPGR PLAN
  1369   Definition : Insuranc e Name
  1370    New       Modify       Delete       No Cha nge
  1371   Output Att ribute Nam e and Defi nition
  1372   Name: n/a
  1373   Definition
  1374    New       Modify       Delete       No Cha nge
  1375   Current Lo gic
  1376  
  1377    ;Display  the Insura nce
  1378    ; Input V ariable ->  BPSDATA - > if 0, sk ip page ch eck
  1379    ;                     BPEXCEL - > 1 - Prin t to Excel /0 Regular  Display
  1380   WRPLAN(BPG RPLAN) N I NS,NP
  1381    ;
  1382    I BPSUMDE T'=0 Q
  1383    I BPEXCEL  Q
  1384    ;Skip for  Recent Tr ansactions  and Total s by Date  Reports
  1385    I BPRTYPE =5!(BPRTYP E=6) Q
  1386    I $G(BPSD ATA) S NP= $$CHKP(5)  Q:BPQ!NP
  1387    ;Get and  display th e Insuranc e Name
  1388    S INS=$E( BPGRPLAN,1 ,90)
  1389    I INS]""  D
  1390    .D ULINE( "-")
  1391    .W !,INS
  1392    .D ULINE( "-")
  1393    Q
  1394  
  1395   Modified L ogic (Chan ges are hi ghlighted)
  1396  
  1397    ;Display  the Insura nce
  1398    ; Input V ariable ->  BPSDATA - > if 0, sk ip page ch eck
  1399    ;                     BPEXCEL - > 1 - Prin t to Excel /0 Regular  Display
  1400   WRPLAN(BPG RPLAN) ;N  INS,NP
  1401    N GPIEN,I NS,NP
  1402    ;
  1403    I BPSUMDE T'=0 Q
  1404    I BPEXCEL  Q
  1405    ;Skip for  Recent Tr ansactions  and Total s by Date  Reports
  1406    I BPRTYPE =5!(BPRTYP E=6) Q
  1407    I $G(BPSD ATA) S NP= $$CHKP(5)  Q:BPQ!NP
  1408    ;Get and  display th e Insuranc e Name
  1409    S INS=$E( BPGRPLAN,1 ,90)
  1410    I INS]""  D
  1411    . D ULINE ("-")
  1412    . W !,INS
  1413    . ;includ e the Insu rance Bin  after the  Insurance  name . I ( ",2,")[BPR TYPE D . .  W " - ",$ $INSBIN^BP SRPT6($P(B PX,U,3))
  1414    . D ULINE ("-")
  1415    Q
  1416      
  1417  
  1418   Modify lin e 2 of the  print hea der to rem ove Drug a nd replace  it with P rescriber  ID – Name.
  1419   Subroutine  Name
  1420   HEADLN2^BP SRPT4
  1421   Enhancemen t Category
  1422    New
  1423    Modify
  1424    Delete
  1425    No Change
  1426   Story
  1427   US572
  1428   Related Me nu Options  or ListMa n Actions
  1429   BPS MENU R PT CLAIM S TATUS
  1430   Related Ro utines
  1431   This Subro utine is C alled By
  1432   This Subro utine Call s
  1433  
  1434   HDR^BPSRPT 7
  1435   n/a
  1436   Related In tegration  Control Re gistration s (ICRs)
  1437   n/a
  1438   Data Passi ng
  1439    Parameter  Input
  1440    Parameter  Output
  1441    Function  Return Val ue
  1442    Global Mo dified
  1443   Input Attr ibute Name  and Defin ition
  1444   Name: BPRT YPE
  1445   Definition : report n umber (1-9 )
  1446    New       Modify       Delete       No Cha nge
  1447   Output Att ribute Nam e and Defi nition
  1448   Name: n/a
  1449   Definition
  1450    New       Modify       Delete       No Cha nge
  1451   Current Lo gic
  1452  
  1453    ;Print He ader 2 Lin e 2 ; ; In put variab le: BPRTYP E -> Repor t Type (1- 7) ; HEADL N2(BPRTYPE ) ; I (BPR TYPE=1)!(B PRTYPE=4)  D  Q . W ! ,?4,"DRUG"  . W ?36," NDC" . I B PRTYPE=1 W  ?47,"RELE ASED ON" .  W ?68,"RX  INFO" . I  BPRTYPE=4  W ?92,"RX  COB" . I  BPRTYPE=1  W ?115,$J( "BILL# RX  COB",17) ;  I BPRTYPE =2 D  Q .  W !,?3,"CA RDHOLD.ID"  . W ?31," GROUP ID"  . W ?41,$J ("$BILLED" ,10) . W ? 54,"QTY" .  W ?61,"ND C#" . W ?8 2,"DRUG" ;
  1454   . . .
  1455  
  1456   Modified L ogic (Chan ges are hi ghlighted)
  1457  
  1458    ;Print He ader 2 Lin e 2 ; ; In put variab le: BPRTYP E -> Repor t Type (1- 79) ; HEAD LN2(BPRTYP E) ; I (BP RTYPE=1)!( BPRTYPE=4)  D  Q . W  !,?4,"DRUG " . W ?36, "NDC" . I  BPRTYPE=1  W ?47,"REL EASED ON"  . W ?68,"R X INFO" .  I BPRTYPE= 4 W ?92,"R X COB" . I  BPRTYPE=1  W ?115,$J ("BILL# RX  COB",17)  ; I BPRTYP E=2 D  Q .  W !,?3,"C ARDHOLD.ID " . W ?31, "GROUP ID"  . W ?41,$ J("$BILLED ",10) . W  ?54,"QTY"  . W ?61,"N DC#"
  1459    . W ?82," DRUG" . W  ?82,"PRESC RIBER ID -  NAME" ;
  1460   . . .
  1461      
  1462  
  1463   The second  line of t he report  will be mo dified to  remove the  Drug name  and repla ce it with  the Presc riber ID a nd Name.
  1464   Subroutine  Name
  1465   WRLINE2^BP SRPT5
  1466   Enhancemen t Category
  1467    New
  1468    Modify
  1469    Delete
  1470    No Change
  1471   Story
  1472   US572
  1473   Related Me nu Options  or ListMa n Actions
  1474   BPS MENU R PT CLAIM S TATUS
  1475   Related Ro utines
  1476   This Subro utine is C alled By
  1477   This Subro utine Call s
  1478  
  1479   REPORT^BPS RPT5
  1480   WRLINE2^BP SRPT8, $$D RGNAM$$BPS RPT6, $$DA TTIM^BPSRP T1, $$MWC^ BPSRPT6, $ $RTBCKNAM^ BPSRPT1, $ $RTBCK^BPS RPT1, $$RX STATUS$BPS PRT6, $$RX COB^BPSRPT 8, $$BILLC OB, $$CRDH LDID^BPSRP T2, $$GRPI D^BPSRPT2,  $$QTY^BPS RPT6, $$GE TNDC^BPSRP T6, $$DRGN AM^BPSRPT6 ,
  1481   $$PRESCIN^ BPSRPT6
  1482   Related In tegration  Control Re gistration s (ICRs)
  1483   n/a
  1484   Data Passi ng
  1485    Parameter  Input
  1486    Parameter  Output
  1487    Function  Return Val ue
  1488    Global Mo dified
  1489   Input Attr ibute Name  and Defin ition
  1490   Name: BPRT YPE
  1491   Definition : report n umber (1-9 )
  1492    New       Modify       Delete       No Cha nge
  1493   Name: BPRE C
  1494   Definition
  1495    New       Modify       Delete       No Cha nge
  1496   Name: BPX
  1497   Definition
  1498    New       Modify       Delete       No Cha nge
  1499   Name: BPRX
  1500   Definition
  1501    New       Modify       Delete       No Cha nge
  1502   Name: BPRE F
  1503   Definition
  1504    New       Modify       Delete       No Cha nge
  1505   Name: BPBI L
  1506   Definition : billed a mount
  1507    New       Modify       Delete       No Cha nge
  1508   Name: BPGR PLAN
  1509   Definition :  insuran ce name
  1510    New       Modify       Delete       No Cha nge
  1511   Name: BPEX CEL
  1512   Definition : indicate s if user  selected E xcel repor t
  1513    New       Modify       Delete       No Cha nge
  1514   Name: BPIC NT
  1515   Definition
  1516    New       Modify       Delete       No Cha nge
  1517   Name: BPPS EQ
  1518   Definition
  1519    New       Modify       Delete       No Cha nge
  1520   Output Att ribute Nam e and Defi nition
  1521   Name: n/a
  1522   Definition
  1523    New       Modify       Delete       No Cha nge
  1524   Current Lo gic
  1525  
  1526    ;Print Re port Line  2WRLINE2(B PRTYPE,BPR EC,BPX,BPR X,BPREF,BP BIL,BPGRPL AN,BPEXCEL ,BPICNT,BP PSEQ) ; ;E xcel Outpu t I $G(BPE XCEL) D WR LINE2^BPSR PT8(BPRTYP E,.BPREC,B PX,BPRX,BP REF,BPBIL, BPGRPLAN,B PPSEQ) Q ; Report Out put I (BPR TYPE=1)!(B PRTYPE=4)  D  Q . W ! ,?4,$$DRGN AM^BPSRPT6 ($P(BPX,U, 14),27),?3 2,$$GETNDC ^BPSRPT6(B PRX,BPREF)  . I BPRTY PE=1 W ?47 ,$$DATTIM^ BPSRPT1(+B PX) . W ?6 8,$$MWC^BP SRPT6(BPRX ,BPREF) .  W ?71,$$RT BCKNAM^BPS RPT1($$RTB CK^BPSRPT1 ($P(BPX,U, 3))) . W ? 75,$$RXSTA TUS^BPSRPT 6($P(BPX,U ,3)) . W ? 77,$S($P(B PX,U):"/R" ,1:"/N") .  W ?82,$S( $P(BPX,U,1 3):"REJ",1 :"") . I B PRTYPE=4 W  ?92,$$RXC OB^BPSRPT8 (BPPSEQ) .  I BPRTYPE =1 W ?115, $$BILLCOB( BPRX,BPREF ,BPPSEQ) I  BPRTYPE=2  D  Q . W  !,?3,$E($$ CRDHLDID^B PSRPT2(+$P (BPX,U,3)) ,3,23) . W  ?31,$E($$ GRPID^BPSR PT2(+$P(BP X,U,3)),3, 10) . W ?4 1,$J(BPBIL ,10,2) . W  ?54,$$QTY ^BPSRPT6($ P(BPX,U,3) ) . W ?61, $$GETNDC^B PSRPT6(BPR X,BPREF) .  W ?82,$$D RGNAM^BPSR PT6($P(BPX ,U,14),32)
  1527   . . .
  1528  
  1529   Modified L ogic (Chan ges are hi ghlighted)
  1530  
  1531    ;Print Re port Line  2WRLINE2(B PRTYPE,BPR EC,BPX,BPR X,BPREF,BP BIL,BPGRPL AN,BPEXCEL ,BPICNT,BP PSEQ) ; ;E xcel Outpu t
  1532    N BPSX I  $G(BPEXCEL ) D WRLINE 2^BPSRPT8( BPRTYPE,.B PREC,BPX,B PRX,BPREF, BPBIL,BPGR PLAN,BPPSE Q) Q ;Repo rt Output  I (BPRTYPE =1)!(BPRTY PE=4) D  Q  . W !,?4, $$DRGNAM^B PSRPT6($P( BPX,U,14), 27),?32,$$ GETNDC^BPS RPT6(BPRX, BPREF) . I  BPRTYPE=1  W ?47,$$D ATTIM^BPSR PT1(+BPX)  . W ?68,$$ MWC^BPSRPT 6(BPRX,BPR EF) . W ?7 1,$$RTBCKN AM^BPSRPT1 ($$RTBCK^B PSRPT1($P( BPX,U,3)))  . W ?75,$ $RXSTATUS^ BPSRPT6($P (BPX,U,3))  . W ?77,$ S($P(BPX,U ):"/R",1:" /N") . W ? 82,$S($P(B PX,U,13):" REJ",1:"")  . I BPRTY PE=4 W ?92 ,$$RXCOB^B PSRPT8(BPP SEQ) . I B PRTYPE=1 W  ?115,$$BI LLCOB(BPRX ,BPREF,BPP SEQ) I BPR TYPE=2 D   Q . W !,?3 ,$E($$CRDH LDID^BPSRP T2(+$P(BPX ,U,3)),3,2 3) . W ?31 ,$E($$GRPI D^BPSRPT2( +$P(BPX,U, 3)),3,10)  . W ?41,$J (BPBIL,10, 2) . W ?54 ,$$QTY^BPS RPT6($P(BP X,U,3)) .  W ?61,$$GE TNDC^BPSRP T6(BPRX,BP REF) . W ? 82,$$DRGNA M^BPSRPT6( $P(BPX,U,1 4),32)
  1533    . S BPSX= $$PRESCIN^ BPSRPT6($P (BPX,U,3))
  1534    . W ?82,$ P(BPSX,U)_ " – "_$P(B PSX,U,2)
  1535   . . .
  1536  
  1537      
  1538  
  1539   Modify the  routine t o move the  call to W RPLAN.  Th e call nee ds to be m ade after  BPX is set .  BPX con tains the  pointer to  file #900 2313.59 wh ich is nee ded to get  the Insur ance Bin t o be displ ayed.  Mod ify the re port to re move the C laim ID an d replace  it with th e Drug Nam e.
  1540   Subroutine  Name
  1541   REPORT^BPS RPT5
  1542   Enhancemen t Category
  1543    New
  1544    Modify
  1545    Delete
  1546    No Change
  1547   Story
  1548   US572
  1549   Related Me nu Options  or ListMa n Actions
  1550   BPS MENU R PT CLAIM S TATUS
  1551   Related Ro utines
  1552   This Subro utine is C alled By
  1553   This Subro utine Call s
  1554  
  1555   RUN^BPSRPT 0
  1556   HDR^BPSRPT 7, WRPLAN,  $$COB59^B PSUTIL2, $ $ELAPSE^BP SRPT6, $$B ILLED^BPSR PT7, $$INS PAID^BPSRP T2, $$COLL ECTD^BPSRP T6, $$PRIC EVAL, $$CH KP, WRLINE 1, WRLINE2 , WRLINE3,  COMMENT,  $$CLAIMID^ BPSRPT2, $ $REJTEXT^B PSRPT2, PT BDT^BPSRPT 7, ITOT^BP SRPT7, TOT ALS^BPSRPT 7, PAUSE^B PSRPT1, PG TOT6^BPSRP T7, PGTOT^ BPSRPT7, $ $DRGNAM^BP SRPT6
  1557   Related In tegration  Control Re gistration s (ICRs)
  1558   n/a
  1559   Data Passi ng
  1560    Parameter  Input
  1561    Parameter  Output
  1562    Function  Return Val ue
  1563    Global Mo dified
  1564   Input Attr ibute Name  and Defin ition
  1565   Name: REF
  1566   Definition : TMP glob al
  1567    New       Modify       Delete       No Cha nge
  1568   Name: BPEX CEL
  1569   Definition : indicate s if user  selected E xcel repor t
  1570    New       Modify       Delete       No Cha nge
  1571   Name: BPSC R
  1572   Definition
  1573    New       Modify       Delete       No Cha nge
  1574   Name: BPSR PTNAM
  1575   Definition : Report N ame
  1576    New       Modify       Delete       No Cha nge
  1577   Name: BPSU MDET
  1578   Definition : indicate s if the u ser select ed Summary  or Detail  format
  1579    New       Modify       Delete       No Cha nge
  1580   Name: BPPA GE
  1581   Definition : page num ber
  1582    New       Modify       Delete       No Cha nge
  1583   Output Att ribute Nam e and Defi nition
  1584   Name: n/a
  1585   Definition
  1586    New       Modify       Delete       No Cha nge
  1587   Current Lo gic
  1588  
  1589   ;Display t he Report
  1590   REPORT(REF ,BPEXCEL,B PSCR,BPRPT NAM,BPSUMD ET,BPPAGE)  ;
  1591    N BPBIL,B PBLINE,BPC OLL,BPDFN, BPDIV,BPEL TM,BPGELTM ,BPGBIL,BP GINS,BPGCO LL,BPGCNT, BPGRPLAN,B PINS,BPLIN ES,BPREC,B PREF,BPRX, BPSRTDT,BP STATUS,BPT BIL,BPTCOL L,BPTINS,B PX,BPSGTOT ,NP,BPSDAT A
  1592    N BPPSEQ, BPBILINF,B PRICINF
  1593    N BPGPRIC E,BPG128,B PG129,BPG1 33,BPG134, BPG135,BPG 136,BPG137
  1594    N BPIPRIC E,BPI128,B PI129,BPI1 33,BPI134, BPI135,BPI 136,BPI137
  1595    N BPTPRIC E,BPT128,B PT129,BPT1 33,BPT134, BPT135,BPT 136,BPT137
  1596    I '$D(@RE F) D HDR^B PSRPT7(BPR TYPE,BPRPT NAM,.BPPAG E) W !,"No  data meet s the crit eria." G X REPORT
  1597    S (BPGBIL ,BPGINS,BP GCOLL,BPGC NT,BPGELTM ,BPGPRICE, BPG128,BPG 129,BPG133 ,BPG134,BP G135,BPG13 6,BPG137)= 0
  1598    S BPDIV=" " F  S BPD IV=$O(@REF @(BPDIV))  Q:BPDIV=""   D  Q:BPQ
  1599    .S BPGRPL AN=""
  1600    .D HDR^BP SRPT7(BPRT YPE,BPRPTN AM,.BPPAGE )
  1601    .N BPCNT  S (BPTBIL, BPTINS,BPT COLL,BPCNT ,BPELTM,BP TPRICE,BPT 128,BPT129 ,BPT133,BP T134,BPT13 5,BPT136,B PT137)=0
  1602    .F  S BPG RPLAN=$O(@ REF@(BPDIV ,BPGRPLAN) ) Q:BPGRPL AN=""  D   Q:BPQ
  1603    .. I BPSU MDET=0 D W RPLAN(BPGR PLAN) Q:BP Q
  1604    .. S BPBL INE=""  ;R eset Blank  Line Indi cator
  1605    .. N BPSC LM,BPREC,B PTOT,BPIBI L,BPICNT,B PICOL,BPII NS
  1606    .. S (BPI BIL,BPICNT ,BPICOL,BP IINS,BPIPR ICE,BPI128 ,BPI129,BP I133,BPI13 4,BPI135,B PI136,BPI1 37)=0
  1607    .. S BPDF N="" F  S  BPDFN=$O(@ REF@(BPDIV ,BPGRPLAN, BPDFN)) Q: BPDFN=""   D  Q:BPQ
  1608    ... S BPS RTDT="" F   S BPSRTDT =$O(@REF@( BPDIV,BPGR PLAN,BPDFN ,BPSRTDT))  Q:BPSRTDT =""  D  Q: BPQ
  1609    .... S BP RX="" F  S  BPRX=$O(@ REF@(BPDIV ,BPGRPLAN, BPDFN,BPSR TDT,BPRX))  Q:BPRX=""   D  Q:BPQ
  1610    ..... S B PREF="" F   S BPREF=$ O(@REF@(BP DIV,BPGRPL AN,BPDFN,B PSRTDT,BPR X,BPREF))  Q:BPREF=""   D  Q:BPQ
  1611    ...... S  BPX=@REF@( BPDIV,BPGR PLAN,BPDFN ,BPSRTDT,B PRX,BPREF)
  1612    ...... S  BPCNT=BPCN T+1,BPGCNT =BPGCNT+1, BPICNT=BPI CNT+1
  1613    ...... S  BPPSEQ=+$$ COB59^BPSU TIL2($P(BP X,U,3))
  1614    ...... I  BPRTYPE=5  D
  1615    ....... S  BPELTM=BP ELTM+$$ELA PSE^BPSRPT 6($P(BPX,U ,3))
  1616    ....... S  BPGELTM=B PGELTM+$$E LAPSE^BPSR PT6($P(BPX ,U,3))
  1617    ...... I  BPRTYPE=9  D
  1618    ....... S  (BPBIL,BP INS,BPTINS ,BPGINS,BP IINS,BPBIL INF,BPCOLL ,BPTCOLL,B PGCOLL,BPI COL)=""
  1619    ....... S  BPTBIL=BP TBIL+$P(BP X,U,2),BPG BIL=BPGBIL +$P(BPX,U, 2),BPIBIL= BPIBIL+$P( BPX,U,2)
  1620    ...... E   D
  1621    ....... S  BPBIL=$$B ILLED^BPSR PT7($P(BPX ,U,3)),BPT BIL=BPTBIL +BPBIL,BPG BIL=BPGBIL +BPBIL,BPI BIL=BPIBIL +BPBIL
  1622    ....... S  BPINS=$$I NSPAID^BPS RPT2($P(BP X,U,3)),BP TINS=BPTIN S+BPINS,BP GINS=BPGIN S+BPINS,BP IINS=BPIIN S+BPINS
  1623    ....... S  BPBILINF= $$COLLECTD ^BPSRPT6(B PRX,BPREF, BPPSEQ)
  1624    ....... S  BPCOLL=+B PBILINF,BP TCOLL=BPTC OLL+BPCOLL ,BPGCOLL=B PGCOLL+BPC OLL,BPICOL =BPICOL+BP COLL
  1625    ...... I  BPRTYPE=6  D  Q
  1626    ....... S  BPSTATUS= $P(BPX,U,7 )
  1627    ....... I  BPSTATUS[ "REJECT" S  $P(BPSCLM (BPSRTDT), U,3)=$P($G (BPSCLM(BP SRTDT)),U, 3)+BPBIL
  1628    ....... I  BPSTATUS[ "PAYABLE"  S $P(BPSCL M(BPSRTDT) ,U,4)=$P($ G(BPSCLM(B PSRTDT)),U ,4)+BPBIL
  1629    ....... S  $P(BPSCLM (BPSRTDT), U,2)=$P($G (BPSCLM(BP SRTDT)),U, 2)+BPBIL
  1630    ....... S  $P(BPSCLM (BPSRTDT), U,5)=$P($G (BPSCLM(BP SRTDT)),U, 5)+BPINS
  1631    ....... S  $P(BPSCLM (BPSRTDT), U)=$P($G(B PSCLM(BPSR TDT)),U)+1
  1632    ...... I  BPRTYPE=8  D
  1633    ....... ; Get Pricin g Informat ion for to tals
  1634    ....... S  BPRICINF= $$PRICEVAL (+$P(BPX,U ,3))
  1635    ....... S  BPI128=BP I128+$P($G (BPRICINF) ,U),BPI129 =BPI129+$P ($G(BPRICI NF),U,2),B PI133=BPI1 33+$P($G(B PRICINF),U ,3),BPI134 =BPI134+$P ($G(BPRICI NF),U,4)
  1636    ....... S  BPI135=BP I135+$P($G (BPRICINF) ,U,5),BPI1 36=BPI136+ $P($G(BPRI CINF),U,6) ,BPI137=BP I137+$P($G (BPRICINF) ,U,7)
  1637    ....... S  BPT128=BP T128+$P($G (BPRICINF) ,U),BPT129 =BPT129+$P ($G(BPRICI NF),U,2),B PT133=BPT1 33+$P($G(B PRICINF),U ,3),BPT134 =BPT134+$P ($G(BPRICI NF),U,4)
  1638    ....... S  BPT135=BP T135+$P($G (BPRICINF) ,U,5),BPT1 36=BPT136+ $P($G(BPRI CINF),U,6) ,BPT137=BP T137+$P($G (BPRICINF) ,U,7)
  1639    ....... S  BPG128=BP G128+$P($G (BPRICINF) ,U),BPG129 =BPG129+$P ($G(BPRICI NF),U,2),B PG133=BPG1 33+$P($G(B PRICINF),U ,3),BPG134 =BPG134+$P ($G(BPRICI NF),U,4)
  1640    ....... S  BPG135=BP G135+$P($G (BPRICINF) ,U,5),BPG1 36=BPG136+ $P($G(BPRI CINF),U,6) ,BPG137=BP G137+$P($G (BPRICINF) ,U,7)
  1641    ....... S  BPIPRICE= BPI128_U_B PI129_U_BP I133_U_BPI 134_U_BPI1 35_U_BPI13 6_U_BPI137
  1642    ....... S  BPTPRICE= BPT128_U_B PT129_U_BP T133_U_BPT 134_U_BPT1 35_U_BPT13 6_U_BPT137
  1643    ....... S  BPGPRICE= BPG128_U_B PG129_U_BP G133_U_BPG 134_U_BPG1 35_U_BPG13 6_U_BPG137
  1644    ...... ;D isplay Det ail Sectio n
  1645    ...... Q: BPSUMDET=1
  1646    ...... S  BPREC=""   ;Reset Exc el Display  Variable
  1647    ...... I  'BPEXCEL,B PRTYPE=1,B PBLINE=1 S  NP=$$CHKP (2) Q:BPQ   I BPBLINE =1 W !  ;P rint blank  line
  1648    ...... S  NP=$$CHKP( 1) Q:BPQ   D WRLINE1( BPRTYPE,.B PREC,BPDIV ,BPGRPLAN, BPDFN,BPRX ,BPREF,BPX ,BPSRTDT,B PBIL,BPINS ,BPCOLL,BP EXCEL,BPPS EQ)
  1649    ...... S  NP=$$CHKP( 1) Q:BPQ   D WRLINE2( BPRTYPE,.B PREC,BPX,B PRX,BPREF, BPBIL,BPGR PLAN,BPEXC EL,.BPICNT ,BPPSEQ)
  1650    ...... D  WRLINE3(BP RTYPE,.BPR EC,BPX,BPE XCEL)
  1651    ...... I  (",2,7,8") [BPRTYPE,' BPEXCEL D   Q:BPQ
  1652    ....... D  COMMENT(+ $P(BPX,U,3 )) Q:BPQ
  1653    ....... S  NP=$$CHKP (1) Q:BPQ
  1654    ....... W  !,?10,"Cl aim ID: ", $$CLAIMID^ BPSRPT2(+$ P(BPX,U,3) )
  1655    ....... N  BPSARR,BP RJCNT,BPZZ  S BPRJCNT =$$REJTEXT ^BPSRPT2(+ $P(BPX,U,3 ),.BPSARR)
  1656    ....... F  BPZZ=1:1: BPRJCNT S  NP=$$CHKP( 1) Q:BPQ   W !,?10,BP SARR(BPZZ)  Q:BPQ
  1657    ...... I  'BPEXCEL,B PRTYPE=1 S  BPBLINE=1   ;Set Bla nk Line Di splay Indi cator
  1658    .. I BPRT YPE=6 D PT BDT^BPSRPT 7(BPDIV,BP SUMDET,.BP SCLM,.BPSG TOT)
  1659    .. I 'BPQ ,(",1,2,3, 4,7,8,9,") [BPRTYPE,' BPEXCEL S  NP=$$CHKP( 5) Q:BPQ   D ITOT^BPS RPT7(BPRTY PE,BPDIV,B PGRPLAN,BP IBIL,BPIIN S,BPICOL,. BPICNT,BPI PRICE)
  1660    .I 'BPEXC EL,'BPQ,BP RTYPE'=6 S  NP=$$CHKP (5) Q:BPQ   D TOTALS^ BPSRPT7(BP RTYPE,BPDI V,BPTBIL,B PTINS,BPTC OLL,.BPCNT ,BPELTM,BP TPRICE)
  1661    .I 'BPEXC EL,'BPQ,$O (@REF@(BPD IV))]"" D: $G(BPSCR)  PAUSE^BPSR PT1 Q:BPQ
  1662    ;Print Gr and Totals
  1663    I 'BPEXCE L D
  1664    .I 'BPQ,B PRTYPE=6 D  PGTOT6^BP SRPT7($G(B PSGTOT))
  1665    .I 'BPQ,B PRTYPE'=6  S NP=$$CHK P(5) Q:BPQ   D PGTOT^ BPSRPT7(BP RTYPE,BPGB IL,BPGINS, BPGCOLL,.B PGCNT,BPGE LTM,BPGPRI CE)
  1666    ;
  1667   XREPORT Q
  1668    ;
  1669  
  1670   Modified L ogic (Chan ges are hi ghlighted)
  1671  
  1672   ;Display t he Report
  1673   REPORT(REF ,BPEXCEL,B PSCR,BPRPT NAM,BPSUMD ET,BPPAGE)  ;
  1674    N BPBIL,B PBLINE,BPC OLL,BPDFN, BPDIV,BPEL TM,BPGELTM ,BPGBIL,BP GINS,BPGCO LL,BPGCNT, BPGRPLAN,B PINS,BPLIN ES,BPREC,B PREF,BPRX, BPSRTDT,BP STATUS,BPT BIL,BPTCOL L,BPTINS,B PX,BPSGTOT ,NP,BPSDAT A
  1675    N BPPSEQ, BPBILINF,B PRICINF,BP INSBIN
  1676    N BPGPRIC E,BPG128,B PG129,BPG1 33,BPG134, BPG135,BPG 136,BPG137
  1677    N BPIPRIC E,BPI128,B PI129,BPI1 33,BPI134, BPI135,BPI 136,BPI137
  1678    N BPTPRIC E,BPT128,B PT129,BPT1 33,BPT134, BPT135,BPT 136,BPT137
  1679    I '$D(@RE F) D HDR^B PSRPT7(BPR TYPE,BPRPT NAM,.BPPAG E) W !,"No  data meet s the crit eria." G X REPORT
  1680    S (BPGBIL ,BPGINS,BP GCOLL,BPGC NT,BPGELTM ,BPGPRICE, BPG128,BPG 129,BPG133 ,BPG134,BP G135,BPG13 6,BPG137)= 0
  1681    S BPDIV=" " F  S BPD IV=$O(@REF @(BPDIV))  Q:BPDIV=""   D  Q:BPQ
  1682    .S BPGRPL AN=""
  1683    .D HDR^BP SRPT7(BPRT YPE,BPRPTN AM,.BPPAGE )
  1684    .N BPCNT  S (BPTBIL, BPTINS,BPT COLL,BPCNT ,BPELTM,BP TPRICE,BPT 128,BPT129 ,BPT133,BP T134,BPT13 5,BPT136,B PT137)=0
  1685    .F  S BPG RPLAN=$O(@ REF@(BPDIV ,BPGRPLAN) ) Q:BPGRPL AN=""  D   Q:BPQ
  1686    .. I BPSU MDET=0 D W RPLAN(BPGR PLAN) Q:BP Q
  1687    .. S BPBL INE=""  ;R eset Blank  Line Indi cator
  1688    .. S BPIN SBIN=0
  1689    .. N BPSC LM,BPREC,B PTOT,BPIBI L,BPICNT,B PICOL,BPII NS
  1690    .. S (BPI BIL,BPICNT ,BPICOL,BP IINS,BPIPR ICE,BPI128 ,BPI129,BP I133,BPI13 4,BPI135,B PI136,BPI1 37)=0
  1691    .. S BPDF N="" F  S  BPDFN=$O(@ REF@(BPDIV ,BPGRPLAN, BPDFN)) Q: BPDFN=""   D  Q:BPQ
  1692    ... S BPS RTDT="" F   S BPSRTDT =$O(@REF@( BPDIV,BPGR PLAN,BPDFN ,BPSRTDT))  Q:BPSRTDT =""  D  Q: BPQ
  1693    .... S BP RX="" F  S  BPRX=$O(@ REF@(BPDIV ,BPGRPLAN, BPDFN,BPSR TDT,BPRX))  Q:BPRX=""   D  Q:BPQ
  1694    ..... S B PREF="" F   S BPREF=$ O(@REF@(BP DIV,BPGRPL AN,BPDFN,B PSRTDT,BPR X,BPREF))  Q:BPREF=""   D  Q:BPQ
  1695    ...... S  BPX=@REF@( BPDIV,BPGR PLAN,BPDFN ,BPSRTDT,B PRX,BPREF)
  1696    ...... I  BPSUMDET=0 ,BPINSBIN= 0 D ...... . D WRPLAN (BPGRPLAN)  S BPINSBI N=1 ;Set I nsurance/B in Indicat or .......  S BPBLINE =""  ;Rese t Blank Li ne Indicat or
  1697    ...... S  BPCNT=BPCN T+1,BPGCNT =BPGCNT+1, BPICNT=BPI CNT+1
  1698    ...... S  BPPSEQ=+$$ COB59^BPSU TIL2($P(BP X,U,3))
  1699    ...... I  BPRTYPE=5  D
  1700    ....... S  BPELTM=BP ELTM+$$ELA PSE^BPSRPT 6($P(BPX,U ,3))
  1701    ....... S  BPGELTM=B PGELTM+$$E LAPSE^BPSR PT6($P(BPX ,U,3))
  1702    ...... I  BPRTYPE=9  D
  1703    ....... S  (BPBIL,BP INS,BPTINS ,BPGINS,BP IINS,BPBIL INF,BPCOLL ,BPTCOLL,B PGCOLL,BPI COL)=""
  1704    ....... S  BPTBIL=BP TBIL+$P(BP X,U,2),BPG BIL=BPGBIL +$P(BPX,U, 2),BPIBIL= BPIBIL+$P( BPX,U,2)
  1705    ...... E   D
  1706    ....... S  BPBIL=$$B ILLED^BPSR PT7($P(BPX ,U,3)),BPT BIL=BPTBIL +BPBIL,BPG BIL=BPGBIL +BPBIL,BPI BIL=BPIBIL +BPBIL
  1707    ....... S  BPINS=$$I NSPAID^BPS RPT2($P(BP X,U,3)),BP TINS=BPTIN S+BPINS,BP GINS=BPGIN S+BPINS,BP IINS=BPIIN S+BPINS
  1708    ....... S  BPBILINF= $$COLLECTD ^BPSRPT6(B PRX,BPREF, BPPSEQ)
  1709    ....... S  BPCOLL=+B PBILINF,BP TCOLL=BPTC OLL+BPCOLL ,BPGCOLL=B PGCOLL+BPC OLL,BPICOL =BPICOL+BP COLL
  1710    ...... I  BPRTYPE=6  D  Q
  1711    ....... S  BPSTATUS= $P(BPX,U,7 )
  1712    ....... I  BPSTATUS[ "REJECT" S  $P(BPSCLM (BPSRTDT), U,3)=$P($G (BPSCLM(BP SRTDT)),U, 3)+BPBIL
  1713    ....... I  BPSTATUS[ "PAYABLE"  S $P(BPSCL M(BPSRTDT) ,U,4)=$P($ G(BPSCLM(B PSRTDT)),U ,4)+BPBIL
  1714    ....... S  $P(BPSCLM (BPSRTDT), U,2)=$P($G (BPSCLM(BP SRTDT)),U, 2)+BPBIL
  1715    ....... S  $P(BPSCLM (BPSRTDT), U,5)=$P($G (BPSCLM(BP SRTDT)),U, 5)+BPINS
  1716    ....... S  $P(BPSCLM (BPSRTDT), U)=$P($G(B PSCLM(BPSR TDT)),U)+1
  1717    ...... I  BPRTYPE=8  D
  1718    ....... ; Get Pricin g Informat ion for to tals
  1719    ....... S  BPRICINF= $$PRICEVAL (+$P(BPX,U ,3))
  1720    ....... S  BPI128=BP I128+$P($G (BPRICINF) ,U),BPI129 =BPI129+$P ($G(BPRICI NF),U,2),B PI133=BPI1 33+$P($G(B PRICINF),U ,3),BPI134 =BPI134+$P ($G(BPRICI NF),U,4)
  1721    ....... S  BPI135=BP I135+$P($G (BPRICINF) ,U,5),BPI1 36=BPI136+ $P($G(BPRI CINF),U,6) ,BPI137=BP I137+$P($G (BPRICINF) ,U,7)
  1722    ....... S  BPT128=BP T128+$P($G (BPRICINF) ,U),BPT129 =BPT129+$P ($G(BPRICI NF),U,2),B PT133=BPT1 33+$P($G(B PRICINF),U ,3),BPT134 =BPT134+$P ($G(BPRICI NF),U,4)
  1723    ....... S  BPT135=BP T135+$P($G (BPRICINF) ,U,5),BPT1 36=BPT136+ $P($G(BPRI CINF),U,6) ,BPT137=BP T137+$P($G (BPRICINF) ,U,7)
  1724    ....... S  BPG128=BP G128+$P($G (BPRICINF) ,U),BPG129 =BPG129+$P ($G(BPRICI NF),U,2),B PG133=BPG1 33+$P($G(B PRICINF),U ,3),BPG134 =BPG134+$P ($G(BPRICI NF),U,4)
  1725    ....... S  BPG135=BP G135+$P($G (BPRICINF) ,U,5),BPG1 36=BPG136+ $P($G(BPRI CINF),U,6) ,BPG137=BP G137+$P($G (BPRICINF) ,U,7)
  1726    ....... S  BPIPRICE= BPI128_U_B PI129_U_BP I133_U_BPI 134_U_BPI1 35_U_BPI13 6_U_BPI137
  1727    ....... S  BPTPRICE= BPT128_U_B PT129_U_BP T133_U_BPT 134_U_BPT1 35_U_BPT13 6_U_BPT137
  1728    ....... S  BPGPRICE= BPG128_U_B PG129_U_BP G133_U_BPG 134_U_BPG1 35_U_BPG13 6_U_BPG137
  1729    ...... ;D isplay Det ail Sectio n
  1730    ...... Q: BPSUMDET=1
  1731    ...... S  BPREC=""   ;Reset Exc el Display  Variable
  1732    ...... I  'BPEXCEL,B PRTYPE=1,B PBLINE=1 S  NP=$$CHKP (2) Q:BPQ   I BPBLINE =1 W !  ;P rint blank  line
  1733    ...... S  NP=$$CHKP( 1) Q:BPQ   D WRLINE1( BPRTYPE,.B PREC,BPDIV ,BPGRPLAN, BPDFN,BPRX ,BPREF,BPX ,BPSRTDT,B PBIL,BPINS ,BPCOLL,BP EXCEL,BPPS EQ)
  1734    ...... S  NP=$$CHKP( 1) Q:BPQ   D WRLINE2( BPRTYPE,.B PREC,BPX,B PRX,BPREF, BPBIL,BPGR PLAN,BPEXC EL,.BPICNT ,BPPSEQ)
  1735    ...... D  WRLINE3(BP RTYPE,.BPR EC,BPX,BPE XCEL)
  1736    ...... I  (",2,7,8") [BPRTYPE,' BPEXCEL D   Q:BPQ
  1737    ....... D  COMMENT(+ $P(BPX,U,3 )) Q:BPQ
  1738    ....... S  NP=$$CHKP (1) Q:BPQ
  1739    ....... I  (",2,")’[ BPRTYPE W  !,?10,"Cla im ID: ",$ $CLAIMID^B PSRPT2(+$P (BPX,U,3))
  1740    ....... E   W !,?10, $$DRGNAM^B PSRPT6($P( BPX,U,14), 34)
  1741    ....... N  BPSARR,BP RJCNT,BPZZ  S BPRJCNT =$$REJTEXT ^BPSRPT2(+ $P(BPX,U,3 ),.BPSARR)
  1742    ....... F  BPZZ=1:1: BPRJCNT S  NP=$$CHKP( 1) Q:BPQ   W !,?10,BP SARR(BPZZ)  Q:BPQ
  1743    ...... I  'BPEXCEL,B PRTYPE=1 S  BPBLINE=1   ;Set Bla nk Line Di splay Indi cator
  1744    .. I BPRT YPE=6 D PT BDT^BPSRPT 7(BPDIV,BP SUMDET,.BP SCLM,.BPSG TOT)
  1745    .. I 'BPQ ,(",1,2,3, 4,7,8,9,") [BPRTYPE,' BPEXCEL S  NP=$$CHKP( 5) Q:BPQ   D ITOT^BPS RPT7(BPRTY PE,BPDIV,B PGRPLAN,BP IBIL,BPIIN S,BPICOL,. BPICNT,BPI PRICE)
  1746    .I 'BPEXC EL,'BPQ,BP RTYPE'=6 S  NP=$$CHKP (5) Q:BPQ   D TOTALS^ BPSRPT7(BP RTYPE,BPDI V,BPTBIL,B PTINS,BPTC OLL,.BPCNT ,BPELTM,BP TPRICE)
  1747    .I 'BPEXC EL,'BPQ,$O (@REF@(BPD IV))]"" D: $G(BPSCR)  PAUSE^BPSR PT1 Q:BPQ
  1748    ;Print Gr and Totals
  1749    I 'BPEXCE L D
  1750    .I 'BPQ,B PRTYPE=6 D  PGTOT6^BP SRPT7($G(B PSGTOT))
  1751    .I 'BPQ,B PRTYPE'=6  S NP=$$CHK P(5) Q:BPQ   D PGTOT^ BPSRPT7(BP RTYPE,BPGB IL,BPGINS, BPGCOLL,.B PGCNT,BPGE LTM,BPGPRI CE)
  1752    ;
  1753   XREPORT Q
  1754    ;
  1755      
  1756  
  1757   The Excel  header wil l be modif ied to sho rten sever al column  headings,  remove CAR DH. ID and  CLAIM ID,  replace t he REJECT  CODE(S) wi th MULT RE J, and add  BIN, PRES CRIBER ID,  and PRESC RIBER (nam e).
  1758   Subroutine  Name
  1759   HDR^BPSRPT 8
  1760   Enhancemen t Category
  1761    New
  1762    Modify
  1763    Delete
  1764    No Change
  1765   Story
  1766   US572
  1767   Related Me nu Options  or ListMa n Actions
  1768   BPS MENU R PT CLAIM S TATUS
  1769   Related Ro utines
  1770   This Subro utine is C alled By
  1771   This Subro utine Call s
  1772  
  1773   HDR^BPSRPT 7
  1774   n/a
  1775   Related In tegration  Control Re gistration s (ICRs)
  1776   n/a
  1777   Data Passi ng
  1778    Parameter  Input
  1779    Parameter  Output
  1780    Function  Return Val ue
  1781    Global Mo dified
  1782   Input Attr ibute Name  and Defin ition
  1783   Name: BPRT YPE
  1784   Definition : report n umber (1-9 )
  1785    New       Modify       Delete       No Cha nge
  1786   Output Att ribute Nam e and Defi nition
  1787   Name: n/a
  1788   Definition
  1789    New       Modify       Delete       No Cha nge
  1790   Current Lo gic
  1791  
  1792   BPSRPT8 ;B HAM ISC/BE E - ECME R EPORTS ;14 -FEB-05 ;; 1.0;E CLAI MS MGMT EN GINE;**1,3 ,5,7,8,10, 11,19,20** ;JUN 2004; Build 27
  1793  
  1794   ...
  1795  
  1796    ;Print Ex cel Header  ;HDR(BPRT YPE) ; ; ; Check if h eader alre ady printe d I $G(BPS DATA) Q S  BPSDATA=1  ; ;Divisio n W !,"DIV ISION",U ;  I BPRTYPE '=5,BPRTYP E'=6 W "IN SURANCE",U  ; I (",1, 2,3,4,5,7, 8,9,")[BPR TYPE W "PA TIENT NAME ",U,"Pt.ID ",U ; I (B PRTYPE=1)! (BPRTYPE=4 ) D  Q . W  "ELIGIBIL ITY",U . W  "RX#",U .  W "REF/EC ME#",U . W  "DATE",U  . W "VA IN GREDIENT C OST",U . W  "VA DISPE NSING FEE" ,U . W "$B ILLED",U .  W "INGRED IENT COST  PAID",U .  W "DISPENS ING FEE PA ID",U . W  "PATIENT R ESP (INS)" ,U . W "$I NS RESPONS E",U . W " $COLLECT", U . W "DRU G",U . W " NDC",U . W  "RELEASED  ON",U . W  "FILL LOC ATION",U .  W "FILL T YPE",U . W  "STATUS", U . I BPRT YPE=4 W "R X COB",U .  W "REJECT ED" . I BP RTYPE=1 W  U,"BILL#", U,"RX COB"  . I BPRTY PE=4 W U," REVERSAL M ETHOD",U," RETURN STA TUS",U,"RE ASON" ; I  BPRTYPE=2  D  Q . W " ELIGIBILIT Y",U . W " RX#",U . W  "REF/ECME #",U . W " DATE",U .  W "RELEASE D ON",U .  W "FILL LO CATION",U  . W "FILL  TYPE",U .  W "STATUS" ,U . W "RX  COB",U .  W "OPEN/CL OSED",U .  W "CARDHOL D.ID",U .  W "GROUP I D",U . W " VA INGREDI ENT COST", U . W "VA  DISPENSING  FEE",U .  W "$BILLED ",U . W "Q TY",U . W  "NDC#",U .  W "DRUG", U . W "CLA IM ID",U .  W "REJECT  CODE(S)", U . W "REJ ECT CODE", U . W "REJ ECT EXPLAN ATION" ;
  1797   ...
  1798  
  1799   Modified L ogic (Chan ges are hi ghlighted)
  1800  
  1801   BPSRPT8 ;B HAM ISC/BE E - ECME R EPORTS ;14 -FEB-05 ;; 1.0;E CLAI MS MGMT EN GINE;**1,3 ,5,7,8,10, 11,19,20,2 3**;JUN 20 04;Build 2 7
  1802  
  1803   ...
  1804  
  1805    ;Print Ex cel Header  ;HDR(BPRT YPE) ; ; ; Check if h eader alre ady printe d I $G(BPS DATA) Q S  BPSDATA=1  ; ;Divisio n W !,"DIV ISION",U ;  I BPRTYPE '=5,BPRTYP E'=6 W "IN SURANCE",U
  1806    I (",2,") [BPRTYPE W  "BIN",U ;  I (",1,2, 3,4,5,7,8, 9,")[BPRTY PE W "PATI ENT NAME", U,"Pt.ID", U ; I (BPR TYPE=1)!(B PRTYPE=4)  D  Q . W " ELIGIBILIT Y",U . W " RX#",U . W  "REF/ECME #",U . W " DATE",U .  W "VA INGR EDIENT COS T",U . W " VA DISPENS ING FEE",U  . W "$BIL LED",U . W  "INGREDIE NT COST PA ID",U . W  "DISPENSIN G FEE PAID ",U . W "P ATIENT RES P (INS)",U  . W "$INS  RESPONSE" ,U . W "$C OLLECT",U  . W "DRUG" ,U . W "ND C",U . W " RELEASED O N",U . W " FILL LOCAT ION",U . W  "FILL TYP E",U . W " STATUS",U  . I BPRTYP E=4 W "RX  COB",U . W  "REJECTED " . I BPRT YPE=1 W U, "BILL#",U, "RX COB" .  I BPRTYPE =4 W U,"RE VERSAL MET HOD",U,"RE TURN STATU S",U,"REAS ON" ; I BP RTYPE=2 D   Q . W "PA TIENT",U
  1807    . W "Pt.I D",U
  1808    . W "ELIG ",U . W "R X#",U . W  "REF/ECME# ",U . W "D ATE",U . W  "RELEASED ",U . W "L OCATION",U  . W "TYPE ",U . W "S TATUS",U .  W "COB",U  . W "OPEN /CLOSED",U  . W "CARD HOLD.ID",U  . W "GROU P ID",U .  W "VA ING.  COST",U .  W "VA DIS P. FEE",U  . W "$BILL ED",U . W  "QTY",U .  W "NDC#",U  . W "DRUG ",U . W "C LAIM ID",U  . W "PRES CRIBER ID" ,U
  1809    . W "PRES CRIBER",U
  1810    . W "REJE CT CODE(S) ",U . W "M ULT REJ",U
  1811    . W "REJE CT CODE",U
  1812    . W "REJE CT EXPLANA TION" ;
  1813   ...
  1814      
  1815  
  1816   The first  line of th e Excel Re port will  be modifie d to trunc ate the Di vision nam e to 12, a dd the BIN  after Ins urance, tr uncate the  Insurance  Name to 2 1, truncat e the Pati ent name t o 13, and  remove the  parenthes es before  and after  the L4SSN.
  1817   Subroutine  Name
  1818   WRLINE1^BP SRPT8
  1819   Enhancemen t Category
  1820    New
  1821    Modify
  1822    Delete
  1823    No Change
  1824   Story
  1825   US572
  1826   Related Me nu Options  or ListMa n Actions
  1827   BPS MENU R PT CLAIM S TATUS
  1828   Related Ro utines
  1829   This Subro utine is C alled By
  1830   This Subro utine Call s
  1831  
  1832   WRLINE1^BP SRPT5
  1833   $$DIVNAME^ BPSSCRDS,  $$PATNAME^ BPSRPT6, $ $SSN4^BPSR PT6, $$ELI GCODE^BPSS CR05, $$RX NUM^BPSRPT 6, $$ECMEN UM^BPSRPT1 , $$DATTIM E^BPSRPT1,  $$INGRCST ^BPSSCRLG,  $$DISPFEE ^BPSSCRLG,  $$PTRESP^ BPSSCRLG,  $$INSBIN^B PSRPT6
  1834   Related In tegration  Control Re gistration s (ICRs)
  1835   n/a
  1836   Data Passi ng
  1837    Parameter  Input
  1838    Parameter  Output
  1839    Function  Return Val ue
  1840    Global Mo dified
  1841   Input Attr ibute Name  and Defin ition
  1842   Name: BPRT YPE
  1843   Definition : report n umber (1-9 )
  1844    New       Modify       Delete       No Cha nge
  1845   Name: BPRE C
  1846   Definition
  1847    New       Modify       Delete       No Cha nge
  1848   Name: BPDI V
  1849   Definition : pharmacy  division
  1850    New       Modify       Delete       No Cha nge
  1851   Name: BPGR PLAN
  1852   Definition : insuranc e name
  1853    New       Modify       Delete       No Cha nge
  1854   Name: BPDF N
  1855   Definition : patient’ s ien
  1856    New       Modify       Delete       No Cha nge
  1857   Name: BPRX
  1858   Definition
  1859    New       Modify       Delete       No Cha nge
  1860   Name: BPRE F
  1861   Definition
  1862    New       Modify       Delete       No Cha nge
  1863   Name: BPX
  1864   Definition
  1865    New       Modify       Delete       No Cha nge
  1866   Name: BPSR TDT
  1867   Definition
  1868    New       Modify       Delete       No Cha nge
  1869   Name: BPBI L
  1870   Definition : billed a mount
  1871    New       Modify       Delete       No Cha nge
  1872   Name: BPIN S
  1873   Definition
  1874    New       Modify       Delete       No Cha nge
  1875   Name: BPCO LL
  1876   Definition
  1877    New       Modify       Delete       No Cha nge
  1878   Name: BPPS EQ
  1879   Definition
  1880    New       Modify       Delete       No Cha nge
  1881   Output Att ribute Nam e and Defi nition
  1882   Name: n/a
  1883   Definition
  1884    New       Modify       Delete       No Cha nge
  1885   Current Lo gic
  1886  
  1887    ;Routine  to Display  the Repor ts in Exce l ; ;Print  Report Li ne 1 ; ; I nput Varia ble -> BPR TYPE,BPDIV ,BPGRPLAN, BPDFN,BPRX ,BPREF,BPX ,BPSRTDT ;  BPBIL,BPI NS,BPCOLL  ; WRLINE1( BPRTYPE,BP REC,BPDIV, BPGRPLAN,B PDFN,BPRX, BPREF,BPX, BPSRTDT,BP BIL,BPINS, BPCOLL,BPP SEQ) ; ; N  BP59,BP02 ,BP03 S BP 59=$P(BPX, U,3) S BP0 2=+$P($G(^ BPST(BP59, 0)),U,4) S  BP03=+$P( $G(^BPST(B P59,0)),U, 5) ;Divisi on S BPREC =$S(BPDIV= 0:"BLANK", $$DIVNAME^ BPSSCRDS(B PDIV)]"":$ $DIVNAME^B PSSCRDS(BP DIV),1:BPD IV)_U ;Ins urance I B PRTYPE'=5, BPRTYPE'=6  S BPREC=B PREC_$E(BP GRPLAN,1,9 0)_U S BPR EC=BPREC_$ $PATNAME^B PSRPT6(BPD FN)_U  ;Pa tient Name  S BPREC=B PREC_"("_$ $SSN4^BPSR PT6(BPDFN) _")"_U ;L4 SSN
  1888   ...
  1889   Modified L ogic (Chan ges are hi ghlighted)
  1890  
  1891    ;Routine  to Display  the Repor ts in Exce l ; ;Print  Report Li ne 1 ; ; I nput Varia ble -> BPR TYPE,BPDIV ,BPGRPLAN, BPDFN,BPRX ,BPREF,BPX ,BPSRTDT ;  BPBIL,BPI NS,BPCOLL  ; WRLINE1( BPRTYPE,BP REC,BPDIV, BPGRPLAN,B PDFN,BPRX, BPREF,BPX, BPSRTDT,BP BIL,BPINS, BPCOLL,BPP SEQ) ; ; N  BP59,BP02 ,BP03 S BP 59=$P(BPX, U,3) S BP0 2=+$P($G(^ BPST(BP59, 0)),U,4) S  BP03=+$P( $G(^BPST(B P59,0)),U, 5) ;Divisi on I (",2, ")’[BPRTYP E S BPREC= $S(BPDIV=0 :"BLANK",$ $DIVNAME^B PSSCRDS(BP DIV)]"":$$ DIVNAME^BP SSCRDS(BPD IV),1:BPDI V)_U
  1892    I (",2,") [BPRTYPE S  BPREC=$S( BPDIV=0:"B LANK",$$DI VNAME^BPSS CRDS(BPDIV )]"":$E($$ DIVNAME^BP SSCRDS(BPD IV),1,12), 1:$E(BPDIV 1,12)_U
  1893    ; ;Insura nce
  1894    I BPRTYPE '=5,BPRTYP E'=6,BPRTY PE’=2 S BP REC=BPREC_ $E(BPGRPLA N,1,90)_U
  1895    ; I (",2, ")[BPRTYPE  D
  1896    . S BPREC =BPREC_$E( BPGRPLAN,1 ,21)_U ;In surance
  1897    . S BPREC =BPREC_$$I NSBIN^BPSR PT6(BP59)_ U ;BIN
  1898    . S BPREC =BPREC_$E( $$PATNAME^ BPSRPT6(BP DFN),1,13) _U  ;Patie nt Name
  1899    . S BPREC =BPREC_"(" _$$SSN4^BP SRPT6(BPDF N)_")"_U ; L4SSN ;
  1900    I (",2,") ’[BPRTYPE  D
  1901    . S BPREC =BPREC_$$P ATNAME^BPS RPT6(BPDFN )_U  ;Pati ent Name
  1902    . S BPREC =BPREC_"(" _$$SSN4^BP SRPT6(BPDF N)_")"_U ; L4SSN ; ..
  1903     
  1904  
  1905   The second  line of t he Excel r eport will  be modifi ed to remo ve the Car dholder ID  and limit  the Drug  name to 15  character s.
  1906   Subroutine  Name
  1907   WRLINE2^BP SRPT8
  1908   Enhancemen t Category
  1909    New
  1910    Modify
  1911    Delete
  1912    No Change
  1913   Story
  1914   US572
  1915   Related Me nu Options  or ListMa n Actions
  1916   BPS MENU R PT CLAIM S TATUS
  1917   Related Ro utines
  1918   This Subro utine is C alled By
  1919   This Subro utine Call s
  1920  
  1921   WRLINE2^BP SRPT5
  1922   $$DRGNAM^B PSRPT6, $$ DATTIME^BP SRPT1, $$M WC^BPSRPT6 , $$RTBCKN AM^BPSRPT1 , $$RXSTAT US^BPSRPT6 , $$RXCOB,  $$BILL^BP SRPT6, $$C RDHLDID^BP SRPT2, $$G RPID^BPSRP T2, $$INGR CST^BPSSCR LG, $$DISP FEE^BPSSCR LG, $$QTY^ BPSRPT6, $ $GETNDC^BP SRPT6, $$D RGNAM^BPSR PT6, $$ELA PSE^BPSRPT 6, $$CLSBY ^BPSRPT6,  $$CLOSEDT^ BPSRPT2, $ $CLRSN^BPS RPT6, $$GE T1^DIQ
  1923   Related In tegration  Control Re gistration s (ICRs)
  1924   n/a
  1925   Data Passi ng
  1926    Parameter  Input
  1927    Parameter  Output
  1928    Function  Return Val ue
  1929    Global Mo dified
  1930   Input Attr ibute Name  and Defin ition
  1931   Name: BPRT YPE
  1932   Definition : report n umber (1-9 )
  1933    New       Modify       Delete       No Cha nge
  1934   Name: BPRE C
  1935   Definition
  1936    New       Modify       Delete       No Cha nge
  1937   Name: BPX
  1938   Definition
  1939    New       Modify       Delete       No Cha nge
  1940   Name: BPRX
  1941   Definition
  1942    New       Modify       Delete       No Cha nge
  1943   Name: BPRE F
  1944   Definition
  1945    New       Modify       Delete       No Cha nge
  1946   Name: BPBI L
  1947   Definition : billed a mount
  1948    New       Modify       Delete       No Cha nge
  1949   Name: BPGR PLAN
  1950   Definition : insuranc e name
  1951    New       Modify       Delete       No Cha nge
  1952   Name: BPPS EQ
  1953   Definition
  1954    New       Modify       Delete       No Cha nge
  1955   Output Att ribute Nam e and Defi nition
  1956   Name: n/a
  1957   Definition
  1958    New       Modify       Delete       No Cha nge
  1959   Current Lo gic
  1960  
  1961    ;Print Re port Line  2 ; ; Inpu t Variable  -> BPRTYP E,BPX,BPRX ,BPREF,BPB IL,BPGRPLA N ; WRLINE 2(BPRTYPE, BPREC,BPX, BPRX,BPREF ,BPBIL,BPG RPLAN,BPPS EQ) ; N BP 59,BP02 S  BP59=$P(BP X,U,3) S B P02=+$P($G (^BPST(BP5 9,0)),U,4)  ; I (BPRT YPE=1)!(BP RTYPE=4) D   Q . ;Dru g, Release d On . S B PREC=BPREC _$$DRGNAM^ BPSRPT6($P (BPX,U,14) ,32)_U_$TR ($$GETNDC^ BPSRPT6(BP RX,BPREF), "-")_U . S  BPREC=BPR EC_$$DATTI M^BPSRPT1( +BPX)_U .  ;RX INFO .  S BPREC=B PREC_$$MWC ^BPSRPT6(B PRX,BPREF) _U ;Fill L ocation .  S BPREC=BP REC_$$RTBC KNAM^BPSRP T1($$RTBCK ^BPSRPT1($ P(BPX,U,3) ))_U ;Fill  Type . S  BPREC=BPRE C_$$RXSTAT US^BPSRPT6 ($P(BPX,U, 3)) ;Statu s . S BPRE C=BPREC_$S ($P(BPX,U) :"/R",1:"/ N")_U ;RL/ NR . I BPR TYPE=4 S B PREC=BPREC _$$RXCOB($ G(BPPSEQ)) _U . S BPR EC=BPREC_$ S($P(BPX,U ,13):"REJ" ,1:"") . I  BPRTYPE=1  S BPREC=B PREC_U_$$B ILL^BPSRPT 6(BPRX,BPR EF,BPPSEQ) _U_$$RXCOB ($G(BPPSEQ )) ;Bill #  and RX CO B ; I BPRT YPE=2 D  Q  . S BPREC =BPREC_$E( $$CRDHLDID ^BPSRPT2(+ $P(BPX,U,3 )),3,23)_U  ;Cardhold er ID . S  BPREC=BPRE C_$E($$GRP ID^BPSRPT2 (+$P(BPX,U ,3)),3,10) _U ;Group  ID . S BPR EC=BPREC_$ $INGRCST^B PSSCRLG(BP 02)_U  ;In gredient C ost . S BP REC=BPREC_ $$DISPFEE^ BPSSCRLG(B P02)_U  ;D ispensing  Fee . S BP REC=BPREC_ $TR($J(BPB IL,10,2),"  ")_U ;$Bi lled . S B PREC=BPREC _$$QTY^BPS RPT6($P(BP X,U,3))_U  ;Qty . S B PREC=BPREC _$$GETNDC^ BPSRPT6(BP RX,BPREF)_ U ;NDC# .  S BPREC=BP REC_$$DRGN AM^BPSRPT6 ($P(BPX,U, 14),32)_U  ;Drug ;
  1962  
  1963   ...
  1964   Modified L ogic (Chan ges are hi ghlighted)
  1965  
  1966    ;Print Re port Line  2 ; ; Inpu t Variable  -> BPRTYP E,BPX,BPRX ,BPREF,BPB IL,BPGRPLA N ; WRLINE 2(BPRTYPE, BPREC,BPX, BPRX,BPREF ,BPBIL,BPG RPLAN,BPPS EQ) ; N BP 59,BP02 S  BP59=$P(BP X,U,3) S B P02=+$P($G (^BPST(BP5 9,0)),U,4)  ; I (BPRT YPE=1)!(BP RTYPE=4) D   Q . ;Dru g, Release d On . S B PREC=BPREC _$$DRGNAM^ BPSRPT6($P (BPX,U,14) ,32)_U_$TR ($$GETNDC^ BPSRPT6(BP RX,BPREF), "-")_U . S  BPREC=BPR EC_$$DATTI M^BPSRPT1( +BPX)_U .  ;RX INFO .  S BPREC=B PREC_$$MWC ^BPSRPT6(B PRX,BPREF) _U ;Fill L ocation .  S BPREC=BP REC_$$RTBC KNAM^BPSRP T1($$RTBCK ^BPSRPT1($ P(BPX,U,3) ))_U ;Fill  Type . S  BPREC=BPRE C_$$RXSTAT US^BPSRPT6 ($P(BPX,U, 3)) ;Statu s . S BPRE C=BPREC_$S ($P(BPX,U) :"/R",1:"/ N")_U ;RL/ NR . I BPR TYPE=4 S B PREC=BPREC _$$RXCOB($ G(BPPSEQ)) _U . S BPR EC=BPREC_$ S($P(BPX,U ,13):"REJ" ,1:"") . I  BPRTYPE=1  S BPREC=B PREC_U_$$B ILL^BPSRPT 6(BPRX,BPR EF,BPPSEQ) _U_$$RXCOB ($G(BPPSEQ )) ;Bill #  and RX CO B ; I BPRT YPE=2 D  Q  . S BPREC =BPREC_$E( $$CRDHLDID ^BPSRPT2(+ $P(BPX,U,3 )),3,23)_U  ;Cardhold er ID . S  BPREC=BPRE C_$E($$GRP ID^BPSRPT2 (+$P(BPX,U ,3)),3,10) _U ;Group  ID . S BPR EC=BPREC_$ $INGRCST^B PSSCRLG(BP 02)_U  ;In gredient C ost . S BP REC=BPREC_ $$DISPFEE^ BPSSCRLG(B P02)_U  ;D ispensing  Fee . S BP REC=BPREC_ $TR($J(BPB IL,10,2),"  ")_U ;$Bi lled . S B PREC=BPREC _$$QTY^BPS RPT6($P(BP X,U,3))_U  ;Qty . S B PREC=BPREC _$$GETNDC^ BPSRPT6(BP RX,BPREF)_ U ;NDC# .  S BPREC=BP REC_$E($$D RGNAM^BPSR PT6($P(BPX ,U,14),32) ,1,15)_U ; Drug ;
  1967   ...
  1968      
  1969  
  1970   The third  line of th e Excel re port will  be modifie d to remov e the Clai m ID and r eplace it  with the P rescriber  ID and Nam e, and the  Reject Co de(s) will  be change d to retur n a ‘Y’ if  there is  more than  one reject  code, oth erwise ret urn ‘N’.
  1971   Subroutine  Name
  1972   WRLINE3^BP SRPT8
  1973   Enhancemen t Category
  1974    New
  1975    Modify
  1976    Delete
  1977    No Change
  1978   Story
  1979   US572
  1980   Related Me nu Options  or ListMa n Actions
  1981   BPS MENU R PT CLAIM S TATUS
  1982   Related Ro utines
  1983   This Subro utine is C alled By
  1984   This Subro utine Call s
  1985  
  1986   WRLINE3^BP SRPT5
  1987   $$CLAIMID^ BPSRPT2, $ $REJTEXT^B PSRPT2, $$ AUTOREV^BP SRPT1, $$R VSRSN^BPSR PT7, $$PRI CEVAL^BPSR PT5, $$PRE SCIN^BPSRP T6
  1988   Related In tegration  Control Re gistration s (ICRs)
  1989   n/a
  1990   Data Passi ng
  1991    Parameter  Input
  1992    Parameter  Output
  1993    Function  Return Val ue
  1994    Global Mo dified
  1995   Input Attr ibute Name  and Defin ition
  1996   Name: BPRT YPE
  1997   Definition : report n umber (1-9 )
  1998    New       Modify       Delete       No Cha nge
  1999   Name: BPRE C
  2000   Definition : excel st ring that  will print  to the re port
  2001    New       Modify       Delete       No Cha nge
  2002   Name: BPX
  2003   Definition : info rel ated to a  specific B PS TRANSAC TION
  2004    New       Modify       Delete       No Cha nge
  2005   Output Att ribute Nam e and Defi nition
  2006   Name: n/a
  2007   Definition
  2008    New       Modify       Delete       No Cha nge
  2009   Current Lo gic
  2010  
  2011    ;Print Re port Line  3 ; ; Inpu t Variable  -> BPRTYP E,BPX ; WR LINE3(BPRT YPE,BPREC, BPX) N BP5 9,BPSARR,B PRJCNT,BPZ Z,BPRICE S  BP59=+$P( BPX,U,3) ;  I (",2,7, ")[BPRTYPE  D  Q .S B PREC=BPREC _$$CLAIMID ^BPSRPT2(B P59)_U ;Cl aim ID .S  BPRJCNT=$$ REJTEXT^BP SRPT2(BP59 ,.BPSARR)  .F BPZZ=1: 1:BPRJCNT  S:BPZZ'=1  BPREC=BPRE C_"," S BP REC=BPREC_ $P(BPSARR( BPZZ),":")  .; .;Writ e one reco rd per rej ect/close  code .S:+B PRJCNT=0 B PRJCNT=1 . F BPZZ=1:1 :BPRJCNT W  !,$G(BPRE C),U,$P($G (BPSARR(BP ZZ)),":"), U,$P($G(BP SARR(BPZZ) ),":",2) ;  I BPRTYPE =4 D . ;Me thod . I $ $AUTOREV^B PSRPT1(BP5 9) S BPREC =BPREC_U_" AUTO"_U .  E  S BPREC =BPREC_U_" REGULAR"_U  . ;Return  Status .  I $P(BPX,U ,15)["ACCE PTED" S BP REC=BPREC_ "ACCEPTED" _U . E  S  BPREC=BPRE C_"REJECTE D"_U . ;Re ason . S B PREC=BPREC _$$RVSRSN^ BPSRPT7(+$ P(BPX,U,3) ) ; I BPRT YPE=8 D .  S BPRICE=$ $PRICEVAL^ BPSRPT5(BP 59) . S BP REC=BPREC_ $P($G(BPRI CE),U,3)_U  . S BPREC =BPREC_$P( $G(BPRICE) ,U,4)_U .  S BPREC=BP REC_$P($G( BPRICE),U, 5)_U . S B PREC=BPREC _$P($G(BPR ICE),U,6)_ U . S BPRE C=BPREC_$P ($G(BPRICE ),U,7)_U .  S BPREC=B PREC_$P($G (BPRICE),U ,2)_U . S  BPREC=BPRE C_$P($G(BP RICE),U,1) _U ;Write  the record  W !,$G(BP REC) Q
  2012   Modified L ogic (Chan ges are hi ghlighted)
  2013  
  2014    ;Print Re port Line  3 ; ; Inpu t Variable  -> BPRTYP E,BPX ; WR LINE3(BPRT YPE,BPREC, BPX) ;
  2015    N BP59,BP SARR,BPRJC NT,BPRJEXP ,BPZZ,BPRI CE S BP59= +$P(BPX,U, 3) ; I (", 2,7,")[BPR TYPE D  Q  .S BPREC=B PREC_$$CLA IMID^BPSRP T2(BP59)_U  ;Claim ID  .S BPRJCN T=$$REJTEX T^BPSRPT2( BP59,.BPSA RR) .F BPZ Z=1:1:BPRJ CNT S:BPZZ '=1 BPREC= BPREC_","  S BPREC=BP REC_$P(BPS ARR(BPZZ), ":")
  2016    .;Write o ne record  per reject /close cod e .S:+BPRJ CNT=0 BPRJ CNT=1 .F B PZZ=1:1:BP RJCNT W !, $G(BPREC), U,$P($G(BP SARR(BPZZ) ),":"),U,$ P($G(BPSAR R(BPZZ))," :",2) .;
  2017    I (",2,") [BPRTYPE D   Q .S BPR EC=BPREC_$ $CLAIMID^B PSRPT2(BP5 9)_U ;Clai m ID
  2018    . S BPREC =BPREC_$P( $$PRESCIN^ BPSRPT6($P (BPX,U,3)) ,U)_U ;Pre scriber ID
  2019    . S BPREC =BPREC_$E( $P($$PRESC IN^BPSRPT6 ($P(BPX,U, 3)),U,2),1 ,13)_U ;Pr escriber N ame (trunc ated to 13 ) . S BPRJ CNT=$$REJT EXT^BPSRPT 2(BP59,.BP SARR) .F B PZZ=1:1:BP RJCNT S:BP ZZ'=1 BPRE C=BPREC_", " S BPREC= BPREC_$S(B PRJCNT>1:" Y",1:"N")$ P(BPSARR(B PZZ),":")  . ;Write o ne record  per reject /close cod e . S:+BPR JCNT=0 BPR JCNT=1 . F  BPZZ=1:1: BPRJCNT S  BPREC2=""  D . . S BP REC2=$G(BP REC)_U_$P( $G(BPSARR( BPZZ)),":" )_U_$P($G( BPSARR(BPZ Z)),":",2)  W !,$E(BP REC2,1,255 ) ; I BPRT YPE=4 D .  ;Method .  I $$AUTORE V^BPSRPT1( BP59) S BP REC=BPREC_ U_"AUTO"_U  . E  S BP REC=BPREC_ U_"REGULAR "_U . ;Ret urn Status  . I $P(BP X,U,15)["A CCEPTED" S  BPREC=BPR EC_"ACCEPT ED"_U . E   S BPREC=B PREC_"REJE CTED"_U .  ;Reason .  S BPREC=BP REC_$$RVSR SN^BPSRPT7 (+$P(BPX,U ,3)) ; I B PRTYPE=8 D  . S BPRIC E=$$PRICEV AL^BPSRPT5 (BP59) . S  BPREC=BPR EC_$P($G(B PRICE),U,3 )_U . S BP REC=BPREC_ $P($G(BPRI CE),U,4)_U  . S BPREC =BPREC_$P( $G(BPRICE) ,U,5)_U .  S BPREC=BP REC_$P($G( BPRICE),U, 6)_U . S B PREC=BPREC _$P($G(BPR ICE),U,7)_ U . S BPRE C=BPREC_$P ($G(BPRICE ),U,2)_U .  S BPREC=B PREC_$P($G (BPRICE),U ,1)_U ;Wri te the rec ord W !,$G (BPREC)
  2020    Q
  2021      
  2022  
  2023   A new subr outine wil l be creat ed that re turns the  Insurance  Bin.
  2024   Subroutine  Name
  2025   INSBIN^BPS RPT6
  2026   Enhancemen t Category
  2027    New
  2028    Modify
  2029    Delete
  2030    No Change
  2031   Story
  2032   US572
  2033   Related Me nu Options  or ListMa n Actions
  2034   BPS MENU R PT CLAIM S TATUS
  2035   Related Ro utines
  2036   This Subro utine is C alled By
  2037   This Subro utine Call s
  2038  
  2039   WRLINE1^BP SRPT8
  2040   $$GET1^DIQ
  2041   Related In tegration  Control Re gistration s (ICRs)
  2042   n/a
  2043   Data Passi ng
  2044    Parameter  Input
  2045    Parameter  Output
  2046    Function  Return Val ue
  2047    Global Mo dified
  2048   Input Attr ibute Name  and Defin ition
  2049   Name: BP59
  2050   Definition : ptr to B PS TRANS-P ATIENT INS URANCE MUL TIPLE (#90 02313.5990 2)
  2051    New       Modify       Delete       No Cha nge
  2052   Name: BPGR PLAN
  2053   Definition : Insuranc e Name
  2054    New       Modify       Delete       No Cha nge
  2055   Output Att ribute Nam e and Defi nition
  2056   Name: $$IN SBIN
  2057   Definition : Insuranc e BIN numb er
  2058    New       Modify       Delete       No Cha nge
  2059   Current Lo gic
  2060  
  2061   n/a – new  subroutine
  2062  
  2063   Modified L ogic (Chan ges are hi ghlighted)
  2064  
  2065    ;Get Insu rance BIN  ; ; Input  variable - > BP59 - p tr to BPS  TRANS-PATI ENT INSURA NCE MULTIP LE (#90023 13.59902)  ; Returned  value ->  BIN ;
  2066   INSBIN(BP5 9) ; N BPS BIN,BPSCIE N ;
  2067    S BPSBIN= "" ; Get C laim IEN f rom BPS TR ANS S BPSC IEN=$$GET1 ^DIQ(90023 13.59,BP59 ,3.1) ; Ge t BIN from  BPS CLAIM S (#900231 3.02) S BP SBIN=$$GET 1^DIQ(9002 313.02,BPS CIEN,101)
  2068    ;
  2069    Q BPSBIN
  2070    
  2071  
  2072   A new subr outine wil l be creat ed that re turns the  Prescriber  ID and Pr escriber N ame. 
  2073   Subroutine  Name
  2074   PRESCIN^BP SRPT6
  2075   Enhancemen t Category
  2076    New
  2077    Modify
  2078    Delete
  2079    No Change
  2080   Story
  2081   US572
  2082   Related Me nu Options  or ListMa n Actions
  2083   n/a
  2084   Related Ro utines
  2085   This Subro utine is C alled By
  2086   This Subro utine Call s
  2087  
  2088   WRLINE2^BP SRPT3
  2089   $$GET1^DIQ
  2090   Related In tegration  Control Re gistration s (ICRs)
  2091   n/a
  2092   Data Passi ng
  2093    Parameter  Input
  2094    Parameter  Output
  2095    Function  Return Val ue
  2096    Global Mo dified
  2097   Input Attr ibute Name  and Defin ition
  2098   Name: BPS5 9
  2099   Definition : ptr to B PS TRANSAC TIONS (#90 02323.59)
  2100    New       Modify       Delete       No Cha nge
  2101   Output Att ribute Nam e and Defi nition
  2102   Name: $$PR ESCIN
  2103   Definition : Prescrib er ID “^”  Prescriber  Name 
  2104    New       Modify       Delete       No Cha nge 
  2105   Current Lo gic
  2106  
  2107   n/a – new  subroutine
  2108  
  2109   Modified L ogic (Chan ges are hi ghlighted)
  2110  
  2111    ;Get Pres criber ID  and Name ;  ; Input v ariable ->  BP59 - pt r to BPS T RANSACTION S (#900231 3.59) ; Re turned val ue -> Pres criber ID  ^ Prescrib er Name ;  PRESCIN(BP 59) ; N BP SIEN,BPSPI D,BPSPNM,B PSRX ;
  2112    S BPSRX=$ $GET1^DIQ( 9002313.59 ,BP59,1.11 ,"I")
  2113    S BPSIEN= $$GET1^DIQ (52,BPSRX, 4,"I")
  2114    S BPSPNM= $$GET1^DIQ (200,BPSIE N,.01)
  2115    S BPSPID= $$GET1^DIQ (200,BPSIE N,41.99)
  2116    ; Q BPSPI D_"^"_BPSP NM
  2117      
  2118  
  2119   Modify the  instructi ons for ca pturing to  Excel.
  2120   Subroutine  Name
  2121   EXMSG^BPSR PT4
  2122   Enhancemen t Category
  2123    New
  2124    Modify
  2125    Delete
  2126    No Change
  2127   Story
  2128   US572
  2129   Related Me nu Options  or ListMa n Actions
  2130   BPS MENU R PT CLAIM S TATUS
  2131   Related Ro utines
  2132   This Subro utine is C alled By
  2133   This Subro utine Call s
  2134  
  2135   SELEXCEL^B PSRPT4
  2136   none
  2137   Related In tegration  Control Re gistration s (ICRs)
  2138   n/a
  2139   Data Passi ng
  2140    Parameter  Input
  2141    Parameter  Output
  2142    Function  Return Val ue
  2143    Global Mo dified
  2144   Input Attr ibute Name  and Defin ition
  2145   Name: n/a
  2146   Definition
  2147    New       Modify       Delete       No Cha nge
  2148   Output Att ribute Nam e and Defi nition
  2149   Name: n/a
  2150   Definition
  2151    New       Modify       Delete       No Cha nge
  2152   Current Lo gic
  2153  
  2154    ;Display  the messag e about ca pturing to  an Excel  file forma t ; EXMSG  ; W !!?5," Before con tinuing, p lease set  up your te rminal to  capture th e" W !?5," detail rep ort data.  On some te rminals, t his can be  done by"  W !?5,"cli cking on t he 'Tools'  menu abov e, then cl ick on 'Ca pture" W ! ?5,"Incomi ng Data' t o save to  Desktop. T his report  may take  a" W !?5," while to r un." W !!? 5,"Note: T o avoid un desired wr apping of  the data s aved to th e" W !?5,"  file, ple ase enter  '0;256;999 ' at the ' DEVICE:' p rompt.",!  Q
  2155  
  2156   Modified L ogic (Chan ges are hi ghlighted)
  2157    
  2158    ;Display  the messag e about ca pturing to  an Excel  file forma t ; EXMSG  ; I (",2," )’[BPRTYPE  D
  2159    . W !!?5, "Before co ntinuing,  please set  up your t erminal to  capture t he" . W !? 5,"detail  report dat a. On some  terminals , this can  be done b y" . W !?5 ,"clicking  on the 'T ools' menu  above, th en click o n 'Capture " . W !?5, "Incoming  Data' to s ave to Des ktop. This  report ma y take a"  . W !?5,"w hile to ru n." . W !! ?5,"Note:  To avoid u ndesired w rapping of  the data  saved to t he" . W !? 5,"      f ile, pleas e enter '0 ;256;999'  at the 'DE VICE:' pro mpt.",! E   D
  2160    . W !!?5, "Before co ntinuing,  please set  up your t erminal to  capture t he"
  2161    . W !?5," detail rep ort data a nd save th e detail r eport data  in a text  file"
  2162    . W !?5," to a local  drive. Th is report  may take a  while to  run."
  2163    . W !!?5, "Note: To  avoid unde sired wrap ping of th e data sav ed to the  file,"
  2164    . W !?5,"       plea se enter ' 0;256;9999 9' at the  'DEVICE:'  prompt.",!
  2165    Q
  2166  
  2167  
  2168  
  2169  
  2170   Back Out/R ollback Pr ocedure
  2171   This story  includes  modificati ons to exi sting rout ines.
  2172  
  2173   To back ou t this enh ancement,  all the ro utines lis ted above  under the  List of Co mponents s hould be b acked up p rior to in stallation . Revertin g to the p revious ve rsion of t hese routi nes would  back out t his enhanc ement. Alt ernatively , the prev ious versi on of thes e routines  could be  distribute d via an e mergency p atch.
  2174