Changeset 1443
- Timestamp:
- Jun 8, 2012, 9:27:49 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
qrda/C0Q/trunk/p/C0QMUERX.m
r1441 r1443 1 C0QMUERX ; VEN - Analyze ERx Data for Patients ; 5/30/12 1 0:21am1 C0QMUERX ; VEN - Analyze ERx Data for Patients ; 5/30/12 1:48am 2 2 ;;1.0;C0Q;;May 21, 2012;Build 44 3 3 QUIT ; No Entry from the top … … 23 23 D EN("^C0Q(301,4,1,""B"")") 24 24 QUIT 25 UT3 ; More Unit Tests 26 N C0QDEBUG S C0QDEBUG=1 27 D EN($$PATLN^C0QMU12("MU12-EP-HasERX")) 28 QUIT 25 29 EN(C0QLIST) ; PEP - Analyze ERx Data and store 26 30 ; Parameters: … … 54 58 ; 55 59 ; Walk the global 56 N C0QWALK S C0QWALK=$SELECT(C0QB:"",'C0QB:0) ; Walker 60 N C0QWALK S C0QWALK=$SELECT(C0QB:"",'C0QB:0) ; Walker, start of $ORDER? 57 61 N C0QDONE S C0QDONE=0 ; Finish Flag 58 62 FOR SET C0QWALK=$O(@C0QLIST@(C0QWALK)) QUIT:C0QDONE DO … … 80 84 . W:$G(C0QDEBUG) "Calling GETMEDS6 SOAP Web Service Call for "_C0QDFN,! 81 85 . D SOAP^C0PWS2("C0POUT","GETMEDS6",DUZ,C0QDFN) 82 . Q:$G( ^TMP($J,C0QDFN,1,"RowCount"))=0 ; WS says no data86 . Q:$G(C0POUT(1,"RowCount"))=0 ; WS says no data 83 87 . M ^TMP($J,C0QDFN)=C0POUT 84 88 ; … … 109 113 ; 110 114 N C0QDFN,C0QRXNO S (C0QDFN,C0QRXNO)=0 111 N C0QD S C0QD=0 ; Denominator 115 N C0QD S C0QD=0 ; Denominator - Overall (cf C0QDP below) 112 116 ; 113 117 ; Calculate Denominator below 114 118 F S C0QDFN=$O(^TMP($J,C0QDFN)) Q:C0QDFN="" DO 119 . N C0QDP S C0QDP=0 ; Denominator - Patient Specific 115 120 . F S C0QRXNO=$O(^TMP($J,C0QDFN,C0QRXNO)) Q:C0QRXNO="" DO 116 121 .. W:$G(C0QDEBUG) "Patient "_C0QDFN_" Rx "_C0QRXNO,! … … 139 144 .. ; 140 145 .. W:$G(C0QDEBUG) "Adding to Denominator",! 146 .. S C0QDP=C0QDP+1 141 147 .. S C0QD=C0QD+1 148 . ; 149 . ; SAVE C0QDP - while it lasts! 150 . D SAVE(C0QLIST,C0QDFN,"ERXDEN",C0QDP) 142 151 ; 143 152 ; Calculate Numerator below 144 153 N C0QDFN,C0QRXNO S (C0QDFN,C0QRXNO)=0 145 N C0QN S C0QN=0 ; Numerator 154 N C0QN S C0QN=0 ; Numerator - Overall (cf C0QNP below) 146 155 F S C0QDFN=$O(^TMP($J,C0QDFN)) Q:C0QDFN="" DO 156 . N C0QNP S C0QNP=0 ; Numerator - Patient Specific 147 157 . F S C0QRXNO=$O(^TMP($J,C0QDFN,C0QRXNO)) Q:C0QRXNO="" DO 148 158 .. W:$G(C0QDEBUG) "Patient "_C0QDFN_" Rx "_C0QRXNO,! … … 171 181 .. ; 172 182 .. W:$G(C0QDEBUG) "Adding to Numerator",! 183 .. S C0QNP=C0QNP+1 173 184 .. S C0QN=C0QN+1 185 . ; 186 . ; Save C0QNP while it lasts 187 . D SAVE(C0QLIST,C0QDFN,"ERXNUM",C0QNP) 174 188 ; 175 189 S ^TMP($J)=C0QN_U_C0QD … … 192 206 . I $G(@ZERX@(ZI,1,1,0))["E-Rx Web" S (DONE,HASERX)=1 193 207 Q +$G(HASERX) 208 ; 209 SAVE(C0QLIST,C0QDFN,TYPE,COUNT) ; Proc - Private; Save Count 210 ; TODO: Documentation 211 ; 212 ; First, QUIT if this isn't a Quality Measures List? 213 ; $QS(x,0) gets you the global name 214 ; 215 ; This should give you an idea of what I am dealing with! 216 ; 217 ; ^C0Q(301,48,1,15,0)=91 218 ; ^C0Q(301,48,1,16,0)=93 219 ; ^C0Q(301,48,1,17,0)=173 220 ; ^C0Q(301,48,1,18,0)=174 221 ; ^C0Q(301,48,1,"B",5,1)="" 222 ; ^C0Q(301,48,1,"B",10,2)="" 223 ; ^C0Q(301,48,1,"B",11,3)="" 224 ; ^C0Q(301,48,1,"B",14,4)="" 225 ; 226 I $QS(C0QLIST,0)'="^C0Q" W:$G(C0QDEBUG) "Not Saving Patient "_C0QDFN,! QUIT 227 ; 228 ; Otherwise, prepare to save 229 N C0QFDA ; Fileman Data Array 230 N C0QIENS ; IENS 231 N L1,L2 ; Top Level, Level 2 232 S L1=$QS(C0QLIST,2) ; Top Level IEN 233 S L2=$O(^C0Q(301,L1,1,"B",C0QDFN,"")) ; Patient IEN 234 S C0QIENS="?+1"_C0QDFN_","_L2_","_L1_"," ; TODO: Here C0QDFN is a dummy for uniqueness in FDA, not meaningful! - DO BETTER! 235 W:$G(C0QDEBUG) "IENs "_C0QIENS_" ready to file",! 236 W:$G(C0QDEBUG) "Saving "_TYPE_" of "_COUNT_" for Patient "_$P(^DPT(C0QDFN,0),U)_" ("_C0QDFN_")",! 237 S C0QFDA(1130580001.3111,C0QIENS,.01)=TYPE 238 S C0QFDA(1130580001.3111,C0QIENS,.02)=COUNT 239 ; 240 W:$G(C0QDEBUG) "Fileman Data Array",! 241 I $G(C0QDEBUG) N % S %=$NA(C0QFDA) F S %=$Q(@%) Q:%="" W %_": "_@%,! 242 ; 243 N C0QERR ; Errors 244 D UPDATE^DIE("","C0QFDA","","C0QERR") 245 ; 246 I $D(C0QERR) DO 247 . W "Error in filing data",! 248 . S %=$NAME(C0QERR) F S %=$Q(@%) Q:%="" W %_": "_@%,! 249 ; 250 QUIT
Note:
See TracChangeset
for help on using the changeset viewer.