source: qrda/C0Q/trunk/p/C0QGEN.m@ 1724

Last change on this file since 1724 was 1300, checked in by George Lilly, 13 years ago

test data generator for the C0Q Quality Reporting package

File size: 3.3 KB
Line 
1C0QGEN ;GPL - Test Patient Reminder List Generator;7/5/11 8:50pm
2 ;;1.0;MU PACKAGE;;;Build 19
3 ;
4 ;2011 George Lilly <glilly@glilly.net> - Licensed under the terms of the GNU
5 ;General Public License See attached copy of the License.
6 ;
7 ;This program is free software; you can redistribute it and/or modify
8 ;it under the terms of the GNU General Public License as published by
9 ;the Free Software Foundation; either version 2 of the License, or
10 ;(at your option) any later version.
11 ;
12 ;This program is distributed in the hope that it will be useful,
13 ;but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;GNU General Public License for more details.
16 ;
17 ;You should have received a copy of the GNU General Public License along
18 ;with this program; if not, write to the Free Software Foundation, Inc.,
19 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 ;
21 Q
22 ;
23EN ; generate random patient lists for C0Q testing
24 ;
25 ; -- here are the attributes in the C0Q PATIENT LIST file
26 ;
27 ;^C0Q(301,"CATTR","FailedDemographics",9)=""
28 ;^C0Q(301,"CATTR","HasAdvancedDirective",15)=""
29 ;^C0Q(301,"CATTR","HasAllergy",24)=""
30 ;^C0Q(301,"CATTR","HasDemographics",25)=""
31 ;^C0Q(301,"CATTR","HasMed",26)=""
32 ;^C0Q(301,"CATTR","HasMedOrders",10)=""
33 ;^C0Q(301,"CATTR","HasMedRecon",19)=""
34 ;^C0Q(301,"CATTR","HasProblem",27)=""
35 ;^C0Q(301,"CATTR","HasSmokingStatus",12)=""
36 ;^C0Q(301,"CATTR","HasVitalSigns",16)=""
37 ;^C0Q(301,"CATTR","NoAdvancedDirective",17)=""
38 ;^C0Q(301,"CATTR","NoAllergy",28)=""
39 ;^C0Q(301,"CATTR","NoMed",5)=""
40 ;^C0Q(301,"CATTR","NoMedOrders",11)=""
41 ;^C0Q(301,"CATTR","NoMedRecon",20)=""
42 ;^C0Q(301,"CATTR","NoProblem",29)=""
43 ;^C0Q(301,"CATTR","NoSmokingStatus",13)=""
44 ;^C0Q(301,"CATTR","NoVitalSigns",18)=""
45 ;^C0Q(301,"CATTR","Over65",14)=""
46 ;^C0Q(301,"CATTR","Patient",30)=""
47 ;^C0Q(301,"CATTR","XferOfCare",21)=""
48 N ZI S ZI=0
49 N ZX,ZY
50 K C0QLIST ; variable to pass to update
51 F S ZI=$O(^DPT(ZI)) Q:+ZI=0 D ; for every patient in the database
52 . ;
53 . S C0QLIST("Patient",ZI)="" ; everyone is a patient
54 . ;
55 . I $$YN(90) S C0QLIST("HasDemographics",ZI)="" ;
56 . E S C0QLIST("FailedDemographics",ZI)="" ;
57 . ;
58 . I $$YN(40) S C0QLIST("HasAdvancedDirective",ZI)="" ;
59 . E S C0QLIST("NoAdvancedDirective",ZI)="" ;
60 . ;
61 . I $$YN(60) S C0QLIST("HasAllergy",ZI)="" ;
62 . E S C0QLIST("NoAllergy",ZI)="" ;
63 . ;
64 . I $$YN(65) S C0QLIST("HasMed",ZI)="" ;
65 . E S C0QLIST("NoMed",ZI)="" ;
66 . ;
67 . I $$YN(80) S C0QLIST("HasMedOrders",ZI)="" ;
68 . E S C0QLIST("NoMedOrders",ZI)="" ;
69 . ;
70 . I $$YN(35) S C0QLIST("HasMedRecon",ZI)="" ;
71 . E S C0QLIST("NoMedRecon",ZI)="" ;
72 . ;
73 . I $$YN(80) S C0QLIST("HasProblem",ZI)="" ;
74 . E S C0QLIST("NoProblem",ZI)="" ;
75 . ;
76 . I $$YN(70) S C0QLIST("HasSmokingStatus",ZI)="" ;
77 . E S C0QLIST("NoSmokingStatus",ZI)="" ;
78 . ;
79 . I $$YN(85) S C0QLIST("HasVitalSigns",ZI)="" ;
80 . E S C0QLIST("NoVitalSigns",ZI)="" ;
81 . ;
82 . I $$YN(20) S C0QLIST("Over65",ZI)="" ;
83 D FILE^C0QPRML ; update the patient list file
84 ; then update the measure set
85 D UPDATE^C0QUPDT(.G,8) ; the MU 2011 INP ATTESTATION measure set ien
86 Q
87 ;
88YN(ZPCT) ; extrinsic which says yes or no based on a percent ZPCT
89 ; for example $$YN(70) will say "yes" 70% of the time
90 N ZN
91 S ZN=0
92 I $R(100)<ZPCT S ZN=1
93 Q ZN
94 ;
Note: See TracBrowser for help on using the repository browser.