Changeset 1204 for ccr/trunk/p/C0CDPT.m
- Timestamp:
- Jun 23, 2011, 3:01:41 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CDPT.m
r767 r1204 1 1 C0CDPT ;WV/CCRCCD/SMH - Routines to Extract Patient Data for CCDCCR; 6/15/08 2 ;;1.0;C0C;;May 19, 2009; 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 2 ;;1.0;C0C;;May 19, 2009;Build 38 3 ; 4 ; Copyright 2008 WorldVistA. Licensed under the terms of the GNU 5 ; General Public License. 6 ; 7 ; This program is distributed in the hope that it will be useful, 8 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 9 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 ; GNU General Public License for more details. 11 ; 12 ; You should have received a copy of the GNU General Public License along 13 ; with this program; if not, write to the Free Software Foundation, Inc., 14 ; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 15 ; 16 ; FAMILY Family Name 17 ; GIVEN Given Name 18 ; MIDDLE Middle Name 19 ; SUFFIX Suffix Name 20 ; DISPNAME Display Name 21 ; DOB Date of Birth 22 ; GENDER Get Gender 23 ; SSN Get SSN for ID 24 ; ADDRTYPE Get Home Address 25 ; ADDR1 Get Home Address line 1 26 ; ADDR2 Get Home Address line 2 27 ; CITY Get City for Home Address 28 ; STATE Get State for Home Address 29 ; ZIP Get Zip code for Home Address 30 ; COUNTY Get County for our Address 31 ; COUNTRY Get Country for our Address 32 ; RESTEL Residential Telephone 33 ; WORKTEL Work Telephone 34 ; EMAIL Email Adddress 35 ; CELLTEL Cell Phone 36 ; NOK1FAM Next of Kin 1 (NOK1) Family Name 37 ; NOK1GIV NOK1 Given Name 38 ; NOK1MID NOK1 Middle Name 39 ; NOK1SUF NOK1 Suffi Name 40 ; NOK1DISP NOK1 Display Name 41 ; NOK1REL NOK1 Relationship to the patient 42 ; NOK1ADD1 NOK1 Address 1 43 ; NOK1ADD2 NOK1 Address 2 44 ; NOK1CITY NOK1 City 45 ; NOK1STAT NOK1 State 46 ; NOK1ZIP NOK1 Zip Code 47 ; NOK1HTEL NOK1 Home Telephone 48 ; NOK1WTEL NOK1 Work Telephone 49 ; NOK1SAME Is NOK1's Address the same the patient? 50 ; NOK2FAM NOK2 Family Name 51 ; NOK2GIV NOK2 Given Name 52 ; NOK2MID NOK2 Middle Name 53 ; NOK2SUF NOK2 Suffi Name 54 ; NOK2DISP NOK2 Display Name 55 ; NOK2REL NOK2 Relationship to the patient 56 ; NOK2ADD1 NOK2 Address 1 57 ; NOK2ADD2 NOK2 Address 2 58 ; NOK2CITY NOK2 City 59 ; NOK2STAT NOK2 State 60 ; NOK2ZIP NOK2 Zip Code 61 ; NOK2HTEL NOK2 Home Telephone 62 ; NOK2WTEL NOK2 Work Telephone 63 ; NOK2SAME Is NOK2's Address the same the patient? 64 ; EMERFAM Emergency Contact (EMER) Family Name 65 ; EMERGIV EMER Given Name 66 ; EMERMID EMER Middle Name 67 ; EMERSUF EMER Suffi Name 68 ; EMERDISP EMER Display Name 69 ; EMERREL EMER Relationship to the patient 70 ; EMERADD1 EMER Address 1 71 ; EMERADD2 EMER Address 2 72 ; EMERCITY EMER City 73 ; EMERSTAT EMER State 74 ; EMERZIP EMER Zip Code 75 ; EMERHTEL EMER Home Telephone 76 ; EMERWTEL EMER Work Telephone 77 ; EMERSAME Is EMER's Address the same the NOK? 78 ; 79 W "No Entry at top!" Q 80 ; 81 ;**Revision History** 82 ; - June 15, 08: v0.1 using merged global 83 ; - Oct 3, 08: v0.2 using fileman calls, many formatting changes. 84 ; 85 ; All methods are Public and Extrinsic 86 ; All calls use Fileman file 2 (Patient). 87 ; You can obtain field numbers using the data dictionary 88 ; 89 89 FAMILY(DFN) ; Family Name 90 91 92 90 N NAME S NAME=$$GET1^DIQ(2,DFN,.01) 91 D NAMECOMP^XLFNAME(.NAME) 92 Q NAME("FAMILY") 93 93 GIVEN(DFN) ; Given Name 94 95 96 94 N NAME S NAME=$$GET1^DIQ(2,DFN,.01) 95 D NAMECOMP^XLFNAME(.NAME) 96 Q NAME("GIVEN") 97 97 MIDDLE(DFN) ; Middle Name 98 99 100 98 N NAME S NAME=$$GET1^DIQ(2,DFN,.01) 99 D NAMECOMP^XLFNAME(.NAME) 100 Q NAME("MIDDLE") 101 101 SUFFIX(DFN) ; Suffi Name 102 103 104 102 N NAME S NAME=$$GET1^DIQ(2,DFN,.01) 103 D NAMECOMP^XLFNAME(.NAME) 104 Q NAME("SUFFIX") 105 105 DISPNAME(DFN) ; Display Name 106 107 108 106 N NAME S NAME=$$GET1^DIQ(2,DFN,.01) 107 ; "G" is Given Name First; "MXc" is Mixed Case, With Suffx Preceded by Comma 108 Q $$NAMEFMT^XLFNAME(.NAME,"G","MXc") 109 109 DOB(DFN) ; Date of Birth 110 111 112 110 N DOB S DOB=$$GET1^DIQ(2,DFN,.03,"I") 111 ; Date in FM Date Format. Convert to UTC/ISO 8601. 112 Q $$FMDTOUTC^C0CUTIL(DOB,"D") 113 113 GENDER(DFN) ; Gender/Sex 114 114 Q $$GET1^DIQ(2,DFN,.02,"I")_"^"_$$GET1^DIQ(2,DFN,.02,"E") ; 115 115 SSN(DFN) ; SSN 116 116 Q $$GET1^DIQ(2,DFN,.09) 117 117 ADDRTYPE(DFN) ; Address Type 118 119 118 ; Vista only stores a home address for the patient. 119 Q "Home" 120 120 ADDR1(DFN) ; Get Home Address line 1 121 121 Q $$GET1^DIQ(2,DFN,.111) 122 122 ADDR2(DFN) ; Get Home Address line 2 123 124 125 126 127 123 ; Vista has Lines 2,3; CCR has only line 1,2; so compromise 124 N ADDLN2,ADDLN3 125 S ADDLN2=$$GET1^DIQ(2,DFN,.112),ADDLN3=$$GET1^DIQ(2,DFN,.113) 126 Q:ADDLN3="" ADDLN2 127 Q ADDLN2_", "_ADDLN3 128 128 CITY(DFN) ; Get City for Home Address 129 129 Q $$GET1^DIQ(2,DFN,.114) 130 130 STATE(DFN) ; Get State for Home Address 131 131 Q $$GET1^DIQ(2,DFN,.115) 132 132 ZIP(DFN) ; Get Zip code for Home Address 133 133 Q $$GET1^DIQ(2,DFN,.116) 134 134 COUNTY(DFN) ; Get County for our Address 135 135 Q $$GET1^DIQ(2,DFN,.117) 136 136 COUNTRY(DFN) ; Get Country for our Address 137 138 137 ; Unfortunately, it's not stored anywhere in Vista, so the inevitable... 138 Q "USA" 139 139 RESTEL(DFN) ; Residential Telephone 140 140 Q $$GET1^DIQ(2,DFN,.131) 141 141 WORKTEL(DFN) ; Work Telephone 142 142 Q $$GET1^DIQ(2,DFN,.132) 143 143 EMAIL(DFN) ; Email Adddress 144 144 Q $$GET1^DIQ(2,DFN,.133) 145 145 CELLTEL(DFN) ; Cell Phone 146 146 Q $$GET1^DIQ(2,DFN,.134) 147 147 NOK1FAM(DFN) ; Next of Kin 1 (NOK1) Family Name 148 149 150 148 N NAME S NAME=$$GET1^DIQ(2,DFN,.211) 149 D NAMECOMP^XLFNAME(.NAME) 150 Q NAME("FAMILY") 151 151 NOK1GIV(DFN) ; NOK1 Given Name 152 153 154 152 N NAME S NAME=$$GET1^DIQ(2,DFN,.211) 153 D NAMECOMP^XLFNAME(.NAME) 154 Q NAME("GIVEN") 155 155 NOK1MID(DFN) ; NOK1 Middle Name 156 157 158 156 N NAME S NAME=$$GET1^DIQ(2,DFN,.211) 157 D NAMECOMP^XLFNAME(.NAME) 158 Q NAME("MIDDLE") 159 159 NOK1SUF(DFN) ; NOK1 Suffi Name 160 161 162 160 N NAME S NAME=$$GET1^DIQ(2,DFN,.211) 161 D NAMECOMP^XLFNAME(.NAME) 162 Q NAME("SUFFIX") 163 163 NOK1DISP(DFN) ; NOK1 Display Name 164 165 166 164 N NAME S NAME=$$GET1^DIQ(2,DFN,.211) 165 ; "G" is Given Name First; "MXc" is Mixed Case, With Suffx Preceded by Comma 166 Q $$NAMEFMT^XLFNAME(.NAME,"G","MXc") 167 167 NOK1REL(DFN) ; NOK1 Relationship to the patient 168 168 Q $$GET1^DIQ(2,DFN,.212) 169 169 NOK1ADD1(DFN) ; NOK1 Address 1 170 170 Q $$GET1^DIQ(2,DFN,.213) 171 171 NOK1ADD2(DFN) ; NOK1 Address 2 172 173 174 175 172 N ADDLN2,ADDLN3 173 S ADDLN2=$$GET1^DIQ(2,DFN,.214),ADDLN3=$$GET1^DIQ(2,DFN,.215) 174 Q:ADDLN3="" ADDLN2 175 Q ADDLN2_", "_ADDLN3 176 176 NOK1CITY(DFN) ; NOK1 City 177 177 Q $$GET1^DIQ(2,DFN,.216) 178 178 NOK1STAT(DFN) ; NOK1 State 179 179 Q $$GET1^DIQ(2,DFN,.217) 180 180 NOK1ZIP(DFN) ; NOK1 Zip Code 181 181 Q $$GET1^DIQ(2,DFN,.218) 182 182 NOK1HTEL(DFN) ; NOK1 Home Telephone 183 183 Q $$GET1^DIQ(2,DFN,.219) 184 184 NOK1WTEL(DFN) ; NOK1 Work Telephone 185 185 Q $$GET1^DIQ(2,DFN,.21011) 186 186 NOK1SAME(DFN) ; Is NOK1's Address the same the patient? 187 187 Q $$GET1^DIQ(2,DFN,.2125) 188 188 NOK2FAM(DFN) ; NOK2 Family Name 189 190 191 189 N NAME S NAME=$$GET1^DIQ(2,DFN,.2191) 190 D NAMECOMP^XLFNAME(.NAME) 191 Q NAME("FAMILY") 192 192 NOK2GIV(DFN) ; NOK2 Given Name 193 194 195 193 N NAME S NAME=$$GET1^DIQ(2,DFN,.2191) 194 D NAMECOMP^XLFNAME(.NAME) 195 Q NAME("GIVEN") 196 196 NOK2MID(DFN) ; NOK2 Middle Name 197 198 199 197 N NAME S NAME=$$GET1^DIQ(2,DFN,.2191) 198 D NAMECOMP^XLFNAME(.NAME) 199 Q NAME("MIDDLE") 200 200 NOK2SUF(DFN) ; NOK2 Suffi Name 201 202 203 201 N NAME S NAME=$$GET1^DIQ(2,DFN,.2191) 202 D NAMECOMP^XLFNAME(.NAME) 203 Q NAME("SUFFIX") 204 204 NOK2DISP(DFN) ; NOK2 Display Name 205 206 207 205 N NAME S NAME=$$GET1^DIQ(2,DFN,.2191) 206 ; "G" is Given Name First; "MXc" is Mixed Case, With Suffx Preceded by Comma 207 Q $$NAMEFMT^XLFNAME(.NAME,"G","MXc") 208 208 NOK2REL(DFN) ; NOK2 Relationship to the patient 209 209 Q $$GET1^DIQ(2,DFN,.2192) 210 210 NOK2ADD1(DFN) ; NOK2 Address 1 211 211 Q $$GET1^DIQ(2,DFN,.2193) 212 212 NOK2ADD2(DFN) ; NOK2 Address 2 213 214 215 216 213 N ADDLN2,ADDLN3 214 S ADDLN2=$$GET1^DIQ(2,DFN,.2194),ADDLN3=$$GET1^DIQ(2,DFN,.2195) 215 Q:ADDLN3="" ADDLN2 216 Q ADDLN2_", "_ADDLN3 217 217 NOK2CITY(DFN) ; NOK2 City 218 218 Q $$GET1^DIQ(2,DFN,.2196) 219 219 NOK2STAT(DFN) ; NOK2 State 220 220 Q $$GET1^DIQ(2,DFN,.2197) 221 221 NOK2ZIP(DFN) ; NOK2 Zip Code 222 222 Q $$GET1^DIQ(2,DFN,.2198) 223 223 NOK2HTEL(DFN) ; NOK2 Home Telephone 224 224 Q $$GET1^DIQ(2,DFN,.2199) 225 225 NOK2WTEL(DFN) ; NOK2 Work Telephone 226 226 Q $$GET1^DIQ(2,DFN,.211011) 227 227 NOK2SAME(DFN) ; Is NOK2's Address the same the patient? 228 228 Q $$GET1^DIQ(2,DFN,.21925) 229 229 EMERFAM(DFN) ; Emergency Contact (EMER) Family Name 230 231 232 230 N NAME S NAME=$$GET1^DIQ(2,DFN,.331) 231 D NAMECOMP^XLFNAME(.NAME) 232 Q NAME("FAMILY") 233 233 EMERGIV(DFN) ; EMER Given Name 234 235 236 234 N NAME S NAME=$$GET1^DIQ(2,DFN,.331) 235 D NAMECOMP^XLFNAME(.NAME) 236 Q NAME("GIVEN") 237 237 EMERMID(DFN) ; EMER Middle Name 238 239 240 238 N NAME S NAME=$$GET1^DIQ(2,DFN,.331) 239 D NAMECOMP^XLFNAME(.NAME) 240 Q NAME("MIDDLE") 241 241 EMERSUF(DFN) ; EMER Suffi Name 242 243 244 242 N NAME S NAME=$$GET1^DIQ(2,DFN,.331) 243 D NAMECOMP^XLFNAME(.NAME) 244 Q NAME("SUFFIX") 245 245 EMERDISP(DFN) ; EMER Display Name 246 247 248 246 N NAME S NAME=$$GET1^DIQ(2,DFN,.331) 247 ; "G" is Given Name First; "MXc" is Mixed Case, With Suffx Preceded by Comma 248 Q $$NAMEFMT^XLFNAME(.NAME,"G","MXc") 249 249 EMERREL(DFN) ; EMER Relationship to the patient 250 250 Q $$GET1^DIQ(2,DFN,.331) 251 251 EMERADD1(DFN) ; EMER Address 1 252 252 Q $$GET1^DIQ(2,DFN,.333) 253 253 EMERADD2(DFN) ; EMER Address 2 254 255 256 257 254 N ADDLN2,ADDLN3 255 S ADDLN2=$$GET1^DIQ(2,DFN,.334),ADDLN3=$$GET1^DIQ(2,DFN,.335) 256 Q:ADDLN3="" ADDLN2 257 Q ADDLN2_", "_ADDLN3 258 258 EMERCITY(DFN) ; EMER City 259 259 Q $$GET1^DIQ(2,DFN,.336) 260 260 EMERSTAT(DFN) ; EMER State 261 261 Q $$GET1^DIQ(2,DFN,.337) 262 262 EMERZIP(DFN) ; EMER Zip Code 263 263 Q $$GET1^DIQ(2,DFN,.338) 264 264 EMERHTEL(DFN) ; EMER Home Telephone 265 265 Q $$GET1^DIQ(2,DFN,.339) 266 266 EMERWTEL(DFN) ; EMER Work Telephone 267 267 Q $$GET1^DIQ(2,DFN,.33011) 268 268 EMERSAME(DFN) ; Is EMER's Address the same the NOK? 269 269 Q $$GET1^DIQ(2,DFN,.3305)
Note:
See TracChangeset
for help on using the changeset viewer.