IBCIUT7 ;DSI/ESG - COMMENTS FIELD UTILITIES ;16-JULY-2001
;;2.0;INTEGRATED BILLING;**161**;21-MAR-94
;;Per VHA Directive 10-93-142, this routine should not be modified.
;
Q
;
; This procedure will capture and file all comments to be stored
; in field 2.01 of the ClaimsManager file (#351.9).
;
; TYPE=1 indicates Exit comments:
; This procedure is called from IBCSCP and from IBCB2 whenever
; the status of the bill in the ClaimsManager file is 4 (returned
; with errors) and the user is trying to exit out of the screens
; without correcting the errors found.
; This is also called from the ListMan screen routine IBCIMG.
;
; TYPE=2 indicates overriding the CM errors:
; This procedure is called from IBCIMG whenever the user wants to
; override the ClaimsManager errors.
;
; TYPE=3 indicates the bill is being cancelled:
; This procedure is called from IBCIST in order to move the cancel
; comments into this file when cancelling a bill that has been thru
; the ClaimsManager interface.
;
; TYPE=4 indicates that the bill was sent from the multiple claim
; send option and some ClaimsManager errors were found. Record a
; comment indicating how this bill was sent to ClaimsManager. This
; procedure is called from IBCIUT2 in this case.
;
; TYPE=5 indicates that the bill is being reassigned by a user,
; typically a coder, to another user, typically a biller,
; from a standalone option which allows only users to
; re-assign a bill. This procedure is called from IBCIASN, which
; as indicated above, is a standalone option available only from
; menus which are assigned at sites.
;
NEW CMNT,D0,DA,DI,DIC,DIE,DN,DQ,DR,LASTONE,LASTTXT
NEW NOCOMMSG,NOW,REASON,X
NEW COMMCHG,NEWCOMCT,OLDCOMCT,CMT,PREVCHG
NEW WHO,WHEN,AUDITMSG
;
; Intro text and set-up to read WP field for exit comments
I TYPE=1 D
. W !!?2,"There are still some unresolved errors reported by ClaimsManager."
. W !?2,"Please enter some comments before exiting this option.",!
. Q
;
; Intro text and set-up to read WP field for override comments
I TYPE=2 D
. W !!?2,"Please enter some comments indicating why you are overriding"
. W !?2,"the errors reported by ClaimsManager.",!
. Q
;
; for cancel processing, just grab the reason cancelled field and
; stuff it in here
I TYPE=3 D
. S REASON=$P($G(^DGCR(399,IBIFN,"S")),U,19)
. D DCOM^IBCIUT4(IBIFN) ; delete whatever's in there
. S DIE="^IBA(351.9,",DA=IBIFN,DR="2.01///^S X=REASON"
. D ^DIE
. Q
;
; for bills with errors from the multiple claim send option,
; just stuff in some text.
I TYPE=4 D
. S DIE="^IBA(351.9,",DA=IBIFN,DR="2.01///This Bill was sent to ClaimsManager from the Multiple Claim Send Option."
. D ^DIE
. Q
;
; for bills that a coder is re-assigning
I TYPE=5 D
. W !!?2,"Please enter some comments for the person to whom this"
. W !?2,"bill will be assigned.",!
. Q
;
; Define a variable for the "no comments entered" text
S NOCOMMSG=" << No Comments Entered >>"
;
; Capture and file just the word-processing field here.
; If the user made an illegal edit, then do it again.
WP I $F(".1.2.5.","."_TYPE_".") D I PREVCHG G WP
. ;
. ; if the only comment currently in there is the message about
. ; there being no comments, then blow that stuff away before
. ; reading in the new comments.
. S LASTONE=+$O(^IBA(351.9,IBIFN,2,99999999),-1)
. S LASTTXT=$P($G(^IBA(351.9,IBIFN,2,LASTONE,0)),U,1)
. I LASTONE=1,LASTTXT=NOCOMMSG D DCOM^IBCIUT4(IBIFN)
. ;
. ; esg - 7/16/01
. ; add an audit text line in the comment text field.
. ; this audit text line should be in the comments field before
. ; the user gets the chance to add/edit comment text.
. ;
. S WHO=$P($G(^VA(200,DUZ,0)),U,1)
. S WHEN=$$FMTE^XLFDT($$NOW^XLFDT,5)
. S AUDITMSG="*---"_WHO_"---"_$P(WHEN,"@",1)_"---"_$P(WHEN,"@",2)_"---*"
. S DIE="^IBA(351.9,",DA=IBIFN,DR="2.01///+"_AUDITMSG
. D ^DIE
. ;
. ; Save off the before version of the comments so we can compare
. ; later on.
. KILL ^TMP($J,"IBCICOMMENTS")
. M ^TMP($J,"IBCICOMMENTS")=^IBA(351.9,IBIFN,2)
. ;
. ; set up the variables for editing the comments field
. S DIE="^IBA(351.9,",DA=IBIFN,DR=2.01
. D ^DIE
. ;
. ; Compare the new comments with the old comments and set variable
. ; COMMCHG appropriately. COMMCHG=1 if the comments were modified in
. ; any way. COMMCHG=0 if there were no changes to the comments.
. ;
. S PREVCHG=0 ; flag indicating if old comment text was changed
. S COMMCHG=0
. S NEWCOMCT=$P($G(^IBA(351.9,IBIFN,2,0)),U,4) ; new comment count
. S OLDCOMCT=$P($G(^TMP($J,"IBCICOMMENTS",0)),U,4) ; old comment count
. I NEWCOMCT'=OLDCOMCT S COMMCHG=1
. E F CMT=1:1:NEWCOMCT I $G(^IBA(351.9,IBIFN,2,CMT,0))'=$G(^TMP($J,"IBCICOMMENTS",CMT,0)) S COMMCHG=1 Q
. ;
. ; If the user made no changes at all to the comment text, then
. ; append the "no comments entered" message to the text and then quit.
. I 'COMMCHG D Q
.. S DIE="^IBA(351.9,",DA=IBIFN,DR="2.01///+"_NOCOMMSG
.. D ^DIE
.. Q
. ;
. ; At this point, we know the user made some changes to the comment
. ; text. Variable PREVCHG is calculated to see if the user
. ; modified previously existing lines of comment text. This is
. ; not allowed and the user will be forced to re-enter their
. ; comment text if they do this.
. ;
. I NEWCOMCT<OLDCOMCT S PREVCHG=1
. E F CMT=1:1:OLDCOMCT I $G(^IBA(351.9,IBIFN,2,CMT,0))'=$G(^TMP($J,"IBCICOMMENTS",CMT,0)) S PREVCHG=1 Q
. ;
. ; If the user didn't change old comment text, then we're OK
. I 'PREVCHG Q
. ;
. ; Here, we know the user did a bad thing. We need to display
. ; an error message to the user and restore the old comments.
. W !!?8,"You are not allowed to modify previously entered comments."
. W !?8,"Any comments that you may have just entered have been discarded."
. W !!?8,"Please remember to start adding your comments on the line"
. W !?8,"following the audit stamp which contains your name and the"
. W !?8,"current date and time."
. W !!
. S DIR("A")="Press RETURN to continue",DIR(0)="E" D ^DIR K DIR
. ;
. ; Remove the last line of the original version of the comments.
. ; This should be the audit message. A new one will get created
. ; upon re-edit.
. KILL ^TMP($J,"IBCICOMMENTS",OLDCOMCT,0)
. S CMT=OLDCOMCT-1
. S $P(^TMP($J,"IBCICOMMENTS",0),U,3,4)=CMT_U_CMT
. ;
. ; Restore the original comments
. D DCOM^IBCIUT4(IBIFN)
. M ^IBA(351.9,IBIFN,2)=^TMP($J,"IBCICOMMENTS")
. Q
;
; remove the scratch global
KILL ^TMP($J,"IBCICOMMENTS")
;
; store the user/date/time stamp information in all cases
S NOW=$$NOW^XLFDT
S CMNT(351.9,IBIFN_",",.13)=NOW ; comment date/time
S CMNT(351.9,IBIFN_",",.14)=DUZ ; comment user
S CMNT(351.9,IBIFN_",",.08)=NOW ; last edited date/time
S CMNT(351.9,IBIFN_",",.09)=DUZ ; last edited user
D FILE^DIE("I","CMNT")
;
; Enter some comment data if the user failed to do so
; This would only apply if the user manually deleted all lines of
; comment text. We want to put something in there. This will
; probably never happen.
I '$P($G(^IBA(351.9,IBIFN,2,0)),U,4) D
. S DIE="^IBA(351.9,",DA=IBIFN,DR="2.01///"_NOCOMMSG
. D ^DIE
. Q
;
; Get the assigned to person after entering Exit comments
; or when using the stand-alone option to assign a bill
I TYPE=1!(TYPE=5) D EDATP^IBCIUT1(IBIFN,COMMCHG)
;
COMMX ;
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBCIUT7 7594 printed Dec 13, 2024@02:13:32 Page 2
IBCIUT7 ;DSI/ESG - COMMENTS FIELD UTILITIES ;16-JULY-2001
+1 ;;2.0;INTEGRATED BILLING;**161**;21-MAR-94
+2 ;;Per VHA Directive 10-93-142, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;
+1 ; This procedure will capture and file all comments to be stored
+2 ; in field 2.01 of the ClaimsManager file (#351.9).
+3 ;
+4 ; TYPE=1 indicates Exit comments:
+5 ; This procedure is called from IBCSCP and from IBCB2 whenever
+6 ; the status of the bill in the ClaimsManager file is 4 (returned
+7 ; with errors) and the user is trying to exit out of the screens
+8 ; without correcting the errors found.
+9 ; This is also called from the ListMan screen routine IBCIMG.
+10 ;
+11 ; TYPE=2 indicates overriding the CM errors:
+12 ; This procedure is called from IBCIMG whenever the user wants to
+13 ; override the ClaimsManager errors.
+14 ;
+15 ; TYPE=3 indicates the bill is being cancelled:
+16 ; This procedure is called from IBCIST in order to move the cancel
+17 ; comments into this file when cancelling a bill that has been thru
+18 ; the ClaimsManager interface.
+19 ;
+20 ; TYPE=4 indicates that the bill was sent from the multiple claim
+21 ; send option and some ClaimsManager errors were found. Record a
+22 ; comment indicating how this bill was sent to ClaimsManager. This
+23 ; procedure is called from IBCIUT2 in this case.
+24 ;
+25 ; TYPE=5 indicates that the bill is being reassigned by a user,
+26 ; typically a coder, to another user, typically a biller,
+27 ; from a standalone option which allows only users to
+28 ; re-assign a bill. This procedure is called from IBCIASN, which
+29 ; as indicated above, is a standalone option available only from
+30 ; menus which are assigned at sites.
+31 ;
+32 NEW CMNT,D0,DA,DI,DIC,DIE,DN,DQ,DR,LASTONE,LASTTXT
+33 NEW NOCOMMSG,NOW,REASON,X
+34 NEW COMMCHG,NEWCOMCT,OLDCOMCT,CMT,PREVCHG
+35 NEW WHO,WHEN,AUDITMSG
+36 ;
+37 ; Intro text and set-up to read WP field for exit comments
+38 IF TYPE=1
Begin DoDot:1
+39 WRITE !!?2,"There are still some unresolved errors reported by ClaimsManager."
+40 WRITE !?2,"Please enter some comments before exiting this option.",!
+41 QUIT
End DoDot:1
+42 ;
+43 ; Intro text and set-up to read WP field for override comments
+44 IF TYPE=2
Begin DoDot:1
+45 WRITE !!?2,"Please enter some comments indicating why you are overriding"
+46 WRITE !?2,"the errors reported by ClaimsManager.",!
+47 QUIT
End DoDot:1
+48 ;
+49 ; for cancel processing, just grab the reason cancelled field and
+50 ; stuff it in here
+51 IF TYPE=3
Begin DoDot:1
+52 SET REASON=$PIECE($GET(^DGCR(399,IBIFN,"S")),U,19)
+53 ; delete whatever's in there
DO DCOM^IBCIUT4(IBIFN)
+54 SET DIE="^IBA(351.9,"
SET DA=IBIFN
SET DR="2.01///^S X=REASON"
+55 DO ^DIE
+56 QUIT
End DoDot:1
+57 ;
+58 ; for bills with errors from the multiple claim send option,
+59 ; just stuff in some text.
+60 IF TYPE=4
Begin DoDot:1
+61 SET DIE="^IBA(351.9,"
SET DA=IBIFN
SET DR="2.01///This Bill was sent to ClaimsManager from the Multiple Claim Send Option."
+62 DO ^DIE
+63 QUIT
End DoDot:1
+64 ;
+65 ; for bills that a coder is re-assigning
+66 IF TYPE=5
Begin DoDot:1
+67 WRITE !!?2,"Please enter some comments for the person to whom this"
+68 WRITE !?2,"bill will be assigned.",!
+69 QUIT
End DoDot:1
+70 ;
+71 ; Define a variable for the "no comments entered" text
+72 SET NOCOMMSG=" << No Comments Entered >>"
+73 ;
+74 ; Capture and file just the word-processing field here.
+75 ; If the user made an illegal edit, then do it again.
WP IF $FIND(".1.2.5.","."_TYPE_".")
Begin DoDot:1
+1 ;
+2 ; if the only comment currently in there is the message about
+3 ; there being no comments, then blow that stuff away before
+4 ; reading in the new comments.
+5 SET LASTONE=+$ORDER(^IBA(351.9,IBIFN,2,99999999),-1)
+6 SET LASTTXT=$PIECE($GET(^IBA(351.9,IBIFN,2,LASTONE,0)),U,1)
+7 IF LASTONE=1
IF LASTTXT=NOCOMMSG
DO DCOM^IBCIUT4(IBIFN)
+8 ;
+9 ; esg - 7/16/01
+10 ; add an audit text line in the comment text field.
+11 ; this audit text line should be in the comments field before
+12 ; the user gets the chance to add/edit comment text.
+13 ;
+14 SET WHO=$PIECE($GET(^VA(200,DUZ,0)),U,1)
+15 SET WHEN=$$FMTE^XLFDT($$NOW^XLFDT,5)
+16 SET AUDITMSG="*---"_WHO_"---"_$PIECE(WHEN,"@",1)_"---"_$PIECE(WHEN,"@",2)_"---*"
+17 SET DIE="^IBA(351.9,"
SET DA=IBIFN
SET DR="2.01///+"_AUDITMSG
+18 DO ^DIE
+19 ;
+20 ; Save off the before version of the comments so we can compare
+21 ; later on.
+22 KILL ^TMP($JOB,"IBCICOMMENTS")
+23 MERGE ^TMP($JOB,"IBCICOMMENTS")=^IBA(351.9,IBIFN,2)
+24 ;
+25 ; set up the variables for editing the comments field
+26 SET DIE="^IBA(351.9,"
SET DA=IBIFN
SET DR=2.01
+27 DO ^DIE
+28 ;
+29 ; Compare the new comments with the old comments and set variable
+30 ; COMMCHG appropriately. COMMCHG=1 if the comments were modified in
+31 ; any way. COMMCHG=0 if there were no changes to the comments.
+32 ;
+33 ; flag indicating if old comment text was changed
SET PREVCHG=0
+34 SET COMMCHG=0
+35 ; new comment count
SET NEWCOMCT=$PIECE($GET(^IBA(351.9,IBIFN,2,0)),U,4)
+36 ; old comment count
SET OLDCOMCT=$PIECE($GET(^TMP($JOB,"IBCICOMMENTS",0)),U,4)
+37 IF NEWCOMCT'=OLDCOMCT
SET COMMCHG=1
+38 IF '$TEST
FOR CMT=1:1:NEWCOMCT
IF $GET(^IBA(351.9,IBIFN,2,CMT,0))'=$GET(^TMP($JOB,"IBCICOMMENTS",CMT,0))
SET COMMCHG=1
QUIT
+39 ;
+40 ; If the user made no changes at all to the comment text, then
+41 ; append the "no comments entered" message to the text and then quit.
+42 IF 'COMMCHG
Begin DoDot:2
+43 SET DIE="^IBA(351.9,"
SET DA=IBIFN
SET DR="2.01///+"_NOCOMMSG
+44 DO ^DIE
+45 QUIT
End DoDot:2
QUIT
+46 ;
+47 ; At this point, we know the user made some changes to the comment
+48 ; text. Variable PREVCHG is calculated to see if the user
+49 ; modified previously existing lines of comment text. This is
+50 ; not allowed and the user will be forced to re-enter their
+51 ; comment text if they do this.
+52 ;
+53 IF NEWCOMCT<OLDCOMCT
SET PREVCHG=1
+54 IF '$TEST
FOR CMT=1:1:OLDCOMCT
IF $GET(^IBA(351.9,IBIFN,2,CMT,0))'=$GET(^TMP($JOB,"IBCICOMMENTS",CMT,0))
SET PREVCHG=1
QUIT
+55 ;
+56 ; If the user didn't change old comment text, then we're OK
+57 IF 'PREVCHG
QUIT
+58 ;
+59 ; Here, we know the user did a bad thing. We need to display
+60 ; an error message to the user and restore the old comments.
+61 WRITE !!?8,"You are not allowed to modify previously entered comments."
+62 WRITE !?8,"Any comments that you may have just entered have been discarded."
+63 WRITE !!?8,"Please remember to start adding your comments on the line"
+64 WRITE !?8,"following the audit stamp which contains your name and the"
+65 WRITE !?8,"current date and time."
+66 WRITE !!
+67 SET DIR("A")="Press RETURN to continue"
SET DIR(0)="E"
DO ^DIR
KILL DIR
+68 ;
+69 ; Remove the last line of the original version of the comments.
+70 ; This should be the audit message. A new one will get created
+71 ; upon re-edit.
+72 KILL ^TMP($JOB,"IBCICOMMENTS",OLDCOMCT,0)
+73 SET CMT=OLDCOMCT-1
+74 SET $PIECE(^TMP($JOB,"IBCICOMMENTS",0),U,3,4)=CMT_U_CMT
+75 ;
+76 ; Restore the original comments
+77 DO DCOM^IBCIUT4(IBIFN)
+78 MERGE ^IBA(351.9,IBIFN,2)=^TMP($JOB,"IBCICOMMENTS")
+79 QUIT
End DoDot:1
IF PREVCHG
GOTO WP
+80 ;
+81 ; remove the scratch global
+82 KILL ^TMP($JOB,"IBCICOMMENTS")
+83 ;
+84 ; store the user/date/time stamp information in all cases
+85 SET NOW=$$NOW^XLFDT
+86 ; comment date/time
SET CMNT(351.9,IBIFN_",",.13)=NOW
+87 ; comment user
SET CMNT(351.9,IBIFN_",",.14)=DUZ
+88 ; last edited date/time
SET CMNT(351.9,IBIFN_",",.08)=NOW
+89 ; last edited user
SET CMNT(351.9,IBIFN_",",.09)=DUZ
+90 DO FILE^DIE("I","CMNT")
+91 ;
+92 ; Enter some comment data if the user failed to do so
+93 ; This would only apply if the user manually deleted all lines of
+94 ; comment text. We want to put something in there. This will
+95 ; probably never happen.
+96 IF '$PIECE($GET(^IBA(351.9,IBIFN,2,0)),U,4)
Begin DoDot:1
+97 SET DIE="^IBA(351.9,"
SET DA=IBIFN
SET DR="2.01///"_NOCOMMSG
+98 DO ^DIE
+99 QUIT
End DoDot:1
+100 ;
+101 ; Get the assigned to person after entering Exit comments
+102 ; or when using the stand-alone option to assign a bill
+103 IF TYPE=1!(TYPE=5)
DO EDATP^IBCIUT1(IBIFN,COMMCHG)
+104 ;
COMMX ;
+1 QUIT
+2 ;