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

IBCNBPG.m

Go to the documentation of this file.
  1. IBCNBPG ;ALB/ARH-Ins Buffer: Option Purge stub entries ;1 Jun 97
  1. ;;2.0;INTEGRATED BILLING;**82**;21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. PURGE ;
  1. N X,Y,DIR,DIRUT,DUOUT,IBX,IBDBDT
  1. ;
  1. W @IOF,!!,?29,"INSURANCE BUFFER PURGE",!
  1. W !!,?3,"This option will purge Buffer file records Processed before a given date."
  1. W !!,?3,"When a Buffer record is Processed a stub entry remains in the Buffer file"
  1. W !,?3,"for tracking and reporting purposes. This option deletes all stub entries"
  1. W !,?3,"of Buffer records processed at least a year ago. Once a record is purged,"
  1. W !,?3,"it can not be retrieved and will no longer be included in Buffer reports."
  1. W !,?3,"To maintain a record of the Buffer activity, consider printing the Buffer"
  1. W !,?3,"reports for the date range you are going to be purging.",!!
  1. ;
  1. DATE ;
  1. S IBX=$$FMADD^XLFDT(DT,-365)
  1. S DIR("?",1)="All Buffer records that were Processed before the selected date will be deleted."
  1. S DIR("?",2)="A minimum of 1 year of Buffer records is maintained on line, therefore"
  1. S DIR("?",3)="the latest selectable date is 1 year ago.",DIR("?",4)=" "
  1. S DIR("?")="Enter a date on or before "_$$FMTE^XLFDT(IBX)_" or '^' to exit."
  1. S DIR("A")="Purge Buffer Records Processed Before",DIR("B")=$$FMTE^XLFDT(IBX)
  1. S DIR(0)="DO^:"_IBX_":EX" D ^DIR K DIR S IBDBDT=+Y I Y'?7N!(Y>IBX)!($D(DIRUT)) Q
  1. ;
  1. W !!
  1. OK ;
  1. S DIR("?",1)="All Buffer records that were Processed before the selected date will be deleted.",DIR("?",2)=" "
  1. S DIR("?")="Enter Yes to continue the Purge. Enter No to stop the process before deleting any Buffer records."
  1. S DIR("A")="Ok to Purge Buffer records Processed before "_$$FMTE^XLFDT(IBDBDT)
  1. S DIR(0)="YO" D ^DIR I Y'=1 Q
  1. ;
  1. ;
  1. QUEUE ;
  1. S ZTDESC="Purge Insurance Buffer",ZTRTN="DELETE^IBCNBPG",ZTSAVE("IBDBDT")="",ZTIO="",ZTDTH=DT_".20" D ^%ZTLOAD
  1. I $D(ZTSK) W !!,"Purge of Insurance Buffer queued for this evening at 8:00pm."
  1. ;
  1. Q
  1. ;
  1. DELETE ; delete all processed buffer entries older than a specified date, date must be 1 year or more ago
  1. ; QUEUED portion of PURGE OPTION
  1. N IBEDT,IBBUFDA,IBB0,IBSTAT,IBPDT,DA,DIK,X,Y
  1. ;
  1. I $G(IBDBDT)'?7N!($G(IBDBDT)'<$$FMADD^XLFDT(DT,-364)) Q
  1. ;
  1. S IBEDT=0 F S IBEDT=$O(^IBA(355.33,"B",IBEDT)) Q:'IBEDT!(IBEDT>IBDBDT) D
  1. . S IBBUFDA=0 F S IBBUFDA=$O(^IBA(355.33,"B",IBEDT,IBBUFDA)) Q:'IBBUFDA D
  1. .. S IBB0=^IBA(355.33,IBBUFDA,0)
  1. .. S IBSTAT=$P(IBB0,U,4) I IBSTAT'="A",IBSTAT'="R" Q
  1. .. S IBPDT=$P(IBB0,U,5) I IBPDT'<IBDBDT Q
  1. .. ;
  1. .. S DA=IBBUFDA,DIK="^IBA(355.33," D ^DIK K DIK,DA
  1. ;
  1. Q