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

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

initial load of WorldVistAEHR

File size: 4.3 KB
Line 
1IBCNRMFE ;BHAM ISC/DMK - Receive HL7 e-Pharmacy MFE Segment ;23-OCT-2003
2 ;;2.0;INTEGRATED BILLING;**251,276**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ; Description
6 ;
7 ; Receive HL7 e-Pharmacy MFE Segment
8 ; Master File Entry
9 ;
10 ; Prepare for potential subsequent Z** Segment(s)
11 ;
12 ; Called by IBCNRHLT
13 ;
14 ; Entry point
15 ;
161000 ; Control MFE Segment processing
17 D INIT
18 Q
19 ;
20INIT ; Initialize MFE Segment variables
21 K DATA,DATAAP,DATACM,ERROR
22 N ANAME,FILENO1,KEY
23 ;
24 S EPHARM=1
25 S FILENO=FLN
26 ;
27 S DATE("NOW")=$$NOW^XLFDT()
28 ;
29 ; Record-Level Event Code (action)
30 ; MAC = Activate
31 ; MAD = Add
32 ; MDC = Deactivate
33 ; MDL = Delete
34 ; MUP = Update
35 S IBCNACT=$G(IBSEG(2))
36 ;
37 ; Primary Key Value ID
38 S KEY=$P($G(IBSEG(5)),$E(HLECH,1),1)
39 ;
40 ; Convert HL7 special characters if necessary
41 I KEY[$E(HLECH,3) S KEY=$$TRAN1^IBCNRHLU(KEY)
42 ;
43 I FILENO'=365.12 S IEN=$$LOOKUP1^IBCNRFM1(FILENO,KEY)
44 I FILENO=365.12 S IEN=$$LOOKUP3^IBCNRFM1(FILENO,"C",KEY)
45 ;
46 ; Error?
47 ; V100 = Payer ID Undefined
48 ; V200 = NCPDP Processor Name Undefined
49 ; V300 = Pharmacy Benefits Manager (PBM) Name Undefined
50 ; V400 = Plan ID Undefined
51 ; V500 = Plan ID Undefined
52 I FILE["Pharmacy Plan",IEN=-1 S ERROR="V500" Q
53 I IBCNACT'="MAD",IEN=-1 S ERROR=$S(FILENO=365.12:"V100",FILENO=366.01:"V200",FILENO=366.02:"V300",FILENO=366.03:"V400") Q
54 ;
55 S FIELDNO=$S(FILENO=365.12:1,1:3)
56 S FILENO1=$S(FILENO=365.12:365.13,1:FILENO+.1)
57 S ANAME="E-PHARM"
58 S AIEN=$$LOOKUP1^IBCNRFM1(FILENO1,ANAME)
59 I AIEN=-1 S AIEN=$$ADD1^IBCNRFM1(FILENO1,ANAME)
60 I IEN'=-1 S APIEN=$$LOOKUP2^IBCNRFM1(FILENO,IEN,FIELDNO,ANAME)
61 I IEN=-1 S APIEN=-1
62 ;
63 ; Error?
64 ; V101 = E-PHARM Application Undefined
65 ; V201 = E-PHARM Application Undefined
66 ; V301 = E-PHARM Application Undefined
67 ; V401 = E-PHARM Application Undefined
68 ; V501 = E-PHARM Application Undefined
69 I IBCNACT'="MAD",APIEN=-1 D Q
70 . S ERROR=$S(FILENO=365.12:"V101",FILENO=366.01:"V201",FILENO=366.02:"V301",FILENO=366.03:"V401")
71 . I FILE["Pharmacy" S ERROR="V501"
72 ;
73 ; MAC = Activate
74 I IBCNACT="MAC" D INITMAC
75 ;
76 ; MAD = Add
77 I IBCNACT="MAD" D INITMAD
78 ;
79 ; MDC = Deactivate
80 I IBCNACT="MDC" D INITMDC
81 ;
82 ; MDL = Delete
83 I IBCNACT="MDL" D INITMDL
84 ;
85 ; MUP = Update
86 I IBCNACT="MUP" D INITMUP
87 Q
88 ;
89INITMAD ; Initialize APPLICATION Subfile variables if MAD (Add) action
90 ; 365.121 PAYER APPLICATION Subfile
91 ; 366.013 NCPDP PROCESSOR APPLICATION Subfile
92 ; 366.023 PHARMACY BENEFITS MANAGER (PBM) APPLICATION Subfile
93 ; 366.033 PLAN APPLICATION Subfile
94 ;
95 ; Process MAD (Add) as MAC (Activate)
96 D INITMAC
97 ;
98 ; .03 LOCAL ACTIVE?
99 ; Set to INACTIVE for PLAN, all others ACTIVE
100 S DATAAP(.03)=$S(FILENO=366.03:0,1:1)
101 ;
102 ; .04 USER EDITED LOCAL
103 S DATAAP(.04)=IDUZ
104 ;
105 ; .05 DATE/TIME LOCAL EDITED
106 S DATAAP(.05)=DATE("NOW")
107 ;
108 ; .13 DATE/TIME CREATED
109 S DATAAP(.13)=DATE("NOW")
110 Q
111 ;
112INITMAC ; Initialize APPLICATION Subfile variables if MAC (Activate) action
113 ; 365.121 PAYER APPLICATION Subfile
114 ; 366.013 NCPDP PROCESSOR APPLICATION Subfile
115 ; 366.023 PHARMACY BENEFITS MANAGER (PBM) APPLICATION Subfile
116 ; 366.033 PLAN APPLICATION Subfile
117 ;
118 ; .02 NATIONAL ACTIVE?
119 S DATAAP(.02)=1
120 ;
121 ; .06 DATE/TIME NATIONAL EDITED
122 S DATAAP(.06)=DATE("NOW")
123 ;
124 ; .11 DEACTIVATED?
125 S DATAAP(.11)=0
126 ;
127 ; .12 DATE/TIME DEACTIVATED
128 S DATAAP(.12)="@"
129 Q
130 ;
131INITMDC ; Initialize APPLICATION Subfile variables if MDC (deactivate) action
132 ; 365.121 PAYER APPLICATION Subfile
133 ; 366.013 NCPDP PROCESSOR APPLICATION Subfile
134 ; 366.023 PHARMACY BENEFITS MANAGER (PBM) APPLICATION Subfile
135 ; 366.033 PLAN APPLICATION Subfile
136 ;
137 ; .02 NATIONAL ACTIVE?
138 S DATAAP(.02)=0
139 ;
140 ; .06 DATE/TIME NATIONAL EDITED
141 S DATAAP(.06)=DATE("NOW")
142 ;
143 ; .11 DEACTIVATED?
144 S DATAAP(.11)=1
145 ;
146 ; .12 DATE/TIME DEACTIVATED
147 S DATAAP(.12)=DATE("NOW")
148 Q
149 ;
150INITMDL ; Initialize APPLICATION Subfile variables if MDL (Delete) action
151 ; 365.121 PAYER APPLICATION Subfile
152 ; 366.013 NCPDP PROCESSOR APPLICATION Subfile
153 ; 366.023 PHARMACY BENEFITS MANAGER (PBM) APPLICATION Subfile
154 ; 366.033 PLAN APPLICATION Subfile
155 ;
156 ; Process MDL (Delete) as MDC (Deactivate)
157 D INITMDC
158 Q
159 ;
160INITMUP ; Initialize APPLICATION Subfile variables if MUP (Update) action
161 ; 365.121 PAYER APPLICATION Subfile
162 ; 366.013 NCPDP PROCESSOR APPLICATION Subfile
163 ; 366.023 PHARMACY BENEFITS MANAGER (PBM) APPLICATION Subfile
164 ; 366.033 PLAN APPLICATION Subfile
165 Q
Note: See TracBrowser for help on using the repository browser.