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