Changeset 1335 for qrda/C0Q/trunk/p


Ignore:
Timestamp:
Jan 4, 2012, 4:37:42 PM (13 years ago)
Author:
George Lilly
Message:

latest C0Q changes with parameters

Location:
qrda/C0Q/trunk/p
Files:
4 added
11 edited

Legend:

Unmodified
Added
Removed
  • qrda/C0Q/trunk/p/C0QERTIM.m

    r1232 r1335  
    11C0QERTIM        ; Time from admission to leaving a hospital location ;
    2         ;;0.1;C0Q;;;Build 19
     2        ;;0.1;C0Q;;;Build 23
    33EN      ;Get Location
    44        S DIC=42,DIC(0)="AEMQ" D ^DIC I Y<1 G EXIT
  • qrda/C0Q/trunk/p/C0QGMRAD.m

    r1232 r1335  
    11C0QGMRAD        ;HIRMFO/RM,WAA-UTILITY TO GATHER PATIENT DATA ;1/15/98  13:47
    2         ;;4.0;Adverse Reaction Tracking;**2,10**;Mar 29, 1996;Build 19
     2        ;;4.0;Adverse Reaction Tracking;**2,10**;Mar 29, 1996;Build 23
    33EN1     ; ENTRY TO GATHER PATIENT A/AR DATA
    44        ;INPUT VARIABLES:
  • qrda/C0Q/trunk/p/C0QGMTSA.m

    r1232 r1335  
    11C0QGMTSA        ; SLC/DLT,KER - Brief Adverse Reaction/Allergy ; 02/27/2002
    2         ;;2.7;Health Summary;**28,49**;Oct 20, 1995;Build 19
     2        ;;2.7;Health Summary;**28,49**;Oct 20, 1995;Build 23
    33        ;                 
    44        ; External References
  • qrda/C0Q/trunk/p/C0QGMTSG.m

    r1232 r1335  
    11C0QGMTSG        ; SLC/DLT,KER - Allergies ; 01/06/2003
    2         ;;2.7;Health Summary;**9,28,49,58**;Oct 20, 1995;Build 19
     2        ;;2.7;Health Summary;**9,28,49,58**;Oct 20, 1995;Build 23
    33        ;                 
    44        ; External References
  • qrda/C0Q/trunk/p/C0QHF.m

    r1232 r1335  
    11C0QHF   ; GPL - Health Factor Utility Routines ;9/02/11  17:05
    2         ;;0.1;C0Q;nopatch;noreleasedate;Build 19
     2        ;;0.1;C0Q;nopatch;noreleasedate;Build 23
    33        ;Copyright 2011 George Lilly.  Licensed under the terms of the GNU
    44        ;General Public License See attached copy of the License.
     
    3737        N ZI,ZJ,ZR
    3838        S ZI=$O(^AUTTHF("B",C0QHF,"")) ; HEALTH FACTOR IEN
     39        I ZI="" D  Q 0 ;
     40        . W !,"BAD HEALTH FACTOR: ",C0QHF
    3941        I $D(^AUPNVHF("AA",DFN,ZI)) S ZR=1
    4042        E  S ZR=0
    4143        Q ZR
     44        ;
     45HFIEN(ZHF)      ; EXTRINSIC RETURNS THE IEN OF THE HEALTHFACTOR
     46        N ZI
     47        S ZI=$O(^AUTTHF("B",ZHF,"")) ; HEALTH FACTOR IEN
     48        Q ZI
     49        ;
     50VHFIEN(DFN,ZHF) ; EXTRINSIC RETURNS THE LAST IEN OF THIS HEALTH FACTOR
     51        ; FOR THE PATIENT
     52        N ZG,ZJ,ZK
     53        S ZG=$$HFIEN(ZHF)
     54        I ZG="" Q  ; OPPS HEALTH FACTOR NOT FOUND
     55        S ZJ=$O(^AUPNVHF("AA",DFN,ZG,""),-1) ;DATE
     56        S ZK=$O(^AUPNVHF("AA",DFN,ZG,ZJ,"")) ;IEN
     57        Q ZK
    4258        ;
    4359HFCAT(RTN,DFN,C0QHFCAT) ; C0QFHCAT IS A HEALTH FACTOR CATEGORY
     
    4763        N ZI
    4864        S ZI=$O(^AUTTHF("B",C0QHFCAT,"")) ; HEALTH FACTOR CATEGORY IEN
    49         N C0QN,C0QO
     65        N C0QN,C0QO,C0QR
    5066        S C0QO=$NA(^AUPNVHF("AA",DFN)) ; ALL THE PATIENT'S HEALTH FACTORS
    5167        S C0QN=$NA(^AUTTHF("AC",ZI)) ; ALL HEALTH FACTORS IN THIS CATEGORY
  • qrda/C0Q/trunk/p/C0QIMMUN.m

    r1232 r1335  
    11C0QIMMUN        ;Prep Immunization Order data for HL7 Message creation ;
    2         ;;0.1;C0Q;nopatch;noreleasedate;Build 19
     2        ;;0.1;C0Q;nopatch;noreleasedate;Build 23
    33        ;  ^XTMP("C0QIMMUN",0)=purge date^create date
    44        ;  ^XTMP("C0QIMMUN",order_date,order#,item_name)=item_value
  • qrda/C0Q/trunk/p/C0QMAIN.m

    r1232 r1335  
    11C0QMAIN ; GPL - Quality Reporting Main Processing ;10/13/10  17:05
    2         ;;0.1;C0Q;nopatch;noreleasedate;Build 19
     2        ;;0.1;C0Q;nopatch;noreleasedate;Build 23
    33        ;Copyright 2009 George Lilly.  Licensed under the terms of the GNU
    44        ;General Public License See attached copy of the License.
     
    2727RLSTFN()        Q 810.5 ; FN FOR REMINDER PATIENT LIST FILE
    2828RLSTPFN()       Q 810.53 ; FN FOR REMINDER PATIENT LIST PATIENT SUBFILE
    29 C0QALFN()       Q 1130580001.311 ; FILE NUMBER FOR C0Q PATIENT LIST PATIENT SUBFILE     ;
     29C0QALFN()       Q 1130580001.311 ; FILE NUMBER FOR C0Q PATIENT LIST PATIENT SUBFILE ;
    3030EXPORT    ; EXPORT ENTRY POINT FOR CCR
    3131        ; Select a patient.
     
    139139        N MSIEN S MSIEN=+Y
    140140        ;D C0QRPC(.G,MSIEN)
    141                D UPDATE^C0QUPDT(.G,MSIEN)
     141        D UPDATE^C0QUPDT(.G,MSIEN)
    142142        Q
    143143        ;
     
    147147        I Y<1 Q  ; EXIT
    148148        N MSIEN S MSIEN=+Y
     149        ; changed by gpl to call the new UPDATE^C0QUPDT routine instead
     150        D UPDATE^C0QUPDT(.G,MSIEN)
     151        Q
     152        ; end gpl change
    149153        S C0QSUM=1
    150154        D C0QRPC(.G,MSIEN)
  • qrda/C0Q/trunk/p/C0QPQRI.m

    r1232 r1335  
    11C0QPQRI   ; GPL - GENERATES A PQRI XML FILE ;6/14/11  17:05
    2         ;;0.1;C0C;nopatch;noreleasedate;Build 19
     2        ;;0.1;C0C;nopatch;noreleasedate;Build 23
    33        ;Copyright 2011 George Lilly.  Licensed under the terms of the GNU
    44        ;General Public License See attached copy of the License.
  • qrda/C0Q/trunk/p/C0QPRML.m

    r1232 r1335  
    11C0QPRML ;JJOH/ZAG/GPL - Patient Reminder List ;7/5/11 8:50pm
    2         ;;1.0;MU PACKAGE;;;Build 19
     2        ;;1.0;MU PACKAGE;;;Build 23
    33        ;
    44        ;2011 Zach Gonzales<zach@linux.com> - Licensed under the terms of the GNU
     
    4343        . D FILE ; FILE THE PATIENT LISTS
    4444        . D UPDATE^C0QUPDT(.G,8) ; UPDATE THE MU MEASUREMENT SET
     45        . D UPDATE^C0QUPDT(.G,9) ; UPDATE THE MU MEASUREMENT SET
    4546        Q
    4647        ;
     
    5859        . . . D PROBLEM
    5960        . . . D ALLERGY
    60         . . . D MEDS
     61        . . . D MEDS4
     62               . . . D RECON2
     63               . . . D ADVDIR
    6164        . . . D SMOKING
    6265        . . . D VITALS
     66               . . . D VTE1
     67               . . . D EDTIME
    6368        . . . I C0QPR D PRINT
    6469        . . . I C0QSS D SS
     
    6772        ;
    6873DEMO    ; patient demographics
     74        K PTDOB
     75        N PTNAME,PTSEX,PTHRN,PTRLANG,PTLANG,RACE,RACEDSC,ETHN,ETHNDSC,RB
    6976        S PTNAME=$P(^DPT(DFN,0),U) ;patient name
    7077        S PTDOB=$$FMTE^XLFDT($P($G(^DPT(DFN,0)),U,3)) ;date of birth
     
    8592        . S ETHNDSC=$P($G(^DIC(10.2,ETHN,0)),U) ;ethnincity description
    8693        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)=""
    87103        Q
    88104        ;
     
    128144        Q
    129145        ;
    130 SMOKING ;
    131         N C0QSMOKE
     146MEDS2   ; 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        ;
     169MEDS3   ; 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        ;
     180MEDS4   ; 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        ;
     203RECON   ; 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        ;
     227RECON2  ; 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        ;
     235ADVDIR  ; 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        ;
     245SMOKING ;
     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
    132255        D HFCAT^C0QHF(.C0QSMOKE,DFN,"TOBACCO") ; GET ALL HEALTH FACTORS FOR THE
    133256        ; 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)=""
    135401        E  S C0QLIST("NoSmokingStatus",DFN)=""
    136402        Q
     
    146412        . E  S C0QLIST("HasVitalSigns",DFN)=""
    147413        Q
     414        ;
     415VTE1    ; 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        ;
     422EDTIME  ; 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        ;
     433INLIST(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
    148440        ;
    149441PRINT   ; PRINT TO SCREEN
     
    203495        I $G(RACEDSC)="" S DEMOYN=0
    204496        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)=""
    207499        ;S G1("Gender")=PTSEX
    208500        ;S G1("DateOfBirth")=PTDOB
     
    217509        I ALDESC["No Allergy" S C0QLIST("NoAllergy",DFN)=""
    218510        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)=""
    222514        ;S G1("MedDescription")=$G(MDDESC)
    223515        Q
     
    237529        . S DTE=$O(^DGPM("B",DTE))
    238530        . Q:'DTE
    239         . Q:DTE<3110703
     531        . Q:$P(DTE,".")<3110703
    240532        . S EXDTE=$$FMTE^XLFDT(DTE)
    241533        . N PTFM S PTFM=""
     
    244536        . . Q:'PTFM
    245537        . . S DFN=$P(^DGPM(PTFM,0),U,3)
     538               . . S C0QLIST("Patient",DFN)=""
    246539        . . D DEMO
    247540        . . D PROBLEM
    248541        . . D ALLERGY
    249         . . D MEDS
     542        . . D MEDS4
     543               . . D RECON2
     544               . . D ADVDIR
    250545        . . D SMOKING
    251546        . . D VITALS
     547               . . D VTE1
     548               . . D EDTIME
    252549        . . I C0QPR D PRINT
    253550        . . I C0QSS D SS
  • qrda/C0Q/trunk/p/C0QSET.m

    r1232 r1335  
    11C0QSET  ;GPL - SET OPERATIONS ON LISTS ;818/11 8:50pm
    2         ;;1.0;MU PACKAGE;;;Build 19
     2        ;;1.0;MU PACKAGE;;;Build 23
    33        ;
    44        ;2011 George Lilly glilly@glilly.net - Licensed under the terms of the GNU
  • qrda/C0Q/trunk/p/C0QUPDT.m

    r1232 r1335  
    11C0QUPDT ; GPL - Quality Reporting List Update Routines ;8/29/11  17:05
    2         ;;0.1;C0Q;nopatch;noreleasedate;Build 19
     2        ;;0.1;C0Q;nopatch;noreleasedate;Build 23
    33        ;Copyright 2009 George Lilly.  Licensed under the terms of the GNU
    44        ;General Public License See attached copy of the License.
     
    2727RLSTFN()        Q 810.5 ; FN FOR REMINDER PATIENT LIST FILE
    2828RLSTPFN()       Q 810.53 ; FN FOR REMINDER PATIENT LIST PATIENT SUBFILE
     29C0QPLF()        Q 1130580001.301 ; C0Q PATIENT LIST FILE
    2930C0QALFN()       Q 1130580001.311 ; FILE NUMBER FOR C0Q PATIENT LIST PATIENT SUBFILE ;
    3031        ;
     
    3940        N ZI S ZI=""
    4041        N C0QM ; FOR HOLDING THE MEASURES IN THE SET
    41         D LIST^DIC($$C0QMMFN,","_MSET_",",".01I") ; GET ALL THE MEASURES
     42        I $$GET1^DIQ($$C0QMFN,MSET_",",.05,"I")="Y" D  Q  ; IS IT LOCKED?
     43        . W !,"ERROR MEASURE SET IS LOCKED, EXITING"
     44        D LIST^DIC($$C0QMMFN,","_MSET_",",".01I;1.2I;2.2I") ; GET ALL THE MEASURES
    4245        D DELIST("C0QM")
    4346        N ZII S ZII=""
    4447        F  S ZII=$O(C0QM(ZII)) Q:ZII=""  D  ; FOR EACH MEASURE
     48        . N C0QNL,C0QDL,C0QFLTN,C0QFLTD
     49        . S C0QFLTN=$P(C0QM(ZII),U,3) ;IEN OF NUMERATOR FILTER LIST
     50        . S C0QFLTD=$P(C0QM(ZII),U,4) ; IEN OF DENOMINATOR FILTER LIST
    4551        . S ZI=$P(C0QM(ZII),U,1) ; IEN OF THE MEASURE IN THE C0Q QUALITY MEAS FILE
    4652        . S C0QNL=$$GET1^DIQ($$C0QQFN,ZI_",",1,"I") ; NUMERATOR POINTER
     
    6066        . E  D  ; USE THE REMINDER PACKAGE PATIENT LISTS
    6167        . . S C0QNEW=$NA(^PXRMXP(810.5,C0QNL,30,"B")) ; REMINDER LIST PATIENTS
     68        . I C0QFLTN'="" D  ; USE A NUMERATOR FILTER LIST
     69        . . N ZNEW
     70        . . S ZNEW=$NA(^C0Q(301,C0QFLTN,1,"B")) ; B INDEX OF FILTER LIST
     71        . . K C0QFLTRD
     72        . . D AND^C0QSET("C0QFLTRD",ZNEW,C0QNEW)
     73        . . S C0QNEW="C0QFLTRD"
    6274        . N C0QOLD ; REFERENCE FOR OLD PATIENT LIST
    6375        . S C0QOLD=$NA(^C0Q(201,MSET,5,ZII,1,"B")) ; NUMERATOR LIST IN MEASURE SET
     
    105117        . E  D  ; USE THE REMINDER PACKAGE PATIENT LISTS
    106118        . . S C0QNEW=$NA(^PXRMXP(810.5,C0QDL,30,"B")) ; REMINDER LIST PATIENTS
     119        . I C0QFLTD'="" D  ; USE A DENOMINATOR FILTER LIST
     120        . . N ZNEW
     121        . . S ZNEW=$NA(^C0Q(301,C0QFLTD,1,"B")) ; B INDEX OF FILTER LIST
     122        . . K C0QFLTRD
     123        . . D AND^C0QSET("C0QFLTRD",ZNEW,C0QNEW)
     124        . . S C0QNEW="C0QFLTRD"
    107125        . N C0QOLD ; REFERENCE FOR OLD PATIENT LIST
    108126        . S C0QOLD=$NA(^C0Q(201,MSET,5,ZII,3,"B")) ; DENOMINATOR LIST IN MEASURE SET
     
    144162        . I $D(C0QFDA) D UPDIE ; PROCESS
    145163        . N C0QPCT ; PERCENT
    146         . I C0QDCNT>0 D  ;
    147         . . S C0QPCT=$J(100*C0QNCNT/C0QDCNT,0,0)
     164        . D  ;
     165               . . I C0QDCNT>0 D  ;
     166        . . . S C0QPCT=$J(100*C0QNCNT/C0QDCNT,0,0)
     167               . . E  S C0QPCT=0
    148168        . . K C0QFDA
    149169        . . S C0QFDA($$C0QMMFN(),ZII_","_MSET_",",3)=C0QPCT ; PERCENT
     
    154174        ; @RTN@(IEN)=INTERNAL VALUE^EXTERNAL VALUE
    155175        ; ADDED A B INDEX @RTN@("B",INTERNAL VALUE,IEN)=EXTERNAL VALUE
    156         N ZI,IV,EV,ZDI,ZIEN
     176        N ZI,IV,EV,ZDI,ZIEN,FLTN,FLTD
    157177        S ZI=""
    158178        S ZDI=$NA(^TMP("DILIST",$J))
     
    161181        . S EV=@ZDI@(1,ZI) ;EXTERNAL VALUE
    162182        . S IV=$G(@ZDI@("ID",ZI,.01)) ; INTERNAL VALUE
     183        . S FLTN=$G(@ZDI@("ID",ZI,1.2)) ; NUMERATOR FILTER LIST
     184        . S FLTD=$G(@ZDI@("ID",ZI,2.2)) ; DENOMINATOR FILTER LIST
    163185        . S ZIEN=@ZDI@(2,ZI) ; IEN
    164         . S @RTN@(ZIEN)=IV_"^"_EV
     186        . S @RTN@(ZIEN)=IV_"^"_EV_"^"_FLTN_"^"_FLTD
    165187        . ;S @RTN@("B",IV,ZIEN)=EV
    166188        Q
Note: See TracChangeset for help on using the changeset viewer.