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

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

initial load of WorldVistAEHR

File size: 4.5 KB
Line 
1IBCNRPS2 ;BHAM ISC/ALA - Plan Match ListMan ;13-NOV-2003
2 ;;2.0;INTEGRATED BILLING;**276**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;;
5EN ; -- main entry point for IBCNR PLAN MATCH
6 D EN^VALM("IBCNR PLAN STATUS INQUIRY")
7 Q
8 ;
9HDR ; -- header code
10 N IBCNS0,IBCNS11,IBCNS13,IBLEAD,X,X1,X2
11 S IBCNS0=$G(^DIC(36,+IBCNSP,0))
12 S IBCNS11=$G(^DIC(36,+IBCNSP,.11))
13 S IBCNS13=$G(^DIC(36,+IBCNSP,.13))
14 S IBLEAD="All Plans for: "
15 S X="Phone: "_$S($P(IBCNS13,"^")]"":$P(IBCNS13,"^"),1:"<not filed>")
16 S VALMHDR(1)=$$SETSTR^VALM1(X,IBLEAD_$P(IBCNS0,"^"),81-$L(X),40)
17 S X1="Precerts: "_$S($P(IBCNS13,"^",3)]"":$P(IBCNS13,"^",3),1:"<not filed>")
18 S X=$TR($J("",$L(IBLEAD)),""," ")_$S($P(IBCNS11,"^")]"":$P(IBCNS11,"^"),1:"<no street address>")
19 S VALMHDR(2)=$$SETSTR^VALM1(X1,X,81-$L(X1),40)
20 S X=$S($P(IBCNS11,"^",4)]"":$P(IBCNS11,"^",4),1:"<no city>")_", "
21 S X=X_$S($P(IBCNS11,"^",5):$P($G(^DIC(5,$P(IBCNS11,"^",5),0)),"^",2),1:"<no state>")_" "_$E($P(IBCNS11,"^",6),1,5)_$S($E($P(IBCNS11,"^",6),6,9)]"":"-"_$E($P(IBCNS11,"^",6),6,9),1:"")
22 S VALMHDR(3)=$$SETSTR^VALM1(X,"",$L(IBLEAD)+1,80)
23 S X="For: ",X=$E(X_$J("",23),1,23)_$S(IBCNTYP="A":"All",IBCNTYP="P":"Pharmacy Covered",1:"Matched")_" Group Plans."
24 S VALMHDR(4)=$$SETSTR^VALM1(" ",X,64,17)
25 Q
26 ;
27INIT ; -- init variables and create list array or report array
28 N IBGP0,IBCPOLD,X,IBCPD6,IBCNRPP,IBCOV,IBCVRD,LIM
29 K ^TMP("IBCNR",$J)
30 S VALMCNT=0,VALMBG=1,IBCNGP=0
31 F S IBCNGP=$O(^IBA(355.3,"B",IBCNSP,IBCNGP)) Q:'IBCNGP D
32 . ; if we want all plans, let it pass
33 . I IBCNTYP="A" D Q
34 . . D SETPLAN(IBCNGP)
35 . ; if we want Pharmacy plans, check for pharms
36 . I IBCNTYP="P" D Q
37 . . S IBCOV=$O(^IBE(355.31,"B","PHARMACY",""))
38 . . S LIM="",IBCVRD=0
39 . . F S LIM=$O(^IBA(355.32,"B",IBCNGP,LIM)) Q:LIM="" D
40 . . . I $P(^IBA(355.32,LIM,0),U,2)=IBCOV S IBCVRD=$P(^IBA(355.32,LIM,0),U,4)
41 . . I IBCVRD D SETPLAN(IBCNGP)
42 . ; if we want Matched plans, check for existence of Plan ID
43 . I IBCNTYP="M" D Q
44 . . I $P($G(^IBA(355.3,IBCNGP,6)),U)'="" D SETPLAN(IBCNGP)
45 I VALMCNT=0 D
46 . S ^TMP("IBCNR",$J,"SI",1,0)="No Plans Available"
47 . S ^TMP("IBCNR",$J,"SI","IDX",1,1)=IBCNGP
48 Q
49 ;
50SETPLAN(IBCNGP) ;
51 ; create text
52 N IBGPZ,I,IBPLN,IBPLNA
53 S VALMCNT=VALMCNT+1
54 S IBGPZ=^IBA(355.3,+IBCNGP,0)
55 ; if creating report and not a list
56 I $G(IBCNRRPT) D Q
57 . ; Group Name, Group #, Group Type, Plan ID, Plan Status
58 . S X=$$FO^IBCNEUT1($P(IBGPZ,U,3),18)
59 . S X=X_" "_$$FO^IBCNEUT1($P(IBGPZ,U,4),17)
60 . S X=X_" "_$$FO^IBCNEUT1($$EXPAND^IBTRE(355.3,.09,$P(IBGPZ,U,9)),13)
61 . S IBPLN=$P($G(^IBA(355.3,+IBCNGP,6)),U)
62 . ; check for plan
63 . I IBPLN="" D Q
64 . . S ^TMP("IBCNR",$J,"DSPDATA",VALMCNT)=X
65 . . S VALMCNT=VALMCNT+1,^TMP("IBCNR",$J,"DSPDATA",VALMCNT)="No Plan Found."
66 . ; check plan status information
67 . S IBPLNA=$P($G(^IBCNR(366.03,IBPLN,0)),U)
68 . S X=X_" "_$$FO^IBCNEUT1(IBPLNA,13)
69 . ;
70 . N ARRAY D STCHK^IBCNRU1(IBPLN,.ARRAY)
71 . S X=X_" "_$$FO^IBCNEUT1($S($G(ARRAY(1))="I":"INACTIVE",1:"ACTIVE"),8)
72 . S ^TMP("IBCNR",$J,"DSPDATA",VALMCNT)=X
73 . I $G(ARRAY(6)) D
74 . . N STATAR
75 . . D STATAR^IBCNRU1(.STATAR)
76 . . F I=1:1:$L(ARRAY(6),",") D
77 . . . S VALMCNT=VALMCNT+1
78 . . . S ^TMP("IBCNR",$J,"DSPDATA",VALMCNT)=" "_$G(STATAR($P(ARRAY(6),",",I)))
79 ;
80 S X=$$SETFLD^VALM1(VALMCNT,"","NUMBER")
81 ;
82 I '$P(IBGPZ,U,2) S $E(X,4)="+"
83 S X=$$SETFLD^VALM1($P(IBGPZ,U,3),X,"GNAME")
84 ;
85 I '$P(IBGPZ,U,11) S $E(X,24)="*"
86 S X=$$SETFLD^VALM1($P(IBGPZ,U,4),X,"GNUM")
87 ;
88 S X=$$SETFLD^VALM1($$EXPAND^IBTRE(355.3,.09,$P(IBGPZ,U,9)),X,"TYPE")
89 ; matched plan active or not
90 S IBPLN=$P($G(^IBA(355.3,+IBCNGP,6)),U)
91 I IBPLN'="" D
92 . S IBPLNA=$P($G(^IBCNR(366.03,+IBPLN,0)),U)
93 . S X=$$SETFLD^VALM1(IBPLNA,X,"PHARM")
94 . N ARRAY
95 . D STCHK^IBCNRU1(IBPLN,.ARRAY)
96 . S X=$$SETFLD^VALM1($S($G(ARRAY(1))="A":"ACTIVE",1:"INACTIVE"),X,"COV")
97 S ^TMP("IBCNR",$J,"SI",VALMCNT,0)=X
98 S ^TMP("IBCNR",$J,"SI","IDX",VALMCNT,VALMCNT)=IBCNGP
99 Q
100 ;
101HELP ; -- help code
102 S X="?" D DISP^XQORM1 W !!
103 Q
104 ;
105EXIT ; -- exit code
106 K ^TMP("IBCNR",$J),VALMBCK,VALMY
107 D CLEAN^VALM10,CLEAR^VALM1
108 Q
109 ;
110SEL ; -- select plan
111 N IBSEL,IBX
112 D S1
113 I 'IBX Q ; no group selected
114 ;
115 D
116 . N IBCNRRPT,IBCNGP,VALMCNT,LST,IBCNRDEV
117 . S VALMCNT=0,IBCNRRPT=1,IBCNRDEV=0,IBCNGP=IBSEL
118 . K ^TMP("IBCNR",$J,"DSPDATA")
119 . D SETPLAN(IBSEL)
120 . D PRINT^IBCNRPSI
121 D SPQ
122 Q
123S1 ;
124 N DIR,DIRUT,DUOUT,DTOUT,DIROUT,IBOK,IBQUIT,Y
125 D EN^VALM2($G(XQORNOD(0)),"S"),FULL^VALM1
126 S IBX=$O(VALMY(0)),VALMBCK="R"
127 ;
128 I 'IBX W !!,"No group selected!" G SPQ
129 S IBSEL=+$G(^TMP("IBCNR",$J,"SI","IDX",IBX,IBX))
130 Q
131 ;
132SPQ ;
133 I '$O(IBSEL(0)),VALMBCK="R" D PAUSE^VALM1
134 Q
Note: See TracBrowser for help on using the repository browser.