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

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1IBCEF6 ;ALB/TMP - EDI TRANSMISSION RULES DISPLAY ;28-APR-99
2 ;;2.0;INTEGRATED BILLING;**137**;21-MAR-94
3 ;
4EN ; -- main entry point for IBCE RULES
5 N IBACTIVE
6 S DIR("A")="Press RETURN to continue: ",DIR("A",1)="",$P(DIR("A",1),"*",54)="",DIR("A",1)=$J("",10)_DIR("A",1)
7 S DIR("A",2)=$J("",10)_"* WARNING - MAKING CHANGES TO THE TRANSMISSION *",DIR("A",3)=$J("",10)_"* RULES USING THIS OPTION CAN SERIOUSLY AFFECT THE *"
8 S DIR("A",4)=$J("",10)_"* SITE'S ABILITY TO BILL. BE EXTREMELY CAUTIOUS *"
9 S DIR("A",5)=$J("",10)_"* WHEN USING THIS OPTION. *"
10 S DIR("A",6)=DIR("A",1),DIR("A",7)=" "
11 S DIR(0)="EA"
12 D ^DIR K DIR
13 I 'Y G ENQ
14 D EN^VALM("IBCE RULES")
15ENQ Q
16 ;
17HDR ; -- header code
18 S VALMHDR(1)=" "
19 S VALMHDR(2)=" FORM TRANSMIT INSURANCE RULE"
20 S VALMHDR(3)=" # TYPE TYPE OPTION NUM SHORT DESCRIPTION"_$J("",30)_"ACTIVE DATE INACTIVE DATE"
21 Q
22 ;
23INIT ; -- init variables and list array
24 N IBI,IBR,IBRT
25 S VALMCNT=0,VALMBG=1
26 ; -- build list of rules
27 D REBLD(0)
28 Q
29 ;
30REBLD(IBACTIVE) ; Set up formatted global
31 ;
32 N IBI,IBR,IBS,IBRT,IBCNT,X,IB0,IBIN,IBNEXT,TEXT,Z
33 D CLEAN^VALM10
34 K ^TMP("IBCE-RULE",$J),^TMP("IBCE-RULEDX",$J)
35 S (IBI,IBR)=0
36 F S IBI=$O(^IBE(364.4,IBI)) Q:'IBI S IB0=$G(^(IBI,0)) D
37 . S IBRT=+$P(IB0,U,11)
38 . ;Extract rules by rule type and keep inactive rules at end
39 . S IBIN=$S($P(IB0,U,2)&($P(IB0,U,2)>DT):800,$P(IB0,U,6)&($P(IB0,U,6)'>DT):900,1:0) ; Is rule inactive?
40 . Q:IBIN&$G(IBACTIVE) ; Only active rules displayed
41 . S IBNEXT=$O(IBR(IBRT,800),-1)+1
42 . I IBIN D
43 .. S IBNEXT=$O(IBR(IBRT,IBIN+99),-1)+1
44 .. I IBNEXT<IBIN S IBNEXT=IBIN
45 . S IBR(IBRT,IBNEXT)=IBI
46 ;
47 S (VALMCNT,IBCNT)=0,IBRT=""
48 F S IBRT=$O(IBR(IBRT)) Q:IBRT="" D
49 . ; -- add rule type to list
50 . ; Add 1 blank line between types
51 . I $O(IBR(""))'=IBRT D SET(" ",.VALMCNT,IBCNT)
52 . S X="- "_$$EXPAND^IBTRE(364.4,.11,IBRT)_" -"
53 . S IBS=(80-$L(X))\2
54 . S X=$J("",IBS)_X
55 . D SET(X,.VALMCNT,$S(IBCNT:IBCNT,1:1))
56 . D CNTRL^VALM10(VALMCNT,IBS+1,$L(X)-IBS,IORVON,IORVOFF)
57 . D SET(" ",.VALMCNT,$S(IBCNT:IBCNT,1:1))
58 . S IBS=0 F S IBS=$O(IBR(IBRT,IBS)) Q:'IBS S IBRULE=+$G(IBR(IBRT,IBS)) I IBRULE D
59 .. S IB0=$G(^IBE(364.4,IBRULE,0))
60 .. S X=""
61 .. S IBCNT=IBCNT+1
62 .. S X=$J(IBCNT,3)_" "_$S($P(IB0,U,5)=1:"INST",$P(IB0,U,5)=2:"PROF",1:"BOTH")_" "_$E($S($P(IB0,U,3)=1:"EDI ONLY",$P(IB0,U,3)=2:"MRA ONLY",1:"BOTH EDI/MRA")_$J("",14),1,14)
63 .. S X=X_$E($S($P(IB0,U,7)=1:"INCLUDES",$P(IB0,U,7)=2:"EXCLUDES",1:"ALL")_$J("",11),1,11)_$E($P(IB0,U)_$S(IBS'<800:"*",1:"")_$J("",6),1,6)
64 .. S X=X_$E($P(IB0,U,8)_$J("",47),1,47)_$E($$EXPAND^IBTRE(364.4,.02,$P(IB0,U,2))_$J("",15),1,15)_$$EXPAND^IBTRE(364.4,.06,$P(IB0,U,6))
65 .. D SET(X,.VALMCNT,IBCNT,IBRULE)
66 . S VALMSG=$S('$G(IBACTIVE):"Rule #'s followed by an * are currently inactive",1:"Only currently active rules are displayed")
67 ;
68 I '$D(^TMP("IBCE-RULE",$J)) S VALMCNT=2,IBCNT=2,^TMP("IBCE-RULE",$J,1,0)=" ",^TMP("IBCE-RULE",$J,2,0)=" No "_$S('$G(IBACTIVE):"",1:"Active")_" Transmission Rules Found",^TMP("IBCE-RULE",$J,"IDX",1,1)="",^TMP("IBCE-RULE",$J,"IDX",2,2)=""
69 Q
70 ;
71SET(X,VALMCNT,IBCNT,IBRULE) ;
72 ; X = Text to set into display global
73 ; VALMCNT = returned if passed by ref = the last line set in display
74 ; IBCNT = entry number to use if the line is selectable; non-select = 0
75 ; IBRULE = ien of rule being displayed
76 ;
77 S VALMCNT=VALMCNT+1,^TMP("IBCE-RULE",$J,VALMCNT,0)=X
78 D SET^VALM10(VALMCNT,X,IBCNT)
79 I $G(IBRULE) D
80 . S ^TMP("IBCE-RULEDX",$J,IBCNT)=VALMCNT_U_IBRULE
81 Q
82 ;
83HELP ; -- help code
84 S X="?" D DISP^XQORM1 W !!
85 Q
86 ;
87EXIT ; -- exit code
88 K ^TMP("IBCE-RULE",$J),^TMP("IBCE-RULEDX",$J),IBRULE
89 D FULL^VALM1
90 Q
91 ;
92EXPND ; -- expand code
93 Q
94 ;
Note: See TracBrowser for help on using the repository browser.