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

IB20POST.m

Go to the documentation of this file.
  1. IB20POST ;ALB/MAF - Post-Init to correct EABD for entries in "ATOBIL" x-ref. - Aug 7, 1997
  1. ;;2.0; INTEGRATED BILLING ;**81**; 21-MAR-94
  1. ; -- Post init to correct the Earliest Auto Biller Date (EABD).
  1. ; The 17th piece ^ibt(356,ifn,0) gets reset to the date the entry
  1. ; was entered into Claims Tracking plus the Days Delay.
  1. ; This is only done for PRESCRIPTION REFILLS.
  1. D BMES^XPDUTL("*** Correcting the Earliest Auto Billing Date (EABD) for entries in the 'ATOBIL' cross reference in Claims Tracking - Only for Prescription Refills.")
  1. N IBDFN,IBTYPE,IBEABD,IBDT,IBDTCT,IBDFNODE,DIC,X,IBCTDA
  1. S (IBDFN,IBTYPE,IBDT,IBEABD,IBCTDA)=0
  1. F S IBDFN=$O(^IBT(356,"ATOBIL",IBDFN)) Q:'IBDFN S IBTYPE=$O(^IBE(356.6,"B","PRESCRIPTION REFILL",0)) D
  1. .F S IBDT=$O(^IBT(356,"ATOBIL",IBDFN,IBTYPE,IBDT)) Q:'IBDT F S IBCTDA=$O(^IBT(356,"ATOBIL",IBDFN,IBTYPE,IBDT,IBCTDA)) Q:'IBCTDA D
  1. ..S IBDFNODE=$G(^IBT(356,IBCTDA,0)),IBDTCT=$S(+$G(^IBT(356,IBCTDA,1))]"":+^IBT(356,IBCTDA,1),1:$P(IBDFNODE,"^",6))
  1. ..S IBEABD=$$EABD(IBTYPE,IBDTCT)
  1. ..S DIE="^IBT(356,",DA=IBCTDA,DR=".17////"_IBEABD
  1. ..D ^DIE K DA,DIE,DR
  1. ..Q
  1. I '$D(^IBT(356,"ATOBIL")) D BMES^XPDUTL("*** There are no EABD cross references to correct ***")
  1. D BMES^XPDUTL("DONE")
  1. Q
  1. EABD(IBETYP,IBTDT) ; -- compute earliest auto bill date: date entered plus days delay for event type
  1. ;the difference betwieen this and EABD^IBTUTL is that the autobill of the event type may be turned off
  1. ;and this procedure will still return a date
  1. ; -- input IBETYPE = pointer to type of entry file
  1. ; IBTDT = episode date, if not passed in uses DT
  1. ;
  1. N X,X1,X2,Y,IBETYPD S Y="" I '$G(IBETYP) G EABDQ
  1. S IBETYPD=$G(^IBE(356.6,+IBETYP,0)) I '$G(IBTDT) S IBTDT=DT
  1. S X2=+$P(IBETYPD,"^",6) ;set earliest autobill date to entered date plus days delay
  1. S X1=IBTDT D C^%DTC S Y=X\1
  1. EABDQ Q Y