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

ABSPOSAN.m

Go to the documentation of this file.
  1. ABSPOSAN ; IHS/FCS/DRS - Cancellation ; [ 09/12/2002 10:05 AM ]
  1. ;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
  1. Q
  1. ;
  1. ; CANCEL: See any of CLAIMIEN's claims have been marked for
  1. ; cancellation. If so, we don't want to send the claim.
  1. ; Called from GETNEXT^ABSPOSAP.
  1. ;
  1. CANCEL() ;EP - Deal with Cancellations in CLAIMIEN
  1. N RXI,CXL,KEEP S RXI="",(CXL,KEEP)=0
  1. N OLDSLOT S OLDSLOT=$$GETSLOT^ABSPOSL
  1. F S RXI=$O(^ABSPT("AE",CLAIMIEN,RXI)) Q:RXI="" D
  1. .I $G(^ABSPT(RXI,3)) S CXL=CXL+1 Q
  1. I 'CXL Q 0 ; none being canceled
  1. ; At least one being canceled
  1. ; The canceled one gets stamped as finished
  1. ; The others get sent back to status 30, Waiting for packet build
  1. S RXI="" F S RXI=$O(^ABSPT("AE",CLAIMIEN,RXI)) Q:RXI="" D
  1. .N ABSBRXI S ABSBRXI=RXI ; as some called subroutines expect it
  1. .D SETSLOT^ABSPOSL(ABSBRXI)
  1. .I $G(^ABSPT(RXI,3)) D
  1. ..D DOCANCEL(RXI) ; cancel this claim
  1. .E D ; send this claim back to status 30
  1. ..S KEEP=KEEP+1
  1. ..D SETSTAT^ABSPOSU(30)
  1. ..D LOG(CXL_" claim"_$S(CXL>1:"s",1:"")_" in the transmit packet were canceled; this claim was requeued.")
  1. ; Finally, rev up a packeter to make sure that any surviving claims
  1. ; get another chance
  1. I KEEP D PACKETER^ABSPOSQ1 ; ensure surviving claims get repacketed
  1. D SETSLOT^ABSPOSL(OLDSLOT)
  1. Q CXL
  1. ;
  1. ;
  1. DOCANCEL(IEN59) ; actually do the cancellation
  1. ; This may be called from other places.
  1. N BYDUZ S BYDUZ=$P(^ABSPT(IEN59,3),U)
  1. N MSG S MSG=RXI_" CANCELED by "_DUZ_" "_$P($G(^VA(200,BYDUZ,0)),U)
  1. N OLDSLOT S OLDSLOT=$$GETSLOT^ABSPOSL
  1. D SETSLOT^ABSPOSL(IEN59)
  1. D LOG(MSG)
  1. D RELSLOT^ABSPOSL
  1. I OLDSLOT D SETSLOT^ABSPOSL(OLDSLOT)
  1. ; In field 302, put the status of the claim at the time it was canceled
  1. ; Test: I field 302 ]"", then the claim was successfully canceled.
  1. S $P(^ABSPT(IEN59,3),U,2)=$P(^ABSPT(IEN59,0),U,2)
  1. D SETSTAT^ABSPOSU(99)
  1. D SETRESU^ABSPOSU(-1,MSG)
  1. Q
  1. LOG(X) D LOG^ABSPOSL($T(+0)_" - "_X) Q