 Source, Copyright, & Licensing:
 ===============================
 This patch to WorldVistA 2.0 was produced in Dew Drop
 by George Lily on 24 August 2012 and released through VISTA Forum.
 
 (C) 2012 George Lilly
 Licensed under GPL 2.
 
 Functionality:
 ==============
 This patch adds the ability to generate modified CCRs
 containing a QUALITY measure section that looks like
 this:
 <QUALITY>
 <MEASURE_SET>
 <ID>1.3.6.1.4.1.33895.1.1.31.1.2.1</ID>
 <MEASURES>
 <MEASURE>1.3.6.1.4.1.33895.1.2.16001.1.2.2</MEASURE>
 <MEASURE>1.3.6.1.4.1.33895.1.2.16002.1.2.2</MEASURE>
 <MEASURE>1.3.6.1.4.1.33895.1.2.16004.1.2.2</MEASURE>
 <MEASURE>1.3.6.1.4.1.33895.1.2.16008.1.2.2</MEASURE>
 </MEASURES>
 </MEASURE_SET>
 </QUALITY>

 This enables you to create a QRDA document in the C32 format to submit to CMS
 containing these measures. The C32 document will be generated by an XSLT
 transform from the CCR document.

 The driving force behind the creation of this patch, as well as the
 documentation of the actual QRDA documents to send to CMS can be found here:
 http://qualitynet.org/dcs/ContentServer?c=Page&pagename=QnetPublic%2FPage%2FQnetTier3&cid=1228772217179
 
 Specifically, this sentence:
 "One part of meeting the requirements for Stage I Meaningful Use may include
 submitting Clinical Quality Measures (CQMs) electronically using the QRDA
 Category I file format."

 Package Elements:
 =================
PACKAGE: C0Q*1.0*4     Aug 24, 2012 12:02 pm                      PAGE 1
-------------------------------------------------------------------------------
TYPE: SINGLE PACKAGE                               TRACK NATIONALLY: YES
NATIONAL PACKAGE: QUALITY MEASURES               ALPHA/BETA TESTING: NO

DESCRIPTION:
QRDA Support.

ENVIRONMENT CHECK:                               DELETE ENV ROUTINE: 
 PRE-INIT ROUTINE:                          DELETE PRE-INIT ROUTINE: 
POST-INIT ROUTINE:                         DELETE POST-INIT ROUTINE: 
PRE-TRANSPORT RTN: TRAN^C0Q1P4

                                           UP    SEND  DATA                USER
                                           DATE  SEC.  COMES   SITE  RSLV  OVER
FILE #      FILE NAME                      DD    CODE  W/FILE  DATA  PTRS  RIDE
-------------------------------------------------------------------------------

1130580001.101C0Q QUALITY MEASURE          YES   YES   YES     OVER  YES   NO

1130580001.201C0Q MEASUREMENT SET          YES   YES   YES     OVER  YES   NO

1130580001.401C0Q PARAMETER                YES   YES   NO                  NO
Partial DD: subDD: 1130580001.401fld: 5.1
                              fld: 5.2
                              fld: 5.3

INPUT TEMPLATE:                                ACTION:
   C0Q EDIT INPATIENT PARMS    FILE #1130580001.401SEND TO SITE
   C0Q EDIT MEASURE SET    FILE #1130580001.201   SEND TO SITE

ROUTINE:                                       ACTION:
   C0QQRDA                                        SEND TO SITE

OPTION:                                        ACTION:
   C0Q EXPORT INPATIENT QRDA CCRS                 SEND TO SITE
   C0Q QRDA MENU                                  SEND TO SITE
   C0Q QUALITY MEASUREMENT MENU                   USE AS LINK FOR MENU ITEMS

INSTALL QUESTIONS: 

 Default Rebuild Menu Trees Upon Completion of Install: YES
 Default INHIBIT LOGONs during the install: NO
 Default DISABLE Scheduled Options, Menu Options, and Protocols: NO

