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

ABSPOSQF.m

Go to the documentation of this file.
  1. ABSPOSQF ; IHS/FCS/DRS - Insurer asleep - status 31 ;
  1. ;;1.0;PHARMACY POINT OF SALE;;JUN 21, 2001
  1. Q
  1. ;
  1. ; Continuation of ABSPOSQ2
  1. ;
  1. STATUS31 ;EP - ABSPOSQ2
  1. ; Situation: you have 1 or 2 or maybe 200 claims in status 31,
  1. ; because we've determined that the insurer is asleep.
  1. ; change at most one claim per insurer to status 30, to let it
  1. ; go through and try again. But if the insurer is awake for sure,
  1. ; let all of the claims for that insurer go on through.
  1. N STATUS30,IEN59,INSURER S STATUS30=31,IEN59=""
  1. K ^TMP("ABSPOSQF",$J) ; build ^TMP("ABSPOSQF",$J,INSURER,IEN59)=""
  1. Q:'$$LOCK59^ABSPOSQ2
  1. F S IEN59=$$NEXT59^ABSPOSQ2(IEN59) Q:'IEN59 D
  1. . ; if $$NEXT59() returned us an IEN59, then the waiting time
  1. . ; has expired - or better yet, the insurer has awakened
  1. . S INSURER=$P(^ABSPT(IEN59,1),U,6)
  1. . ; If still in wait, but wait expired, just allow one claim thru.
  1. . ; But if wait has been canceled - that is, we had a successful
  1. . ; transmit, meaning the insurer has awakened - then let them all
  1. . ; go through to status 30.
  1. . N X S X=$G(^ABSPEI(INSURER,101))
  1. . N T,PROBER S T=$P(X,U),PROBER=$P(X,U,6)
  1. . ; if somehow the prober became complete, without clearing 101;6
  1. . ; (maybe this happens if cancellation takes place?)
  1. . I PROBER D
  1. . . N X S X=$P($G(^ABSPT(PROBER,0)),U,2)
  1. . . I X=99!(X="") S PROBER=""
  1. . I T,PROBER,PROBER'=IEN59 Q ; only prober can go thru during wait
  1. . I T S $P(^ABSPEI(INSURER,101),U,6)=IEN59 ; you're the prober
  1. . S ^TMP("ABSPOSQF",$J,INSURER,IEN59)=""
  1. D UNLOCK59^ABSPOSQ2
  1. S INSURER="" F S INSURER=$O(^TMP("ABSPOSQF",$J,INSURER)) Q:'INSURER D
  1. . S IEN59="" F S IEN59=$O(^TMP("ABSPOSQF",$J,INSURER,IEN59)) Q:'IEN59 D
  1. . . D SETSTAT^ABSPOSQ2(30) ; reset to status 30
  1. . . K ^ABSPT(IEN59,8) ; clear Listmanager wait info
  1. Q