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

IBCIST.m

Go to the documentation of this file.
  1. IBCIST ;DSI/SLM - ENTRY POINTS FOR CLAIMSMANAGER INTERFACE ;7-MAR-2001
  1. ;;2.0;INTEGRATED BILLING;**161**;21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ST1 ;add or update in 351.9
  1. Q:'$D(IBIFN)
  1. Q:$$CK1^IBCIUT1(IBIFN) ; Exit if the bill is not a HCFA-1500
  1. K IBCIREDT ; remove the re-edit flag upon start of bill edit
  1. ;
  1. ; If the bill is not editable, then just quit.
  1. ; This can happen in the IB PRINT BILL option when the user wants to
  1. ; review the IB screens on a bill that has already been authorized.
  1. ; esg - 5/22/01
  1. ;
  1. I '$F(".1.","."_$P($G(^DGCR(399,IBIFN,0)),U,13)_".") Q ;DSI/DJW 3/21/02
  1. ;
  1. I '$D(^IBA(351.9,IBIFN)) D ADD^IBCIADD1 Q
  1. D UPDT1,OVRDN,UPDT^IBCIADD1
  1. ST1Q Q
  1. ;
  1. ST2 ;send to claimsmanager
  1. ; When calling ST2 the following 4 variables will always be returned:
  1. ; IBCISNT - identifies where it was sent from
  1. ; IBCIERR - error code if error condition
  1. ; IBCISTAT - claim status in 351.9
  1. ; IBCIREDT - re-edit flag
  1. ;
  1. I '$D(IBIFN) Q ; check for ibifn
  1. I '$D(IBCISNT) Q ; check for this variable
  1. I IBCISNT'=7 D CKFT^IBCIUT1(IBIFN) ; check for form type change
  1. I IBCISNT'=7,$$CK1^IBCIUT1(IBIFN) Q ; check for hcfa 1500
  1. I '$D(^IBA(351.9,IBIFN)) Q ; check for existence in 351.9
  1. ;
  1. NEW IBCIMT
  1. S IBCIERR="",IBCIREDT=0,IBCIMT=$$ENV^IBCIUT5
  1. ;
  1. ;if claimsmanager not working okay update status and quit
  1. I '$$CK2^IBCIUT1() D G ST2Q
  1. .I IBCISNT=1 S (IBCIST,IBCISTAT)=7 D ST^IBCIUT1(IBCIST) Q
  1. .I IBCISNT=2 S (IBCIST,IBCISTAT)=7 D ST^IBCIUT1(IBCIST) Q
  1. .I IBCISNT=3 Q
  1. .I IBCISNT=4 S (IBCIST,IBCISTAT)=10 D ST^IBCIUT1(IBCIST) Q
  1. .I IBCISNT=5 S (IBCIST,IBCISTAT)=11 D ST^IBCIUT1(IBCIST) Q
  1. .I IBCISNT=6 S (IBCIST,IBCISTAT)=7 D ST^IBCIUT1(IBCIST) Q
  1. ;
  1. ;normal send
  1. I IBCISNT=1 D MSG1,SEND D G ST2Q
  1. .D UPDT1,UPDT2
  1. .I IBCISTAT=6 D MSG3
  1. .I IBCISTAT=3 D MSG2
  1. .I IBCISTAT=4 D EN^IBCIWK(1)
  1. ;
  1. ;multiple send option - not authorized
  1. I IBCISNT=2 D G ST2Q
  1. .I '$$CKLI^IBCIUT1(IBIFN) Q ; check for line items
  1. .D SEND
  1. .D UPDT1,UPDT2
  1. .I IBCISTAT=4 D
  1. ..N IBCIETP
  1. ..S IBCIETP=""
  1. ..F S IBCIETP=$O(^IBA(351.9,IBIFN,1,"B",IBCIETP)) Q:IBCIETP="" D GENERR^IBCIUT4(IBIFN,IBCIETP)
  1. ..Q
  1. ;
  1. ;test send
  1. I IBCISNT=3 D G ST2Q
  1. .D MSG1,SEND
  1. .I IBCISTAT=3 D MSG2
  1. ;
  1. ;cancelled
  1. I IBCISNT=4 D G ST2Q
  1. .D COMMENT^IBCIUT7(IBIFN,3)
  1. .; if the bill has never been sent to CM or if there are currently
  1. .; no line items on the bill, then just change the status and quit
  1. .I '$P(^IBA(351.9,IBIFN,0),U,15)!('$$CKLI^IBCIUT1(IBIFN)) D Q
  1. ..S IBCIST=9 D ST^IBCIUT1(IBCIST)
  1. ..D DELTI^IBCIUT4 ;delete temp nodes on a cancel even when not sending to claimsmanager
  1. .D UPDT1,UPDT2,SEND
  1. ;
  1. ;overridden
  1. I IBCISNT=5 D G ST2Q
  1. .D UPDT1,UPDT2,OVRDN1,SEND
  1. ;
  1. ;multiple send option - authorized
  1. I IBCISNT=6 D G ST2Q
  1. .I '$$CKLI^IBCIUT1(IBIFN) Q ; check for line items
  1. .D UPDT1,UPDT2,SEND
  1. ;
  1. ;
  1. ; Notes about IBCISNT=7 - esg - 1/3/2002
  1. ; User changed the form type from a HCFA into a UB and this bill
  1. ; has been previously sent to ClaimsManager as a HCFA. So this
  1. ; bill is currently a UB bill, but we need to send it to
  1. ; ClaimsManager in order to delete the line items over there.
  1. ; Ultimately, this bill will get deleted from 351.9, but we have
  1. ; to send it over there first.
  1. ;
  1. I IBCISNT=7 D G ST2Q
  1. . I '$$CKLI^IBCIUT1(IBIFN) Q ; check for line items
  1. . D SEND
  1. . Q
  1. ;
  1. ;
  1. ST2Q D CLEAN1^IBCIUT2 K PROBLEM
  1. Q
  1. ;
  1. SEND ; send the bill to claimsmanager
  1. I $$ASND^IBCIUT2(IBIFN) G SENDX ; no tcp/ip problems
  1. D COMERR^IBCIUT4 ; communications error mail message
  1. I PROBLEM'=99 D CLRCMQ^IBCIUT6(0) ; clear CM queue (silent mode)
  1. SENDX ;
  1. Q
  1. ;
  1. UPDT1 ; update certain fields when editing
  1. ; update the Date/Time Last Edited field (.08)
  1. ; update the User Last Edited field (.09)
  1. ;
  1. N IENS,FDA
  1. S IENS=IBIFN_",",FDA(351.9,IENS,.08)=$$NOW^XLFDT,FDA(351.9,IENS,.09)=DUZ
  1. D FILE^DIE("K","FDA")
  1. Q
  1. ;
  1. UPDT2 ; update certain fields when sending
  1. ; update the Entered By User field if not there (.07)
  1. ; update the Date/Time Entered field if not there (.06)
  1. ; update the number of times sent to ClaimsManager (.04)
  1. ; update the Date/Time last sent to ClaimsManager (.03)
  1. ; update the Last Sent By User field (.05)
  1. ;
  1. N IENS,FDA,IBCIEB,IBCIDE
  1. S IENS=IBIFN_","
  1. I $P(^IBA(351.9,IBIFN,0),U,7)="" S FDA(351.9,IENS,.07)=DUZ
  1. I $P(^IBA(351.9,IBIFN,0),U,6)="" S FDA(351.9,IENS,.06)=$$NOW^XLFDT
  1. S IBCILSI=$$NOW^XLFDT,CTR=$S($P(^IBA(351.9,IBIFN,0),U,4)]"":$P(^(0),U,4),1:0)
  1. S IBCITSI=CTR+1,FDA(351.9,IENS,.04)=IBCITSI
  1. S FDA(351.9,IENS,.03)=IBCILSI,FDA(351.9,IENS,.05)=DUZ
  1. D FILE^DIE("K","FDA")
  1. Q
  1. ;
  1. OVRDN ;clear if overridden
  1. N IENS,FDA
  1. I $P(^IBA(351.9,IBIFN,0),U,10)]"" D
  1. .S IENS=IBIFN_","
  1. .S FDA(351.9,IENS,.1)="",FDA(351.9,IENS,.11)=""
  1. .D FILE^DIE("K","FDA")
  1. Q
  1. OVRDN1 ;set if overridden
  1. N IENS,FDA
  1. S IENS=IBIFN_","
  1. S FDA(351.9,IENS,.1)=1,FDA(351.9,IENS,.11)=DUZ
  1. D FILE^DIE("K","FDA")
  1. Q
  1. MSG1 ;display 'sending to ClaimsManager' message
  1. W !!,"... ",$S(IBCIMT="T":"TEST-",1:""),"Sending ",$P(^DGCR(399,IBIFN,0),U)," to ClaimsManager"
  1. Q
  1. MSG2 ;display 'no errors found' message
  1. W !!,"No Errors found by ClaimsManager"
  1. Q
  1. MSG3 ;display 'comm error' messsage
  1. W !!,"Communications Error - Not Sent to ClaimsManager"
  1. W !?3,$P(IBCIERR,U,2)
  1. I $P(IBCIERR,U,3)'="" D
  1. . W !?3,$P($P(IBCIERR,U,3)," - ",1)
  1. . W !?3,$P($P(IBCIERR,U,3,99)," - ",2,99)
  1. . Q
  1. Q
  1. MSG4 ;display 'no line items' message
  1. W !!,"There are no line items associated with this claim."
  1. W !!,"ClaimsManager cannot process without line items. Please"
  1. W !,"enter the line item data and resend."
  1. Q
  1. MSG5 ;display 'cancelled' message
  1. W !!,"... Claim has been CANCELLED in ClaimsManager."
  1. Q