| 1 | IBCNBME ;ALB/ARH-Ins Buffer: external entry points, add/edit buffer ;1 Jun 97 | 
|---|
| 2 | ;;2.0;INTEGRATED BILLING;**82,103,184**;21-MAR-94 | 
|---|
| 3 | ;;Per VHA Directive 10-93-142, this routine should not be modified. | 
|---|
| 4 | ; | 
|---|
| 5 | FEE(DFN) ; ENTRY FOR FEE BASIS:  add/edit a buffer entry | 
|---|
| 6 | I '$D(^DPT(+$G(DFN),0)) Q | 
|---|
| 7 | Q:'$$INSCOV(+DFN) | 
|---|
| 8 | D DISPLAY | 
|---|
| 9 | D EDADD(1,+DFN) | 
|---|
| 10 | Q | 
|---|
| 11 | ; | 
|---|
| 12 | REG(DFN) ; ENTRY FOR REGISTRATION:  add/edit a buffer entry | 
|---|
| 13 | I '$D(^DPT(+$G(DFN),0)) Q | 
|---|
| 14 | Q:'$$INSCOV(+DFN) | 
|---|
| 15 | D DISPLAY | 
|---|
| 16 | D EDADD(1,+DFN) | 
|---|
| 17 | Q | 
|---|
| 18 | ; | 
|---|
| 19 | PREG(DFN) ; ENTRY FOR PRE-REGISTRATION:  add/edit a buffer entry | 
|---|
| 20 | I '$D(^DPT(+$G(DFN),0)) Q | 
|---|
| 21 | Q:'$$INSCOV(+DFN) | 
|---|
| 22 | D DISPLAY | 
|---|
| 23 | D EDADD(4,+DFN) | 
|---|
| 24 | Q | 
|---|
| 25 | ; | 
|---|
| 26 | EDADD(IBSOURCE,DFN) ; add or select a specific patient's buffer entry then edit all data | 
|---|
| 27 | ; IBSOURCE = 1-interview, 2-data match, 3-ivm, 4-pre-reg, 5-eiiv | 
|---|
| 28 | N X,Y,IBX,IBY,IBBUFDA,DIR,DIRUT,IBINSNM I '$D(^DPT(+$G(DFN),0))!('$G(IBSOURCE)) Q | 
|---|
| 29 | ; | 
|---|
| 30 | ; allow user to choose one of their own entries for this patient to edit or add a new one | 
|---|
| 31 | S DIR("?")="^D HELP^IBCNBME" | 
|---|
| 32 | S DIR(0)="FO^3:30",DIR("A")="Select INSURANCE COMPANY" D ^DIR I $D(DIRUT)!(Y="") Q | 
|---|
| 33 | ; | 
|---|
| 34 | S IBINSNM=$$UP^XLFSTR(Y),IBBUFDA=0 | 
|---|
| 35 | ; | 
|---|
| 36 | ; -- If Medicare (WNR) entered call MII | 
|---|
| 37 | I IBINSNM="MEDICARE (WNR)" D ENR^IBCNSMM(DFN,IBSOURCE) Q | 
|---|
| 38 | ; | 
|---|
| 39 | S IBX=$$DICBUF^IBCNBU1(IBINSNM,DFN,DUZ) I +IBX>0 S IBY=$$EDIT Q:IBY<0  I +IBY>0 S IBBUFDA=+IBX | 
|---|
| 40 | ;I 'IBBUFDA S IBX=$$DICINS^IBCNBU1(IBINSNM) Q:IBX<0  I IBX'=0 S IBINSNM=IBX | 
|---|
| 41 | I 'IBBUFDA S IBBUFDA=$$NEW(DFN,IBINSNM,IBSOURCE) | 
|---|
| 42 | Q:'IBBUFDA  W !! | 
|---|
| 43 | ; | 
|---|
| 44 | I '$$LOCK^IBCNBU1(IBBUFDA,1) Q | 
|---|
| 45 | ; | 
|---|
| 46 | D INS^IBCNBEE(IBBUFDA,"OT") W ! | 
|---|
| 47 | D GRP^IBCNBEE(IBBUFDA,"OT") W ! | 
|---|
| 48 | D POLICY^IBCNBEE(IBBUFDA,"OT") | 
|---|
| 49 | ; | 
|---|
| 50 | ; set buffer symbol | 
|---|
| 51 | D BUFF^IBCNEUT2(IBBUFDA,+$$INSERROR^IBCNEUT3("B",IBBUFDA)) | 
|---|
| 52 | ; | 
|---|
| 53 | D UNLOCK^IBCNBU1(IBBUFDA) | 
|---|
| 54 | Q | 
|---|
| 55 | ; | 
|---|
| 56 | HELP ; | 
|---|
| 57 | N Z W !!,"You may add a new Insurance Buffer entry or edit an entry you have already ",!,"created for this patient.  Insurance Company name must be 3-30 characters.",! | 
|---|
| 58 | W "To 'fast enter' Medicare coverage information, please enter 'MEDICARE (WNR)'.",! | 
|---|
| 59 | S Z=$$DICBUF^IBCNBU1("??",DFN,DUZ) | 
|---|
| 60 | Q | 
|---|
| 61 | ; | 
|---|
| 62 | NEW(DFN,INSNAME,SOURCE) ; ask then add new insurance buffer entry | 
|---|
| 63 | N X,Y,IBX,DIR,DIRUT,IBDATA S IBX=0 W ! | 
|---|
| 64 | S DIR(0)="YO",DIR("A")="Add a new Insurance Buffer entry for this patient",DIR("B")="YES" D ^DIR | 
|---|
| 65 | I Y=1 S IBDATA(20.01)=INSNAME,IBDATA(60.01)=DFN S IBX=+$$ADDSTF^IBCNBES(SOURCE,DFN,.IBDATA) | 
|---|
| 66 | Q IBX | 
|---|
| 67 | ; | 
|---|
| 68 | EDIT() ; ask user if they want to edit an existing buffer entry | 
|---|
| 69 | ; returns 0 if don't want to edit, -1 if trys to exit, 1 if wants to edit existing buffer entry | 
|---|
| 70 | N X,Y,IBX,DIR,DIRUT,DUOUT,DTOUT S IBX=0 W ! | 
|---|
| 71 | S DIR(0)="Y",DIR("A")="Edit existing Insurance Buffer entry for this patient",DIR("B")="YES" D ^DIR S IBX=Y I $D(DIRUT) S IBX=-1 | 
|---|
| 72 | Q IBX | 
|---|
| 73 | ; | 
|---|
| 74 | ; | 
|---|
| 75 | DISPLAY ; | 
|---|
| 76 | ; | 
|---|
| 77 | W !!,?2,"This option adds or edits insurance information in the Insurance Buffer File." | 
|---|
| 78 | W !,?2,"This is a temporary file that will hold all new insurance information until" | 
|---|
| 79 | W !,?2,"authorized insurance personnel can coordinate this new information with the" | 
|---|
| 80 | W !,?2,"patient's existing insurance.  You may add a new Buffer entry or edit a" | 
|---|
| 81 | W !,?2,"Buffer entry that you previously created for this patient if that entry" | 
|---|
| 82 | W !,?2,"has not yet been processed by insurance personnel." | 
|---|
| 83 | W !!,?2,"Please enter all available insurance information.",!! | 
|---|
| 84 | Q | 
|---|
| 85 | ; | 
|---|
| 86 | INSCOV(DFN) ; return true if covered by insurance is yes, false if not covered or user ^ out | 
|---|
| 87 | ; allow user to edit 'Covered By Insurance' question (2,.3192), then auto correct if if they were wrong | 
|---|
| 88 | ; (primarily needed because this field an inconsistancy check in registration so it must have a value) | 
|---|
| 89 | ; | 
|---|
| 90 | N IBX,IBY,IBCOV1 S IBX=1 | 
|---|
| 91 | S IBY=$$ASKCOVD^IBCNSP2(DFN,"",.IBCOV1),IBX=+IBY | 
|---|
| 92 | D COVERED^IBCNSM31(DFN,IBCOV1) | 
|---|
| 93 | Q IBX | 
|---|