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

IBCIUT7.m

Go to the documentation of this file.
  1. IBCIUT7 ;DSI/ESG - COMMENTS FIELD UTILITIES ;16-JULY-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. Q
  1. ;
  1. COMMENT(IBIFN,TYPE) ; Capture the comments
  1. ; This procedure will capture and file all comments to be stored
  1. ; in field 2.01 of the ClaimsManager file (#351.9).
  1. ;
  1. ; TYPE=1 indicates Exit comments:
  1. ; This procedure is called from IBCSCP and from IBCB2 whenever
  1. ; the status of the bill in the ClaimsManager file is 4 (returned
  1. ; with errors) and the user is trying to exit out of the screens
  1. ; without correcting the errors found.
  1. ; This is also called from the ListMan screen routine IBCIMG.
  1. ;
  1. ; TYPE=2 indicates overriding the CM errors:
  1. ; This procedure is called from IBCIMG whenever the user wants to
  1. ; override the ClaimsManager errors.
  1. ;
  1. ; TYPE=3 indicates the bill is being cancelled:
  1. ; This procedure is called from IBCIST in order to move the cancel
  1. ; comments into this file when cancelling a bill that has been thru
  1. ; the ClaimsManager interface.
  1. ;
  1. ; TYPE=4 indicates that the bill was sent from the multiple claim
  1. ; send option and some ClaimsManager errors were found. Record a
  1. ; comment indicating how this bill was sent to ClaimsManager. This
  1. ; procedure is called from IBCIUT2 in this case.
  1. ;
  1. ; TYPE=5 indicates that the bill is being reassigned by a user,
  1. ; typically a coder, to another user, typically a biller,
  1. ; from a standalone option which allows only users to
  1. ; re-assign a bill. This procedure is called from IBCIASN, which
  1. ; as indicated above, is a standalone option available only from
  1. ; menus which are assigned at sites.
  1. ;
  1. NEW CMNT,D0,DA,DI,DIC,DIE,DN,DQ,DR,LASTONE,LASTTXT
  1. NEW NOCOMMSG,NOW,REASON,X
  1. NEW COMMCHG,NEWCOMCT,OLDCOMCT,CMT,PREVCHG
  1. NEW WHO,WHEN,AUDITMSG
  1. ;
  1. ; Intro text and set-up to read WP field for exit comments
  1. I TYPE=1 D
  1. . W !!?2,"There are still some unresolved errors reported by ClaimsManager."
  1. . W !?2,"Please enter some comments before exiting this option.",!
  1. . Q
  1. ;
  1. ; Intro text and set-up to read WP field for override comments
  1. I TYPE=2 D
  1. . W !!?2,"Please enter some comments indicating why you are overriding"
  1. . W !?2,"the errors reported by ClaimsManager.",!
  1. . Q
  1. ;
  1. ; for cancel processing, just grab the reason cancelled field and
  1. ; stuff it in here
  1. I TYPE=3 D
  1. . S REASON=$P($G(^DGCR(399,IBIFN,"S")),U,19)
  1. . D DCOM^IBCIUT4(IBIFN) ; delete whatever's in there
  1. . S DIE="^IBA(351.9,",DA=IBIFN,DR="2.01///^S X=REASON"
  1. . D ^DIE
  1. . Q
  1. ;
  1. ; for bills with errors from the multiple claim send option,
  1. ; just stuff in some text.
  1. I TYPE=4 D
  1. . S DIE="^IBA(351.9,",DA=IBIFN,DR="2.01///This Bill was sent to ClaimsManager from the Multiple Claim Send Option."
  1. . D ^DIE
  1. . Q
  1. ;
  1. ; for bills that a coder is re-assigning
  1. I TYPE=5 D
  1. . W !!?2,"Please enter some comments for the person to whom this"
  1. . W !?2,"bill will be assigned.",!
  1. . Q
  1. ;
  1. ; Define a variable for the "no comments entered" text
  1. S NOCOMMSG=" << No Comments Entered >>"
  1. ;
  1. ; Capture and file just the word-processing field here.
  1. ; If the user made an illegal edit, then do it again.
  1. WP I $F(".1.2.5.","."_TYPE_".") D I PREVCHG G WP
  1. . ;
  1. . ; if the only comment currently in there is the message about
  1. . ; there being no comments, then blow that stuff away before
  1. . ; reading in the new comments.
  1. . S LASTONE=+$O(^IBA(351.9,IBIFN,2,99999999),-1)
  1. . S LASTTXT=$P($G(^IBA(351.9,IBIFN,2,LASTONE,0)),U,1)
  1. . I LASTONE=1,LASTTXT=NOCOMMSG D DCOM^IBCIUT4(IBIFN)
  1. . ;
  1. . ; esg - 7/16/01
  1. . ; add an audit text line in the comment text field.
  1. . ; this audit text line should be in the comments field before
  1. . ; the user gets the chance to add/edit comment text.
  1. . ;
  1. . S WHO=$P($G(^VA(200,DUZ,0)),U,1)
  1. . S WHEN=$$FMTE^XLFDT($$NOW^XLFDT,5)
  1. . S AUDITMSG="*---"_WHO_"---"_$P(WHEN,"@",1)_"---"_$P(WHEN,"@",2)_"---*"
  1. . S DIE="^IBA(351.9,",DA=IBIFN,DR="2.01///+"_AUDITMSG
  1. . D ^DIE
  1. . ;
  1. . ; Save off the before version of the comments so we can compare
  1. . ; later on.
  1. . KILL ^TMP($J,"IBCICOMMENTS")
  1. . M ^TMP($J,"IBCICOMMENTS")=^IBA(351.9,IBIFN,2)
  1. . ;
  1. . ; set up the variables for editing the comments field
  1. . S DIE="^IBA(351.9,",DA=IBIFN,DR=2.01
  1. . D ^DIE
  1. . ;
  1. . ; Compare the new comments with the old comments and set variable
  1. . ; COMMCHG appropriately. COMMCHG=1 if the comments were modified in
  1. . ; any way. COMMCHG=0 if there were no changes to the comments.
  1. . ;
  1. . S PREVCHG=0 ; flag indicating if old comment text was changed
  1. . S COMMCHG=0
  1. . S NEWCOMCT=$P($G(^IBA(351.9,IBIFN,2,0)),U,4) ; new comment count
  1. . S OLDCOMCT=$P($G(^TMP($J,"IBCICOMMENTS",0)),U,4) ; old comment count
  1. . I NEWCOMCT'=OLDCOMCT S COMMCHG=1
  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
  1. . ;
  1. . ; If the user made no changes at all to the comment text, then
  1. . ; append the "no comments entered" message to the text and then quit.
  1. . I 'COMMCHG D Q
  1. .. S DIE="^IBA(351.9,",DA=IBIFN,DR="2.01///+"_NOCOMMSG
  1. .. D ^DIE
  1. .. Q
  1. . ;
  1. . ; At this point, we know the user made some changes to the comment
  1. . ; text. Variable PREVCHG is calculated to see if the user
  1. . ; modified previously existing lines of comment text. This is
  1. . ; not allowed and the user will be forced to re-enter their
  1. . ; comment text if they do this.
  1. . ;
  1. . I NEWCOMCT<OLDCOMCT S PREVCHG=1
  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
  1. . ;
  1. . ; If the user didn't change old comment text, then we're OK
  1. . I 'PREVCHG Q
  1. . ;
  1. . ; Here, we know the user did a bad thing. We need to display
  1. . ; an error message to the user and restore the old comments.
  1. . W !!?8,"You are not allowed to modify previously entered comments."
  1. . W !?8,"Any comments that you may have just entered have been discarded."
  1. . W !!?8,"Please remember to start adding your comments on the line"
  1. . W !?8,"following the audit stamp which contains your name and the"
  1. . W !?8,"current date and time."
  1. . W !!
  1. . S DIR("A")="Press RETURN to continue",DIR(0)="E" D ^DIR K DIR
  1. . ;
  1. . ; Remove the last line of the original version of the comments.
  1. . ; This should be the audit message. A new one will get created
  1. . ; upon re-edit.
  1. . KILL ^TMP($J,"IBCICOMMENTS",OLDCOMCT,0)
  1. . S CMT=OLDCOMCT-1
  1. . S $P(^TMP($J,"IBCICOMMENTS",0),U,3,4)=CMT_U_CMT
  1. . ;
  1. . ; Restore the original comments
  1. . D DCOM^IBCIUT4(IBIFN)
  1. . M ^IBA(351.9,IBIFN,2)=^TMP($J,"IBCICOMMENTS")
  1. . Q
  1. ;
  1. ; remove the scratch global
  1. KILL ^TMP($J,"IBCICOMMENTS")
  1. ;
  1. ; store the user/date/time stamp information in all cases
  1. S NOW=$$NOW^XLFDT
  1. S CMNT(351.9,IBIFN_",",.13)=NOW ; comment date/time
  1. S CMNT(351.9,IBIFN_",",.14)=DUZ ; comment user
  1. S CMNT(351.9,IBIFN_",",.08)=NOW ; last edited date/time
  1. S CMNT(351.9,IBIFN_",",.09)=DUZ ; last edited user
  1. D FILE^DIE("I","CMNT")
  1. ;
  1. ; Enter some comment data if the user failed to do so
  1. ; This would only apply if the user manually deleted all lines of
  1. ; comment text. We want to put something in there. This will
  1. ; probably never happen.
  1. I '$P($G(^IBA(351.9,IBIFN,2,0)),U,4) D
  1. . S DIE="^IBA(351.9,",DA=IBIFN,DR="2.01///"_NOCOMMSG
  1. . D ^DIE
  1. . Q
  1. ;
  1. ; Get the assigned to person after entering Exit comments
  1. ; or when using the stand-alone option to assign a bill
  1. I TYPE=1!(TYPE=5) D EDATP^IBCIUT1(IBIFN,COMMCHG)
  1. ;
  1. COMMX ;
  1. Q
  1. ;