Changeset 1335 for qrda/C0Q/trunk/p/C0QPRML.m
- Timestamp:
- Jan 4, 2012, 4:37:42 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
qrda/C0Q/trunk/p/C0QPRML.m
r1232 r1335 1 1 C0QPRML ;JJOH/ZAG/GPL - Patient Reminder List ;7/5/11 8:50pm 2 ;;1.0;MU PACKAGE;;;Build 192 ;;1.0;MU PACKAGE;;;Build 23 3 3 ; 4 4 ;2011 Zach Gonzales<zach@linux.com> - Licensed under the terms of the GNU … … 43 43 . D FILE ; FILE THE PATIENT LISTS 44 44 . D UPDATE^C0QUPDT(.G,8) ; UPDATE THE MU MEASUREMENT SET 45 . D UPDATE^C0QUPDT(.G,9) ; UPDATE THE MU MEASUREMENT SET 45 46 Q 46 47 ; … … 58 59 . . . D PROBLEM 59 60 . . . D ALLERGY 60 . . . D MEDS 61 . . . D MEDS4 62 . . . D RECON2 63 . . . D ADVDIR 61 64 . . . D SMOKING 62 65 . . . D VITALS 66 . . . D VTE1 67 . . . D EDTIME 63 68 . . . I C0QPR D PRINT 64 69 . . . I C0QSS D SS … … 67 72 ; 68 73 DEMO ; patient demographics 74 K PTDOB 75 N PTNAME,PTSEX,PTHRN,PTRLANG,PTLANG,RACE,RACEDSC,ETHN,ETHNDSC,RB 69 76 S PTNAME=$P(^DPT(DFN,0),U) ;patient name 70 77 S PTDOB=$$FMTE^XLFDT($P($G(^DPT(DFN,0)),U,3)) ;date of birth … … 85 92 . S ETHNDSC=$P($G(^DIC(10.2,ETHN,0)),U) ;ethnincity description 86 93 S RB=$P($G(^DPT(DFN,.101)),U) ;room and bed 94 N DEMOYN S DEMOYN=1 95 I $G(PTSEX)="" S DEMOYN=0 96 I $G(PTDOB)="" S DEMOYN=0 97 I $G(PTHRN)="" S DEMOYN=0 98 I $G(PTLANG)="" S DEMOYN=0 99 I $G(RACEDSC)="" S DEMOYN=0 100 I $G(ETHNDSC)="" S DEMOYN=0 101 I DEMOYN S C0QLIST("HasDemographics",DFN)="" 102 E S C0QLIST("FailedDemographics",DFN)="" 87 103 Q 88 104 ; … … 128 144 Q 129 145 ; 130 SMOKING ; 131 N C0QSMOKE 146 MEDS2 ; MEDICATIONS 147 ; 148 K MEDSL,MDDESC,MDITEM 149 D COVER^ORWPS(.MEDSL,DFN) ; CPRS MED LIST 150 I '$D(MEDSL) D ; 151 . S C0QLIST("NoMedOrders",DFN)="" 152 . I $$HFYN^C0QHF(DFN,"MEDS HAVE BEEN REVIEWED") D ; 153 . . S C0QLIST("HasMed",DFN)="" 154 . E S C0QLIST("NoMed",DFN)="" 155 S MDCNT="" S HASINP=0 156 F S MDCNT=$O(MEDSL(MDCNT)) Q:MDCNT="" D ; 157 . ;Q:$P(MEDSL(MDCNT),U,4)'="ACTIVE" ;active medications only 158 . ;S C0QLIST("HasMedOrders",DFN)="" 159 . S C0QLIST("HasMed",DFN)="" 160 . S MDDESC=$P(MEDSL(MDCNT),U,2) ;medication description 161 . S MDITEM=$P($G(MEDSL(MDCNT)),U,3) 162 . I $P($P(MEDSL(MDCNT),"^",1),";",2)="I" S HASINP=1 163 I HASINP D ; THE PATIENT HAS AN INPATIENT MED 164 . S C0QLIST("HasMedOrders",DFN)="" ; an inpatient drug indicates CPOE 165 E S C0QLIST("NoMedOrders",DFN)="" ; this will be different for outpatient 166 K MEDSL 167 Q 168 ; 169 MEDS3 ; USE THE REMINDER INDEX ^PXRMINDX TO CHECK FOR MEDS 170 ; 171 S C0QPXRM=$NA(^PXRMINDX(55,"PI")) ; REMINDER INDEX FOR DRUGS 172 I $D(@C0QPXRM@(DFN)) D ; HAS MEDS 173 . S C0QLIST("HasMed",DFN)="" 174 . S C0QLIST("HasMedOrders",DFN)="" 175 E D ; NO MEDS 176 . S C0QLIST("NoMed",DFN)="" 177 . S C0QLIST("NoMedOrders",DFN)="" 178 Q 179 ; 180 MEDS4 ; USE OCL^PSOORRL TO GET ALL MEDS 181 N BEG,END 182 S BEG=$$DT^C0PCUR("JULY 3,2011") 183 S END=$$DT^C0PCUR("NOW") 184 D OCL^PSOORRL(DFN,BEG,END) ;DBIA #2400 185 N C0QMEDS 186 M C0QMEDS=^TMP("PS",$J) ; MEDS RETURNED FROM CALL 187 N FOUND 188 N ZI 189 I '$D(C0QMEDS(1)) D Q ; QUIT IF NO MEDS 190 . S C0QLIST("NoMed",DFN)="" 191 E D ; HAS MEDS 192 . S C0QLIST("HasMed",DFN)="" 193 S ZI="" S FOUND=0 194 F S ZI=$O(C0QMEDS(ZI)) Q:ZI="" D ; FOR EACH MED 195 . N ZM 196 . S ZM=$G(C0QMEDS(ZI,0)) ;THE MEDICATION 197 . I $P($P(ZM,"^",1),";",2)="I" D ; IE 1U;I FOR AN INPATIENT UNIT DOSE 198 . . S FOUND=1 199 I FOUND S C0QLIST("HasMedOrders",DFN)="" ; MET CPOE MEASURE 200 E S C0QLIST("NoMedOrders",DFN)="" 201 Q 202 ; 203 RECON ; MEDICATIONS RECONCILIATION 204 ; 205 I $$HASNTYN^C0QNOTES("MED/SURG NURSING ADMISSION ASSESSMENT",DFN) D ; 206 . S C0QLIST("XferOfCare",DFN)="" ; transfer of care patient 207 N HASRECON S HASRECON=0 208 N GT,G 209 S GT(4,"HasMedRecon","MEDICATION RECONCILIATION COMPLET")="" 210 S GT(5,"HasMedRecon","Medication Reconcilation Complete")="" 211 I $$TXTALL^C0QNOTES(.G,.GT,DFN) D ; SEARCH ALL NOTES FOR MED RECON 212 . S HASRECON=1 213 ;N ZT 214 ;S ZT="MEDICATION RECONCILIATION COMPLET" 215 ;I $$NTTXT^C0QNOTES("ER NURSE NOTE",ZT,DFN) D ; 216 ;. S HASRECON=1 217 ;E D ; 218 ;. S ZT="Medication Reconcilation Complete" 219 ;. I $$NTTXT^C0QNOTES("MED/SURG NURSING ADMISSION ASSESSMENT",ZT,DFN) D ; 220 ;. . S HASRECON=1 221 ;I $$HFYN^C0QHF("MEDS HAVE BEEN REVIEWED",DFN) S HASRECON=1 222 I HASRECON D ; 223 . S C0QLIST("HasMedRecon",DFN)="" 224 E S C0QLIST("NoMedRecon",DFN)="" 225 Q 226 ; 227 RECON2 ; USE HEALTH FACTORS FOR MEDICATION RECONCILIATION 228 I $$HASNTYN^C0QNOTES("MED/SURG NURSING ADMISSION ASSESSMENT",DFN) D ; 229 . S C0QLIST("XferOfCare",DFN)="" ; transfer of care patient 230 I $$HFYN^C0QHF(DFN,"Medication Reconciliation Completed: Yes") D ; 231 . S C0QLIST("HasMedRecon",DFN)="" 232 E S C0QLIST("NoMedRecon",DFN)="" 233 Q 234 ; 235 ADVDIR ; ADVANCE DIRECTIVE 236 ; 237 I $$AGE^C0QUTIL(DFN)>64 D ; ONLY FOR PATIENTS 65 AND OLDER 238 . S C0QLIST("Over65",DFN)="" 239 . I $$HASNTYN^C0QNOTES("ADVANCE DIRECTIVE",DFN) D ; 240 . . S C0QLIST("HasAdvanceDirective",DFN)="" 241 . E D ; 242 . . S C0QLIST("NoAdvanceDirective",DFN)="" 243 Q 244 ; 245 SMOKING ; 246 I $$INLIST("HasSmokingStatus",DFN) D Q ; ALREADY HAS SMOKING STATUS CHECK 247 . S C0QLIST("HasSmokingStatus",DFN)="" 248 . S C0QLIST("Over12",DFN)="" 249 I $$INLIST("NoSmokingStatus",DFN) D Q ; ALREADY HAS SMOKING STATUS CHECK 250 . S C0QLIST("NoSmokingStatus",DFN)="" 251 . S C0QLIST("Over12",DFN)="" 252 N C0QSMOKE,C0QSYN 253 S C0QSYN=0 254 I $$AGE^C0QUTIL(DFN)<13 Q ; DON'T CHECK UNDER AGE 13 132 255 D HFCAT^C0QHF(.C0QSMOKE,DFN,"TOBACCO") ; GET ALL HEALTH FACTORS FOR THE 133 256 ; PATIENT IN THE CATEGORY OF TOBACCO 134 I $D(C0QSMOKE) S C0QLIST("HasSmokingStatus",DFN)="" 257 I $D(C0QSMOKE) S C0QSYN=1 258 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Quit Smokeless Tobacco <1 Yr Ago") 259 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Quit Smokeless Tobacco > 20 Yrs Ago") 260 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Quit Smokeless Tobacco: 1-5 Yrs Ago") 261 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Quit Smokeless Tobacco: 10-20 Yrs Ago") 262 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Quit Smokeless Tobacco: 5-10 Yrs Ago") 263 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Quit Smoking") 264 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Quit Smoking < 1 Yr Ago") 265 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Quit Smoking > 20 Yrs Ago") 266 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Quit Smoking: 1-5 Yrs Ago") 267 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Quit Smoking: 10-20 Yrs Ago") 268 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Quit Smoking: 5-10 Yrs Ago") 269 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKELESS TOBACCO USER") 270 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKELESS: 1-5 YRS AGO") 271 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKELESS: 10-20 YRS AGO") 272 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKELESS: 5-10 YRS AGO") 273 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKELESS: < 1 YR AGO") 274 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKELESS: > 20 YRS AGO") 275 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKER") 276 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKER 10-20 YRS") 277 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKER 20+ YRS") 278 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKER < 1 YR") 279 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKER < 1 YR AGO") 280 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKER > 20 YRS AGO") 281 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKER: 1-5 YRS") 282 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKER: 1-5 YRS AGO") 283 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKER: 10-20 YRS AGO") 284 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKER: 5-10 YRS") 285 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKER: 5-10 YRS AGO") 286 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"PREVIOUS SMOKELESS TOBACCO USER") 287 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"LIFETIME NON-SMOKER") 288 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Former Smokeless Tobacco User") 289 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Former Smoker") 290 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Former Smoker (PMH)") 291 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoke Exposure/2nd Hand Exposure") 292 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For 1-5 Yrs") 293 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For 10-20 Yrs") 294 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For 5-10 Yrs") 295 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For < 1 Yr") 296 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For > 20 Yrs") 297 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Tobacco User") 298 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for 1-5 Yrs") 299 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for 10-20 Yrs") 300 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for 5-10 Yrs") 301 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for < 1 Yr") 302 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for > 20 Yrs") 303 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoker (HPI)") 304 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoking (FMH)") 305 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoking (PMH)") 306 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoking Cessation (OPH)") 307 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"LIFETIME NON-SMOKER") 308 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Former Smokeless Tobacco User") 309 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Former Smoker") 310 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Former Smoker (PMH)") 311 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoke Exposure/2nd Hand Exposure") 312 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For 1-5 Yrs") 313 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For 10-20 Yrs") 314 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For 5-10 Yrs") 315 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For < 1 Yr") 316 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For > 20 Yrs") 317 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Tobacco User") 318 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for 1-5 Yrs") 319 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for 10-20 Yrs") 320 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for 5-10 Yrs") 321 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for < 1 Yr") 322 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for > 20 Yrs") 323 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoker (HPI)") 324 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoking (FMH)") 325 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoking (PMH)") 326 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Non-Smoker") 327 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"LIFETIME NON-SMOKER") 328 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Former Smokeless Tobacco User") 329 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Former Smoker") 330 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Former Smoker (PMH)") 331 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoke Exposure/2nd Hand Exposure") 332 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For 1-5 Yrs") 333 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For 10-20 Yrs") 334 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For 5-10 Yrs") 335 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For < 1 Yr") 336 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For > 20 Yrs") 337 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Tobacco User") 338 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for 1-5 Yrs") 339 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for 10-20 Yrs") 340 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for 5-10 Yrs") 341 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for < 1 Yr") 342 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for > 20 Yrs") 343 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoker (HPI)") 344 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoking (FMH)") 345 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoking (PMH)") 346 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"LIFETIME NON-SMOKER") 347 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Former Smokeless Tobacco User") 348 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Former Smoker") 349 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Former Smoker (PMH)") 350 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoke Exposure/2nd Hand Exposure") 351 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For 1-5 Yrs") 352 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For 10-20 Yrs") 353 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For 5-10 Yrs") 354 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For < 1 Yr") 355 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For > 20 Yrs") 356 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Tobacco User") 357 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for 1-5 Yrs") 358 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for 10-20 Yrs") 359 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for 5-10 Yrs") 360 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for < 1 Yr") 361 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for > 20 Yrs") 362 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoker (HPI)") 363 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoking (FMH)") 364 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoking (PMH)") 365 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Non-Smoker") 366 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"LIFETIME NON-SMOKER") 367 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Former Smokeless Tobacco User") 368 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Former Smoker") 369 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Former Smoker (PMH)") 370 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoke Exposure/2nd Hand Exposure") 371 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For 1-5 Yrs") 372 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For 10-20 Yrs") 373 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For 5-10 Yrs") 374 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For < 1 Yr") 375 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoked For > 20 Yrs") 376 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Tobacco User") 377 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for 1-5 Yrs") 378 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for 10-20 Yrs") 379 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for 5-10 Yrs") 380 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for < 1 Yr") 381 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smokeless Used for > 20 Yrs") 382 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoker (HPI)") 383 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoking (FMH)") 384 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Smoking (PMH)") 385 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Non-Smoker") 386 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Non-Smoker (PMH)") 387 S:'C0QSYN C0QSYN=$$HFYN^C0QHF(DFN,"Non-Tobacco User") 388 S C0QLIST("Over12",DFN)="" 389 N GT 390 S GT(1,"HasSmokingStatus","SMOK")="" 391 S GT(2,"HasSmokingStatus","Smok")="" 392 S GT(3,"HasSmokingStatus","smok")="" 393 ;N ZT 394 ;S ZT="Smok" 395 ;S:'C0QSYN C0QSYN=$$NTTXT^C0QNOTES("ER NURSE NOTE",ZT,DFN) ; 396 I 'C0QSYN D ; 397 . N G 398 . S OK=$$TXTALL^C0QNOTES(.G,.GT,DFN) 399 . I $D(G) S C0QSYN=1 400 I C0QSYN S C0QLIST("HasSmokingStatus",DFN)="" 135 401 E S C0QLIST("NoSmokingStatus",DFN)="" 136 402 Q … … 146 412 . E S C0QLIST("HasVitalSigns",DFN)="" 147 413 Q 414 ; 415 VTE1 ; VTE PROPHYLAXIS WITHIN 24HRS OF ARRIVAL 416 ; 417 I $$HFYN^C0QHF(DFN,"VTE PROPHYLAXIS WITHIN 24HRS OF ARRIVAL") D ; 418 . S C0QLIST("HasVTE24",DFN)="" 419 E S C0QLIST("NoVTE24",DFN)="" 420 Q 421 ; 422 EDTIME ; CHECK FOR EMERGENCY DEPT TIME FACTORS 423 N FOUND 424 S FOUND=0 425 I $$HFYN^C0QHF(DFN,"ED ARRIVAL TIME") S FOUND=1 426 I '$$HFYN^C0QHF(DFN,"ED DEPARTURE TIME") S FOUND=0 427 I '$$HFYN^C0QHF(DFN,"TIME DECISION TO ADMIT MADE") S FOUND=0 428 I FOUND D ; 429 . S C0QLIST("HasEDtime",DFN)="" 430 E S C0QLIST("NoEDtime",DFN)="" 431 Q 432 ; 433 INLIST(ZLIST,DFN) ; EXTRINSIC FOR IS PATIENT ALREADY IN LIST ZLIST 434 N ZL,ZR 435 S ZL=$O(^C0Q(301,"CATTR",ZLIST,"")) ; IEN OF LIST IN C0Q PATIENT LIST FILE 436 I ZL="" Q 0 ; LIST DOES NOT EXIST 437 S ZR=0 ; ASSUME NOT IN LIST 438 I $D(^C0Q(301,ZL,1,"B",DFN)) S ZR=1 ; PATIENT IS IN LIST 439 Q ZR 148 440 ; 149 441 PRINT ; PRINT TO SCREEN … … 203 495 I $G(RACEDSC)="" S DEMOYN=0 204 496 I $G(ETHNDSC)="" S DEMOYN=0 205 I DEMOYN S C0QLIST("HasDemographics",DFN)=""206 E S C0QLIST("FailedDemographics",DFN)=""497 ;I DEMOYN S C0QLIST("HasDemographics",DFN)="" 498 ;E S C0QLIST("FailedDemographics",DFN)="" 207 499 ;S G1("Gender")=PTSEX 208 500 ;S G1("DateOfBirth")=PTDOB … … 217 509 I ALDESC["No Allergy" S C0QLIST("NoAllergy",DFN)="" 218 510 E S C0QLIST("HasAllergy",DFN)="" 219 I $D(MDITEM) D ;220 . S C0QLIST("HasMed",DFN)=""221 E S G1("NoMed",DFN)=""511 ;I $D(MDITEM) D ; 512 ;. S C0QLIST("HasMed",DFN)="" 513 ;E S G1("NoMed",DFN)="" 222 514 ;S G1("MedDescription")=$G(MDDESC) 223 515 Q … … 237 529 . S DTE=$O(^DGPM("B",DTE)) 238 530 . Q:'DTE 239 . Q: DTE<3110703531 . Q:$P(DTE,".")<3110703 240 532 . S EXDTE=$$FMTE^XLFDT(DTE) 241 533 . N PTFM S PTFM="" … … 244 536 . . Q:'PTFM 245 537 . . S DFN=$P(^DGPM(PTFM,0),U,3) 538 . . S C0QLIST("Patient",DFN)="" 246 539 . . D DEMO 247 540 . . D PROBLEM 248 541 . . D ALLERGY 249 . . D MEDS 542 . . D MEDS4 543 . . D RECON2 544 . . D ADVDIR 250 545 . . D SMOKING 251 546 . . D VITALS 547 . . D VTE1 548 . . D EDTIME 252 549 . . I C0QPR D PRINT 253 550 . . I C0QSS D SS
Note:
See TracChangeset
for help on using the changeset viewer.