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

ABSPOSU7.m

Go to the documentation of this file.
  1. ABSPOSU7 ; IHS/FCS/DRS - misc. utilities ;
  1. ;;1.0;PHARMACY POINT OF SALE;;JUN 21, 2001
  1. Q
  1. ; delete antique, hopeless .59s [ 09/14/2000 8:36 AM ]
  1. ; How can they possibly get stranded?
  1. ; Well, this cleans them up
  1. PURGE(HRS) ;EP - purge all the ones older than HRS hours
  1. W !
  1. I '$D(HRS) D Q:'$G(HRS)
  1. . W "Unstrand all the claims which haven't been updated",!
  1. . N PROMPT S PROMPT="in how many hours? "
  1. . N DEF S DEF=24
  1. . N OPT S OPT=1
  1. . N MIN,MAX S MIN=.05,MAX=99999999 ; .05 hours = 3 minutes
  1. . S HRS=$$NUMERIC^ABSPOSU2(PROMPT,DEF,OPT,MIN,MAX,2) ; 2 = dec. places
  1. . I HRS<MIN K HRS
  1. . W !
  1. W "Stranded claims survey and cleanup; HRS=",HRS," ",$$NOWEXT^ABSPOSU1,!
  1. N COUNT S (COUNT,COUNT("SET TO COMPLETE"))=0
  1. N SECS S SECS=HRS*60*60 ; ABSP*1.0T7*5 ; needed an extra *60
  1. N STAT S STAT=""
  1. F S STAT=$O(^ABSPT("AD",STAT)) Q:STAT="" D
  1. . Q:STAT=99 ; complete
  1. . N IEN59 S IEN59=""
  1. . F S IEN59=$O(^ABSPT("AD",STAT,IEN59)) Q:IEN59="" D
  1. . . S COUNT=COUNT+1
  1. . . I '$D(^ABSPT(IEN59,0)) D Q ; should never happen
  1. . . . W "STAT=",STAT,", IEN59=",IEN59," has no 0 node",!
  1. . . N LAST S LAST=$P(^ABSPT(IEN59,0),U,8)
  1. . . I 'LAST D Q ; should never happen
  1. . . . W "STAT=",STAT,", IEN59=",IEN59," has no LAST UPDATE time",!
  1. . . N AGE,AGEI
  1. . . S AGEI=$$TIMEAGOI^ABSPOSUD(LAST),AGE=$$TIMEAGO^ABSPOSUD(LAST)
  1. . . W IEN59," last update ",LAST," which was ",AGE," ago",!
  1. . . I AGEI>SECS D
  1. . . . W ?10,"setting it to complete..."
  1. . . . D PURGE1(IEN59)
  1. . . . W "done.",!
  1. . . . S COUNT("SET TO COMPLETE")=COUNT("SET TO COMPLETE")+1
  1. . . E D
  1. . . . W ?10,"nothing done to this claim.",!
  1. D ZWRITE^ABSPOS("COUNT")
  1. Q
  1. PURGE1(IEN59) ;
  1. N ABSBRXI S ABSBRXI=IEN59
  1. D SETSTAT^ABSPOSU(99)
  1. D SETRESU^ABSPOSU(-1,"mark incomplete claim as stranded after "_AGE)
  1. Q
  1. PURGEALL D PURGE(0) Q ; should only be done by programmer?