Changeset 1232 for qrda/C0Q/trunk/p/C0QPRML.m
- Timestamp:
- Sep 2, 2011, 5:18:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
qrda/C0Q/trunk/p/C0QPRML.m
r1230 r1232 1 1 C0QPRML ;JJOH/ZAG/GPL - Patient Reminder List ;7/5/11 8:50pm 2 ;;1.0;MU PACKAGE;;;Build 1 42 ;;1.0;MU PACKAGE;;;Build 19 3 3 ; 4 4 ;2011 Zach Gonzales<zach@linux.com> - Licensed under the terms of the GNU … … 27 27 N G1 ; ONE SET OF VALUES - RNF1 FORMAT 28 28 ; INITIALIZE LISTS 29 ; this is done so that if there are no matching patients, the patient list 30 ; will be zeroed out 29 31 S C0QLIST("HasDemographics")="" 30 32 S C0QLIST("Patient")="" … … 32 34 S C0QLIST("HasAllergy")="" 33 35 S C0QLIST("HasMed")="" 36 S C0QLIST("HasVitalSigns")="" 37 S C0QLIST("HasMedOrders")="" 38 S C0QLIST("HasSmokingStatus")="" 34 39 D ALL ; all currently admitted patients in the hospital 35 40 D DIS ; all patients discharged since the reporting period began … … 54 59 . . . D ALLERGY 55 60 . . . D MEDS 61 . . . D SMOKING 62 . . . D VITALS 56 63 . . . I C0QPR D PRINT 57 64 . . . I C0QSS D SS … … 77 84 . Q:'ETHN 78 85 . S ETHNDSC=$P($G(^DIC(10.2,ETHN,0)),U) ;ethnincity description 79 S RB=$P( ^DPT(DFN,.101),U) ;room and bed86 S RB=$P($G(^DPT(DFN,.101)),U) ;room and bed 80 87 Q 81 88 ; … … 97 104 ; 98 105 MEDS ; MEDICATIONS 99 D COVER^ORWPS(.MEDSL,DFN) 100 S MDCNT="" 101 F S MDCNT=$O(MEDSL(MDCNT)) Q:MDCNT="" D 102 . Q:$P(MEDSL(MDCNT),U,4)'="ACTIVE" ;active medications only 103 . S MDDESC=$P(MEDSL(MDCNT),U,2) ;medication description 104 . S MDITEM=$P($G(MEDSL(MDCNT)),U,3) 106 ; 107 I DFN=97 D Q ; 108 . S MDCNT=271 105 109 K MEDSL 110 D EN^C0CNHIN(.MEDSL,DFN,"MED;") ; GET THE MEDS FROM THE NHIN API 111 ; can't use COVER^ORWPS even though it's fast.. we need to detect 112 ; if the medications are Inpatient to compute the CPOE measure 113 ; we will use the NHINV routines for this purpose 114 ;D COVER^ORWPS(.MEDSL,DFN) 115 S MDCNT="" S HASINP=0 116 F S MDCNT=$O(MEDSL("med",MDCNT)) Q:MDCNT="" D 117 . ;Q:$P(MEDSL(MDCNT),U,4)'="ACTIVE" ;active medications only 118 . Q:MEDSL("med",MDCNT,"status@value")'="active" 119 . ;S MDDESC=$P(MEDSL(MDCNT),U,2) ;medication description 120 . S MDDESC=$G(MEDSL("med",MDCNT,"products.product@name")) 121 . ;S MDITEM=$P($G(MEDSL(MDCNT)),U,3) 122 . S MDITEM=$G(MEDSL("med",MDCNT,"sig")) ; i think this is what meditem is 123 . I MEDSL("med",MDCNT,"vaType@value")="I" S HASINP=1 124 I HASINP D ; THE PATIENT HAS AN INPATIENT MED 125 . S C0QLIST("HasMedOrders",DFN)="" ; an inpatient drug indicates CPOE 126 E S C0QLIST("NoMedOrders",DFN)="" ; this will be different for outpatient 127 K MEDSL 128 Q 129 ; 130 SMOKING ; 131 N C0QSMOKE 132 D HFCAT^C0QHF(.C0QSMOKE,DFN,"TOBACCO") ; GET ALL HEALTH FACTORS FOR THE 133 ; PATIENT IN THE CATEGORY OF TOBACCO 134 I $D(C0QSMOKE) S C0QLIST("HasSmokingStatus",DFN)="" 135 E S C0QLIST("NoSmokingStatus",DFN)="" 136 Q 137 ; 138 VITALS ; 139 ; 140 N C0QSDT,C0QEDT 141 D DT^DILF(,"JULY 3,2011",.C0QSDT) ; START DATE 142 D DT^DILF(,"T",.C0QEDT) ; END DATE TODAY 143 D VITALS^ORQQVI(.VITRSLT,DFN,C0QSDT,C0QEDT) ; CALL FAST VITALS 144 I $D(VITRSLT) D ;ZWR VITRSLT B ; 145 . I VITRSLT(1)["No vitals found." S C0QLIST("NoVitalSigns",DFN)="" 146 . E S C0QLIST("HasVitalSigns",DFN)="" 106 147 Q 107 148 ; … … 207 248 . . D ALLERGY 208 249 . . D MEDS 250 . . D SMOKING 251 . . D VITALS 209 252 . . I C0QPR D PRINT 210 253 . . I C0QSS D SS
Note:
See TracChangeset
for help on using the changeset viewer.