SDSCCLM ;ALB/JAM/RBS - ASCD Update Claims Tracking ; 3/12/07 4:58pm
;;5.3;Scheduling;**495,1015**;Aug 13, 1993;Build 21
;;MODIFIED FOR NATIONAL RELEASE from a Class III software product
;;known as Service Connected Automated Monitoring (SCAM).
;
Q
CLM(SDENC) ; Check Claims Tracking
N SDOE0,SCSTAT,SCTIEN,SCVAL,SCTUPD,SDSC,SCERR
;
; If this encounter is not yet completed, quit
I $P(^SDSC(409.48,SDENC,0),"^",5)'="C" Q
;
; Status of encounter must be 'checked out'
S SDOE0=$$GETOE^SDOE(SDENC)
S SCSTAT=$P(SDOE0,"^",12) I SCSTAT'=2 Q
;
; Call IB API to get the claims tracking number
S SCTIEN=$$CT^IBRSUTL(SDENC)
;
;If there is no CT entry quit
I SCTIEN="" Q
S SDSC(409.48,SDENC_",",.1)=SCTIEN
D FILE^DIE("I","SDSC","SCERR")
;
;If SC value hasn't changed quit, else update CT in IB
S SCVAL=$$SCHNG^SDSCUTL(SDENC) I '+SCVAL Q
S SCTUPD=$$RNBU^IBRSUTL(SDENC,$S($P(SCVAL,U,3):1,1:2))
Q
SDSCCLM ;ALB/JAM/RBS - ASCD Update Claims Tracking ; 3/12/07 4:58pm
+1 ;;5.3;Scheduling;**495,1015**;Aug 13, 1993;Build 21
+2 ;;MODIFIED FOR NATIONAL RELEASE from a Class III software product
+3 ;;known as Service Connected Automated Monitoring (SCAM).
+4 ;
+5 QUIT
CLM(SDENC) ; Check Claims Tracking
+1 NEW SDOE0,SCSTAT,SCTIEN,SCVAL,SCTUPD,SDSC,SCERR
+2 ;
+3 ; If this encounter is not yet completed, quit
+4 IF $PIECE(^SDSC(409.48,SDENC,0),"^",5)'="C"
QUIT
+5 ;
+6 ; Status of encounter must be 'checked out'
+7 SET SDOE0=$$GETOE^SDOE(SDENC)
+8 SET SCSTAT=$PIECE(SDOE0,"^",12)
IF SCSTAT'=2
QUIT
+9 ;
+10 ; Call IB API to get the claims tracking number
+11 SET SCTIEN=$$CT^IBRSUTL(SDENC)
+12 ;
+13 ;If there is no CT entry quit
+14 IF SCTIEN=""
QUIT
+15 SET SDSC(409.48,SDENC_",",.1)=SCTIEN
+16 DO FILE^DIE("I","SDSC","SCERR")
+17 ;
+18 ;If SC value hasn't changed quit, else update CT in IB
+19 SET SCVAL=$$SCHNG^SDSCUTL(SDENC)
IF '+SCVAL
QUIT
+20 SET SCTUPD=$$RNBU^IBRSUTL(SDENC,$SELECT($PIECE(SCVAL,U,3):1,1:2))
+21 QUIT