source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGQERPC.m@ 1087

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

initial load of WorldVistAEHR

File size: 4.9 KB
RevLine 
[613]1DGQERPC ;ALB/RPM - VIC REPLACEMENT VISTA TO MAXIMUS RPC ; 10/04/05
2 ;;5.3;Registration;**571,679**;Aug 13, 1993
3 ;
4 ; This routine contains the primary entry points to the
5 ; VistA to Maximus interface RPCs.
6 ;
7 Q ;no direct entry
8 ;
9GETDEMO(RESULT,DGICN) ;retrieve patient demographics
10 ;
11 ; --rpc: DGQE GET PATIENT DEMO
12 ;
13 ; This remote procedure retrieves demographic data for a given patient
14 ; and returns an array of text lines. Each text line consists of at
15 ; least two circumflex("^")-delimited fields. The first field of each
16 ; line contains an XML style tag (e.g. <RESULT>). The second through
17 ; nth fields contain data.
18 ;
19 ; Supported References:
20 ; DBIA #2701: $$GETDFN^MPIF001
21 ;
22 ; Input:
23 ; DGICN - patient's Integration Control Number
24 ;
25 ; Output:
26 ; RESULT - array of tag-labeled patient demographics
27 ;
28 ; Subscript Field# Field contents Description
29 ; --------- ------ ------------------------- ----------------
30 ; 1 1 <RESULT> RPC status tag
31 ; 2 Card Print Release Status
32 ; 3 "VIC"
33 ;
34 ; 2 1 <MSG> Remarks tag
35 ; 2 Free text remarks
36 ;
37 ; 3 1 <NAME> Identifier tag
38 ; 2 Full Name
39 ; 3 Social Security Number
40 ; 4 Date of Birth
41 ;
42 ; 4 1 <NAME1> Name components tag
43 ; 2 Last Name
44 ; 3 First Name
45 ; 4 Middle Name
46 ; 5 Name Suffix
47 ; 6 Name Prefix
48 ;
49 ; 5 1 <TYPE> Veteran type tag
50 ; 2 Service Connected Indicator
51 ; 3 Prisoner of War Indicator
52 ; 4 Purple Heart Indicator
53 ;
54 ; 6 1 <PATAS> Mailing address tag
55 ; 2 Street Line 1
56 ; 3 Street Line 2
57 ; 4 Street Line 3
58 ;
59 ; 7 1 <PATAZ> Mailing address tag
60 ; 2 City
61 ; 3 State
62 ; 4 Zip
63 ;
64 ; 8 1 <MPI> Master Patient Index tag
65 ; 2 Integration Control Number
66 ; 3 DFN
67 ;
68 ; 9 1 <SITE> Facility tag
69 ; 2 Facility Name
70 ; 3 Station Number
71 ; 4 VISN
72 ;
73 N DGDFN ;pointer to patient in PATIENT (#2) file
74 N DGVIC ;patient data array
75 ;
76 ;initialize patient data array
77 D INITARR^DGQEUT1(.DGVIC)
78 ;
79 D ;drop out of block on error
80 . ;
81 . ;check for input parameter
82 . S DGDFN=+$$GETDFN^MPIF001($G(DGICN))
83 . Q:(DGDFN'>0)
84 . ;
85 . ;build patient object
86 . Q:'$$GETPAT^DGQEUT1(DGDFN,.DGVIC)
87 . ;
88 . ;build eligibility object
89 . Q:'$$GETELIG^DGQEUT1(DGDFN,.DGVIC)
90 ;
91 ;determine card print release status and get into array
92 D CPRSTAT^DGQEUT2(.DGVIC)
93 ;
94 ;build results document
95 D BLDDOC(.DGVIC,.RESULT)
96 ;
97 Q
98 ;
99 ;
100SETID(RESULT,DGICN,DGRSTAT,DGID) ;callback RPC from Maximus workstation
101 ;
102 ; --rpc: DGQE SET CARD ID
103 ;
104 ; This remote procedure provides a "callback" for the VIC PICS
105 ; Workstation to notify VistA that a patient's VIC request has been
106 ; successfully forwarded to the National Card Management Directory.
107 ; The procedure creates an entry in the VIC REQUEST (#39.6) file when
108 ; the Card Print Release Status is "H" [Hold].
109 ;
110 ; Supported References:
111 ; DBIA #2701: $$GETDFN^MPIF001
112 ;
113 ; Input:
114 ; DGICN - patient's Integration Control Number
115 ; DGRSTAT - card print release status
116 ; DGID - NCMD assigned Card ID
117 ;
118 ; Output:
119 ; none
120 ;
121 N DGDFN ;pointer to patient in PATIENT (#2) file
122 ;
123 S DGDFN=+$$GETDFN^MPIF001($G(DGICN))
124 I DGDFN>0,$D(^DPT(DGDFN,0)),$G(DGRSTAT)]"" D
125 . I $E(DGRSTAT)="H" D STOCID^DGQEREQ(DGID,DGDFN,DGRSTAT)
126 S RESULT=1
127 ;
128 Q
129 ;
130 ;
131BLDDOC(DGPAT,DGRSLT) ;build results document based on DOCMAP table
132 ; This procedure uses the array subscript to field location table
133 ; in linetag DOCMAP to format the GETDEMO RPC result array.
134 ;
135 ; Input:
136 ; DGPAT - combined patient/eligibility data array
137 ;
138 ; Output:
139 ; DGRSLT - RPC result array
140 ;
141 N DGFLD ;table field location
142 N DGLCNT ;line count
143 N DGLINE ;line content
144 N DGFLDNM ;field name
145 ;
146 F DGLCNT=1:1 S DGLINE=$T(DOCMAP+DGLCNT) Q:DGLINE="" D
147 . S DGRSLT(DGLCNT)="<"_$P(DGLINE,";",3)_">" ;set TAG
148 . F DGFLD=4:1 S DGFLDNM=$P(DGLINE,";",DGFLD) Q:DGFLDNM="" D
149 . . S DGRSLT(DGLCNT)=DGRSLT(DGLCNT)_"^"_$G(DGPAT(DGFLDNM))
150 ;
151 Q
152 ;
153 ;
154DOCMAP ;document field to array subscript map;TAG;FIELD1;FIELD2;...;FIELDn
155 ;;RESULT;STAT;DOCTYPE
156 ;;MSG;REMARKS
157 ;;NAME;NAME;SSN;DOB
158 ;;NAME1;LAST;FIRST;MIDDLE;SUFFIX;PREFIX
159 ;;TYPE;SC;POW;PH
160 ;;PATAS;STREET1;STREET2;STREET3
161 ;;PATAZ;CITY;STATE;ZIP
162 ;;MPI;ICN;DFN
163 ;;SITE;FACNAME;FACNUM;VISN
Note: See TracBrowser for help on using the repository browser.