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

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

initial load of WorldVistAEHR

File size: 7.5 KB
Line 
1IBCRER1 ;ALB/ARH - RATES: CM RC NATIONAL ENTER/EDIT OPTION (CONT) ; 13-FEB-2007
2 ;;2.0;INTEGRATED BILLING;**370**;21-MAR-94;Build 5
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5 ;
6CHGLN(IBEFF,IBTYP,IBLINE) ; get all user data for charge
7 ; Input: pass by reference to get/retain defaults: Effective Date, Inst/Prof
8 ; Output: IBLINE if passed by reference
9 ; IBLINE = 'cpt ifn^eff dt^mod ifn^type (I/P)^charge^incr type (PR/ML/HR/MN)^incr charge^inpt^snf^opt^free'
10 ; or null if no CPT, or -1 if invalid (exit)
11 N IBCPT,IBMOD,IBCHGU,IBINCR,IBCHGI,IBINP,IBSNF,IBOPT,IBFS S IBEFF=$G(IBEFF),IBTYP=$G(IBTYP),IBLINE=""
12 ;
13 S IBCPT=$$GETCPT(IBEFF) I IBCPT<1 S IBLINE=-1 Q ; active cpt code
14 S IBEFF=$$GETEFF(IBEFF) Q:IBEFF<1 ; charge effective date
15 S IBMOD=$$GETMOD() Q:IBMOD<0 ; modifier for procedure charge
16 S IBTYP=$$GETTYP(IBTYP) Q:IBTYP<0 ; charge type, inst/prof
17 S IBCHGU=$$GETCHGU() Q:IBCHGU<0 W ! ; unit charge
18 ;
19 S IBINCR=$$GETINCR() Q:IBINCR<0 ; type of incremental charge
20 S IBCHGI=$$GETCHGI(IBINCR) Q:IBCHGI<0 W ! ; incremental charge
21 ;
22 S IBINP=$$GETIINP() Q:IBINP<0 ; inpatient indicator
23 S IBSNF=$$GETISNF() Q:IBSNF<0 ; snf indicator
24 S IBOPT=$$GETIOPT() Q:IBOPT<0 ; outpatient indictor
25 S IBFS=$$GETIFS() Q:IBFS<0 ; freestanding indicator
26 ;
27 S IBLINE=+IBCPT_U_+IBEFF_U_IBMOD_U_IBTYP_U_IBCHGU_U_IBINCR_U_IBCHGI_U_IBINP_U_IBSNF_U_IBOPT_U_IBFS
28 Q
29 ;
30GETCPT(EFFDT) ; Get CPT/HCPCS procedure associated with charge
31 ; Returns: IFN of CPT/HCPCS selected, -1 if invalid
32 N IBX,DIC,DIE,DA,DR,I,X,Y,DTOUT,DUOUT S IBX=-1
33 ;
34 S DIC("A")="Select PROCEDURE CPT/HCPCS: " I +$G(EFFDT) S DIC("S")="I $$CPTACT^IBACSV(+Y,EFFDT)"
35 S DIC="^ICPT(",DIC(0)="AEMNQ" D ^DIC K DIC I +Y>0 S IBX=+Y
36 I $D(DTOUT)!$D(DUOUT) S IBX=-1
37 Q IBX
38 ;
39GETEFF(DEFAULT) ; Get Effective Date for charge, must be within date range of current version
40 ; returns valid effective date, -1 if invalid
41 N IBX,DIR,DUOUT,DTOUT,DIRUT,X,Y,IBY,IBI,IBZ,IBA,IBMIN S IBMIN="",IBA="",IBX=-1
42 S IBY=$$VERSALL^IBCRHBRV() F IBI=1:1 S IBZ=$P(IBY,U,IBI) Q:IBZ="" S IBMIN=IBZ
43 S DIR("?",1)="Charge Effective Date must be within the date range of the current RC"
44 S DIR("?",2)="version, v"_+IBMIN_". Date must be between "_$$DATE(+$P(IBMIN,";",2))_" and Today.",DIR("?",3)=""
45 S DIR("?")="Enter Effective Date of Charge."
46 ;
47 S DIR("A")="EFFECTIVE DATE" I +$G(DEFAULT)>0 S DIR("B")=$$DATE(DEFAULT),IBA="A",DIR("A")=DIR("A")_": "
48 S DIR(0)="D"_IBA_"^"_+$P(IBMIN,";",2)_":"_DT_":EX" D ^DIR K DIR I Y?7N S IBX=+Y
49 I $D(DTOUT)!$D(DUOUT) S IBX=-1
50 Q IBX
51 ;
52GETMOD() ; Get Modifier associated with the procedure charge
53 ; Modifier not limited to valid CPTs since that list is often out of date
54 ; Returns: IFN of selected modifier, null if no modifier selected, -1 if invalid
55 N IBX,DIR,DUOUT,DTOUT,DIRUT,X,Y S IBX=""
56 S DIR("?",1)="Modifier is optional. If a modifier is added then the charge will only"
57 S DIR("?",2)="be applied if the modifier is assigned to the procedure on the bill.",DIR("?",3)=""
58 S DIR("?")="Enter the Modifier associated with the procedure charge."
59 ;
60 S DIR("A")="MODIFIER"
61 S DIR(0)="PO^DIC(81.3,:AEMQ" D ^DIR K DIR I Y>0 S IBX=+Y
62 I $D(DUOUT)!$D(DTOUT) S IBX=-1
63 Q IBX
64 ;
65GETTYP(DEFAULT) ; Get Charge Type: Institutional or Professional
66 ; Returns: I for Institutional, P for Professional, -1 if invalid
67 N IBX,DIR,DUOUT,DTOUT,DIRUT,X,Y S IBX=-1
68 I $G(DEFAULT)'="" S DEFAULT=$S(DEFAULT="I":"Institutional",DEFAULT="P":"Professional",1:"")
69 S DIR("?")="Enter the type of charge, either Institutional or Professional."
70 ;
71 S DIR("A")="CHARGE TYPE" I $G(DEFAULT)'="" S DIR("B")=DEFAULT
72 S DIR(0)="SB^I:Institutional;P:Professional" D ^DIR S IBX=Y
73 I $D(DTOUT)!$D(DUOUT) S IBX=-1
74 Q IBX
75 ;
76GETCHGU() ; get procedures unit charge
77 ; Returns: dollar amount (non-zero), -1 if invalid
78 N IBX,DIR,DUOUT,DTOUT,DIRUT,X,Y S IBX=-1
79 S DIR("?",1)="The dollar amount to be added to a bill for each of this procedure on the bill."
80 S DIR("?",2)="Enter an amount greater than zero and less than 99999, 2 decimal digits."
81 S DIR("?")="Enter the unit charge for Procedure to be used at all sites."
82 ;
83 S DIR("A")="UNIT CHARGE: "
84 S DIR(0)="NA^.001:99999:2" D ^DIR K DIR I +Y>0 S IBX=Y
85 I $D(DTOUT)!$D(DUOUT) S IBX=-1
86 Q IBX
87 ;
88GETINCR() ; get the type of charge, identifies Charge Method and incremental calculations
89 ; Returns: PR for standard, HR for observation, MN for anesthesia, ML for ambulance, -1 if invalid
90 N IBX,DIR,DUOUT,DTOUT,DIRUT,X,Y S IBX=-1
91 S DIR("?",1)="Most charges are a standard charge per procedure. There are three types of"
92 S DIR("?",2)="charges that require special calculations that add charge based on an "
93 S DIR("?",3)="increment of units: Anesthesia, Observation, Ambulance."
94 S DIR("?")="Enter type of care that will identify the charge calculation."
95 ;
96 S DIR("A")="Standard, Observation, Anesthesia, or Ambulance",DIR("B")="Standard"
97 S DIR(0)="SB^PR:Standard;HR:Observation;MN:Anesthesia;ML:Ambulance" D ^DIR S IBX=Y
98 I $D(DTOUT)!$D(DUOUT) S IBX=-1
99 ;
100 Q IBX
101 ;
102GETCHGI(TYPE) ; if a special charge then get the incremental charge amount, anesthesia and observation only
103 ; Returns: dollar amount if applicable (non-zero), null if not applicable, -1 if invalid
104 N IBX,DIR,DUOUT,DTOUT,DIRUT,X,Y,IBTYP S TYPE=$G(TYPE),IBX=-1
105 S IBTYP=$S(TYPE="MN":"Anesthesia",TYPE="HR":"Observation",1:"") I IBTYP="" S IBX=""
106 S DIR("?",1)="Anesthesia and Observation have a unit charge added to a base/incremental"
107 S DIR("?",2)="charge that is multiplied by the time associated with the procedure."
108 S DIR("?",3)="Enter an amount greater than zero and less than 99999, 2 decimal digits.",DIR("?",4)=""
109 S DIR("?")="Enter the base or incremental "_IBTYP_" charge for this procedure."
110 ;
111 S DIR("A")=IBTYP_" BASE CHARGE: "
112 I IBTYP'="" S DIR(0)="NA^.001:99999:2" D ^DIR K DIR I +Y>0 S IBX=Y
113 I $D(DTOUT)!$D(DUOUT) S IBX=-1
114 Q IBX
115 ;
116GETIINP() ; Get Inpatient Indicator, is this charge billable for Inpatient care
117 ; Returns: 1 for Yes Billable for Inpatient care, 0 for not billable, -1 if invalid
118 N IBX,DIR,DUOUT,DTOUT,DIRUT,X,Y S IBX=0
119 S DIR("?")="Enter Yes if this charge is billable for Inpatient care, No otherwise."
120 ;
121 S DIR(0)="Y",DIR("A")="INPATIENT",DIR("B")="No" D ^DIR I Y=1 S IBX=1
122 I $D(DTOUT)!$D(DUOUT) S IBX=-1
123 Q IBX
124 ;
125GETISNF() ; Get SNF Indicator, is this charge billable for Skilled Nursing care
126 ; Returns: 1 for Yes Billable for SNF care, 0 for not billable, -1 if invalid
127 N IBX,DIR,DUOUT,DTOUT,DIRUT,X,Y S IBX=0
128 S DIR("?")="Enter Yes if this charge is billable for SNF care, No otherwise."
129 ;
130 S DIR(0)="Y",DIR("A")="SKILLED NURSING",DIR("B")="Yes" D ^DIR I Y=1 S IBX=1
131 I $D(DTOUT)!$D(DUOUT) S IBX=-1
132 Q IBX
133 ;
134GETIOPT() ; Get Outpatient Indicator, is this charge billable for Outpatient care
135 ; Returns: 1 for Yes Billable for outpatient care, 0 for not billable, -1 if invalid
136 N IBX,DIR,DUOUT,DTOUT,DIRUT,X,Y S IBX=0
137 S DIR("?")="Enter Yes if this charge is billable for Outpatient care, No otherwise."
138 ;
139 S DIR(0)="Y",DIR("A")="OUTPATIENT",DIR("B")="Yes" D ^DIR I Y=1 S IBX=1
140 I $D(DTOUT)!$D(DUOUT) S IBX=-1
141 Q IBX
142 ;
143GETIFS() ; Get Freestanding Indicator, is this charge billable at Freestanding Sites
144 ; Returns: 1 for Yes Billable at Non-Provider Based/Freestanding sites, 0 for not billable, -1 if invalid
145 N IBX,DIR,DUOUT,DTOUT,DIRUT,X,Y S IBX=0
146 S DIR("?",1)="All charges for Freestanding sites will be stored as Professional charges."
147 S DIR("?")="Enter Yes if this charge is billable at Freestanding Sites, No otherwise."
148 ;
149 S DIR(0)="Y",DIR("A")="FREESTANDING",DIR("B")="Yes" D ^DIR I Y=1 S IBX=1
150 I $D(DTOUT)!$D(DUOUT) S IBX=-1
151 Q IBX
152 ;
153DATE(X) ; returns VA date in external form
154 N Y S Y="" I $G(X)?7N.E S Y=$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3)
155 Q Y
Note: See TracBrowser for help on using the repository browser.