REQUIRED BUILDS:                               ACTION:
   CCD/CCR GENERATION UTILITIES 1.2               Don't install, leave global
   QUALITY MEASURES 1.0                           Don't install, leave global

 Summary of Changes to package:
 - Population of QRDA TEMPLATE ROOT field in all of the C0Q QUALITY MEASUREs
   for Inpatients, as follows:

NAME                  QRDA TEMPLATE ROOT                        NUMERATOR RULE SET
----------------------------------------------------------------------------------

MU HOS NQF 0495       2.16.840.1.113883.3.249.11.14.2.1.2.2     MU ED-1 NUMER RS
MU HOS NQF 0497       2.16.840.1.113883.3.249.11.14.3.1.2.2     MU ED-2 NUMER RS

MU HOS NQF 0435       1.3.6.1.4.1.33895.1.2.16001.1.2.2         MU STK-2 NUMER RS
MU HOS NQF 0436       1.3.6.1.4.1.33895.1.2.16002.1.2.2         MU STK-3 NUMER RS
MU HOS NQF 0437       1.3.6.1.4.1.33895.1.2.16003.1.2.2         MU STK-4 NUMER RS
MU HOS NQF 0438       1.3.6.1.4.1.33895.1.2.16004.1.2.2         MU STK-5 NUMER RS
MU HOS NQF 0439       1.3.6.1.4.1.33895.1.2.16005.1.2.2         MU STK-6 NUMER RS
MU HOS NQF 0440       1.3.6.1.4.1.33895.1.2.16007.1.2.2         MU STK-8 NUMER RS
MU HOS NQF 0441       1.3.6.1.4.1.33895.1.2.16008.1.2.2         MU STK-10 NUMER RS

MU HOS NQF 0371       1.3.6.1.4.1.33895.1.2.15971.1.2.2         MU VTE-1 NUMER RS
MU HOS NQF 0372       1.3.6.1.4.1.33895.1.2.15972.1.2.2         MU VTE-2 NUMER RS
MU HOS NQF 0373       1.3.6.1.4.1.33895.1.2.15973.1.2.2         MU VTE-3 NUMER RS
MU HOS NQF 0374       1.3.6.1.4.1.33895.1.2.15974.1.2.2         MU VTE-4 NUMER RS
MU HOS NQF 0375       1.3.6.1.4.1.33895.1.2.15975.1.2.2         MU VTE-5 NUMER RS
MU HOS NQF 0376       1.3.6.1.4.1.33895.1.2.15976.1.2.2         MU VTE-6 NUMER RS

 - Change of C0Q MEASUREMENT file name to C0Q MEASUREMENT SET
 - Addition of QRDA TEMPLATE ROOT field to C0Q MEASUREMENT SET
 - Creation of three Measurement Sets in the C0Q MEASUREMENT SET as follows:
NAME: ED CMS REPORTING MEASURES
  QRDA TEMPLATE ROOT: 2.16.840.1.113883.3.249.11.14.1.1.1
  BEGIN DATE: JAN 1,2012                END DATE: DEC 13,2012
MEASURE: MU HOS NQF 0495
MEASURE: MU HOS NQF 0497
  MU YEAR KEY: MU12

NAME: STK CMS REPORTING MEASURES
  QRDA TEMPLATE ROOT: 1.3.6.1.4.1.33895.1.1.31.1.2.1
  BEGIN DATE: JAN 1,2012                END DATE: DEC 31,2012
MEASURE: MU HOS NQF 0435
MEASURE: MU HOS NQF 0436
MEASURE: MU HOS NQF 0437
MEASURE: MU HOS NQF 0438
MEASURE: MU HOS NQF 0439
MEASURE: MU HOS NQF 0440
MEASURE: MU HOS NQF 0441
  MU YEAR KEY: MU12

NAME: VTE CMS REPORTING MEASURES
  QRDA TEMPLATE ROOT: 1.3.6.1.4.1.33895.1.1.32.1.2.1
  BEGIN DATE: JAN 1,2012                END DATE: DEC 31,2012
