Changeset 1428 for ccr/branches/ohum/p/C0CDPT.m
- Timestamp:
- May 11, 2012, 6:06:25 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/branches/ohum/p/C0CDPT.m
r1342 r1428 1 C0CDPT 2 ;;1.0;C0C;;May 19, 2009;Build 2 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 89 FAMILY(DFN) 90 91 92 93 GIVEN(DFN) 94 95 96 97 MIDDLE(DFN) 98 99 100 101 SUFFIX(DFN) 102 103 104 105 DISPNAME(DFN) 106 107 108 109 DOB(DFN) 110 111 112 113 GENDER(DFN) 114 115 SSN(DFN) 116 117 ADDRTYPE(DFN) 118 119 120 ADDR1(DFN) 121 122 ADDR2(DFN) 123 124 125 126 127 128 CITY(DFN) 129 130 STATE(DFN) 131 132 ZIP(DFN) 133 134 COUNTY(DFN) 135 136 COUNTRY(DFN) 137 138 139 RESTEL(DFN) 140 141 WORKTEL(DFN) 142 143 EMAIL(DFN) 144 145 CELLTEL(DFN) 146 147 NOK1FAM(DFN) 148 149 150 151 NOK1GIV(DFN) 152 153 154 155 NOK1MID(DFN) 156 157 158 159 NOK1SUF(DFN) 160 161 162 163 NOK1DISP(DFN) 164 165 166 167 NOK1REL(DFN) 168 169 NOK1ADD1(DFN) 170 171 NOK1ADD2(DFN) 172 173 174 175 176 NOK1CITY(DFN) 177 178 NOK1STAT(DFN) 179 180 NOK1ZIP(DFN) 181 182 NOK1HTEL(DFN) 183 184 NOK1WTEL(DFN) 185 186 NOK1SAME(DFN) 187 188 NOK2FAM(DFN) 189 190 191 192 NOK2GIV(DFN) 193 194 195 196 NOK2MID(DFN) 197 198 199 200 NOK2SUF(DFN) 201 202 203 204 NOK2DISP(DFN) 205 206 207 208 NOK2REL(DFN) 209 210 NOK2ADD1(DFN) 211 212 NOK2ADD2(DFN) 213 214 215 216 217 NOK2CITY(DFN) 218 219 NOK2STAT(DFN) 220 221 NOK2ZIP(DFN) 222 223 NOK2HTEL(DFN) 224 225 NOK2WTEL(DFN) 226 227 NOK2SAME(DFN) 228 229 EMERFAM(DFN) 230 231 232 233 EMERGIV(DFN) 234 235 236 237 EMERMID(DFN) 238 239 240 241 EMERSUF(DFN) 242 243 244 245 EMERDISP(DFN) 246 247 248 249 EMERREL(DFN) 250 251 EMERADD1(DFN) 252 253 EMERADD2(DFN) 254 255 256 257 258 EMERCITY(DFN) 259 260 EMERSTAT(DFN) 261 262 EMERZIP(DFN) 263 264 EMERHTEL(DFN) 265 266 EMERWTEL(DFN) 267 268 EMERSAME(DFN) 269 1 C0CDPT ;WV/CCRCCD/SMH - Routines to Extract Patient Data for CCDCCR; 6/15/08 2 ;;1.2;C0C;;May 11, 2012;Build 46 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 FAMILY(DFN) ; Family Name 90 N NAME S NAME=$$GET1^DIQ(2,DFN,.01) 91 D NAMECOMP^XLFNAME(.NAME) 92 Q NAME("FAMILY") 93 GIVEN(DFN) ; Given Name 94 N NAME S NAME=$$GET1^DIQ(2,DFN,.01) 95 D NAMECOMP^XLFNAME(.NAME) 96 Q NAME("GIVEN") 97 MIDDLE(DFN) ; Middle Name 98 N NAME S NAME=$$GET1^DIQ(2,DFN,.01) 99 D NAMECOMP^XLFNAME(.NAME) 100 Q NAME("MIDDLE") 101 SUFFIX(DFN) ; Suffi Name 102 N NAME S NAME=$$GET1^DIQ(2,DFN,.01) 103 D NAMECOMP^XLFNAME(.NAME) 104 Q NAME("SUFFIX") 105 DISPNAME(DFN) ; Display Name 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 DOB(DFN) ; Date of Birth 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 GENDER(DFN) ; Gender/Sex 114 Q $$GET1^DIQ(2,DFN,.02,"I")_"^"_$$GET1^DIQ(2,DFN,.02,"E") ; 115 SSN(DFN) ; SSN 116 Q $$GET1^DIQ(2,DFN,.09) 117 ADDRTYPE(DFN) ; Address Type 118 ; Vista only stores a home address for the patient. 119 Q "Home" 120 ADDR1(DFN) ; Get Home Address line 1 121 Q $$GET1^DIQ(2,DFN,.111) 122 ADDR2(DFN) ; Get Home Address line 2 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 CITY(DFN) ; Get City for Home Address 129 Q $$GET1^DIQ(2,DFN,.114) 130 STATE(DFN) ; Get State for Home Address 131 Q $$GET1^DIQ(2,DFN,.115) 132 ZIP(DFN) ; Get Zip code for Home Address 133 Q $$GET1^DIQ(2,DFN,.116) 134 COUNTY(DFN) ; Get County for our Address 135 Q $$GET1^DIQ(2,DFN,.117) 136 COUNTRY(DFN) ; Get Country for our Address 137 ; Unfortunately, it's not stored anywhere in Vista, so the inevitable... 138 Q "USA" 139 RESTEL(DFN) ; Residential Telephone 140 Q $$GET1^DIQ(2,DFN,.131) 141 WORKTEL(DFN) ; Work Telephone 142 Q $$GET1^DIQ(2,DFN,.132) 143 EMAIL(DFN) ; Email Adddress 144 Q $$GET1^DIQ(2,DFN,.133) 145 CELLTEL(DFN) ; Cell Phone 146 Q $$GET1^DIQ(2,DFN,.134) 147 NOK1FAM(DFN) ; Next of Kin 1 (NOK1) Family Name 148 N NAME S NAME=$$GET1^DIQ(2,DFN,.211) 149 D NAMECOMP^XLFNAME(.NAME) 150 Q NAME("FAMILY") 151 NOK1GIV(DFN) ; NOK1 Given Name 152 N NAME S NAME=$$GET1^DIQ(2,DFN,.211) 153 D NAMECOMP^XLFNAME(.NAME) 154 Q NAME("GIVEN") 155 NOK1MID(DFN) ; NOK1 Middle Name 156 N NAME S NAME=$$GET1^DIQ(2,DFN,.211) 157 D NAMECOMP^XLFNAME(.NAME) 158 Q NAME("MIDDLE") 159 NOK1SUF(DFN) ; NOK1 Suffi Name 160 N NAME S NAME=$$GET1^DIQ(2,DFN,.211) 161 D NAMECOMP^XLFNAME(.NAME) 162 Q NAME("SUFFIX") 163 NOK1DISP(DFN) ; NOK1 Display Name 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 NOK1REL(DFN) ; NOK1 Relationship to the patient 168 Q $$GET1^DIQ(2,DFN,.212) 169 NOK1ADD1(DFN) ; NOK1 Address 1 170 Q $$GET1^DIQ(2,DFN,.213) 171 NOK1ADD2(DFN) ; NOK1 Address 2 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 NOK1CITY(DFN) ; NOK1 City 177 Q $$GET1^DIQ(2,DFN,.216) 178 NOK1STAT(DFN) ; NOK1 State 179 Q $$GET1^DIQ(2,DFN,.217) 180 NOK1ZIP(DFN) ; NOK1 Zip Code 181 Q $$GET1^DIQ(2,DFN,.218) 182 NOK1HTEL(DFN) ; NOK1 Home Telephone 183 Q $$GET1^DIQ(2,DFN,.219) 184 NOK1WTEL(DFN) ; NOK1 Work Telephone 185 Q $$GET1^DIQ(2,DFN,.21011) 186 NOK1SAME(DFN) ; Is NOK1's Address the same the patient? 187 Q $$GET1^DIQ(2,DFN,.2125) 188 NOK2FAM(DFN) ; NOK2 Family Name 189 N NAME S NAME=$$GET1^DIQ(2,DFN,.2191) 190 D NAMECOMP^XLFNAME(.NAME) 191 Q NAME("FAMILY") 192 NOK2GIV(DFN) ; NOK2 Given Name 193 N NAME S NAME=$$GET1^DIQ(2,DFN,.2191) 194 D NAMECOMP^XLFNAME(.NAME) 195 Q NAME("GIVEN") 196 NOK2MID(DFN) ; NOK2 Middle Name 197 N NAME S NAME=$$GET1^DIQ(2,DFN,.2191) 198 D NAMECOMP^XLFNAME(.NAME) 199 Q NAME("MIDDLE") 200 NOK2SUF(DFN) ; NOK2 Suffi Name 201 N NAME S NAME=$$GET1^DIQ(2,DFN,.2191) 202 D NAMECOMP^XLFNAME(.NAME) 203 Q NAME("SUFFIX") 204 NOK2DISP(DFN) ; NOK2 Display Name 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 NOK2REL(DFN) ; NOK2 Relationship to the patient 209 Q $$GET1^DIQ(2,DFN,.2192) 210 NOK2ADD1(DFN) ; NOK2 Address 1 211 Q $$GET1^DIQ(2,DFN,.2193) 212 NOK2ADD2(DFN) ; NOK2 Address 2 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 NOK2CITY(DFN) ; NOK2 City 218 Q $$GET1^DIQ(2,DFN,.2196) 219 NOK2STAT(DFN) ; NOK2 State 220 Q $$GET1^DIQ(2,DFN,.2197) 221 NOK2ZIP(DFN) ; NOK2 Zip Code 222 Q $$GET1^DIQ(2,DFN,.2198) 223 NOK2HTEL(DFN) ; NOK2 Home Telephone 224 Q $$GET1^DIQ(2,DFN,.2199) 225 NOK2WTEL(DFN) ; NOK2 Work Telephone 226 Q $$GET1^DIQ(2,DFN,.211011) 227 NOK2SAME(DFN) ; Is NOK2's Address the same the patient? 228 Q $$GET1^DIQ(2,DFN,.21925) 229 EMERFAM(DFN) ; Emergency Contact (EMER) Family Name 230 N NAME S NAME=$$GET1^DIQ(2,DFN,.331) 231 D NAMECOMP^XLFNAME(.NAME) 232 Q NAME("FAMILY") 233 EMERGIV(DFN) ; EMER Given Name 234 N NAME S NAME=$$GET1^DIQ(2,DFN,.331) 235 D NAMECOMP^XLFNAME(.NAME) 236 Q NAME("GIVEN") 237 EMERMID(DFN) ; EMER Middle Name 238 N NAME S NAME=$$GET1^DIQ(2,DFN,.331) 239 D NAMECOMP^XLFNAME(.NAME) 240 Q NAME("MIDDLE") 241 EMERSUF(DFN) ; EMER Suffi Name 242 N NAME S NAME=$$GET1^DIQ(2,DFN,.331) 243 D NAMECOMP^XLFNAME(.NAME) 244 Q NAME("SUFFIX") 245 EMERDISP(DFN) ; EMER Display Name 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 EMERREL(DFN) ; EMER Relationship to the patient 250 Q $$GET1^DIQ(2,DFN,.331) 251 EMERADD1(DFN) ; EMER Address 1 252 Q $$GET1^DIQ(2,DFN,.333) 253 EMERADD2(DFN) ; EMER Address 2 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 EMERCITY(DFN) ; EMER City 259 Q $$GET1^DIQ(2,DFN,.336) 260 EMERSTAT(DFN) ; EMER State 261 Q $$GET1^DIQ(2,DFN,.337) 262 EMERZIP(DFN) ; EMER Zip Code 263 Q $$GET1^DIQ(2,DFN,.338) 264 EMERHTEL(DFN) ; EMER Home Telephone 265 Q $$GET1^DIQ(2,DFN,.339) 266 EMERWTEL(DFN) ; EMER Work Telephone 267 Q $$GET1^DIQ(2,DFN,.33011) 268 EMERSAME(DFN) ; Is EMER's Address the same the NOK? 269 Q $$GET1^DIQ(2,DFN,.3305)
Note:
See TracChangeset
for help on using the changeset viewer.