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

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

initial load of FOIAVistA 6/30/08 version

File size: 3.5 KB
Line 
1IBNCPDPE ;DALOI/AAT - NCPDP BILLING EVENTS REPORT ;10-JUN-2003
2 ;;2.0;INTEGRATED BILLING;**276,342,347,363**;21-MAR-94;Build 35
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5DATE ;
6 S (IBBDT,IBEDT)=DT
7 S %DT="AEX"
8 S %DT("A")="START WITH DATE: ",%DT("B")="TODAY"
9 D ^%DT K %DT
10 I Y<0 S IBQ=1 Q
11 S IBBDT=+Y
12 S %DT="AEX"
13 S %DT("A")="GO TO DATE: ",%DT("B")="TODAY"
14 D ^%DT K %DT
15 I Y<0 S IBQ=1 Q
16 S IBEDT=+Y
17 Q
18 ;
19MODE ;
20 N DIR,DIC,DIRUT,DUOUT,PSOFILE
21 S (IBM1,IBM2,IBM3)="A"
22 S DIR(0)="S^P:SINGLE PATIENT;R:SINGLE RX;E:SINGLE ECME #;A:ALL ACTIVITY"
23 S DIR("A")="SINGLE (P)ATIENT, SINGLE (R)X, SINGLE (E)CME #, (A)LL ACTIVITY"
24 S DIR("B")="ALL"
25 D ^DIR K DIR I $D(DIRUT) S IBQ=1 Q
26 S IBM1=Y
27 I IBM1="P" S DIC="^DPT(",DIC(0)="AEQMN" D ^DIC Q:$D(DUOUT) S IBPAT=$S(Y>0:+Y,1:0) I 'IBPAT W " ALL" S IBM1="A"
28 I IBM1="R" S PSOFILE=52,DIC="^PSRX(",DIC(0)="AEQMN" D DIC^PSODI(PSOFILE,.DIC) Q:$D(DUOUT) S IBRX=$S(Y>0:+Y,1:0) I 'IBRX W " ALL" S IBM1="A"
29 K PSODIY
30 I IBM1="E" S DIR(0)="FO^7:7^I X'?1.7N W !!,""Cannot contain alpha characters"" K X",DIR("A")="Enter ECME #" D ^DIR Q:$D(DUOUT) S IBECME=$S(+Y>0:Y,1:0) I 'IBECME W " ALL" S IBM1="A"
31 S IBM2="B"
32 ; if "All"
33 I IBM1="A" D Q:$G(IBQ)
34 .S DIR(0)="S^E:ECME BILLABLE;N:NON ECME BILLABLE;B:BOTH"
35 .S DIR("A")="(E)CME BILLABLE;(N)ON ECME BILLABLE;(B)OTH"
36 .S DIR("B")="BOTH"
37 .D ^DIR K DIR I $D(DIRUT) S IBQ=1 Q
38 .S IBM2=Y
39 ;
40 ;Mail/Window/CMOP?
41 S DIR(0)="S^M:MAIL;W:WINDOW;C:CMOP;A:ALL"
42 S DIR("A")="(M)AIL, (W)INDOW, (C)CMOP, (A)LL"
43 S DIR("B")="ALL"
44 D ^DIR K DIR I $D(DIRUT) S IBQ=1 Q
45 S IBM3=Y
46 ;
47 S DIR(0)="S^S:SUMMARY REPORT;D:DETAILED REPORT"
48 S DIR("A")="(S)UMMARY REPORT, (D)ETAILED REPORT"
49 S DIR("B")="SUMMARY REPORT"
50 D ^DIR K DIR I $D(DIRUT) S IBQ=1 Q
51 S IBDTL=($E(Y)="D")
52 Q
53 ;
54TESTDATA() ;
55 N Y
56 S Y=$$HAVEDATA()
57 I 'Y W !!,"No data found in the specified period.",!
58 Q Y
59 ;
60HAVEDATA() ;
61 N Z
62 I $D(^IBCNR(366.14,"B",IBBDT)) Q 1
63 S Z=+$O(^IBCNR(366.14,"B",IBBDT))
64 I Z=0 Q 0
65 I Z>IBEDT Q 0
66 Q 1
67 ;
68DEVICE ;
69 N DIR,DIRUT,POP,ZTRTN,ZTIO,ZTSAVE,ZTDESC,%ZIS,ZTSK
70 S %ZIS="QM"
71 W ! D ^%ZIS
72 I POP S IBQ=1 Q
73 S IBSCR=$S($E($G(IOST),1,2)="C-":1,1:0)
74 ;
75 I $D(IO("Q")) D S IBQ=1
76 . S ZTRTN="START^IBNCPEV"
77 . S ZTIO=ION
78 . S ZTSAVE("IB*")=""
79 . S ZTDESC="IB ECME BILLING EVENTS REPORT"
80 . D ^%ZTLOAD
81 . W !,$S($D(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED")
82 . D HOME^%ZIS
83 U IO
84 Q
85 ;------ added for the User screen --------
86 ;User Screen Entry point (to call from ECME User Screen)
87 ;IBMODE:
88 ; P-patient
89 ; R-Rx
90 ;IBVAL - patient DFN or RX ien (#52)
91 ;
92USRSCREN(IBMODE,IBVAL) ;
93 Q:$$PFSSON^IBNCPDPI() ;quit if PFSS is ON
94 N IBPAT,IBRX,IBBDT,IBEDT,Y,IBM1,IBM2,IBM3,IBQ,IBSCR,IBPAGE,IBDTL,IBDIVS
95 S (IBPAT,IBRX,IBQ,IBSCR,IBPAGE,IBDTL,IBDIVS)=0
96 S IBM1=IBMODE
97 I IBM1="P" S IBPAT=+IBVAL
98 I IBM1="R" S IBRX=+IBVAL
99 ;date
100 F D DATE Q:IBQ Q:$$TESTDATA
101 Q:IBQ
102 N IBMLTDV S IBMLTDV=$$MULTPHRM^BPSUTIL()
103 I +IBMLTDV=1 S IBDIVS=+$$MULTIDIV^IBNCPEV1(.IBDIVS) S:IBDIVS=0 IBDIVS(0)="0^ALL" I IBDIVS=-1 S IBQ=1 Q
104 I +IBMLTDV=0 S IBDIVS=0,IBDIVS(0)="0^"_$P(IBMLTDV,U,2)
105 D MODE2 Q:IBQ
106 D DEVICE Q:IBQ
107 D START^IBNCPEV
108 D ^%ZISC
109 I IBQ W !,"Cancelled"
110 Q
111 ;
112MODE2 ;
113 N DIR,DIC,DIRUT,DUOUT
114 S (IBM1,IBM2,IBM3)="A"
115 S IBM2="B"
116 ;
117 ;Mail/Window/CMOP?
118 S DIR(0)="S^M:MAIL;W:WINDOW;C:CMOP;A:ALL"
119 S DIR("A")="(M)AIL, (W)INDOW, (C)CMOP, (A)LL"
120 S DIR("B")="ALL"
121 D ^DIR K DIR I $D(DIRUT) S IBQ=1 Q
122 S IBM3=Y
123 ;
124 S DIR(0)="S^S:SUMMARY REPORT;D:DETAILED REPORT"
125 S DIR("A")="(S)UMMARY REPORT, (D)ETAILED REPORT"
126 S DIR("B")="SUMMARY REPORT"
127 D ^DIR K DIR I $D(DIRUT) S IBQ=1 Q
128 S IBDTL=($E(Y)="D")
129 Q
130 ;IBNCPDPE
Note: See TracBrowser for help on using the repository browser.