MEASURE: MU HOS NQF 0371
MEASURE: MU HOS NQF 0372
MEASURE: MU HOS NQF 0373
MEASURE: MU HOS NQF 0374
MEASURE: MU HOS NQF 0375
MEASURE: MU HOS NQF 0376
  MU YEAR KEY: MU12

 - Creation of supporting fields in the C0Q PARAMETER file to drive generation
   of the QRDA documents.
   - VTE CMS MEASUREMENT SET
   - STK CMS MEASUREMENT SET
   - ED CMS MEASUREMENT SET

 - Modification of existing input templates to support the new fields created.
   C0Q EDIT INPATIENT PARMS    FILE #1130580001.401
   C0Q EDIT MEASURE SET        FILE #1130580001.201   

 - Routine C0QQRDA to drive the generation of the QRDA documents.

 - Menu option to call EN^C0QQRDA: 
   -> C0Q QUALITY MEASUREMENT MENU
   Parent: C0Q QRDA MENU
 
 Routine Versioning:
 
 The second line of each of these routines now looks like:
 ;;1.0;QUALITY MEASURES;**4**;May 21, 2012;Build 28

 
 The following checksums can be checked with CHECK1^XTSUMBLD:
 
 Routine   Before        After         Patch List
 -------   -----------   ------------  ---------------------------------
 C0QQRDA                 89943644      **4**
 
 Documentation:
 ==============
 None at this moment. 
 
 Test Sites:
 ===========
 None at this moment.
 
 Compliance:
 ===========
 This software complies with the VA MUMPS Programming Standards and
 Conventions (version 3 April 2007).
 
 Installation Instructions:
 ==========================
 Install Time - less than 1 minute
 
 1.  LOAD TRANSPORT GLOBAL
 
     Choose the PackMan message containing this patch and invoke the
     INSTALL/CHECK MESSAGE PackMan option to unload the build.
 
 2.  START UP KIDS
 
      Start up the Kernel Installation and Distribution System Menu
      [XPD MAIN]:
 
           Edits and Distribution ...
           Utilities ...
           Installation ...
 
 Select Kernel Installation & Distribution System Option: INStallation
                                                          ---
           Load a Distribution
           Print Transport Global
           Compare Transport Global to Current System
           Verify Checksums in Transport Global
           Install Package(s)
           Restart Install of Package(s)
           Unload a Distribution
           Backup a Transport Global
 
 Select Installation Option:
 
 3.  Select Installation Option:
 
     NOTE:  The following are OPTIONAL - (When prompted for the INSTALL
             NAME, enter C0Q*1.0*4):
 
     a.  Backup a Transport Global - This option will create a backup
         message of any routines exported with this patch. It will not
         backup any other changes such as DD's or templates.
     b.  Compare Transport Global to Current System - This option will
         allow you to view all changes that will be made when this patch
         is installed.  It compares all components of this patch
         (routines, DD's, templates, etc.).
     c.  Verify Checksums in Transport Global - This option will allow
         you to ensure the integrity of the routines that are in the
         transport global.
 
 4.  Select Installation Option: Install Package(s)
 
     **This is the step to start the installation of this KIDS patch:
 
     a.  Choose the Install Package(s) option to start the patch install
         and enter "C0Q*1.0*4" at the INSTALL NAME prompt.  
     b.  When asked, 'Shall I write over your C0Q MEASUREMENTS File? YES//'
         Answer YES. The file is just renamed, that's why KIDS asks you to 
         overwrite it. 
     c.  When prompted 'Want KIDS to Rebuild Menu Trees Upon Completion of
         Install? YES//'  answer YES
     d.  When prompted 'Want KIDS to INHIBIT LOGONs during the install?
         NO//'  answer NO
     e.  When prompted 'Want to DISABLE Scheduled Options, Menu Options,
         and Protocols? NO//'  answer NO
 
 Installation Example:
Select Installation Option: 6  Install Package(s)
Select INSTALL NAME:    C0Q*1.0*4     Loaded from Distribution     Loaded from D
istribution  8/24/12@10:05
     => INPATIENT CMS QRDA GENERATION SUPPORT  ;Created on Aug 02, 2012@10:40:

This Distribution was loaded on Aug 24, 2012@10:05 with header of 
   INPATIENT CMS QRDA GENERATION SUPPORT  ;Created on Aug 02, 2012@10:40:23
   It consisted of the following Install(s):
      C0Q*1.0*4

   Checking C0Q*1.0*4 for overlap with VOE 1.0 .... OK
            No overlap found


   Checking C0Q*1.0*4 for overlap with VOE 1.1 .... OK
            No overlap found


   Checking C0Q*1.0*4 for overlap with NO HOME 1.0 .... OK
            No overlap found

Checking Install for Package C0Q*1.0*4

Install Questions for C0Q*1.0*4

Incoming Files:


   1130580001.101C0Q QUALITY MEASURE  (including data)
Note:  You already have the 'C0Q QUALITY MEASURE' File.
I will OVERWRITE your data with mine.


   1130580001.201C0Q MEASUREMENT SET  (including data)
*BUT YOU ALREADY HAVE 'C0Q MEASUREMENTS' AS FILE #1130580001.201!
Shall I write over your C0Q MEASUREMENTS File? YES// 
I will OVERWRITE your data with mine.


   1130580001.401C0Q PARAMETER  (Partial Definition)
Note:  You already have the 'C0Q PARAMETER' File.

Want KIDS to Rebuild Menu Trees Upon Completion of Install? YES// 


Want KIDS to INHIBIT LOGONs during the install? NO// 
Want to DISABLE Scheduled Options, Menu Options, and Protocols? NO//  

Enter the Device you want to print the Install messages.
You can queue the install by enter a 'Q' at the device prompt.
Enter a '^' to abort the install.

DEVICE: HOME// PHOME  HOME PRINTER

 
 Install Started for C0Q*1.0*4 : 
               Aug 24, 2012@10:08:54
 
Build Distribution Date: Aug 02, 2012
 
 Installing Routines:..
               Aug 24, 2012@10:08:54
 
 Installing Data Dictionaries: ....
               Aug 24, 2012@10:08:55
 
 Installing Data: 
               Aug 24, 2012@10:08:55
 
 Installing PACKAGE COMPONENTS: 
 
 Installing INPUT TEMPLATE...
 
 Installing OPTION....
               Aug 24, 2012@10:08:55
 
 Updating Routine file......
 
 Updating KIDS files.......
 
 C0Q*1.0*4 Installed. 
               Aug 24, 2012@10:08:55
 
 Not a VA primary domain
 
 NO Install Message sent 
 
 Call MENU rebuild

Starting Menu Rebuild:  Aug 24, 2012@10:08:57

Collecting primary menus in the New Person file...

                    Primary menus found in the New Person file
                    ------------------------------------------

OPTION NAME         MENU TEXT                    # OF         LAST     LAST
                                                 USERS        USED     BUILT

EVE                 Systems Manager Menu         25         08/24/12   08/06/12
XUCORE              Core Applications            3          08/14/12   08/06/12
XUSERTOOLS          User's Toolbox               3          06/28/11   08/06/12
XMUSER              MailMan Menu                 1          06/03/11   08/06/12
DG REGISTRATION MENURegistration Menu            1          06/21/11   08/06/12
DGZ REGISTRATION MENU
                    EHR Registration Menu        39         07/09/12   08/06/12
XUZEVE              STARTUP FUNCTIONS            1          11/16/05   08/06/12

Building secondary menu trees....

Merging.... done.

Menu Rebuild Complete:  Aug 24, 2012@10:09:01

Brief Usage Instructions:
====================================
Before running the QRDA option, you need to set-up your inpatient parameters.
You need AT LEAST a Parameter Name, an MU Year, and a Parameter Type in order
for the software to pick up the parameter's presence. If you already have it
set-up, you don't need to perform this step. Please note that the software does
a reverse $Order through the MU years and will only pick the latest one.

---
Select SETUP QUALITY REPORTING Option: INP EDIT PARMS

Select C0Q PARAMETER NAME: ?      
                                   to exit: 
        You may enter a new C0Q PARAMETER, if you wish
        NAME MUST BE 3-30 CHARACTERS, NOT NUMERIC OR STARTING WITH
        PUNCTUATION
   
Select C0Q PARAMETER NAME: INPATIENT
  Are you adding 'INPATIENT' as a new C0Q PARAMETER (the 1ST)? No// Y  (Yes)
NAME: INPATIENT// 
MEASUREMENT PERIOD KEY: MU12
PARAMETER TYPE: INP  INPATIENT
INP MU MEASUREMENT SET: 
INP QUALITY MEASUREMENT SET: 
VTE CMS MEASUREMENT SET: 
STK CMS MEASUREMENT SET: 
ED CMS MEASUREMENT SET: 
Select SUBSCRIBER: 
---

Next, the you can invoke the menu option as follows, but you may not get any
CCRs to generate. The option will run EN^C0QQRDA which will look up the
installed measure sets and try to set-up your parameters correctly. If you
re-named the installed measure sets, this step will fail and you will need to
populate them manually in the parameters.

---
Select QUALITY MEASUREMENT MENU Option: QRDA MENU

Select QRDA MENU Option: EXPORT INPATIENT QRDA MEASURES AS CCRS
Trying to automatically set-up measure sets in parameters
...Set-up complete



This program collects patients from the denominators of the measures
STK, VTE, and ED and outputs modified CCR files to the kernel default
directory (probably /tmp/).

This will take some time to execute.



Which measure set would you like to produce QRDA documents for?
Choose to Run [V]TE Measure Set, [S]TK Measure Set, or 
[E]D Measure Set. Or you can choose to run [A]ll of them.
Measure to calculate:  (V/S/E/A): VTE
10: VTE CMS REPORTING MEASURES^1.3.6.1.4.1.33895.1.1.32.1.2.1
---

The patient list to generate the CCRs is ultimately taken from the Patient
Lists pointed to from the C0Q QUALITY MEASURE file for each of the measures
being processed in the VTE, ED, or STK Measure Set. At this point of package
development, you must run these measures manually in the reminders package and
then populate the Numerator Patient List field and the Denominator Patient List
field for each of these measures. The software per CMS regs picks up the
patients in the denominator once the measure set is processed.

A successful execution looks like this:
---
Select QRDA MENU Option:  EXPORT INPATIENT QRDA MEASURES AS CCRS
This program collects patients from the denominators of the measures
STK, VTE, and ED and outputs modified CCR files to the kernel default
directory (probably /tmp/).

This will take some time to execute.



Which measure set would you like to produce QRDA documents for?
Choose to Run [V]TE Measure Set, [S]TK Measure Set, or 
[E]D Measure Set. Or you can choose to run [A]ll of them.
Measure to calculate:  (V/S/E/A): V
10: VTE CMS REPORTING MEASURES^1.3.6.1.4.1.33895.1.1.32.1.2.1C0QFDA(1130580001.2
011,"6,10,",3)=33

Prosessing DFN 97
RUNNING D EXTRACT^C0CPROBS(IXML,DFN,OXML)
NULL RESULT FROM LIST^ORQQPL3 
RUNNING D EXTRACT^C0CALERT(IXML,DFN,OXML)
RUNNING D EXTRACT^C0CMED(IXML,DFN,OXML)
RUNNING D MAP^C0CIMMU(IXML,DFN,OXML)
NULL RESULT FROM IMMUN^PXRHS03 
RUNNING D EXTRACT^C0CVITAL(IXML,DFN,OXML)
VITALS START: T LIMIT: T-360
RUNNING D MAP^C0CLABS(IXML,DFN,OXML)
I MAPPED
VARS:^TMP("C0CCCR",9097,"RESULTS")
DFN:97
LAB LOOKUP FAILED, NO SSN
RUNNING D EXTRACT^C0CPROC(IXML,DFN,OXML)
RUNNING D EXTRACT^C0CENC(IXML,DFN,OXML)
PROCESSING:PATIENT 97
PROCESSING:PROVIDER 8
PROCESSING:SYSTEM 1

1^WROTE FILE: VTE_QRDA_CCR_DFN0000000097.XML TO /tmp/
---
