source: FOIAVistA/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBCEF62.m@ 1203

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

initial load of FOIAVistA 6/30/08 version

File size: 3.7 KB
Line 
1IBCEF62 ;ALB/TMP - EDI TRANSMISSION RULES BT RESTRICTIONS DISPLAY ;30-APR-99
2 ;;2.0;INTEGRATED BILLING;**137**;21-MAR-94
3 ;
4EN ; -- main entry point for IBCE RULE BT RESTRICT
5 D EN^VALM("IBCE RULE BT RESTRICT")
6 Q
7 ;
8HDR ; -- header code
9 N IB0
10 Q:'$G(IBRULE)
11 S IB0=$G(^IBE(364.4,IBRULE,0))
12 S VALMHDR(1)=IORVON_"BILL TYPE RESTRICTIONS FOR RULE #"_$P(IB0,U)_IORVOFF
13 S VALMHDR(2)=$J("",4)_"Transmit type: "_$S($P(IB0,U,3)=1:"EDI ",$P(IB0,U,3)=2:"MRA ",1:"BOTH")_$J("",8)_" Form Type : "_$S($P(IB0,U,5)=1:"INST",$P(IB0,U,5)=2:"PROF",1:"BOTH")
14 S VALMHDR(2)=VALMHDR(2)_" Ins Co Option: "_$S($P(IB0,U,7)=1:"INCLUDE",$P(IB0,U,7)=2:"EXCLUDE",1:"ALL ")
15 S VALMHDR(3)=$J("",4)_"Active Date : "_$E($$EXPAND^IBTRE(364.4,.02,$P(IB0,U,2))_$J("",12),1,12)_" Inactive Date: "_$E($$EXPAND^IBTRE(364.4,.06,$P(IB0,U,6))_$J("",12),1,12)
16 S VALMHDR(4)=$J("",4)_$P(IB0,U,8)
17 Q
18 ;
19INIT ; -- init variables and list array
20 N IBI,IBR,IBRT
21 S VALMCNT=0,VALMBG=1
22 ; -- build list of rule's bill type restrictions
23 D REBLD
24 Q
25 ;
26REBLD ; Set up formatted global
27 ;
28 N IBI,IBBT,IBCNT,X,IB0,Z
29 D CLEAN^VALM10
30 K ^TMP("IBCE-BT",$J),^TMP("IBCE-BTDX",$J)
31 I '$G(IBRULE) Q
32 S IBBT="",X="",(VALMCNT,IBCNT)=0
33 F S IBBT=$O(^IBE(364.4,IBRULE,"BTYP","B",IBBT),-1) Q:IBBT="" S IBI=0 F S IBI=$O(^IBE(364.4,IBRULE,"BTYP","B",IBBT,IBI)) Q:'IBI S IB0=$G(^IBE(364.4,IBRULE,"BTYP",IBI,0)) D
34 . S IBCNT=IBCNT+1
35 . S X=$$SETFLD^VALM1(" "_IBCNT,X,"NUMBER")
36 . S X=$$SETFLD^VALM1(" "_IBBT,X,"BILL TYPE")
37 . S X=$$SETFLD^VALM1($$EXPAND^IBTRE(364.41,.02,$P(IB0,U,2)),X,"ACT")
38 . S X=$$SETFLD^VALM1($$EXPAND^IBTRE(364.41,.03,$P(IB0,U,3)),X,"INACT")
39 . D SET(X,IBCNT,IBI)
40 ;
41 I '$D(^TMP("IBCE-BT",$J)) S VALMCNT=2,IBCNT=2,^TMP("IBCE-BT",$J,1,0)=" ",^TMP("IBCE-BT",$J,2,0)=" No Bill Type Restrictions Found",^TMP("IBCE-BT",$J,"IDX",1,1)="",^TMP("IBCE-BT",$J,"IDX",2,2)=""
42 Q
43 ;
44SET(X,IBCNT,IBIEN) ;
45 ; X = Text to set into display global
46 ; IBCNT = the count of the entries in display
47 ; IBIEN = ien of rule's bill type restriction being displayed
48 ;
49 S VALMCNT=VALMCNT+1,^TMP("IBCE-BT",$J,VALMCNT,0)=X
50 D SET^VALM10(VALMCNT,X,IBCNT)
51 S ^TMP("IBCE-BTDX",$J,VALMCNT)=IBIEN
52 Q
53 ;
54HELP ; -- help code
55 S X="?" D DISP^XQORM1 W !!
56 Q
57 ;
58EXIT ; -- exit code
59 K ^TMP("IBCE-BT",$J),^TMP("IBCE-BTDX",$J),IBRULE
60 D FULL^VALM1
61 Q
62 ;
63EXPND ; -- expand code
64 Q
65 ;
66SUCCBT ; Display success message after bill type restriction delete
67 ;
68 N DIR,Y,X
69 S DIR(0)="EA"
70 W !
71 S DIR("A",1)="THE BILL TYPE RESTRICTION(S) WAS/WERE DELETED"
72 S DIR("A")="PRESS RETURN " D ^DIR K DIR
73 S VALMBCK="R"
74 Q
75 ;
76BTDEL(IBRULE) ; Delete bill type restriction
77 ; IBRULE = the ien of the rule being processed in file 364.4
78 ;
79 ; Function returns 1 if successful, 0 if not
80 ;
81 N IBOK,DA,DIK,Y,X,IBHT,Z,Z0,VALMY,IBCT,IBX
82 ;
83 S IBOK=0,IBCT=0
84 D SEL^IBCEF61(.VALMY)
85 G:'$O(VALMY(0)) BTDQ ; None selected
86 ;
87 S IBX=0 F S IBX=$O(VALMY(IBX)) Q:'IBX S Z0=+$G(^TMP("IBCE-BTDX",$J,IBX)),Z=$P($G(^IBE(364.4,IBRULE,"BTYP",Z0,0)),U) I Z'="" S IBX(Z)=Z0,IBCT=IBCT+1
88 ; First check that delete will leave the rest of the restrictions valid
89 S Z="" F S Z=$O(^IBE(364.4,IBRULE,"BTYP","B",Z)) Q:Z="" F Z0=0:0 S Z0=$O(^IBE(364.4,IBRULE,"BTYP","B",Z,Z0)) Q:'Z0 I '$D(IBX(Z)) S IB0=$G(^IBE(364.4,IBRULE,"BTYP",Z0,0)) I IB0'="" S IBHT($P(IB0,U))=Z0 ;Extract all bill types
90 ;
91 S Z="",IBOK=1
92 F S Z=$O(IBHT(Z)) Q:Z="" D Q:'IBOK
93 . N IBB
94 . M IBB=IBHT K IBB(Z)
95 . S IBOK=$$BTOK^IBCEF51(Z,.IBB,1)
96 . I 'IBOK D
97 .. S DIR(0)="EA",DIR("A",1)="Bill type"_$S(IBCT=1:"",1:"s")_" not deleted - deleting "_$S(IBCT=1:"this restriction",1:"these restrictions")_" would cause an inconsistency",DIR("A")="Press return: "
98 .. D ^DIR K DIR
99 ;
100 I IBOK D
101 . S Z="" F S Z=$O(IBX(Z)) Q:Z="" S DA=IBX(Z),DA(1)=IBRULE,DIK="^IBE(364.4,"_DA(1)_",""BTYP""," I DA D ^DIK
102 . D REBLD
103 ;
104BTDQ S VALMBCK="R"
105 Q IBOK
106 ;
Note: See TracBrowser for help on using the repository browser.