IBTRH2B ;ALB/JWS - HCSR worklist expand entry, send 215 ;18-JUN-2014
;;2.0;INTEGRATED BILLING;**517**;21-MAR-94;Build 240
;;Per VA Directive 6402, this routine should not be modified.
;
Q
;
SEND215 ; send 278X215 inquiry ; JWS 10/17/14 add ability to manually submit a 278x215 Inquiry
N ADMIEN,DDT,DIR,DIROUT,DIRUT,DTOUT,DUOUT,EDT,DISIEN,IENS,STATUS,X,Y,NEWIEN
N IBRESP,ERROR,IBFDA,TTYPE
S IBRESP=0
S VALMBCK="R"
; if no valid 356.22 ien, complain and bail out
I +$G(IBTRIEN)'>0 D MSG215^IBTRH2A(1) Q
I $P(^IBT(356.22,IBTRIEN,0),"^",19) D MSG215^IBTRH2A(5) Q
S STATUS=$$STATUS^IBTRH2(IBTRIEN)
; don't send an inquiry if status of 217 is not 07 Pending
I STATUS'="07" D MSG215^IBTRH2A(3) Q
; Create the 278 request to be sent
; S DIR("A")="Send Inquiry? (Y/N): ",DIR("B")="Y",DIR(0)="YAO" D ^DIR K DIR
S DIR("A")="Send (I)nquiry or (C)ancel? ",DIR("B")="I",DIR(0)="SAO^I:Inquiry;C:Cancel" D ^DIR K DIR
;I $G(DTOUT)!$G(DUOUT)!$G(DIROUT)!($G(Y)'=1) Q
I $G(DTOUT)!$G(DUOUT)!$G(DIROUT) Q
S TTYPE=Y,NEWIEN=$$CRTENTRY^IBTRH5C(IBTRIEN,$P(^IBT(356.22,IBTRIEN,0),"^",14),$P(^IBT(356.22,IBTRIEN,0),"^",3),"",0,"",1,Y) ;create 215 entry from original 217
I 'NEWIEN D MSG215^IBTRH2A(4) Q
S IBFDA(356.22,NEWIEN_",",.2)=1
S IBFDA(356.22,NEWIEN_",",.26)=1 ;flag indicating manual 215
D FILE^DIE(,"IBFDA","ERROR")
D EN^IBTRHLO(NEWIEN,1)
S IBFDA(356.22,IBTRIEN_",",.19)=1 ;flag request/inquiry as having already had a 215 generated
S IBFDA(356.22,IBTRIEN_",",.08)="09" ;set status to 215 inquiry sent, so skipped by worklist
D FILE^DIE(,"IBFDA","ERROR") Q:$D(ERROR)
; check if message id got populated and display appropriate message
H 2
D MSG215^IBTRH2A($S($P($G(^IBT(356.22,NEWIEN,0)),U,12)="":2,1:0),TTYPE)
;I $P($G(^IBT(356.22,NEWIEN,0)),"^",12)'="" D
;. S IBFDA(356.22,IBTRIEN_",",.19)=1 ;flag request/inquiry as having already had a 215 generated
;. S IBFDA(356.22,IBTRIEN_",",.08)="09" ;set status to 215 inquiry sent, so skipped by worklist
;. D FILE^DIE(,"IBFDA","ERROR") Q:$D(ERROR)
; refresh display
D INIT^IBTRH2
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBTRH2B 2095 printed Dec 13, 2024@02:28:03 Page 2
IBTRH2B ;ALB/JWS - HCSR worklist expand entry, send 215 ;18-JUN-2014
+1 ;;2.0;INTEGRATED BILLING;**517**;21-MAR-94;Build 240
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;
SEND215 ; send 278X215 inquiry ; JWS 10/17/14 add ability to manually submit a 278x215 Inquiry
+1 NEW ADMIEN,DDT,DIR,DIROUT,DIRUT,DTOUT,DUOUT,EDT,DISIEN,IENS,STATUS,X,Y,NEWIEN
+2 NEW IBRESP,ERROR,IBFDA,TTYPE
+3 SET IBRESP=0
+4 SET VALMBCK="R"
+5 ; if no valid 356.22 ien, complain and bail out
+6 IF +$GET(IBTRIEN)'>0
DO MSG215^IBTRH2A(1)
QUIT
+7 IF $PIECE(^IBT(356.22,IBTRIEN,0),"^",19)
DO MSG215^IBTRH2A(5)
QUIT
+8 SET STATUS=$$STATUS^IBTRH2(IBTRIEN)
+9 ; don't send an inquiry if status of 217 is not 07 Pending
+10 IF STATUS'="07"
DO MSG215^IBTRH2A(3)
QUIT
+11 ; Create the 278 request to be sent
+12 ; S DIR("A")="Send Inquiry? (Y/N): ",DIR("B")="Y",DIR(0)="YAO" D ^DIR K DIR
+13 SET DIR("A")="Send (I)nquiry or (C)ancel? "
SET DIR("B")="I"
SET DIR(0)="SAO^I:Inquiry;C:Cancel"
DO ^DIR
KILL DIR
+14 ;I $G(DTOUT)!$G(DUOUT)!$G(DIROUT)!($G(Y)'=1) Q
+15 IF $GET(DTOUT)!$GET(DUOUT)!$GET(DIROUT)
QUIT
+16 ;create 215 entry from original 217
SET TTYPE=Y
SET NEWIEN=$$CRTENTRY^IBTRH5C(IBTRIEN,$PIECE(^IBT(356.22,IBTRIEN,0),"^",14),$PIECE(^IBT(356.22,IBTRIEN,0),"^",3),"",0,"",1,Y)
+17 IF 'NEWIEN
DO MSG215^IBTRH2A(4)
QUIT
+18 SET IBFDA(356.22,NEWIEN_",",.2)=1
+19 ;flag indicating manual 215
SET IBFDA(356.22,NEWIEN_",",.26)=1
+20 DO FILE^DIE(,"IBFDA","ERROR")
+21 DO EN^IBTRHLO(NEWIEN,1)
+22 ;flag request/inquiry as having already had a 215 generated
SET IBFDA(356.22,IBTRIEN_",",.19)=1
+23 ;set status to 215 inquiry sent, so skipped by worklist
SET IBFDA(356.22,IBTRIEN_",",.08)="09"
+24 DO FILE^DIE(,"IBFDA","ERROR")
if $DATA(ERROR)
QUIT
+25 ; check if message id got populated and display appropriate message
+26 HANG 2
+27 DO MSG215^IBTRH2A($SELECT($PIECE($GET(^IBT(356.22,NEWIEN,0)),U,12)="":2,1:0),TTYPE)
+28 ;I $P($G(^IBT(356.22,NEWIEN,0)),"^",12)'="" D
+29 ;. S IBFDA(356.22,IBTRIEN_",",.19)=1 ;flag request/inquiry as having already had a 215 generated
+30 ;. S IBFDA(356.22,IBTRIEN_",",.08)="09" ;set status to 215 inquiry sent, so skipped by worklist
+31 ;. D FILE^DIE(,"IBFDA","ERROR") Q:$D(ERROR)
+32 ; refresh display
+33 DO INIT^IBTRH2
+34 QUIT