12. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 9/6/2017 3:05:31 PM Eastern 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.

12.1 Files compared

# Location File Last Modified
1 MCCF EDI TAS BPS PSO PSX Bundle.zip\MCCF EDI TAS BPS PSO PSX Bundle TAS ePhm SDD US22 v1.02.docx Thu Jul 27 19:21:20 2017 UTC
2 MCCF EDI TAS BPS PSO PSX Bundle.zip\MCCF EDI TAS BPS PSO PSX Bundle TAS ePhm SDD US22 v1.02.docx Wed Sep 6 17:54:55 2017 UTC

12.2 Comparison summary

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

12.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

12.4 Active regular expressions

No regular expressions were active.

12.5 Comparison detail

  1   MCCF EDI T AS US22
  2   System Des ign Docume nt
  3  
  4  
  5  
  6  
  7  
  8   Department  of Vetera ns Affairs
  9   June 2017
  10   Version 1. 02
  11   User Story  Number: U SRX-186
  12   User Story  Name: 
  13   Product Ba cklog ID:  186
  14   Backlog Pr iority: Hi gh
  15   Initial Si zing Estim ate: 
  16   Rational I D: tbd
  17   Rally ID:  US22
  18  
  19   Design – S ummary
  20   Overview o f the CMOP  process a s it perta ins to thi s story:
  21  
  22   When the n ightly CMO P batch pr ocess runs , the CMOP  system (P SX) loops  through al l the pres criptions  in the que ue. The ba tch calls  Outpatient  Pharmacy  (specifica lly ECMESN D^PSOBPSU1 ) to send  a claim fo r each bil lable pres cription.  After it h as gone th rough the  entire que ue, the CM OP process  waits for  15 second s for each  claim sen t, waiting  a maximum  of two ho urs. After  waiting,  if the sta tus of a p rescriptio n’s claim  is still “ IN PROGRES S” (meanin g a respon se has not  yet been  received f or that cl aim), then  the CMOP  process pu ts that pr escription  back in t he suspens e queue. T he CMOP pr ocess then  sends to  the CMOP f acility a  batch of p rescriptio ns to be f illed.
  23  
  24   Background  of the pr oblem this  story is  seeking to  remedy:
  25  
  26   During the  CMOP proc ess, TRICA RE/CHAMPVA  prescript ions are s ometimes b eing left  in the sus pense queu e due to t he claims  having a s tatus of “ IN PROGRES S”. The cl aim submis sion proce ss current ly does th e followin g:
  27   An email i s sent to  users indi cating tha t a specif ic Rx/Fill , “could n ot be fill ed because  of a dela y in proce ssing the  third-part y claim.”  (See BULL1 ^BPSNCPD1. )
  28   An entry i s added to  the presc ription’s  Activity L og sub-fil e stating,  “Rx place d on Suspe nse due to  ECME IN P ROGRESS st atus”. (Se e TACT^PSO REJU3.)
  29   The CMOP p rocess cur rently doe s the foll owing:
  30   An email i s sent to  the users  listing al l prescrip tions that  were not  filled but  put back  on suspens e. (See MA IL^PSXBPSM S.)
  31   The prescr iption is  put back o n suspense  and is no t sent to  the CMOP f acility.
  32  
  33   These thin gs happen  at differe nt points  in the pro cess. In m ost instan ces, the p roblem occ urs becaus e somethin g is being  checked p rematurely . If a cla im is stil l “IN PROG RESS”, the  determina tion of wh ether to l eave the p rescriptio n in the s uspense qu eue should  not be ma de until a fter the C MOP proces s waits 15  seconds f or each cl aim sent.  There are  three chec ks happeni ng prior t o that poi nt.
  34  
  35   This desig n calls fo r:
  36   Modifying  a check in  the claim  submissio n process  to include  the BWHER E/FROM val ue of “PC” . This wil l prevent  the claim  submission  process f rom sendin g the emai l to the u sers.
  37   Quitting o ut of a pr ocedure ea rly if the  value of  BWHERE/FRO M is “PC”  and the EC ME status  is “IN PRO GRESS”. Th is will pr event the  claim subm ission pro cess from  adding an  entry to t he prescri ption’s Ac tivity Log .
  38   Modifying  a check in  the CMOP  process to  perform a dditional  checks on  a TRICARE/ CHAMPVA pr escription  only if t he ECME st atus is no t “IN PROG RESS”. Mod ifying thi s check wi ll result  in the CMO P process  not puttin g a prescr iption bac k on suspe nse inappr opriately.
  39   Modifying  the CMOP p rocess to  add an ent ry in the  Activity L og of a pr escription  if it is  being left  on suspen se due to  a status o f “IN PROG RESS” (sin ce the cre ation of t his Activi ty Log ent ry is bein g removed  from the c laim submi ssion proc ess).
  40  
  41   List of Co mponents:
  42   Routine: B PSNCPDP
  43   Routine: P SOREJU3
  44   Routine: P SXBPSMS
  45   Routine: P SXRPPL
  46   Routine: P SXRPPL1
  47   Routine: P SXRPPL2
  48  
  49   Design – D etail
  50  
  51   In END^BPS NCPDP, aft er the cla im has bee n created  and sent,  and after  it has wai ted the le ngth of ti me specifi ed by the  ECME TIMEO UT value,  if the cla im status  is still “ IN PROGRES S”, then t he system  conditiona lly sends  an email b ulletin to  communica te that th e Rx/Fill  could not  be filled  and has be en place o n suspense  due to a  delay in p rocessing  the third  party clai m. At this  point in  the proces s, it does  not put t he Rx/Fill  on suspen se; it sim ply sends  the email  if certain  condition s are met.
  52  
  53   The system  currently  does not  send that  email bull etin if th e BWHERE/F ROM variab le is “CRL B”, “CRLR” , “CRLX”,  “CRRL”, or  “RRL”. Th is enhance ment calls  for addin g to that  list the v alue “PC”  (Pull CMOP S). This i s the valu e of BWHER E/FROM whe n the clai m submissi on process  in ECME/B PS is call ed from CM OP/PSX, in cluding th e nightly  CMOP trans mission ru n and the  user selec ting the C MOP pull f rom suspen se.
  54  
  55   If the val ue of “PC”  is added  to the lis t of possi ble BWHERE /FROM valu es describ ed above,  then the s ystem will  not call  BULL^BPSNC PD1 when C MOP proces sing is pe rformed, a nd it will  not send  the email  bulletin.  The CMOP p rocess its elf will c ontinue to  check for  any claim s that are  still “IN  PROGRESS” , as it do es now, bu t that che ck will no t happen u ntil all t he prescri ptions hav e been sen t and the  process ha s waited a n addition al 15 seco nds for ev ery claim  sent, wait ing up to  two hours.  (The send ing of cla ims is in  SBTEMCE^PS XRPPL1, an d the wait ing is in  SDT^PSXRPP L.)
  56  
  57   Subroutine  Name
  58   EN^BPSNCPD P
  59   Enhancemen t Category
  60    New
  61    Modify
  62    Delete
  63    No Change
  64   Story
  65   US22
  66   Related Me nu Options  or ListMa n Actions
  67   Pull Early  from Susp ense [PSO  PNDRX]
  68   Print from  Suspense  File [PSO  PNDLBL]
  69   Related Ro utines
  70   This Subro utine is C alled By
  71   This Subro utine Call s
  72  
  73   REVERSE^BP SBCKJ, REQ ST99^BPSOS RX5, SUBMC LM^BPSPRRX 2, DOSELCT D^BPSRES,  RESUBMIT^B PSSCRRS, R EVERSE^BPS SCRRV, SUB MIT^IBNCPD PU, ECMESN D^PSOBPSU1 , REVERSE^ PSOBPSU1
  74   CLOSE2^BPS BUTL, BULL ^BPSNCPD1,  $$STTM^BP SNCPD4, DI SPL^BPSNCP D4, $$SCHR EQ^BPSNCPD 5, BB^BPSN CPD6, NEWC LAIM^BPSNC PD6, RSPAI D^BPSNCPD6 , RVNEW^BP SNCPD6, RV NPAID^BPSN CPD6, RVPA ID^BPSNCPD 6, RVRSNPD ^BPSNCPD6,  RVRSPAID^ BPSNCPD6,  LOG^BPSOSL , $$IEN59^ BPSOSRX, $ $LOCKRF^BP SOSRX, $$S TATUS^BPSO SRX, UNLCK RF^BPSOSRX , $$ACTTYP E^BPSOSRX5 , $$PAYABL E^BPSOSRX5 , $$CHKREQ ST^BPSOSRX 7, $$CHCKP AR^BPSOSRX 8, $$GETSI TE^BPSOSRX 8, $$PRINT SCR^BPSOSR X8, $$FIND ECLM^BPSPR RX5, $$SEC DATA^BPSPR RX6, $$DOS DATE^BPSSC RRS, $$RXA PI1^BPSUTI L1, $$CLMI NFO^BPSUTI L2, $$GET1 ^DIQ, $$GE TNDC^PSOND CUT, $$DT^ XLFDT, $$P ROD^XUPROD
  75   Related In tegration  Control Re gistration s (ICRs)
  76   Reference  to $$PROD^ XUPROD sup ported by  DBIA 4440
  77   Reference  to $$GETND C^PSONDCUT  supported  by DBIA 4 705
  78   Reference  to Patient  file (#2)  supported  by DBIA 1 0035
  79   Data Passi ng
  80    Parameter  Input
  81    Parameter  Output
  82    Function  Return Val ue
  83    Global Mo dified
  84   Input Attr ibute Name  and Defin ition
  85   Name: BRXI EN
  86   Definition : Prescrip tion IEN
  87    New       Modify       Delete       No Cha nge
  88   Name: BFIL L
  89   Definition : Fill num ber
  90    New       Modify       Delete       No Cha nge
  91   Name: DOS
  92   Definition : Date of  service
  93    New       Modify       Delete       No Cha nge
  94   Name: BWHE RE
  95   Definition : User or  system act ion initia ting this  claim proc ess
  96    New       Modify       Delete       No Cha nge
  97   Name: BILL NDC
  98   Definition : Valid ND C
  99    New       Modify       Delete       No Cha nge
  100   Name: REVR EAS
  101   Definition : Reversal  reason
  102    New       Modify       Delete       No Cha nge
  103   Name: DURR EC
  104   Definition : String o f up to th ree sets o f DUR info
  105   Reason for  Service C ode ^ Prof . Srvc. Co de ^ Resul t of Srvc.  Code
  106   Each set i s delimite d by “~”
  107    New       Modify       Delete       No Cha nge
  108   Name: BPOV RIEN
  109   Definition : Point to  BPS NCPDP  OVERRIDE  file, if o verrides e ntered
  110    New       Modify       Delete       No Cha nge
  111   Name: BPSC LARF
  112   Definition : Submissi on clarifi cation cod e entered  by pharmac ist
  113    New       Modify       Delete       No Cha nge
  114   Name: BPSA UTH
  115   Definition : Prior au thorizatio n code
  116    New       Modify       Delete       No Cha nge
  117   Name: BPCO BIND
  118   Definition : COB indi cator
  119    New       Modify       Delete       No Cha nge
  120   Name: BPJO BFLG
  121   Definition : “F” if i n foregrou nd, “B” if  in backgr ound
  122    New       Modify       Delete       No Cha nge
  123   Name: BPRE QIEN
  124   Definition : BPS Requ est
  125    New       Modify       Delete       No Cha nge
  126   Name: BPSC LOSE
  127   Definition : Array po pulated on ly if clai m should b e closed a fter rever sal
  128    New       Modify       Delete       No Cha nge
  129   Name: BPSP LAN
  130   Definition : Pointer  to GROUP I NSURANCE P LAN file
  131    New       Modify       Delete       No Cha nge
  132   Name: BPSP RDAT
  133   Definition : Array of  primary c laim data  needed for  submittin g a second ary claim
  134    New       Modify       Delete       No Cha nge
  135   Name: BPSR TYPE
  136   Definition : Rate typ e
  137    New       Modify       Delete       No Cha nge
  138   Name: BPSD ELAY
  139   Definition : Delay re ason code
  140    New       Modify       Delete       No Cha nge
  141   Output Att ribute Nam e and Defi nition
  142   Name: $$EN
  143   Definition : RESPONSE  ^ MESSAGE  ^ ELIGIBI LITY ^ CLA IMSTATUS ^  COB ^ RXC OB ^ INSUR ANCE
  144   RESPONSE
  145     0  Submi tted throu gh ECME
  146     1  No su bmission t hrough ECM E
  147     2  IB no t billable
  148     3  Claim  was close d, not sub mitted (RT S/Deletes)
  149     4  Unabl e to queue  claim
  150     5  Incor rect infor mation sup plied to E CME
  151     6  Inact ive ECME -  Primarily  used for  TRICARE/CH AMPVA to s ay ok to p rocess rx
  152    10 Revers al but no  resubmit
  153  
  154   MESSAGE =  Message as sociated w ith the re sponse (er ror/submit ted)
  155   ELIGIBILIT Y = V - Ve teran, T -  TRICARE,  C - CHAMPV A
  156   CLAIMSTATU S = claim  status (nu ll or IN P ROGRESS/E  PAYABLE/et c...)
  157   COB  = Coo rdination  Of Benefit  indicator  of the in surance as  it is sto red in the  PATIENT f ile: 1-pri mary, 2-se condary, 3 -tertiary
  158   RXCOB =  t he payer s equence in dicator of  the claim  which was  sent to t he payer a s a result  of this c all: 1-pri mary, 2-se condary)
  159   INSURANCE  = Name of  the insura nce compan y that was  billed as  a result  of this ca ll
  160    New       Modify       Delete       No Cha nge
  161   Current Lo gic
  162  
  163   BPSNCPDP ; BHAM ISC/L JE/SS - AP I to submi t a claim  to ECME ;1 1/7/07  16 :58
  164            ; ;1.0;E CLA IMS MGMT E NGINE;**1, 3,4,2,5,6, 7,8,10,11, 19,20**;JU N 2004;Bui ld 27
  165            ; ;Per VA Di rective 64 02, this r outine sho uld not be  modified.
  166            ;
  167            ;  Reference  to $$PROD ^XUPROD su pported by  DBIA 4440
  168            ;  Reference  to $$GETN DC^PSSNDCU T supporte d by DBIA  4707
  169  
  170   ...
  171  
  172   EN(BRXIEN, BFILL,DOS, BWHERE,BIL LNDC,REVRE AS,DURREC, BPOVRIEN,B PSCLARF,BP SAUTH,BPCO BIND,BPJOB FLG,
  173   BPREQIEN,B PSCLOSE,BP SPLAN,BPSP RDAT,BPSRT YPE,BPSDEL AY) ;
  174  
  175   ...
  176  
  177            ;
  178            ;  Initializ e log
  179            D  LOG^BPSOS L(IEN59,$T (+0)_"-Sta rt of clai m","DT")
  180            D  LOG^BPSOS L(IEN59,$T (+0)_"-Job  flag = "_ BPJOBFLG_$ S(BPJOBFLG ="B":" BPS  REQUEST i en = "_$G( BPREQIEN), 1:""))
  181            ;
  182  
  183   ...
  184  
  185   END      ;
  186            ;  BPSELIG a nd other v ariables a re establi shed by in ference in  BPSNCPD6.
  187            I  BPJOBFLG= "F",BPLCK  D UNLCKRF^ BPSOSRX(BR XIEN,BFILL ,$G(IEN59) ,$T(+0)) S  BPLCK=0
  188            ;  Get Site  in case we  send a Bu lletin
  189            S  SITE=$$GE TSITE^BPSO SRX8(BRXIE N,BFILL)
  190            ; if foregro und AND we  can't sch edule requ est for an y reason A ND this is  not OP -  send bulle tin
  191            I  BPJOBFLG= "F",RESPON SE=4,",ARE V,BB,ERES, ERWV,ERNB, EREV,P2,P2 S,"'[(","_ BWHERE_"," ) D BULL^B PSNCPD1(BR XIEN,BFILL ,$G(SITE), $G(DFN),$G (PNAME),"" ,$G(CLMSTA T),$G(RESP ONSE),$G(B PSCOB))
  192            I  $G(BPSELI G)="" S BP SELIG=""
  193            ;  Send Bull etin if TR ICARE or C HAMPVA is  IN PROGRES S and this  is not a  release pr ocess
  194            S  BPSSTAT=$ S($G(BRXIE N):$P($$ST ATUS^BPSOS RX(BRXIEN, BFILL,,,BP SCOB),U),1 :"")
  195            I  BPSELIG=" T"!(BPSELI G="C"),BPS STAT="IN P ROGRESS",$ G(REVREAS) '="RX RELE ASE-NDC CH ANGE",",CR LB,CRLR,CR LX,CRRL,RR L,"'[(","_ BWHERE_"," ) D BULL^B PSNCPD1(BR XIEN,BFILL ,SITE,$G(D FN),$G(PNA ME),BPSELI G,"","",$G (BPSCOB))
  196            ;
  197            S :'$D(RESPO NSE) RESPO NSE=1
  198            K  MOREDATA
  199            I  $G(IEN59)  D
  200            .  N MSG
  201            .  S MSG="Fo reground P rocess Com plete-RESP ONSE="_$G( RESPONSE)
  202            .  I $G(RESP ONSE)'=0 S  MSG=MSG_" , CLMSTAT= "_$G(CLMST AT)
  203            .  D LOG^BPS OSL(IEN59, $T(+0)_"-" _MSG)
  204            Q  RESPONSE_ U_$G(CLMST AT)_U_BPSE LIG_U_BPSS TAT_U_$$CL MINFO^BPSU TIL2(+$G(I EN59))
  205  
  206   Modified L ogic (Chan ges are hi ghlighted)
  207  
  208   BPSNCPDP ; BHAM ISC/L JE/SS - AP I to submi t a claim  to ECME ;1 1/7/07  16 :58
  209            ; ;1.0;E CLA IMS MGMT E NGINE;**1, 3,4,2,5,6, 7,8,10,11, 19,20,22** ;JUN 2004; Build 27
  210            ; ;Per VA Di rective 64 02, this r outine sho uld not be  modified.
  211            ;
  212            ;  Reference  to $$PROD ^XUPROD su pported by  DBIA 4440
  213            ;  Reference  to $$GETN DC^PSONDCU T supporte d by DBIA  4705
  214  
  215   ...
  216  
  217   EN(BRXIEN, BFILL,DOS, BWHERE,BIL LNDC,REVRE AS,DURREC, BPOVRIEN,B PSCLARF,BP SAUTH,BPCO BIND,BPJOB FLG,
  218   BPREQIEN,B PSCLOSE,BP SPLAN,BPSP RDAT,BPSRT YPE,BPSDEL AY) ;
  219  
  220   ...
  221  
  222            ;
  223            ;  Initializ e log
  224            D  LOG^BPSOS L(IEN59,$T (+0)_"-Sta rt of clai m","DT")
  225            D  LOG^BPSOS L(IEN59,$T (+0)_"-BWH ERE = "_BW HERE)
  226            D  LOG^BPSOS L(IEN59,$T (+0)_"-Job  flag = "_ BPJOBFLG_$ S(BPJOBFLG ="B":" BPS  REQUEST i en = "_$G( BPREQIEN), 1:""))
  227            ;
  228  
  229   ...
  230  
  231   END      ;
  232            ;  BPSELIG a nd other v ariables a re establi shed by in ference in  BPSNCPD6.
  233            I  BPJOBFLG= "F",BPLCK  D UNLCKRF^ BPSOSRX(BR XIEN,BFILL ,$G(IEN59) ,$T(+0)) S  BPLCK=0
  234            ;  Get Site  in case we  send a Bu lletin
  235            S  SITE=$$GE TSITE^BPSO SRX8(BRXIE N,BFILL)
  236            ; if foregro und AND we  can't sch edule requ est for an y reason A ND this is  not OP -  send bulle tin
  237            I  BPJOBFLG= "F",RESPON SE=4,",ARE V,BB,ERES, ERWV,ERNB, EREV,P2,P2 S,"'[(","_ BWHERE_"," ) D BULL^B PSNCPD1(BR XIEN,BFILL ,$G(SITE), $G(DFN),$G (PNAME),"" ,$G(CLMSTA T),$G(RESP ONSE),$G(B PSCOB))
  238            I  $G(BPSELI G)="" S BP SELIG=""
  239            ;  Send Bull etin if TR ICARE or C HAMPVA is  IN PROGRES S and this  is not a  release pr ocess
  240            S  BPSSTAT=$ S($G(BRXIE N):$P($$ST ATUS^BPSOS RX(BRXIEN, BFILL,,,BP SCOB),U),1 :"")
  241            ;
  242            I  $G(IEN59)  D
  243            .  D LOG^BPS OSL(IEN59, $T(+0)_"-N earing end  of first  process, B PSELIG="_B PSELIG_",  BPSSTAT="_ BPSSTAT)
  244            .  I BPSELIG ="T"!(BPSE LIG="C"),B PSSTAT="IN  PROGRESS" ,$G(REVREA S)'="RX RE LEASE-NDC  CHANGE",BW HERE="PC"  D LOG^BPSO SL(IEN59,$ T(+0)_"-Wo uld have s ent bullet in")
  245            ;
  246            I  BPSELIG=" T"!(BPSELI G="C"),BPS STAT="IN P ROGRESS",$ G(REVREAS) '="RX RELE ASE-NDC CH ANGE",",CR LB,CRLR,CR LX,CRRL,PC ,RRL,"'[(" ,"_BWHERE_ ",") D BUL L^BPSNCPD1 (BRXIEN,BF ILL,SITE,$ G(DFN),$G( PNAME),BPS ELIG,"","" ,$G(BPSCOB ))
  247            ;
  248            S :'$D(RESPO NSE) RESPO NSE=1
  249            K  MOREDATA
  250            I  $G(IEN59)  D
  251            .  N MSG
  252            .  S MSG="Fo reground P rocess Com plete-RESP ONSE="_$G( RESPONSE)
  253            .  S MSG="Fi rst Proces s Complete -RESPONSE= "_$G(RESPO NSE)
  254            .  I $G(RESP ONSE)'=0 S  MSG=MSG_" , CLMSTAT= "_$G(CLMST AT)
  255            .  D LOG^BPS OSL(IEN59, $T(+0)_"-" _MSG)
  256            ;
  257            ;  The funct ion $$ECME SND return s the foll owing:
  258            ;    Respons e ^ Messag e ^ Eligib ility ^ Cl aim Status  ^ COB ^
  259            ;    RxCOB ^  Insurance
  260            ;  Response  =
  261            ;    0  Subm itted thro ugh ECME
  262            ;    1  No s ubmission  through EC ME
  263            ;    2  IB n ot billabl e
  264            ;    3  Clai m was clos ed, not su bmitted (R TS/Deletes )
  265            ;    4  Unab le to queu e claim
  266            ;    5  Inco rrect info rmation su pplied to  ECME
  267            ;    6  Inac tive ECME  - Primaril y used for  TRICARE/C HAMPVA to
  268            ;       say  ok to proc ess Rx
  269            ;    10 Reve rsal but n o resubmit
  270            ;  Message =  Message i ndicating  whether th e claim wa s submitte d
  271            ;  Eligibili ty = V, Ve teran;  T,  TRICARE;  C, CHAMPVA
  272            ;  Claim Sta tus = IN P ROGRESS if  incomplet e; final s tatus (e.g .
  273            ;    E PAYAB LE or E RE JECTED) if  complete;  null if n on-billabl e
  274            ;  COB  = CO B indicato r as store d in the I NSURANCE T YPE sub-fi le
  275            ;    of the  PATIENT fi le
  276            ;  RxCOB = C OB indicat or sent to  the payer  and store d in the
  277            ;    BPS TRA NSACTIONS  file
  278            ;  Insurance  = Name of  the insur ance compa ny that wa s billed a s
  279            ;    a resul t of this  call
  280            ;
  281            Q  RESPONSE_ U_$G(CLMST AT)_U_BPSE LIG_U_BPSS TAT_U_$$CL MINFO^BPSU TIL2(+$G(I EN59))
  282      
  283  
  284   Near the e nd of the  claim subm ission pro cess, it c alls TRICC HK^PSOREJU 3 for TRIC ARE/CHAMPV A claims.  Currently,  if the st atus is st ill “IN PR OGRESS”, t hat proced ure and co de below i t eventual ly adds a  comment to  the ECME  Activity L og stating  that the  Rx is bein g placed b ack on sus pense. At  this point  in the pr ocess, it  does not p ut the Rx/ Fill on su spense.
  285  
  286   This enhan cement cal ls for mod ifying TRI CCHK^PSORE JU3 so tha t it Quits  out if th e status i s still “I N PROGRESS ” and the  value of B WHERE/FROM  is “PC” ( Pull CMOPS ). That is  the value  of BWHERE /FROM when  the claim  submissio n process  in ECME/BP S is calle d from CMO P/PSX, whi ch include s when the  nightly C MOP transm ission is  run and wh en the use r selects  the CMOP p ull from s uspense.
  287  
  288   The CMOP p rocess its elf will c ontinue to  check for  any claim s that are  still “IN  PROGRESS” , as it do es now, bu t that che ck will no t happen u ntil all t he prescri ptions hav e been sen t and the  process ha s waited a n addition al 15 seco nds for ev ery claim  sent, wait ing up to  two hours.  (The send ing of cla ims is in  SBTEMCE^PS XRPPL1, an d the wait ing is in  SDT^PSXRPP L.)
  289  
  290   Subroutine  Name
  291   TRICCHK^PS OREJU3
  292   Enhancemen t Category
  293    New
  294    Modify
  295    Delete
  296    No Change
  297   Story
  298   US22
  299   Related Me nu Options  or ListMa n Actions
  300   Pull Early  from Susp ense [PSO  PNDRX]
  301   Print from  Suspense  File [PSO  PNDLBL]
  302   Related Ro utines
  303   This Subro utine is C alled By
  304   This Subro utine Call s
  305  
  306   ECMESND^PS OBPSU1, HD LG^PSOREJU 1, STATUS^ PSOREJU3
  307   $$GET1^DIQ , RXACT^PS OBPSU2, $$ ELIGDISP^P SOREJP1,   LOG^BPSOSL
  308   Related In tegration  Control Re gistration s (ICRs)
  309   N/A
  310   Data Passi ng
  311    Parameter  Input
  312    Parameter  Output
  313    Function  Return Val ue
  314    Global Mo dified
  315   Input Attr ibute Name  and Defin ition
  316   Name: RX
  317   Definition : Prescrip tion
  318    New       Modify       Delete       No Cha nge
  319   Name: RFL
  320   Definition : Fill num ber
  321    New       Modify       Delete       No Cha nge
  322   Name: RESP
  323   Definition : Response  from $$EN ^BPSNCPDP
  324    New       Modify       Delete       No Cha nge
  325   Name: FROM
  326   Definition : BWHERE v alue
  327    New       Modify       Delete       No Cha nge
  328   Name: RVTX
  329   Definition : Reversal  reason
  330    New       Modify       Delete       No Cha nge
  331   Output Att ribute Nam e and Defi nition
  332   Name: N/A
  333   Definition
  334    New       Modify       Delete       No Cha nge
  335   Current Lo gic
  336  
  337   PSOREJU3 ; BIRM/LJE -  BPS (ECME ) - Clinic al Rejects  Utilities  (3) ;04/2 5/08
  338            ; ;7.0;OUTPA TIENT PHAR MACY;**287 ,290,358,3 59,385,421 ,427,448** ;DEC 1997; Build 25
  339            ; References  to 900231 3.99 suppo rted by IA  4305
  340            ; Reference  to $$CLAIM ^BPSBUTL s upported b y IA 4719
  341            ;
  342  
  343   ...
  344  
  345   TRICCHK(RX ,RFL,RESP, FROM,RVTX)  ;check to  see if Rx  is non-bi llable or  in an "In  Progress"  state on E CME
  346            ;  Input:  ( r) RX  - R x IEN (#52
  347            ;          ( r) RFL - R EFILL
  348            ;          ( o) RESP -  Response f rom $$EN^B PSNCPDP ap i
  349            ;    TRICCHK  assumes t hat the ca lling rout ine has va lidated th at the fil l is TRICA RE or CHAM PVA.
  350            ;
  351            ;   - \Need  to be mind ful of for eground an d backgrou nd process ing.
  352            ;
  353            N  ETOUT,EST AT,PSOBEI
  354            S :'$D(FROM)  FROM="" S  ESTAT="", ESTAT=$P(R ESP,"^",4) ,NFROM=0 I  FROM="PL" !(FROM="PC ") S NFROM =1
  355            Q :ESTAT["PA YABLE"!(ES TAT["REJEC TED")
  356            S  PSOBEI=$$ ELIGDISP^P SOREJP1(RX ,RFL)
  357            I  ESTAT["IN  PROGRESS" ,FROM="RRL "!($G(RVTX )="RX RELE ASE-NDC CH ANGE") D   Q
  358            .  I 'NFROM  D
  359            .  . W !!,PS OBEI_" Pre scription  "_$$GET1^D IQ(52,RX," .01")_" ca nnot be re leased unt il ECME 'I N PROGRESS '"
  360            .  . W !,"st atus is re solved pay able.",!!
  361            ;
  362            I  $D(RESP)  D  Q
  363            .  I +RESP=6  W:'NFROM& ('$G(CMOP) ) !!,"Inac tive ECME  "_PSOBEI,! ! D  Q
  364            .  . S ACT=" Inactive E CME "_PSOB EI D RXACT ^PSOBPSU2( RX,RFL,ACT ,"M",DUZ)
  365            .  I +RESP=2 !(+RESP=3)  N PSONBIL L S PSONBI LL=1 D TRI C2 Q
  366            .  I +RESP=4 !(ESTAT["I N PROGRESS ") N PSONP ROG S PSON PROG=1 D T RIC2 Q
  367            Q
  368  
  369   Modified L ogic (Chan ges are hi ghlighted)
  370  
  371   PSOREJU3 ; BIRM/LJE -  BPS (ECME ) - Clinic al Rejects  Utilities  (3) ;04/2 5/08
  372            ; ;7.0;OUTPA TIENT PHAR MACY;**287 ,290,358,3 59,385,421 ,427,448,4 78**;DEC 1 997;Build  25
  373            ; References  to 900231 3.99 suppo rted by IA  4305
  374            ; Reference  to $$CLAIM ^BPSBUTL s upported b y IA 4719
  375            ; Reference  to LOG^BPS OSL suppor ted by ICR # 6764
  376            ; Reference  to IEN59^B PSOSRX sup ported by  ICR# 4412
  377            ;
  378  
  379   ...
  380  
  381   TRICCHK(RX ,RFL,RESP, FROM,RVTX)  ;check to  see if Rx  is non-bi llable or  in an "In  Progress"  state on E CME
  382            ;  Input:  ( r) RX  - R x IEN (#52
  383            ;          ( r) RFL - R EFILL
  384            ;          ( o) RESP -  Response f rom $$EN^B PSNCPDP ap i
  385            ;    TRICCHK  assumes t hat the ca lling rout ine has va lidated th at the fil l is TRICA RE or CHAM PVA.
  386            ;
  387            ;   - \Need  to be mind ful of for eground an d backgrou nd process ing.
  388            ;
  389            N  ETOUT,EST AT,NFROM,P SOBEI
  390            I  '$D(FROM)  S FROM=""
  391            S  ESTAT="", ESTAT=$P(R ESP,"^",4)
  392            S  NFROM=0
  393            I  FROM="PL" !(FROM="PC ") S NFROM =1
  394            Q :ESTAT["PA YABLE"!(ES TAT["REJEC TED")
  395            S  PSOBEI=$$ ELIGDISP^P SOREJP1(RX ,RFL)
  396            ;
  397            D  LOG^BPSOS L($$IEN59^ BPSOSRX(RX ,RFL),$T(+ 0)_"-TRICC HK, ESTAT= "_ESTAT)   ; ICR#s 44 12,6764
  398            I  ESTAT["IN  PROGRESS" ,FROM="PC"  D LOG^BPS OSL($$IEN5 9^BPSOSRX( RX,RFL),$T (+0)_"-Wou ld have no ted in Act ivity Log  that Rx wa s left in  CMOP suspe nse") Q  ;  ICR#s 441 2,6764
  399            ;
  400            I  ESTAT["IN  PROGRESS" ,FROM="RRL "!($G(RVTX )="RX RELE ASE-NDC CH ANGE") D   Q
  401            .  I 'NFROM  D
  402            .  . W !!,PS OBEI_" Pre scription  "_$$GET1^D IQ(52,RX," .01")_" ca nnot be re leased unt il ECME 'I N PROGRESS '"
  403            .  . W !,"st atus is re solved pay able.",!!
  404            ;
  405            I  $D(RESP)  D  Q
  406            .  I +RESP=6  W:'NFROM& ('$G(CMOP) ) !!,"Inac tive ECME  "_PSOBEI,! ! D  Q
  407            .  . S ACT=" Inactive E CME "_PSOB EI D RXACT ^PSOBPSU2( RX,RFL,ACT ,"M",DUZ)
  408            .  I +RESP=2 !(+RESP=3)  N PSONBIL L S PSONBI LL=1 D TRI C2 Q
  409            .  I +RESP=4 !(ESTAT["I N PROGRESS ") N PSONP ROG S PSON PROG=1 D T RIC2 Q
  410            Q
  411      
  412  
  413   The below  subroutine  had a bug . The vari able RFCNT  is the Re fill and w ill always  have a va lue of 0 o r a positi ve integer . It will  never cont ain “PAYAB LE”. The f unction $$ STATUS^PSO BPSUT retu rns the EC ME status  for the gi ven Rx/Fil l. The ret urn value  will conta in “PAYABL E” if the  claim resp onse came  back payab le.
  414  
  415   Subroutine  Name
  416   SUBMIT^PSO REJU3
  417   Enhancemen t Category
  418    New
  419    Modify
  420    Delete
  421    No Change
  422   Story
  423   US22
  424   Related Me nu Options  or ListMa n Actions
  425   Pull Early  from Susp ense [PSO  PNDRX]
  426   Print from  Suspense  File [PSO  PNDLBL]
  427   Related Ro utines
  428   This Subro utine is C alled By
  429   This Subro utine Call s
  430  
  431   ACT^PSOCAN 2
  432   $$SUBMIT^P SOBPSUT, E MCESND^PSO BPSU1, $$P SOET^PSORE JP3, $$FIN D^PSOREJUT , $$HDLG^P SOREJU1, $ $STATUS^PS OBPSUT, TR ICCHK^PSOR EJU3
  433   Related In tegration  Control Re gistration s (ICRs)
  434   N/A
  435   Data Passi ng
  436    Parameter  Input
  437    Parameter  Output
  438    Function  Return Val ue
  439    Global Mo dified
  440   Input Attr ibute Name  and Defin ition
  441   Name: RXIE N
  442   Definition : Prescrip tion
  443    New       Modify       Delete       No Cha nge
  444   Name: RFCN T
  445   Definition : Fill num ber
  446    New       Modify       Delete       No Cha nge
  447   Name: PSOT RIC
  448   Definition : 1 if TRI CARE; 2 if  CHAMPVA;  0 if neith er
  449    New       Modify       Delete       No Cha nge
  450   Output Att ribute Nam e and Defi nition
  451   Name: N/A
  452   Definition
  453    New       Modify       Delete       No Cha nge
  454   Current Lo gic
  455  
  456   SUBMIT(RXI EN,RFCNT,P SOTRIC) ;c alled from  PSOCAN2 ( routine si ze exceede d)
  457            N  SUBMITE S  SUBMITE=$ $SUBMIT^PS OBPSUT(RXI EN)
  458            I  SUBMITE D
  459            .  N ACTION
  460            .  D ECMESND ^PSOBPSU1( RXIEN,,,$S ($O(^PSRX( RXIEN,1,0) ):"RF",1:" OF"))
  461            .  ; Quit if  there is  an unresol ved TRICAR E or CHAMP VA non-bil lable reje ct code, P SO*7*358
  462            .  I $$PSOET ^PSOREJP3( RXIEN) S A CTION="Q" 
  463            .  I $$FIND^ PSOREJUT(R XIEN) S AC TION=$$HDL G^PSOREJU1 (RXIEN,,"7 9,88","OF" ,"IOQ","Q" )
  464            I  'SUBMITE& (PSOTRIC)  D
  465            .  I $$STATU S^PSOBPSUT (RXIEN,RFC NT'["PAYAB LE") D TRI CCHK(RXIEN ,RFCNT)
  466            Q
  467  
  468   Modified L ogic (Chan ges are hi ghlighted)
  469  
  470   SUBMIT(RXI EN,RFCNT,P SOTRIC) ;c alled from  PSOCAN2 ( routine si ze exceede d)
  471            N  SUBMITE S  SUBMITE=$ $SUBMIT^PS OBPSUT(RXI EN)
  472            I  SUBMITE D
  473            .  N ACTION
  474            .  D ECMESND ^PSOBPSU1( RXIEN,,,$S ($O(^PSRX( RXIEN,1,0) ):"RF",1:" OF"))
  475            .  ; Quit if  there is  an unresol ved TRICAR E or CHAMP VA non-bil lable reje ct code, P SO*7*358
  476            .  I $$PSOET ^PSOREJP3( RXIEN) S A CTION="Q" 
  477            .  I $$FIND^ PSOREJUT(R XIEN) S AC TION=$$HDL G^PSOREJU1 (RXIEN,,"7 9,88","OF" ,"IOQ","Q" )
  478            I  'SUBMITE& (PSOTRIC)  D
  479            .  I $$STATU S^PSOBPSUT (RXIEN,RFC NT)'["PAYA BLE" D TRI CCHK(RXIEN ,RFCNT)
  480            Q
  481      
  482  
  483   Immediatel y after ca lling ECME SND^PSOBPS U1 to send  a claim f or a given  Rx/Fill,  the system  is curren tly perfor ming the c heck $$TRI STA^PSOREJ U3, and if  that func tion retur ns a “1” t hen the Rx /Fill is p ut into ^T MP(“PSXEPH NB”). Late r in the p rocess, an y Rx/Fills  in that t emp global  are not s ent to CMO P and are  put back o n suspense , and the  system sen ds a mail  message li sting all  of the Rx/ Fills left  on suspen se at the  end of the  CMOP proc ess.
  484  
  485   This call  to $$TRIST A^PSOREJU3  is not on ly early b ut is not  necessary.  $$TRISTA  is called  again from  EPHARM^PS XRPPL2. Th ere is no  reason to  call it he re at this  point in  the proces s, so this  line is b eing remov ed. A simi lar change  will be m ade in SBT ECME^PSXRP PL1 and CH KDFN^PSXRP PL2.
  486  
  487   Subroutine  Name
  488   SBTECME^PS XRPPL1
  489   Enhancemen t Category
  490    New
  491    Modify
  492    Delete
  493    No Change
  494   Story
  495   US22
  496   Related Me nu Options  or ListMa n Actions
  497   Pull Early  from Susp ense [PSO  PNDRX]
  498   Print from  Suspense  File [PSO  PNDLBL]
  499   Related Ro utines
  500   This Subro utine is C alled By
  501   This Subro utine Call s
  502  
  503   SDT^PSXRPP L
  504   $$CMOPON^B PSUTIL, $$ ECMEON^BPS UTIL, $$GE T1^DIQ, $$ LSTRFL^PSO BPSU1, ECM ESND^PSOBP SU1, $$RET RX^PSOBPSU T, $$STATU S^PSOBPSUT , $$TRISTA ^PSOREJU3,  $$FIND^PS OREJUT, PS OUL^PSSLOC K, $$XMIT^ PSXBPSUT,  $$DSH^PSXR PPL2, $$DU R^PSXRPPL2 , $$ECMEST AT^PSXRPPL 2, $$PATCH ^XPDUTL,   LOG^BPSOSL , $$IEN59^ BPSOSRX
  505   Related In tegration  Control Re gistration s (ICRs)
  506            ; Reference  to ^PS(52. 5, support ed by DBIA  #1978
  507            ; Reference  to ^BPSUTI L  support ed by DBIA  #4410
  508            ; Reference  to ^PSSLOC K  support ed by DBIA  #2789
  509            ; Reference  to ^PSOBPS UT support ed by DBIA  #4701
  510            ; Reference  to ^PSOBPS U1 support ed by DBIA  #4702
  511            ; Reference  to ^PSOREJ UT support ed by DBIA  #4706
  512            ; Reference  to ^PSOREJ U3 support ed by DBIA  #5186
  513   Data Passi ng
  514    Parameter  Input
  515    Parameter  Output
  516    Function  Return Val ue
  517    Global Mo dified
  518   Input Attr ibute Name  and Defin ition
  519   Name: PSXT P
  520   Definition : Type of  prescripti ons (“C” =  controlle d substanc es, “N” =  non-contro lled subst ances)
  521    New       Modify       Delete       No Cha nge
  522   Name: PSXD V
  523   Definition : Pointer  to DIVISIO N file# 59
  524    New       Modify       Delete       No Cha nge
  525   Name: PSXD T
  526   Definition : T+N when  schedulin g the THRO UGH DATE t o run CMOP  transmiss ion
  527    New       Modify       Delete       No Cha nge
  528   Name: PULL DT
  529   Definition : T+N+PULL  DAYS para meter in t he DIVISIO N file# 59
  530    New       Modify       Delete       No Cha nge
  531   Output Att ribute Nam e and Defi nition
  532   Name: $$SB TECME
  533   Definition
  534    New       Modify       Delete       No Cha nge
  535   Current Lo gic
  536  
  537   PSXRPPL1 ; BIR/WPB -  Resets Sus pense to P rint/Trans mit ;10/02 /97
  538            ; ;2.0;CMOP; **3,48,62, 66,65,69,7 3,74**;11  Apr 97;Bui ld 11
  539            ; Reference  to ^PSRX(  supported  by DBIA #1 977
  540            ; Reference  to File #5 9  support ed by DBIA  #1976
  541            ; Reference  to PSOSURS T  support ed by DBIA  #1970
  542            ; Reference  to ^PS(52. 5, support ed by DBIA  #1978
  543            ; Reference  to ^BPSUTI L  support ed by DBIA  #4410
  544            ; Reference  to ^PSSLOC K  support ed by DBIA  #2789
  545            ; Reference  to ^PSOBPS UT support ed by DBIA  #4701
  546            ; Reference  to ^PSOBPS U1 support ed by DBIA  #4702
  547            ; Reference  to ^PSOREJ UT support ed by DBIA  #4706
  548            ; Reference  to ^PSOREJ U3 support ed by DBIA  #5186
  549            ; Reference  to ^PSOBPS U2 support ed by DBIA  #4970
  550            ; Reference  to ^PSOSUL B1 support ed by DBIA  #2478
  551   ...
  552  
  553   SBTECME(PS XTP,PSXDV, THRDT,PULL DT) ; - Su mitting pr escription s to EMCE  (3rd Party  Billing)
  554            ; Input: PSX TP  - Type  of prescr iptions "C " - Contro lled Subs  / "N" Non- Controlled  Subs
  555            ;        PSX DV  - Poin ter to DIV SION file  (#59)
  556            ;        THR DT  - T+N  when sched uling the  THROUGH DA TE to run  CMOP Trans mission
  557            ;        PUL LDT - T+N+ PULL DAYS  parameter  in the DIV ISION file  (#59)
  558            ; Output:SBT ECME- Numb er of pres criptions  submitted  to ECME
  559            N  RX,RFL,SB TECME,PSOL RX,RESP,SD T,XDFN,REC ,PSOLRX
  560            I  '$$ECMEON ^BPSUTIL(P SXDV)!'$$C MOPON^BPSU TIL(PSXDV)  Q
  561            S  (SDT,SBTE CME)=0 K ^ TMP("PSXEP HDFN",$J)
  562            F   S SDT=$O (^PS(52.5, "CMP","Q", PSXTP,PSXD V,SDT)) S  XDFN=0 Q:( SDT>PULLDT )!(SDT'>0)   D
  563            .  F  S XDFN =$O(^PS(52 .5,"CMP"," Q",PSXTP,P SXDV,SDT,X DFN)) S RE C=0 Q:(XDF N'>0)!(XDF N="")  D
  564            .  . F  S RE C=$O(^PS(5 2.5,"CMP", "Q",PSXTP, PSXDV,SDT, XDFN,REC))  Q:(REC'>0 )!(REC="")   D
  565            .  . . S (PS OLRX,RX)=+ $$GET1^DIQ (52.5,REC, .01,"I") I  'RX Q
  566            .  . . S RFL =$$GET1^DI Q(52.5,REC ,9,"I") I  RFL="" S R FL=$$LSTRF L^PSOBPSU1 (RX)
  567            .  . . I $$X MIT^PSXBPS UT(REC) D
  568            .  . . . I S DT>THRDT,' $D(^TMP("P SXEPHDFN", $J,XDFN))  Q
  569            .  . . . I $ $PATCH^XPD UTL("PSO*7 .0*148") D
  570            .  . . . . I  $$RETRX^P SOBPSUT(RX ,RFL),SDT> DT Q
  571            .  . . . . I  $$DOUBLE( RX,RFL) Q
  572            .  . . . . I  $$FIND^PS OREJUT(RX, RFL,,"79,8 8",,1) Q
  573            .  . . . . I  '$$RETRX^ PSOBPSUT(R X,RFL),'$$ ECMESTAT^P SXRPPL2(RX ,RFL) Q
  574            .  . . . . I  $$PATCH^X PDUTL("PSO *7.0*289")  Q:'$$DUR^ PSXRPPL2(R X,RFL)  ;e Pharm Host  error hol d
  575            .  . . . . I  $$PATCH^X PDUTL("PSO *7.0*289") ,RFL>0,$$S TATUS^PSOB PSUT(RX,RF L-1)'="" Q :'$$DSH^PS XRPPL2(REC )  ;ePharm  3/4 days  supply (re fill)
  576            .  . . . . I  $$PATCH^X PDUTL("PSO *7.0*289") ,RFL=0 Q:' $$DSH^PSXR PPL2(REC)   ;ePharm 3 /4 days su pply (orig inal fill)
  577            .  . . . . D  ECMESND^P SOBPSU1(RX ,RFL,"","P C",,1,,,,. RESP)
  578            .  . . . . I  $$PATCH^X PDUTL("PSO *7.0*287") ,$$TRISTA^ PSOREJU3(R X,RFL,.RES P,"PC") S  ^TMP("PSXE PHNB",$J,R X,RFL)=$G( RESP)
  579            .  . . . . I  $D(RESP), 'RESP S SB TECME=SBTE CME+1
  580            .  . . . . S  ^TMP("PSX EPHDFN",$J ,XDFN)=""
  581            .  . . D PSO UL^PSSLOCK (PSOLRX)
  582            K  ^TMP("PSX EPHDFN",$J )
  583            Q  SBTECME
  584  
  585   Modified L ogic (Chan ges are hi ghlighted)
  586  
  587  
  588   PSXRPPL1 ; BIR/WPB -  Resets Sus pense to P rint/Trans mit ;10/02 /97
  589            ; ;2.0;CMOP; **3,48,62, 66,65,69,7 3,74,81**; 11 Apr 97; Build 11
  590            ; Reference  to ^PSRX(  supported  by DBIA #1 977
  591            ; Reference  to File #5 9  support ed by DBIA  #1976
  592            ; Reference  to PSOSURS T  support ed by DBIA  #1970
  593            ; Reference  to ^PS(52. 5, support ed by DBIA  #1978
  594            ; Reference  to ^BPSUTI L  support ed by DBIA  #4410
  595            ; Reference  to ^PSSLOC K  support ed by DBIA  #2789
  596            ; Reference  to ^PSOBPS UT support ed by DBIA  #4701
  597            ; Reference  to ^PSOBPS U1 support ed by DBIA  #4702
  598            ; Reference  to ^PSOREJ UT support ed by DBIA  #4706
  599            ; Reference  to ^PSOREJ U3 support ed by DBIA  #5186
  600            ; Reference  to ^PSOBPS U2 support ed by DBIA  #4970
  601            ; Reference  to ^PSOSUL B1 support ed by DBIA  #2478
  602            ; Reference  to LOG^BPS OSL suppor ted by ICR # 6764
  603            ; Reference  to IEN59^B PSOSRX sup ported by  ICR# 4412
  604   ...
  605  
  606   SBTECME(PS XTP,PSXDV, THRDT,PULL DT) ; - Su mitting pr escription s to EMCE  (3rd Party  Billing)
  607            ; Input: PSX TP  - Type  of prescr iptions "C " - Contro lled Subs  / "N" Non- Controlled  Subs
  608            ;        PSX DV  - Poin ter to DIV SION file  (#59)
  609            ;        THR DT  - T+N  when sched uling the  THROUGH DA TE to run  CMOP Trans mission
  610            ;        PUL LDT - T+N+ PULL DAYS  parameter  in file# 5 9, OUTPATI ENT SITE
  611            ; Output:SBT ECME- Numb er of pres criptions  submitted  to ECME
  612            ;
  613            N  PSOLRX,RE C,RESP,RFL ,RX,SBTECM E,SDT,XDFN
  614            ;
  615            I  '$$ECMEON ^BPSUTIL(P SXDV)!'$$C MOPON^BPSU TIL(PSXDV)  Q
  616            K  ^TMP("PSX EPHDFN",$J )
  617            S  (SDT,SBTE CME)=0
  618            F   S SDT=$O (^PS(52.5, "CMP","Q", PSXTP,PSXD V,SDT)) S  XDFN=0 Q:( SDT>PULLDT )!(SDT'>0)   D
  619            .  F  S XDFN =$O(^PS(52 .5,"CMP"," Q",PSXTP,P SXDV,SDT,X DFN)) S RE C=0 Q:(XDF N'>0)!(XDF N="")  D
  620            .  . F  S RE C=$O(^PS(5 2.5,"CMP", "Q",PSXTP, PSXDV,SDT, XDFN,REC))  Q:(REC'>0 )!(REC="")   D
  621            .  . . S (PS OLRX,RX)=+ $$GET1^DIQ (52.5,REC, .01,"I") I  'RX Q
  622            .  . . S RFL =$$GET1^DI Q(52.5,REC ,9,"I") I  RFL="" S R FL=$$LSTRF L^PSOBPSU1 (RX)
  623            .  . . I $$X MIT^PSXBPS UT(REC) D
  624            .  . . . I S DT>THRDT,' $D(^TMP("P SXEPHDFN", $J,XDFN))  Q
  625            .  . . . I $ $PATCH^XPD UTL("PSO*7 .0*148") D
  626            .  . . . . I  $$RETRX^P SOBPSUT(RX ,RFL),SDT> DT Q
  627            .  . . . . I  $$DOUBLE( RX,RFL) Q
  628            .  . . . . I  $$FIND^PS OREJUT(RX, RFL,,"79,8 8",,1) Q
  629            .  . . . . I  '$$RETRX^ PSOBPSUT(R X,RFL),'$$ ECMESTAT^P SXRPPL2(RX ,RFL) Q
  630            .  . . . . I  $$PATCH^X PDUTL("PSO *7.0*289")  Q:'$$DUR^ PSXRPPL2(R X,RFL)  ;e Pharm Host  error hol d
  631            .  . . . . I  $$PATCH^X PDUTL("PSO *7.0*289") ,RFL>0,$$S TATUS^PSOB PSUT(RX,RF L-1)'="" Q :'$$DSH^PS XRPPL2(REC )  ;ePharm  3/4 days  supply (re fill)
  632            .  . . . . I  $$PATCH^X PDUTL("PSO *7.0*289") ,RFL=0 Q:' $$DSH^PSXR PPL2(REC)   ;ePharm 3 /4 days su pply (orig inal fill)
  633            .  . . . . D  ECMESND^P SOBPSU1(RX ,RFL,"","P C",,1,,,,. RESP)
  634            .  . . . . ;
  635            .  . . . . D  LOG^BPSOS L($$IEN59^ BPSOSRX(RX ,RFL),$T(+ 0)_"-SBTEC ME, RESP=" _$P(RESP," ^",4))  ;  ICR #4412, 6764
  636            .  . . . . ;
  637            .  . . . . I  $$PATCH^X PDUTL("PSO *7.0*287") ,$$TRISTA^ PSOREJU3(R X,RFL,.RES P,"PC") S  ^TMP("PSXE PHNB",$J,R X,RFL)=$G( RESP)
  638            .  . . . . I  $D(RESP), 'RESP S SB TECME=SBTE CME+1
  639            .  . . . . S  ^TMP("PSX EPHDFN",$J ,XDFN)=""
  640            .  . . D PSO UL^PSSLOCK (PSOLRX)
  641            K  ^TMP("PSX EPHDFN",$J )
  642            Q  SBTECME
  643      
  644  
  645  
  646   Subroutine  Name
  647   CHKDFN^PSX RPPL2
  648   Enhancemen t Category
  649    New
  650    Modify
  651    Delete
  652    No Change
  653   Story
  654   US22
  655   Related Me nu Options  or ListMa n Actions
  656   Pull Early  from Susp ense [PSO  PNDRX]
  657   Print from  Suspense  File [PSO  PNDLBL]
  658   Related Ro utines
  659   This Subro utine is C alled By
  660   This Subro utine Call s
  661  
  662   SDT^PSXRPP L
  663   $$CMOPON^B PSUTIL, $$ ECMEON^BPS UTIL, $$GE T1^DIQ, $$ LSTRFL^PSO BPSU1, ECM ESND^PSOBP SU1, $$RET RX^PSOBPSU T, $$STATU S^PSOBPSUT , $$TRISTA ^PSOREJU3,  $$FIND^PS OREJUT, PS OUL^PSSLOC K, $$XMIT^ PSXBPSUT,  $$DSH^PSXR PPL2, $$DU R^PSXRPPL2 , $$ECMEST AT^PSXRPPL 2, $$PATCH ^XPDUTL,   LOG^BPSOSL , $$IEN59^ BPSOSRX
  664   Related In tegration  Control Re gistration s (ICRs)
  665            ; Reference  to ^PS(52. 5, support ed by DBIA  #1978
  666            ; Reference  to ^BPSUTI L  support ed by DBIA  #4410
  667            ; Reference  to ^PSSLOC K  support ed by DBIA  #2789
  668            ; Reference  to ^PSOBPS UT support ed by DBIA  #4701
  669            ; Reference  to ^PSOBPS U1 support ed by DBIA  #4702
  670            ; Reference  to ^PSOREJ UT support ed by DBIA  #4706
  671            ; Reference  to ^PSOREJ U3 support ed by DBIA  #5186
  672            ; Reference  to LOG^BPS OSL suppor ted by ICR # 6764
  673            ; Reference  to IEN59^B PSOSRX sup ported by  ICR# 4412
  674   Data Passi ng
  675    Parameter  Input
  676    Parameter  Output
  677    Function  Return Val ue
  678    Global Mo dified
  679   Input Attr ibute Name  and Defin ition
  680   Name: PSXT P
  681   Definition : Type of  prescripti ons (“C” =  controlle d substanc es, “N” =  non-contro lled subst ances)
  682    New       Modify       Delete       No Cha nge
  683   Name: PSXD V
  684   Definition : Pointer  to DIVISIO N file# 59
  685    New       Modify       Delete       No Cha nge
  686   Name: PSXD T
  687   Definition : T+N when  schedulin g the THRO UGH DATE t o run CMOP  transmiss ion
  688    New       Modify       Delete       No Cha nge
  689   Name: PULL DT
  690   Definition : T+N+PULL  DAYS para meter in t he DIVISIO N file# 59
  691    New       Modify       Delete       No Cha nge
  692   Output Att ribute Nam e and Defi nition
  693   Name: $$SB TECME
  694   Definition
  695    New       Modify       Delete       No Cha nge
  696   Current Lo gic
  697  
  698   PSXRPPL2 ; BIR/WPB -  Print From  Suspense  Utilities  ;06/10/08
  699            ; ;2.0;CMOP; **65,69,73 ,74,79**;1 1 Apr 97;B uild 25
  700            ; Reference  to ^PSRX(  supported  by DBIA #1 977
  701            ; Reference  to ^PS(52. 5, support ed by DBIA  #1978
  702            ; Reference  to ^PSSLOC K  support ed by DBIA  #2789
  703            ; Reference  to ^PSOBPS UT support ed by DBIA  #4701
  704            ; Reference  to ^PSOBPS U1 support ed by DBIA  #4702
  705            ; Reference  to ^PSOBPS U2 support ed by DBIA  #4970
  706            ; Reference  to ^PSOREJ UT support ed by DBIA  #4706
  707            ; Reference  to ^PSOREJ U3 support ed by DBIA  #5186
  708            ; Reference  to CHANGE^ PSOSUCH1 s uppored by  DBIA #542 7
  709            ; Reference  to PREVRX^ PSOREJP2 s upported b y DBIA #59 12
  710            ; Reference  to $$BILLA BLE^IBNCPD P supporte d by DBIA  #6243
  711            ;
  712   CHKDFN(THR DT) ; use  the patien t 'C' inde x under RX  multiple  in file 55 0.2 to GET  dfn to ga ther Patie nts' futur e RXs
  713            ; Input: THR DT - THROU GH DATE to  run CMOP  transmissi on
  714            ;
  715            I  '$D(^PSX( 550.2,PSXB AT,15,"C") ) Q
  716            S  (SBTECME) =0 K ^TMP( "PSXEPHDFN ",$J)
  717            S  PSXPTNM=" " F  S PSX PTNM=$O(^P SX(550.2,P SXBAT,15," C",PSXPTNM )) Q:PSXPT NM=""  D
  718            .  S XDFN=0  F  S XDFN= $O(^PSX(55 0.2,PSXBAT ,"15","C", PSXPTNM,XD FN)) Q:(XD FN'>0)  D
  719            .  . S SDT=P RTDT F  S  SDT=$O(^PS (52.5,"CMP ","Q",PSXT YP,PSXTDIV ,SDT)),NDF N=0 Q:(SDT >PSXDTRG)! (SDT="")   D
  720            .  . . F  S  NDFN=$O(^P S(52.5,"CM P","Q",PSX TYP,PSXTDI V,SDT,NDFN )),REC=0 Q :NDFN'>0   I NDFN=XDF N D
  721            .  . . . F   S REC=$O(^ PS(52.5,"C MP","Q",PS XTYP,PSXTD IV,SDT,NDF N,REC)) Q: REC'>0  D
  722            .  . . . . S  (PSOLRX,R X)=+$$GET1 ^DIQ(52.5, REC,.01,"I ") I 'RX Q
  723            .  . . . . S  RFL=$$GET 1^DIQ(52.5 ,REC,9,"I" ) I RFL=""  S RFL=$$L STRFL^PSOB PSU1(RX)
  724            .  . . . . I  $$XMIT^PS XBPSUT(REC ) D
  725            .  . . . . .  I SDT>THR DT,'$D(^TM P("PSXEPHD FN",$J,XDF N)) Q
  726            .  . . . . .  I $$PATCH ^XPDUTL("P SO*7.0*148 ") D
  727            .  . . . . .  . I $$RET RX^PSOBPSU T(RX,RFL), SDT>DT Q
  728            .  . . . . .  . I $$DOU BLE^PSXRPP L1(RX,RFL)  Q
  729            .  . . . . .  . I $$FIN D^PSOREJUT (RX,RFL,," 79,88",,1)  Q
  730            .  . . . . .  . I '$$RE TRX^PSOBPS UT(RX,RFL) ,$$ECMESTA T(RX,RFL)  Q
  731            .  . . . . .  . I $$PAT CH^XPDUTL( "PSO*7.0*2 89"),'$$DU R(RX,RFL), '$$DSH(REC ) Q
  732            .  . . . . .  . D ECMES ND^PSOBPSU 1(RX,RFL," ","PC",,1, ,,,.RESP)
  733            .  . . . . .  . I $$PAT CH^XPDUTL( "PSO*7.0*2 87"),$$TRI STA^PSOREJ U3(RX,RFL, .RESP,"PC" ) S ^TMP(" PSXEPHNB", $J,RX,RFL) =$G(RESP)
  734            .  . . . . .  . I $D(RE SP),'RESP  S SBTECME= SBTECME+1
  735            .  . . . . .  . S ^TMP( "PSXEPHDFN ",$J,XDFN) =""
  736            .  . . . . D  PSOUL^PSS LOCK(PSOLR X)
  737            K  ^TMP("PSX EPHDFN",$J )
  738            I  SBTECME>0  H 60+$S(( SBTECME*15 )>7200:720 0,1:(SBTEC ME*15))
  739            Q
  740  
  741   Modified L ogic (Chan ges are hi ghlighted)
  742  
  743   PSXRPPL2 ; BIR/WPB -  Print From  Suspense  Utilities  ;06/10/08
  744            ; ;2.0;CMOP; **65,69,73 ,74,79,81* *;11 Apr 9 7;Build 25
  745            ; Reference  to ^PSRX(  supported  by DBIA #1 977
  746            ; Reference  to ^PS(52. 5, support ed by DBIA  #1978
  747            ; Reference  to ^PSSLOC K  support ed by DBIA  #2789
  748            ; Reference  to ^PSOBPS UT support ed by DBIA  #4701
  749            ; Reference  to ^PSOBPS U1 support ed by DBIA  #4702
  750            ; Reference  to ^PSOBPS U2 support ed by DBIA  #4970
  751            ; Reference  to ^PSOREJ UT support ed by DBIA  #4706
  752            ; Reference  to ^PSOREJ U3 support ed by DBIA  #5186
  753            ; Reference  to CHANGE^ PSOSUCH1 s upported b y DBIA #54 27
  754            ; Reference  to PREVRX^ PSOREJP2 s upported b y DBIA #59 12
  755            ; Reference  to $$BILLA BLE^IBNCPD P supporte d by DBIA  #6243
  756            ; Reference  to LOG^BPS OSL suppor ted by ICR # 6764
  757            ; Reference  to IEN59^B PSOSRX sup ported by  ICR# 4412
  758            ;
  759   CHKDFN(THR DT) ; use  the patien t 'C' inde x under RX  multiple  in file 55 0.2 to GET  dfn to ga ther Patie nts' futur e RXs
  760            ; Input: THR DT - THROU GH DATE to  run CMOP  transmissi on
  761            ;
  762            ;  This proc edure assu mes the fo llowing va riables to  exist:
  763            ;    PRTDT =  Transmit/ Print data  through t his date
  764            ;    PSXBAT  = Batch, p ointer to  file#550.2 , CMOP Tra nsmission
  765            ;    PSXDTRG  = Pull ah ead throug h date
  766            ;    PSXTDIV  = Divisio n
  767            ;    PSXTYP  = "C" if r unning for  Controlle d Substanc e, "N" oth erwise
  768            ;
  769            N  NDFN,PSOL RX,PSXPTNM ,REC,RESP, RFL,RX,SBT ECME,SDT,X DFN
  770            ;
  771            I  '$D(^PSX( 550.2,PSXB AT,15,"C") ) Q
  772            S  SBTECME=0
  773            K  ^TMP("PSX EPHDFN",$J )
  774            S  PSXPTNM=" "
  775            F   S PSXPTN M=$O(^PSX( 550.2,PSXB AT,15,"C", PSXPTNM))  Q:PSXPTNM= ""  D
  776            .  S XDFN=0
  777            .  F  S XDFN =$O(^PSX(5 50.2,PSXBA T,"15","C" ,PSXPTNM,X DFN)) Q:(X DFN'>0)  D
  778            .  . S SDT=P RTDT
  779            .  . F  S SD T=$O(^PS(5 2.5,"CMP", "Q",PSXTYP ,PSXTDIV,S DT)) Q:(SD T>PSXDTRG) !(SDT="")   D
  780            .  . . S NDF N=0
  781            .  . . F  S  NDFN=$O(^P S(52.5,"CM P","Q",PSX TYP,PSXTDI V,SDT,NDFN )) Q:NDFN' >0  I NDFN =XDFN D
  782            .  . . . S R EC=0
  783            .  . . . F   S REC=$O(^ PS(52.5,"C MP","Q",PS XTYP,PSXTD IV,SDT,NDF N,REC)) Q: REC'>0  D
  784            .  . . . . S  (PSOLRX,R X)=+$$GET1 ^DIQ(52.5, REC,.01,"I ") I 'RX Q
  785            .  . . . . S  RFL=$$GET 1^DIQ(52.5 ,REC,9,"I" ) I RFL=""  S RFL=$$L STRFL^PSOB PSU1(RX)
  786            .  . . . . I  $$XMIT^PS XBPSUT(REC ) D
  787            .  . . . . .  I SDT>THR DT,'$D(^TM P("PSXEPHD FN",$J,XDF N)) Q
  788            .  . . . . .  I $$PATCH ^XPDUTL("P SO*7.0*148 ") D
  789            .  . . . . .  . I $$RET RX^PSOBPSU T(RX,RFL), SDT>DT Q
  790            .  . . . . .  . I $$DOU BLE^PSXRPP L1(RX,RFL)  Q
  791            .  . . . . .  . I $$FIN D^PSOREJUT (RX,RFL,," 79,88",,1)  Q
  792            .  . . . . .  . I '$$RE TRX^PSOBPS UT(RX,RFL) ,$$ECMESTA T(RX,RFL)  Q
  793            .  . . . . .  . I $$PAT CH^XPDUTL( "PSO*7.0*2 89"),'$$DU R(RX,RFL), '$$DSH(REC ) Q
  794            .  . . . . .  . D ECMES ND^PSOBPSU 1(RX,RFL," ","PC",,1, ,,,.RESP)
  795            .  . . . . .  . I $$PAT CH^XPDUTL( "PSO*7.0*2 87"),$$TRI STA^PSOREJ U3(RX,RFL, .RESP,"PC" ) S ^TMP(" PSXEPHNB", $J,RX,RFL) =$G(RESP)
  796            .  . . . . .  . ;
  797            .  . . . . .  . D LOG^B PSOSL($$IE N59^BPSOSR X(RX,RFL), $T(+0)_"-C HKDFN, RES P="_$P(RES P,"^",4))   ; ICR #44 12,6764
  798            .  . . . . .  . ;
  799            .  . . . . .  . I $D(RE SP),'RESP  S SBTECME= SBTECME+1
  800            .  . . . . .  . S ^TMP( "PSXEPHDFN ",$J,XDFN) =""
  801            .  . . . . D  PSOUL^PSS LOCK(PSOLR X)
  802            K  ^TMP("PSX EPHDFN",$J )
  803            I  SBTECME>0  H 60+$S(( SBTECME*15 )>7200:720 0,1:(SBTEC ME*15))
  804            Q
  805      
  806  
  807  
  808   Subroutine  Name
  809   EPHARM^PSX RPPL2
  810   Enhancemen t Category
  811    New
  812    Modify
  813    Delete
  814    No Change
  815   Story
  816   US22
  817   Related Me nu Options  or ListMa n Actions
  818   Pull Early  from Susp ense [PSO  PNDRX]
  819   Print from  Suspense  File [PSO  PNDLBL]
  820   Related Ro utines
  821   This Subro utine is C alled By
  822   This Subro utine Call s
  823  
  824   GETDATA^PS XRPPL
  825   $$DSH^PSXR PPL2, $$DU R^PSXRPPL2 , EPH^PSXR PPL2, $$RE TRX^PSOBPS UT, $$STAT US^PSOBPSU T, $$TRIST A^PSOREJU3 , $$FIND^P SOREJUT, $ $DOUBLE^PS XRPPL1, $$ PATCH^XPDU TL
  826   Related In tegration  Control Re gistration s (ICRs)
  827            ; Reference  to ^PSOBPS UT support ed by DBIA  #4701
  828            ; Reference  to ^PSOREJ UT support ed by DBIA  #4706
  829            ; Reference  to ^PSOREJ U3 support ed by DBIA  #5186
  830   Data Passi ng
  831    Parameter  Input
  832    Parameter  Output
  833    Function  Return Val ue
  834    Global Mo dified
  835   Input Attr ibute Name  and Defin ition
  836   Name: N/A
  837   Definition
  838    New       Modify       Delete       No Cha nge
  839   Output Att ribute Nam e and Defi nition
  840   Name: N/A
  841   Definition
  842    New       Modify       Delete       No Cha nge
  843   Current Lo gic
  844  
  845   EPHARM   ;  - ePharma cy checks  for third  party bill ing
  846            I  $$DOUBLE^ PSXRPPL1(R XN,RFL) S  EPHQT=1 Q
  847            I  $$RETRX^P SOBPSUT(RX N,RFL),SDT >DT S EPHQ T=1 Q
  848            I  $$FIND^PS OREJUT(RXN ,RFL,,"79, 88",,1) S  EPHQT=1 Q
  849            I  $$PATCH^X PDUTL("PSO *7.0*287") ,$$TRISTA^ PSOREJU3(R XN,RFL,.RE SP,"PC") D  EPH Q
  850            I  $$PATCH^X PDUTL("PSO *7.0*287") ,$D(^TMP(" PSXEPHNB", $J,RXN,RFL )) D EPH Q
  851            I  $$STATUS^ PSOBPSUT(R XN,RFL)="I N PROGRESS " D EPH Q
  852            I  $$PATCH^X PDUTL("PSO *7.0*289") ,'$$DSH(RE C) S EPHQT =1 Q
  853            I  $$PATCH^X PDUTL("PSO *7.0*289") ,'$$DUR(RX N,RFL) D E PH Q
  854            Q
  855   EPH      ;  - Store R x not xmit ted to CMO P in XTMP  file for M ailMan mes sage.
  856  
  857   Modified L ogic (Chan ges are hi ghlighted)
  858  
  859            ;  EPHARM is  called on ly by GETD ATA^PSXRPP L.  The va riable EPH QT is
  860            ;  Newed in  GETDATA.   If EPHQT i s set to 1  here, the n GETDATA  does
  861            ;  not conti nue proces sing the c urrent Rx/ Fill; this  Rx/Fill w ill
  862            ;  not be se nt to CMOP  if EPHQT  is set to  1 here.
  863            ;
  864   EPHARM   ;  - ePharma cy checks  for third  party bill ing
  865            ;
  866            ;  If CMOP i s still pr ocessing t he previou s fill ($$ DOUBLE), o r if the
  867            ;  RE-TRANSM IT flag is  'Yes' and  the send  date is in  the futur e, or if
  868            ;  this pres cription h as an unre solved 79, 88, or RRR  reject, t hen Set
  869            ;  EPHQT to  1 and Quit .  This Rx /Fill will  not be se nt to CMOP .
  870            ;
  871            I  $$DOUBLE^ PSXRPPL1(R XN,RFL) S  EPHQT=1 Q
  872            I  $$RETRX^P SOBPSUT(RX N,RFL),SDT >DT S EPHQ T=1 Q
  873            I  $$FIND^PS OREJUT(RXN ,RFL,,"79, 88",,1) S  EPHQT=1 Q
  874            ;
  875            ;  $$TRISTA  performs c hecks spec ific to TR ICARE/CHAM PVA.  If t he claim
  876            ;  was rejec ted or is  still "IN  PROGRESS",  or if it  is non-bil lable,
  877            ;  then add  this Rx to  the ^TMP( "PSXEPHIN" ) array an d quit.
  878            ;
  879            I  $$PATCH^X PDUTL("PSO *7.0*287") ,$$TRISTA^ PSOREJU3(R XN,RFL,.RE SP,"PC") D  EPH Q
  880            I  $$PATCH^X PDUTL("PSO *7.0*287") ,$D(^TMP(" PSXEPHNB", $J,RXN,RFL )) D EPH Q
  881            ;
  882            ;  If the cl aim is sti ll "IN PRO GRESS", th en add thi s Rx to th e
  883            ;  ^TMP("PSX EPHIN") ar ray and qu it.
  884            ;
  885            I  $$STATUS^ PSOBPSUT(R XN,RFL)="I N PROGRESS " D EPH Q
  886            ;
  887            ;  If this P rescriptio n violates  the 3/4 s upply (i.e . if it is  too soon
  888            ;  to refill ), then Se t EPHQT to  1 and Qui t.  This R x/Fill wil l not be
  889            ;  sent to C MOP.
  890            ;
  891            I  $$PATCH^X PDUTL("PSO *7.0*289") ,'$$DSH(RE C) S EPHQT =1 Q
  892            ;
  893            ;  If there  is a host  reject for  this Rx/F ill, then  add this R x to the
  894            ;  ^TMP("PSX EPHIN") ar ray and qu it.
  895            ;
  896            I  $$PATCH^X PDUTL("PSO *7.0*289") ,'$$DUR(RX N,RFL) D E PH Q
  897            Q
  898            ;
  899            ;  EPH is ca lled only  by EPHARM,  above.  I t adds a p rescriptio ns to the
  900            ;  ^TMP("PSX EPHIN") ar ray.  Of t hose Presc riptions n ot sent to  the CMOP
  901            ;  facility  and left i n the susp ense queue , some are  added to  this
  902            ;  array.  T hose in th is array w ill be lis ted in the  email sen t to users
  903            ;  indicatin g that the y were lef t in the q ueue (see  ^PSXBPSMS) .  That
  904            ;  email sta tes these  Rxs were n ot transmi tted to th e CMOP fac ility
  905            ;  because e ither a) a  response  from the p ayer was n ot receive d, or b)
  906            ;  the Rx is  non-billa ble.
  907            ;
  908   EPH      ;  - Store R x not xmit ted to CMO P in XTMP  file for M ailMan mes sage.
  909      
  910  
  911   An extrane ous <space > in CHHED T^PSXRPPL2  will be r emoved by  this enhan cement.
  912  
  913   Subroutine  Name
  914   CHHEDT^PSX RPPL2
  915   Enhancemen t Category
  916    New
  917    Modify
  918    Delete
  919    No Change
  920   Story
  921   US22
  922   Related Me nu Options  or ListMa n Actions
  923   Pull Early  from Susp ense [PSO  PNDRX]
  924   Print from  Suspense  File [PSO  PNDLBL]
  925   Related Ro utines
  926   This Subro utine is C alled By
  927   This Subro utine Call s
  928  
  929  
  930   $$SHDT^PSX RPPL2
  931   Related In tegration  Control Re gistration s (ICRs)
  932   N/A
  933   Data Passi ng
  934    Parameter  Input
  935    Parameter  Output
  936    Function  Return Val ue
  937    Global Mo dified
  938   Input Attr ibute Name  and Defin ition
  939   Name: RX
  940   Definition : Prescrip tion
  941    New       Modify       Delete       No Cha nge
  942   Name: RFL
  943   Definition : Refill
  944    New       Modify       Delete       No Cha nge
  945   Output Att ribute Nam e and Defi nition
  946   Name: $$CH HEDT
  947   Definition : 0 if hos t reject d ate is not  expired;  1 if host  reject has  expired;  2 if host  reject not  defined
  948    New       Modify       Delete       No Cha nge
  949   Current Lo gic
  950  
  951   CHHEDT(RX, RFL) ;
  952            ;  RX = Pres cription F ile IEN
  953            ;  RFL = Ref ill
  954            ; Returns: 
  955            ;  0 = host  reject dat e not expi red, 1 - h ost reject  has expir ed, 2 - ho st reject  not define
  956            ;
  957            S  SHDT=$$SH DT(RX,RFL)  ; Get sus pense hold  date for  rx/refill
  958            I  SHDT'=""  Q:DT'<SHDT  1  Q 0
  959            Q  2
  960  
  961   Modified L ogic (Chan ges are hi ghlighted)
  962  
  963   CHHEDT(RX, RFL) ;
  964            ;  RX = Pres cription F ile IEN
  965            ;  RFL = Ref ill
  966            ; Returns: 
  967            ;  0 = host  reject dat e not expi red, 1 - h ost reject  has expir ed, 2 - ho st reject  not define
  968            ;
  969            S  SHDT=$$SH DT(RX,RFL)  ; Get sus pense hold  date for  rx/refill
  970            I  SHDT'=""  Q:DT'<SHDT  1 Q 0
  971            Q  2
  972      
  973  
  974   The global  array ^TM P(“PSXEPHN B”) will n o longer b e used; bo th places  where it w as set, an d the one  place wher e it was c hecked, ar e being re moved from  SBTECME^P SXRPPL1, C HKDFN^PSXR PPL2, and  EPHARM^PSX RPPL2. The refore, th e three pl aces where  that glob al node wa s being Ki lled (all  in SDT^PSX RPPL, at t he beginni ng at end  of the pro cess) are  being remo ved.
  975  
  976   Subroutine  Name
  977   SDT^PSXRPP L
  978   Enhancemen t Category
  979    New
  980    Modify
  981    Delete
  982    No Change
  983   Story
  984   US22
  985   Related Me nu Options  or ListMa n Actions
  986   Pull Early  from Susp ense [PSO  PNDRX]
  987   Print from  Suspense  File [PSO  PNDLBL]
  988   Related Ro utines
  989   This Subro utine is C alled By
  990   This Subro utine Call s
  991  
  992   TRANS^PSXR SUS, PRT1^ PSXRSUS
  993   CHKDFN^PSX RPPL, GETD ATA^PSXRPP L, OERRLOC K^PSXRPPL,  T0^%ZOSV,  T1^%ZOSV,  $$CMOPON^ BPSUTIL, $ $ECMEON^BP SUTIL, PSO UL^PSSLOCK , ^PSXBPSM S, $$SBTEC ME^PSXRPPL 1, CHKDFN^ PSXRPPL2
  994   Related In tegration  Control Re gistration s (ICRs)
  995            ; Reference  to ^BPSUTI L   suppor ted by DBI A #4410
  996            ; Reference  to ^PSSLOC K   suppor ted by DBI A #2789
  997   Data Passi ng
  998    Parameter  Input
  999    Parameter  Output
  1000    Function  Return Val ue
  1001    Global Mo dified
  1002   Input Attr ibute Name  and Defin ition
  1003   Name: N/A
  1004   Definition
  1005    New       Modify       Delete       No Cha nge
  1006   Output Att ribute Nam e and Defi nition
  1007   Name: N/A
  1008   Definition
  1009    New       Modify       Delete       No Cha nge
  1010   Current Lo gic
  1011  
  1012   PSXRPPL  ; BIR/WPB,BA B-Gathers  data for t he CMOP Tr ansmission  ;13 Mar 2 002  10:31  AM
  1013            ; ;2.0;CMOP; **3,23,33, 28,40,42,4 1,48,62,58 ,66,65,69, 70**;11 Ap r 97;Build  9
  1014            ; Reference  to ^PS(52. 5,  suppor ted by DBI A #1978
  1015            ; Reference  to ^PSRX(      suppor ted by DBI A #1977
  1016            ; Reference  to ^PSOHLS N1  suppor ted by DBI A #2385
  1017            ; Reference  to ^PSORXL     suppor ted by DBI A #1969
  1018            ; Reference  to ^PSOLSE T   suppor ted by DBI A #1973
  1019            ; Reference  to %ZIS(1      suppor ted by DBI A #290
  1020            ; Reference  to %ZIS(2      suppor ted by DBI A #2247
  1021            ; Reference  to ^PSSLOC K   suppor ted by DBI A #2789
  1022            ; Reference  to ^XTMP(" ORLK-" sup ported by  DBIA #4001
  1023            ; Reference  to ^BPSUTI L   suppor ted by DBI A #4410
  1024            ; Reference  to ^PS(59      suppor ted by DBI A #1976
  1025            ; Reference  to $$SELPR T^PSOFDAUT  supported  by DBIA # 5740
  1026            ; Called fro m PSXRSUS  -Builds ^P SX(550.2,, 15,"C" , a nd returns  to PSXRSU S or PSXRT RAN
  1027            ;
  1028   SDT      K  ^TMP($J," PSX"),^TMP ($J,"PSXDF N"),^TMP(" PSXEPHNB", $J),ZCNT,P SXBAT D:$D (XRTL) T0^ %ZOSV
  1029            S  PSXTDIV=P SOSITE,PSX TYP=$S(+$G (PSXCS):"C ",1:"N")
  1030            ;
  1031            ;  - Submitt ing prescr iptions to  ECME (Ele ctronic Cl aims Mgmt  Engine) -  3rd pary
  1032            I  $$ECMEON^ BPSUTIL(PS XTDIV),$$C MOPON^BPSU TIL(PSXTDI V) D
  1033            .  N BPSCNT  S BPSCNT=$ $SBTECME^P SXRPPL1(PS XTYP,PSXTD IV,PRTDT,P SXDTRG)
  1034            .  ; - Wait  15 seconds  per presc ription se nt to ECME  (max of 2  hours)
  1035            .  I BPSCNT> 0 H 60+$S( (BPSCNT*15 )>7200:720 0,1:(BPSCN T*15))
  1036            ;
  1037            ;  - Transmi tting pres cription t o CMOP (up  to THROUG H DATE)
  1038            K  ^TMP("PSX EPHIN",$J)
  1039            S  SDT=0 F   S SDT=$O(^ PS(52.5,"C MP","Q",PS XTYP,PSXTD IV,SDT)) S  XDFN=0 Q: (SDT>PRTDT )!(SDT'>0)   D
  1040            .  F  S XDFN =$O(^PS(52 .5,"CMP"," Q",PSXTYP, PSXTDIV,SD T,XDFN)) S  REC=0 Q:( XDFN'>0)!( XDFN="")   D
  1041            .  . F  S RE C=$O(^PS(5 2.5,"CMP", "Q",PSXTYP ,PSXTDIV,S DT,XDFN,RE C)) Q:(REC '>0)!(REC= "")  D
  1042            .  . . D GET DATA D:$G( RXN) PSOUL ^PSSLOCK(R XN),OERRLO CK(RXN)
  1043            ;
  1044            ;  - Pulling  prescript ions ahead  (paramete r in OUTPA TIENT SITE  file #59)
  1045            I  $G(PSXBAT ),'$G(PSXR TRAN) D CH KDFN^PSXRP PL2(PRTDT)
  1046            I  $G(PSXBAT ),'$G(PSXR TRAN) D CH KDFN
  1047            ;
  1048            ;  - Sends a  Mailman m essage if  there were  transmiss ion proble ms with th e 3rd Part y Payer
  1049            I  $D(^TMP(" PSXEPHIN", $J)) D ^PS XBPSMS K ^ TMP("PSXEP HIN",$J),^ TMP("PSXEP HNB",$J)
  1050            ;
  1051   EXIT     ;    
  1052            K  SDT,DFN,R EC,RXNUM,P SXOK,FILNU M,REF,PNAM E,CNAME,DI E,DR,NDFN, %,CNT,COM, DTTM,FILL, JJ,PRTDT,P SXDIV,XDFN ,NFLAG,CIN D,XDFN
  1053            K  CHKDT,DAY S,DRUG,DRU GCHK,NM,OP DT,PHARCLK ,PHY,PSTAT ,PTRA,PTRB ,QTY,REL,R XERR,RXF,S FN,PSXDGST ,PSXMC,PSX MDT
  1054            S :$D(XRT0)  XRTN=$T(+0 ) D:$D(XRT 0) T1^%ZOS V
  1055            K  ^TMP("PSX EPHIN",$J) ,^TMP("PSX EPHNB",$J)
  1056            Q
  1057  
  1058   Modified L ogic (Chan ges are hi ghlighted)
  1059  
  1060   PSXRPPL  ; BIR/WPB,BA B-Gathers  data for t he CMOP Tr ansmission  ;13 Mar 2 002  10:31  AM
  1061            ; ;2.0;CMOP; **3,23,33, 28,40,42,4 1,48,62,58 ,66,65,69, 70,81**;11  Apr 97;Bu ild 9
  1062            ; Reference  to ^PS(52. 5,  suppor ted by DBI A #1978
  1063            ; Reference  to ^PSRX(      suppor ted by DBI A #1977
  1064            ; Reference  to ^PSOHLS N1  suppor ted by DBI A #2385
  1065            ; Reference  to ^PSORXL     suppor ted by DBI A #1969
  1066            ; Reference  to ^PSOLSE T   suppor ted by DBI A #1973
  1067            ; Reference  to %ZIS(1      suppor ted by DBI A #290
  1068            ; Reference  to %ZIS(2      suppor ted by DBI A #2247
  1069            ; Reference  to ^PSSLOC K   suppor ted by DBI A #2789
  1070            ; Reference  to ^XTMP(" ORLK-" sup ported by  DBIA #4001
  1071            ; Reference  to ^BPSUTI L   suppor ted by DBI A #4410
  1072            ; Reference  to ^PS(59      suppor ted by DBI A #1976
  1073            ; Reference  to $$SELPR T^PSOFDAUT  supported  by DBIA # 5740
  1074            ;
  1075            ; Called fro m PSXRSUS  -Builds ^P SX(550.2,, 15,"C" , a nd returns  to PSXRSU S or PSXRT RAN
  1076            ;
  1077   SDT      ;
  1078            K  ^TMP($J," PSX"),^TMP ($J,"PSXDF N")
  1079            K  PSXBAT,ZC NT
  1080            I  $D(XRTL)  D T0^%ZOSV
  1081            S  PSXTDIV=P SOSITE,PSX TYP=$S(+$G (PSXCS):"C ",1:"N")
  1082            ;
  1083            ;  - Submitt ing prescr iptions to  ECME (Ele ctronic Cl aims Mgmt  Engine) -  3rd pary
  1084            I  $$ECMEON^ BPSUTIL(PS XTDIV),$$C MOPON^BPSU TIL(PSXTDI V) D
  1085            .  N BPSCNT  S BPSCNT=$ $SBTECME^P SXRPPL1(PS XTYP,PSXTD IV,PRTDT,P SXDTRG)
  1086            .  ; - Wait  15 seconds  per presc ription se nt to ECME  (max of 2  hours)
  1087            .  I BPSCNT> 0 H 60+$S( (BPSCNT*15 )>7200:720 0,1:(BPSCN T*15))
  1088            ;
  1089            ;  - Transmi tting pres cription t o CMOP (up  to THROUG H DATE)
  1090            K  ^TMP("PSX EPHIN",$J)
  1091            S  SDT=0 F   S SDT=$O(^ PS(52.5,"C MP","Q",PS XTYP,PSXTD IV,SDT)) S  XDFN=0 Q: (SDT>PRTDT )!(SDT'>0)   D
  1092            .  F  S XDFN =$O(^PS(52 .5,"CMP"," Q",PSXTYP, PSXTDIV,SD T,XDFN)) S  REC=0 Q:( XDFN'>0)!( XDFN="")   D
  1093            .  . F  S RE C=$O(^PS(5 2.5,"CMP", "Q",PSXTYP ,PSXTDIV,S DT,XDFN,RE C)) Q:(REC '>0)!(REC= "")  D
  1094            .  . . D GET DATA D:$G( RXN) PSOUL ^PSSLOCK(R XN),OERRLO CK(RXN)
  1095            ;
  1096            ;  - Pulling  prescript ions ahead  (paramete r in OUTPA TIENT SITE  file #59)
  1097            I  $G(PSXBAT ),'$G(PSXR TRAN) D CH KDFN^PSXRP PL2(PRTDT)
  1098            I  $G(PSXBAT ),'$G(PSXR TRAN) D CH KDFN
  1099            ;
  1100            ;  - Sends a  Mailman m essage if  there were  transmiss ion proble ms with th e 3rd Part y Payer
  1101            I  $D(^TMP(" PSXEPHIN", $J)) D ^PS XBPSMS K ^ TMP("PSXEP HIN",$J),^ TMP("PSXEP HNB",$J)
  1102            ;
  1103   EXIT     ;    
  1104            K  SDT,DFN,R EC,RXNUM,P SXOK,FILNU M,REF,PNAM E,CNAME,DI E,DR,NDFN, %,CNT,COM, DTTM,FILL, JJ,PRTDT,P SXDIV,XDFN ,NFLAG,CIN D,XDFN
  1105            K  CHKDT,DAY S,DRUG,DRU GCHK,NM,OP DT,PHARCLK ,PHY,PSTAT ,PTRA,PTRB ,QTY,REL,R XERR,RXF,S FN,PSXDGST ,PSXMC,PSX MDT
  1106            S :$D(XRT0)  XRTN=$T(+0 ) D:$D(XRT 0) T1^%ZOS V
  1107            K  ^TMP("PSX EPHIN",$J) ,^TMP("PSX EPHNB",$J)
  1108            Q
  1109      
  1110  
  1111  
  1112   Since the  claims sub mission pr ocess will  no longer  make an e ntry on th e prescrip tion’s Act ivity Log  if a presc ription wi ll be left  on suspen se due to  an “IN PRO GRESS” sta tus, this  design cal ls for upd ating the  CMOP proce ss to do t hat. The m ost approp riate time  in the pr ocess for  this to ha ppen is wh en the sys tem create s the emai l listing  all the pr escription s which ar e being le ft on susp ense and n ot sent to  CMOP.
  1113  
  1114   Subroutine  Name
  1115   EN^PSXBPSM S
  1116   Enhancemen t Category
  1117    New
  1118    Modify
  1119    Delete
  1120    No Change
  1121   Story
  1122   US22
  1123   Related Me nu Options  or ListMa n Actions
  1124   Pull Early  from Susp ense [PSO  PNDRX]
  1125   Print from  Suspense  File [PSO  PNDLBL]
  1126   Related Ro utines
  1127   This Subro utine is C alled By
  1128   This Subro utine Call s
  1129  
  1130   SDT^PSXRPP L, 
  1131   DEM^VADPT,  $$FMADD^X LFDT, LOG^ BPSOSL, $$ IEN59^BPSO SRX, $$STA TUS^PSOBPS UT, $$ELIG DISP^PSORE JP1, RXACT ^PSOBPSU2
  1132   Related In tegration  Control Re gistration s (ICRs)
  1133   Reference  to ^PSOBPS UT support ed by DBIA  #4701
  1134   Reference  to ^PSOBPS U2 support ed by DBIA  #4970
  1135   A new ICR  will have  to be crea ted to all ow this PS X routine  to call th e API ELIG DISP^PSORE JP1
  1136   Data Passi ng
  1137    Parameter  Input
  1138    Parameter  Output
  1139    Function  Return Val ue
  1140    Global Mo dified
  1141   Input Attr ibute Name  and Defin ition
  1142   Name: N/A
  1143   Definition
  1144    New       Modify       Delete       No Cha nge
  1145   Output Att ribute Nam e and Defi nition
  1146   Name: N/A
  1147   Definition :  
  1148    New       Modify       Delete       No Cha nge
  1149   Current Lo gic
  1150  
  1151   PSXBPSMS ; BIRM/BSR -  BPS (ECME ) Utilitie s ;10/29/9 8  2:13 PM
  1152            ; ;2.0;CMOP; **48,77**; 11 Apr 97; Build 3
  1153            ; Reference  to $$RXFLD T^PSOBPSUT  supported  by IA 470 1
  1154            ;
  1155   EN       ; Main entry  point.
  1156            N  EMCNT,DFN ,ORCNT,PAT CNT,DIV,RX ,RFL,DFN,S SN,PATNM,P TLST,VADM
  1157            K  ^TMP("PSX EPHOUT",$J )
  1158            S  ^XTMP("PS XBPSMS",0) =$$FMADD^X LFDT(DT,35 )_"^"_DT
  1159            S  DIV="",(E MCNT,ORCNT ,PATCNT)=0
  1160            F   S DIV=$O (^TMP("PSX EPHIN",$J, DIV)) Q:DI V=""  D
  1161            . D HEADER(D IV)
  1162            . S RX="" F   S RX=$O(^ TMP("PSXEP HIN",$J,DI V,RX)) Q:R X=""  D
  1163            . .S RFL=+$G (^TMP("PSX EPHIN",$J, DIV,RX))
  1164            . .S ^XTMP(" PSXBPSMS", 1,RX,RFL,D T)=""
  1165            . .S DFN=+$P (^PSRX(RX, 0),"^",2)  D DEM^VADP T
  1166            . .S SSN=$E( $P(VADM(2) ,U),6,9),P ATNM=(VADM (1))
  1167            . .S ORCNT=$ G(ORCNT)+1  D PATCNT( PATNM_SSN)
  1168            . .D FORMAT
  1169            . D FOOTER(D IV)
  1170            D  MAIL,CLEA N
  1171            Q
  1172  
  1173   Modified L ogic (Chan ges are hi ghlighted)
  1174  
  1175   PSXBPSMS ; BIRM/BSR -  BPS (ECME ) Utilitie s ;10/29/9 8  2:13 PM
  1176            ; ;2.0;CMOP; **48,77,81 **;11 Apr  97;Build 3
  1177            ; Reference  to $$RXFLD T^PSOBPSUT  supported  by IA 470 1
  1178            ; Reference  to LOG^BPS OSL suppor ted by ICR # 6764
  1179            ; Reference  to IEN59^B PSOSRX sup ported by  ICR# 4412
  1180            ; Reference  to ELIGDIS P^PSOREJP1  supported  by ICR# 6 763
  1181            ;
  1182            ;  PSXBPSMS  sends an e mail at th e conclusi on of the  CMOP proce ss to
  1183            ;  communica te to the  users whic h prescrip tions were  left in t he
  1184            ;  suspense  queue and  not sent t o the CMOP  facility.   There ar e two
  1185            ;  scenarios  that coul d lead to  this; eith er the pre scription  is
  1186            ;  non-billa ble, or a  response f rom the th ird party  payer was  not 
  1187            ;  received  by the tim e the CMOP  process s topped wai ting for
  1188            ;  responses  (see SDT^ PSXRPPL an d CHKDFN^P SXRPPL2).   Each of t he
  1189            ;  prescript ions liste d in ^TMP( "PSXEPHIN"  are inclu ded in thi s email.
  1190            ;  That glob al is set  only in EP H^PSXRPPL2 , which is  called on ly
  1191            ;  by EPHARM ^PSXRPPL2.
  1192            ;
  1193   EN       ; Main entry  point.
  1194            N  DFN,DIV,E MCNT,ORCNT ,PATCNT,PA TNM,PSXACT IVITY,PTLS T,RFL,RX,S SN,VADM
  1195            K  ^TMP("PSX EPHOUT",$J )
  1196            S  ^XTMP("PS XBPSMS",0) =$$FMADD^X LFDT(DT,35 )_"^"_DT
  1197            S  (EMCNT,OR CNT,PATCNT )=0
  1198            ;
  1199            S  DIV=""
  1200            F   S DIV=$O (^TMP("PSX EPHIN",$J, DIV)) Q:DI V=""  D
  1201            .  D HEADER( DIV)
  1202            .  S RX=""
  1203            .  F  S RX=$ O(^TMP("PS XEPHIN",$J ,DIV,RX))  Q:RX=""  D
  1204            .  . S RFL=+ $G(^TMP("P SXEPHIN",$ J,DIV,RX))
  1205            .  . S ^XTMP ("PSXBPSMS ",1,RX,RFL ,DT)=""
  1206            .  . ;
  1207            .  . ; Add a n entry to  the devel oper's log , BPS LOG,  file# 900 2313.12.
  1208            .  . ;
  1209            .  . D LOG^B PSOSL($$IE N59^BPSOSR X(RX,RFL), $T(+0)_"-P rescriptio n being le ft on CMOP  queue")   ; ICR #441 2,6764
  1210            .  . ;
  1211            .  . ; Add a n entry to  the Activ ity Log fo r this Rx  (sub-file#  52.3).
  1212            .  . ;
  1213            .  . I $$STA TUS^PSOBPS UT(RX,RFL) ="IN PROGR ESS" D  ;  ICR #4701
  1214            .  . . S PSX ACTIVITY=$ $ELIGDISP^ PSOREJP1(R X,RFL)_"-R x placed o n Suspense  due to EC ME IN PROG RESS statu s"  ; ICR  #6763
  1215            .  . . D RXA CT^PSOBPSU 2(RX,RFL,P SXACTIVITY ,"M",DUZ)   ; ICR # 4 970
  1216            .  . ;
  1217            .  . ; Deter mine the S SN and Pat ient Name.
  1218            .  . ;
  1219            .  . S DFN=+ $P(^PSRX(R X,0),"^",2 ) D DEM^VA DPT
  1220            .  . S SSN=$ E($P(VADM( 2),U),6,9) ,PATNM=(VA DM(1))
  1221            .  . ;
  1222            .  . ; Incre ment the c ount of or ders (Rxs)  and uniqu e patients .
  1223            .  . ;
  1224            .  . S ORCNT =$G(ORCNT) +1
  1225            .  . D PATCN T(PATNM_SS N)
  1226            .  . ;
  1227            .  . D FORMA T
  1228            .  D FOOTER( DIV)
  1229            D  MAIL,CLEA N
  1230            Q
  1231      
  1232  
  1233  
  1234   Subroutine  Name
  1235   MAIL^PSXBP SMS
  1236   Enhancemen t Category
  1237    New
  1238    Modify
  1239    Delete
  1240    No Change
  1241   Story
  1242   US22
  1243   Related Me nu Options  or ListMa n Actions
  1244   Pull Early  from Susp ense [PSO  PNDRX]
  1245   Print from  Suspense  File [PSO  PNDLBL]
  1246   Related Ro utines
  1247   This Subro utine is C alled By
  1248   This Subro utine Call s
  1249  
  1250    EN^PSXBPS MS
  1251   $$GET1^DIQ , ^XMD
  1252   Related In tegration  Control Re gistration s (ICRs)
  1253   N/A
  1254   Data Passi ng
  1255    Parameter  Input
  1256    Parameter  Output
  1257    Function  Return Val ue
  1258    Global Mo dified
  1259   Input Attr ibute Name  and Defin ition
  1260   Name: N/A
  1261   Definition
  1262    New       Modify       Delete       No Cha nge
  1263   Output Att ribute Nam e and Defi nition
  1264   Name: N/A
  1265   Definition :  
  1266    New       Modify       Delete       No Cha nge
  1267   Current Lo gic
  1268  
  1269            ; Build and  Send email  to provid er.
  1270   MAIL     ;
  1271            N  PSBMSG,M1 ,Y,USER,XM TEXT,XMDUZ ,XMSUB,XMY
  1272            S  PSBMSG(1) ="The pres criptions  listed in  this messa ge did not  transmit  to CMOP fo r one of"
  1273            S  PSBMSG(2) ="the reas ons below: "
  1274            S  PSBMSG(3) =" "
  1275            S  PSBMSG(4) ="         A response  from the  third part y payer wa s not rece ived"
  1276            S  PSBMSG(5) =" "
  1277            S  PSBMSG(6) ="         OR"
  1278            S  PSBMSG(7) =" "
  1279            S  PSBMSG(8) ="         The prescr iptions ar e non-bill able in Vi stA"
  1280            S  PSBMSG(9) =" "
  1281            S  PSBMSG(10 )="The pre scriptions  will rema in in the  CMOP queue  and will  transmit w hen the"
  1282            S  PSBMSG(11 )="respons e from the  third par ty payer i s received , or the n on-billabl e issue"
  1283            S  PSBMSG(12 )="is reso lved.  Exa mples of n on-billabl e issues a re prescri ptions for "
  1284            S  PSBMSG(13 )="sensiti ve medicat ions that  need Relea se of Info rmation an d prescrip tions"
  1285            S  PSBMSG(14 )="for non -billable  drugs (e.g ., OTC pro ducts for  CHAMPVA an d TRICARE  patients). "
  1286            S  PSBMSG(15 )=" "
  1287            S  M1=16
  1288            S  Y="" F  S  Y=$O(^TMP ("PSXEPHOU T",$J,"M", Y)) Q:Y=""   D
  1289            . S PSBMSG(M 1)=$P(^TMP ("PSXEPHOU T",$J,"M", Y),"^"),M1 =M1+1
  1290            ;  Send emai l to all u sers who h old a secu rity key
  1291            S  USER=0
  1292            I  $D(^XUSEC ("PSXMAIL" )) D
  1293            . F  S USER= $O(^XUSEC( "PSXMAIL", USER)) Q:' USER  S XM Y(USER)=""
  1294            E   D
  1295            . F  S USER= $O(^XUSEC( "PSXCMOPMG R",USER))  Q:'USER  S  XMY(USER) =""
  1296            ;
  1297            N  DIV,SITES
  1298            S  DIV="",SI TES=""
  1299            F   S DIV=$O (^TMP("PSX EPHIN",$J, DIV)) Q:DI V=""  S SI TES=SITES_ $$GET1^DIQ (59,DIV_", ",.01,"E") _","
  1300            S  XMSUB=$E( "ePharmacy  CMOP Not  TRANSMITTE D Rxs - "_ $E(SITES,1 ,$L(SITES) -1),1,65)
  1301            S  XMTEXT="P SBMSG(",XM DUZ=.5
  1302            D  ^XMD
  1303            Q
  1304  
  1305   Modified L ogic (Chan ges are hi ghlighted)
  1306  
  1307            ;  MAIL buil ds the ema il message  and sends  it to use rs who hol d the
  1308            ;  key PSXMA IL (or PSX CMOPMGR).
  1309            ;
  1310   MAIL     ;
  1311            ;
  1312            N  DIV,M1,PS BMSG,SITES ,USER,XMDU Z,XMSUB,XM TEXT,XMY,Y
  1313            ;
  1314            S  PSBMSG(1) ="The pres criptions  listed in  this messa ge did not  transmit  to CMOP fo r one of"
  1315            S  PSBMSG(2) ="the reas ons below: "
  1316            S  PSBMSG(3) =" "
  1317            S  PSBMSG(4) ="         A response  from the  third part y payer wa s not rece ived"
  1318            S  PSBMSG(5) =" "
  1319            S  PSBMSG(6) ="         OR"
  1320            S  PSBMSG(7) =" "
  1321            S  PSBMSG(8) ="         The prescr iptions ar e non-bill able in Vi stA"
  1322            S  PSBMSG(9) =" "
  1323            S  PSBMSG(10 )="The pre scriptions  will rema in in the  CMOP queue  and will  transmit w hen the"
  1324            S  PSBMSG(11 )="respons e from the  third par ty payer i s received , or the n on-billabl e issue"
  1325            S  PSBMSG(12 )="is reso lved.  Exa mples of n on-billabl e issues a re prescri ptions for "
  1326            S  PSBMSG(13 )="sensiti ve medicat ions that  need Relea se of Info rmation an d prescrip tions"
  1327            S  PSBMSG(14 )="for non -billable  drugs (e.g ., OTC pro ducts for  CHAMPVA an d TRICARE  patients). "
  1328            S  PSBMSG(15 )=" "
  1329            S  M1=16
  1330            ;
  1331            S  Y=""
  1332            F   S Y=$O(^ TMP("PSXEP HOUT",$J," M",Y)) Q:Y =""  D
  1333            .  S PSBMSG( M1)=$P(^TM P("PSXEPHO UT",$J,"M" ,Y),"^")
  1334            .  S M1=M1+1
  1335            ;
  1336            ;  Setup the  list of r ecipients  (XMY).  Se nd the ema il to all  users
  1337            ;  holding t he securit y key PSXM AIL, if an y; otherwi se, send t o all
  1338            ;  users hol ding the k ey PSXCMOP MGR.
  1339            ;
  1340            S  USER=0
  1341            I  $D(^XUSEC ("PSXMAIL" )) D
  1342            . F  S USER= $O(^XUSEC( "PSXMAIL", USER)) Q:' USER  S XM Y(USER)=""
  1343            E   D
  1344            . F  S USER= $O(^XUSEC( "PSXCMOPMG R",USER))  Q:'USER  S  XMY(USER) =""
  1345            ;
  1346            ;  Set the s ubject (XM SUB), indi cate the a rray conta ining the  text of
  1347            ;  the messa ge is PSBM SG, and se t the send er to be P OSTMASTER  (.5).
  1348            ;
  1349            S  DIV="",SI TES=""
  1350            F   S DIV=$O (^TMP("PSX EPHIN",$J, DIV)) Q:DI V=""  S SI TES=SITES_ $$GET1^DIQ (59,DIV_", ",.01,"E") _","
  1351            S  XMSUB=$E( "ePharmacy  CMOP Not  TRANSMITTE D Rxs - "_ $E(SITES,1 ,$L(SITES) -1),1,65)
  1352            S  XMTEXT="P SBMSG("
  1353            S  XMDUZ=.5
  1354            ;
  1355            D  ^XMD
  1356            ;
  1357            Q
  1358      
  1359  
  1360  
  1361   The existi ng ICR #49 70 will ne ed to be u pdated int o include  the entry  point $$RX ACT^PSOBPS U2.
  1362  
  1363   Two new IC Rs will ne ed to be c reated to  allow rout ines in PS O and PSX  to call LO G^BPSOSL ( ICR #6764)  and routi nes in PSX  to call I EN59^BPSOS RX (ICR #6 763).
  1364  
  1365   Back Out/R ollback Pr ocedure
  1366   This story  does not  include ad ding or ch anging dat a fields i n any Vist A files, s o no rollb ack of dat a would be  necessary  if this e nhancement  needed to  be backed  out.
  1367  
  1368   To back ou t this enh ancement,  the routin es BPSNCPD P, PSOREJU 3, PSXBPSM S, PSXRPPL 1, and PSX RPPL2 shou ld be back ed up prio r to insta lling this  patch. Re verting to  the previ ous versio n of these  routines  would back  out this  enhancemen t. Alterna tively, th e previous  version o f these ro utines cou ld be dist ributed vi a an emerg ency patch .