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

ABSPOSQ1.m

Go to the documentation of this file.
  1. ABSPOSQ1 ; IHS/FCS/DRS - POS background, Part 1 ; [ 11/04/2002 2:21 PM ]
  1. ;;1.0;PHARMACY POINT OF SALE;**3,46**;JUN 01, 2001;Build 38
  1. ;
  1. ; This is usually started by Taskman call in TASK^ABSPOSIZ
  1. ;
  1. ; For all with status 0, LOOP loops and calls CLAIMINF()
  1. ; to fill in any missing information. Pricing, for example,
  1. ; may or may not have already been determined.
  1. ; Sets status = 10 while it's working on a request.
  1. ; Sets status = 30 when it's done - and then it's ready for ABSPOSQ2
  1. ; If there were problems with the claim, the status will be set = 99.
  1. ;
  1. ; Also deals with status = 19 (special for Oklahoma Medicaid)
  1. ;
  1. ; ABSPOSQ - contains many useful $$ calls
  1. ; Here in ABSPOSQ1:
  1. ; The big outer loop through ^ABSPT("AD",0,*)
  1. ; and Task manager calls to start up ^ABSPOSQ2
  1. ; Extensions of ABSPOSQ1:
  1. ; ABSPOSQA - ONE59
  1. ; ABSPOSQB - CLAIMINF
  1. ; ABSPOSQC - some CLAIMINF subroutines
  1. ; ABSPOSQD - data for certain a/r interfaces
  1. ; ABSPOSQS - special queuing for Oklahoma Medicaid 3 highest prices
  1. ;
  1. ;--------------------------------------------------------------
  1. ;IHS/SD/lwj 11/04/02 on behalf of IHS/OKCAO/POC
  1. ; Set ZTREQ to delete the task after it completes in task man
  1. ;
  1. ;-------------------------------------------------------------
  1. Q
  1. LOOP ; line item detail: your work list is ^ABSPT("AD",0)
  1. N ERROR,PREVPAT,THISPAT,COUNT,PACKETER S PACKETER=0
  1. N IEN59,ABSBRXI,ABSBRXR,ABSBNDC,MODULO
  1. N ABSBPATI,ABSBPDIV,ABSBSDIV,ABSBVISI,ABSPHARM,INSURER
  1. N VMEDDFN,APCDVCN
  1. ;
  1. ;IHS/OIT/CAS/RCS Patch 46...If 'POSSTAT' flag is set to '1' then halt the POS process
  1. I $G(^ABSP(9002313.99,1,"POSSTAT"))=1 Q ;Halt the POS Process, only used by programmers
  1. ;
  1. ;IHS/SD/lwj 11/04/02 on behalf of IHS/OKCAO/POC 11/04/02
  1. I $D(ZTQUEUED) S ZTREQ="@" ;delete task if complete
  1. ;
  1. ;IHS/SD/lwj 11/04/02 end change
  1. ;
  1. S MODULO=4 ; interval at which we start up a packeter program
  1. S COUNT=0
  1. F S IEN59=$$NEXT59 Q:'IEN59 D
  1. . D INIT^ABSPOSL(IEN59,1) ; logging (don't delete old data)
  1. . D ONE59^ABSPOSQA ; process this claim
  1. . D RELSLOT^ABSPOSL ; release logging slot
  1. ; Deal with the status 19s (special for Oklahoma Medicaid bundling)
  1. I $D(^ABSPT("AD",19)) D
  1. . I $$STAT19^ABSPOSQS D ; if any 19s pushed to status 30, then
  1. . . S COUNT=.1 ; force packeter to start
  1. I COUNT#MODULO'=0 D PACKETER
  1. Q
  1. NEXT59() ; Get the next entry with Status = 0
  1. ; If there is one, change its status to 10
  1. ; (says "Gathering claim information")
  1. ; (Being very careful to LOCK access while you're getting the entry
  1. ; and changing its status.)
  1. ; Timed lock and resulting complications is a hassle but not a mess.
  1. L +^ABSPT:300
  1. I '$T D Q 0 ; lock failed?!
  1. . D TASK^ABSPOSIZ ; try again - requeue this job
  1. S IEN59=$O(^ABSPT("AD",0,0))
  1. I IEN59 D SETSTAT(10)
  1. L -^ABSPT
  1. Q IEN59
  1. SETSTAT(NEWSTAT) ;EP - from ABSPOSQA
  1. N ABSBRXI S ABSBRXI=IEN59 ; unfortunate variable name convention
  1. D SETSTAT^ABSPOSU(NEWSTAT)
  1. Q
  1. PACKETER ;EP - from ABSPOSAN,ABSPOSQA
  1. ; tell the packetizer it's time to get working
  1. ; But only if there are claims in status 30
  1. I $O(^ABSPT("AD",30,0)) D TASK
  1. Q
  1. TASK ;EP - from ABSPOS2D,ABSPOS6D,ABSPOS6L,ABSPOSQ2,ABSPOSQ4
  1. N X,%DT,Y S X="N",%DT="ST" D ^%DT
  1. D TASKAT(Y)
  1. I $D(PACKETER) S PACKETER=PACKETER+1 ; note: "we started the packeter"
  1. Q
  1. TASKAT(ZTDTH) ;EP - from ABSPOSQ4 (requeue if insurer is sleeping)
  1. ; called here from ABSPOSQS -
  1. ;N (DUZ,PACKETER,ZTDTH) N ZTRTN
  1. N ZTRTN,ZTIO
  1. S ZTRTN="PACKETS^ABSPOSQ2",ZTIO=""
  1. D ^%ZTLOAD
  1. Q