source: WorldVistAEHR/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBCEP4A.m@ 1006

Last change on this file since 1006 was 623, checked in by George Lilly, 15 years ago

revised back to 6/30/08 version

File size: 7.9 KB
Line 
1IBCEP4A ;ALB/TMP - EDI UTILITIES for provider ID ;29-SEP-00
2 ;;2.0;INTEGRATED BILLING;**137,232,280,349**;21-MAR-94;Build 46
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5NEW(IB) ; Add care unit
6 ; Assumes IBINS is defined as ins co ien (file 36)
7 ; IB = 0 or null if called from list manager, 1 if not
8 N DIC,DIR,X,Y,Z,DA,DR,DIE,DO,DD,DLAYGO,IB95,IBADD,IBOK
9 I '$G(IB) D FULL^VALM1
10 ;
11 ; Add an entry - either new care unit/ins co or a combination for
12 ; existing care unit/ins co
13 S DIC("A")="SELECT CARE UNIT FOR THE INSURANCE CO: ",DIC="^IBA(355.95,",DIC("S")="I $P(^(0),U,3)=+$G(IBINS)",DIC(0)="AELMQ",DIC("DR")=".03////"_+$G(IBINS)_";.02",DLAYGO=355.95 D ^DIC K DIC,DLAYGO
14 G:Y'>0 NEWQ
15 S IB95=3,IB95("IBCU")=+Y
16 D INSASS(IBINS,.IB95)
17 I '$G(IB) D BLD^IBCEP4
18NEWQ I '$G(IB) S VALMBCK="R"
19 Q
20 ;
21CHANGE(IB) ; Edit a care unit name or combination for ins co IBINS
22 ; Assumes IBINS is defined as ins co ien (file 36)
23 ; IB = 0 or null if called from list manager, 1 if not
24 N DIC,DIK,DIR,X,Y,Z,DA,DR,DIE,DO,DD,DLAYGO,IB95,IBOK,IBZ,IB0,IBEDIT,IBCK,IBDA,IBCHG,IBDELETE,Z100,DTOUT,DUOUT
25 I '$G(IB) D FULL^VALM1
26 S DIC("A")="CARE UNIT NAME: ",DIC(0)="AEMQ",DIC("S")="I $P(^(0),U,3)=+$G(IBINS)",DIC="^IBA(355.95," W ! D ^DIC K DIC
27 I Y'>0 G CHGQ
28 S IB95("IBCU")=+Y,IBDELETE=0,IBDELETE(0)=$G(^IBA(355.95,0)),IBDELETE(1)=$G(^(1))
29 ; Edit fields outside of FM to assure uniqueness of combos is maintained
30 W ! S DIR("A")="CARE UNIT NAME: ",DIR("B")=$P($G(^IBA(355.95,+IB95("IBCU"),0)),U),DIR(0)="355.95,.01AO",DIR("S")="I $P(^(0),U,3)=IBINS" D ^DIR K DIR
31 I $D(DTOUT)!$D(DUOUT) G CHGQ
32 ;
33 ; Care unit name was deleted
34 I X="@" D G CHGQ
35 . S DIR("A",1)="THIS WILL DELETE THE CARE UNIT NAME AND ALL ITS COMBINATIONS",DIR("A")="ARE YOU SURE THIS IS WHAT YOU WANT TO DO?: ",DIR(0)="YA",DIR("B")="NO" D ^DIR K DIR
36 . I Y'=1 S IB95("IBCU")="" Q ; Changed their mind - don't delete
37 . S Z=0 F S Z=$O(^IBA(355.96,"B",IB95("IBCU"),Z)) Q:'Z S DIK="^IBA(355.96,",DA=Z D ^DIK
38 . S DA=IB95("IBCU"),DIK="^IBA(355.95," D ^DIK
39 . W ! S DIR(0)="EA",DIR("A",1)="CARE UNIT AND ALL ITS COMBINATIONS WERE DELETED",DIR("A")="PRESS ENTER TO CONTINUE " D ^DIR K DIR D BLD^IBCEP4
40 ;
41 I $P($G(^IBA(355.95,IB95("IBCU"),0)),U)'=Y S DIE="^IBA(355.95,",DR=".01///"_Y,DA=IB95("IBCU") D ^DIE ; File the name change
42 S DR=".02",DIE="^IBA(355.95,",DA=IB95("IBCU") D ^DIE
43 I $D(Y) G CHGQ
44 ;
45 I $O(^IBA(355.96,"ACARE",IB95("IBCU"),""))="" S IB95=3 D INSASS(IBINS,.IB95) G CHGQ
46 ; only 1 combination found for ins/care unit
47 I $O(^IBA(355.96,"ACARE",IB95("IBCU"),""),-1)=$O(^IBA(355.96,"ACARE",IB95("IBCU"),0)) D
48 . S IBDA=$O(^IBA(355.96,"ACARE",IB95("IBCU"),0))
49 ;
50 ; Choose the combination to edit - more than 1 exists
51 E D
52 . W !,"SELECT ONE OF THE FOLLOWING CARE UNIT COMBINATIONS:"
53 . S DIC="^IBA(355.96,",DIC(0)="EMQ",DIC("S")="I $D(^IBA(355.96,""ACARE"","_IB95("IBCU")_",Y))",X=IBINS D ^DIC K DIC S IBDA=+Y
54 ;
55 I IBDA>0 D
56 . N IBDA0,Q,Q0
57 . S IBDA0=$G(^IBA(355.96,IBDA,0))
58 . Q:IBDA0=""
59 . W !!,"*** CARE UNIT COMBINATION FOR: ",$P($G(^IBA(355.95,+IB95("IBCU"),0)),U)," ***"
60 . D DISP^IBCEP4("Q",IBINS,$P(IBDA0,U,6),$P(IBDA0,U,4),$P(IBDA0,U,5),1,.Q0)
61 . S Z=0 F S Z=$O(Q(Z)) Q:'Z W !,Q(Z)
62 . I $P(IBDA0,U,7) W !,"EXP DATE: ",$$FMTE^XLFDT($P(IBDA0,U,7),"2D")
63 . W !,"CARE UNIT: ",$P($G(^IBA(355.95,+IBDA0,0)),U),!
64 . W ! S DIR(0)="SA^E:EDIT;D:DELETE",DIR("B")="EDIT",DIR("A")="EDIT OR DELETE THIS CARE UNIT COMBINATION?: " D ^DIR K DIR
65 . I $D(DTOUT)!$D(DUOUT) Q
66 . I Y="D" D Q
67 .. S DIR(0)="YA",DIR("A")="ARE YOU SURE YOU WANT TO DELETE THIS CARE UNIT COMBINATION?: ",DIR("B")="NO" D ^DIR K DIR
68 .. I Y=1 S DIK="^IBA(355.96,",DA=IBDA,IBCHG=1 D ^DIK
69 . S (IBCK,IBCHG)=0,(IBEDIT,IBOK)=1
70 . F Q:'IBEDIT S IBEDIT=0,IB0=$G(^IBA(355.96,+IBDA,0)) K IBZ F Z=.01,.03,.06,.04,.05 D Q:'IBOK!IBEDIT
71 .. S Z100=Z*100
72 .. I Z100=1 W !,"CARE UNIT: ",$P($G(^IBA(355.95,IB95("IBCU"),0)),U) S IBZ(.01)=$P(IB0,U) Q
73 .. I Z100=3 W !,"INSURANCE COMPANY: ",$$EXPAND^IBTRE(355.96,.03,$P(IB0,U,3)) S IBZ(.03)=$P(IB0,U) Q
74 .. I Z100=5 S IBCK=1
75 .. S IBZ(Z)=$$EDIT(Z,IB0,+IBDA,IBCK),IBCK=0
76 .. I '$P(IBZ(Z),U,2) D Q
77 ... I $P(IB0,U,Z100)'=IBZ(Z) S IBCHG=1
78 ... S $P(IB0,U,Z100)=IBZ(Z)
79 .. S (IBOK,IBCHG)=0
80 .. I $P(IBZ(Z),U,2)=2 D
81 ... S DIR(0)="YA",DIR("A",1)="This entry already exists",DIR("A")="Do you want to re-edit?: " W ! D ^DIR K DIR W !
82 ... I Y=1 S (IBOK,IBEDIT)=1
83 . I IBOK Q:'IBCHG S DIE="^IBA(355.96,",DR=".03////"_IBZ(.03)_";.04////"_IBZ(.04)_";.05////"_IBZ(.05)_";.06////"_IBZ(.06)_";.07",DA=+IBDA D ^DIE,BLD^IBCEP4 Q
84 ;
85 I '$G(IB) D BLD^IBCEP4
86CHGQ I '$G(IB) S VALMBCK="R"
87 Q
88 ;
89INSASS(IBINSZ,IB95) ; Assign care unit to or delete from an ins co
90 ; IBINSZ = ien of ins co (file 36)
91 ; IB95 = flag ("IBCU")=care unit
92 ; can have subscripts to send in pre-entered data
93 N DIR,DIC,DA,DR,X,Y,Z,IBFT,IBCT,IBPTYP,IBCU,IBCHG,IBINS,IBDA,IBPXDT,IBDICS
94 S IBINS=IBINSZ
95 S IBCHG=0,IBCU=$G(IB95("IBCU"))
96 D FULL^VALM1
97 I '$G(IBINSZ) K IB95 G INSQ
98 W !
99 F Z=.06,.04,.05,.07,.03 D G:Z="" INSQ
100 . ;
101 . I $S(Z=.04:'$D(IB95("IBFT")),Z=.05:'$D(IB95("IBCT")),Z=.06:'$D(IB95("IBPTYP")),Z=.03:'$D(IB95("IBCU")),1:1) D
102 .. N DA
103 .. K IBDICS
104 .. I Z=.04 D
105 ... I $P($G(^IBE(355.97,+$G(IB95("IBPTYP")),0)),U,3)="1A" S IBDICS="I Y'=1 K X",DIR("B")="UB-04",DIR("?")="ONLY UB-04 IS VALID FOR A BLUE CROSS ID"
106 .. S DIR(0)="355.96,"_Z_$S($G(IBDICS)="":"",1:"^^"_IBDICS) D ^DIR K DIR
107 . I $D(DTOUT)!$D(DUOUT) S VALMBCK="R",Z="" K:$G(IB95)=2 IB95 Q
108 . ;
109 . I Z=.04 S IBFT=$S($G(IB95("IBFT"))="":+Y,1:IB95("IBFT")) S IB95("IBFT")=IBFT Q
110 . ;
111 . I Z=.05 S IBCT=$S($G(IB95("IBCT"))="":+Y,1:IB95("IBCT")) S IB95("IBCT")=IBCT Q
112 . ;
113 . I Z=.06 S IBPTYP=$S($G(IB95("IBPTYP"))="":+Y,1:IB95("IBPTYP")) S IB95("IBPTYP")=IBPTYP Q
114 . ;
115 . I Z=.07 S IBPXDT=$S('$G(IB95("IBEXPDT")):+Y,1:IB95("IBEXPDT")) S IB95("IBEXPDT")=IBPXDT Q
116 . ;
117 . I Z=.03,$G(IB95)=3,$G(IB95("IBCU"))'="" D Q:Z=""
118 .. N Q ; Assign from add care type
119 .. S IBCT=0
120 .. W !,"CARE UNIT: "_$$EXPAND^IBTRE(355.96,.01,IB95("IBCU"))
121 .. S IB95("IBINS")=+IBINSZ
122 .. I $D(^IBA(355.96,"AUNIQ",IBINSZ,IB95("IBCU"),IB95("IBFT"),IB95("IBCT"),IB95("IBPTYP"))) D Q
123 ... S DIR(0)="EA",DIR("A",1)="This combination already exists - NOT ADDED",DIR("A")="Press ENTER to continue" W ! D ^DIR K DIR W !
124 .. S IBCT=1 S Y=$$ADDCU(IBINSZ,IB95("IBCU"),IB95("IBFT"),IB95("IBCT"),IB95("IBPTYP"))
125 .. I Y<0 W ! S DIR("A",1)=" >> Care Unit NOT completely filed",DIR("A")="PRESS ENTER TO CONTINUE ",DIR(0)="EA" D ^DIR K DIR Q
126 .. W ! S DIR(0)="EA",DIR("A",1)=" >> CARE UNIT COMBINATION FILED FOR THE INSURANCE CO",IBCT=1,IBCHG=1,DIR("A")="PRESS ENTER TO CONTINUE ",DIR(0)="EA" D ^DIR K DIR
127 I $G(IBCHG) D BLD^IBCEP4
128INSQ S VALMBCK="R"
129 Q
130 ;
131EDIT(IBFLD,IB0,IBIEN,IBCK1) ; Allow addition/edit of fields in file 355.96
132 ; without direct Fileman call so uniqueness can be checked
133 ; IBFLD = field # in file 355.96
134 ; IB0 = current 0-node of data in the entry in file 355.96
135 ; IBIEN = ien of entry being edited in file 355.96
136 ; IBCK1 = flag ... if 1, checks for uniqueness after field changed
137 ;
138 ; FUNCTION RETURNS: value of field if field is OK, second piece is null
139 ; If not good, 2nd piece = 1 : no data or ^ entered
140 ; = 2 : record not unique
141 N DIR,DA,Y,X,IBNEW,IBINS,IBVAL
142 S IBINS=+IB0,IBNEW="",IBVAL=$$EXPAND^IBTRE(355.96,IBFLD,$P(IB0,U,(IBFLD*100)))
143 S DIR(0)="355.96,"_IBFLD
144 S:IBVAL'="" DIR("B")=IBVAL
145 D ^DIR K DIR
146 I Y=""!$D(DTOUT)!$D(DUOUT) S IBNEW="^1" G EDITQ
147 S IBNEW=$P(Y,U)
148 I $G(IBCK1) D
149 . N X1,X2,X3,X4,X5
150 . S X1=$S(IBFLD'=.03:IBINS,1:IBNEW),X2=$S(IBFLD'=.01:$P(IB0,U),1:IBNEW),X3=$S(IBFLD'=.04:$P(IB0,U,4),1:IBNEW),X4=$S(IBFLD'=.05:$P(IB0,U,5),1:IBNEW),X5=$S(IBFLD'=.06:$P(IB0,U,6),1:IBNEW)
151 . I $S(X1=""!(X2="")!(X3="")!(X4="")!(X5=""):1,$O(^IBA(355.96,"AUNIQ",X1,X2,X3,X4,X5,0)):$O(^(0))'=IBIEN,1:0) S IBNEW=IBNEW_"^2"
152 ;
153EDITQ Q IBNEW
154 ;
155ADDCU(IBINSZ,IBCU,IBFT,IBCT,IBPTYP) ; Add a new care unit record to file 355.96
156 ; Same parameter definitions as EDIT
157 N DIC,DA,X,Y,DLAYGO
158 S DIC(0)="L",DLAYGO=355.96,DIC="^IBA(355.96,",DIC("DR")=".03////"_IBINSZ_";.04////"_IBFT_";.05////"_IBCT_";.06////"_IBPTYP,X=IBCU
159 D FILE^DICN
160 Q Y
161 ;
Note: See TracBrowser for help on using the repository browser.