Changeset 1588


Ignore:
Timestamp:
Oct 30, 2012, 1:17:44 PM (11 years ago)
Author:
Sam Habiel
Message:

License changed to AGPL v3

Location:
ccr/tags/CCD-CCR_GENERATION_UTILITIES_1P2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ccr/tags/CCD-CCR_GENERATION_UTILITIES_1P2/CCD-CCR_GENERATION_UTILITIES_1P2.KID

    r1551 r1588  
    1 KIDS Distribution saved on Jun 25, 2012@10:01:50
    2 Changed name to full Package Name rather than nmsp
     1KIDS Distribution saved on Oct 30, 2012@10:27:50
     2CCD/CCR Generation Package Version 1.2
    33**KIDS**:CCD/CCR GENERATION UTILITIES 1.2^
    44
    55**INSTALL NAME**
    66CCD/CCR GENERATION UTILITIES 1.2
    7 "BLD",7891,0)
    8 CCD/CCR GENERATION UTILITIES 1.2^CCD/CCR GENERATION UTILITIES^0^3120625^n
    9 "BLD",7891,1,0)
    10 ^^185^185^3120511^^^^
    11 "BLD",7891,1,1,0)
     7"BLD",7883,0)
     8CCD/CCR GENERATION UTILITIES 1.2^CCD/CCR GENERATION UTILITIES^0^3121030^n
     9"BLD",7883,1,0)
     10^^188^188^3121029^
     11"BLD",7883,1,1,0)
     12Licensed under AGPL v3. For complete license text, see
     13"BLD",7883,1,2,0)
     14http://www.gnu.org/licenses/agpl-3.0.html
     15"BLD",7883,1,3,0)
     16 
     17"BLD",7883,1,4,0)
    1218CCR Project release v1.2
    13 "BLD",7891,1,2,0)
     19"BLD",7883,1,5,0)
    1420 
    15 "BLD",7891,1,3,0)
     21"BLD",7883,1,6,0)
    1622The purpose of the CCR package is to provide support for exporting and
    17 "BLD",7891,1,4,0)
     23"BLD",7883,1,7,0)
    1824eventually importing patient information from/to VistA in XML documents
    19 "BLD",7891,1,5,0)
     25"BLD",7883,1,8,0)
    2026conforming to the Continuity of Care Record (CCR - ASTM) and Continuity
    21 "BLD",7891,1,6,0)
     27"BLD",7883,1,9,0)
    2228of Care Document (CCD - HL7) standards.
    23 "BLD",7891,1,7,0)
     29"BLD",7883,1,10,0)
    2430 
    25 "BLD",7891,1,8,0)
     31"BLD",7883,1,11,0)
    2632This version of the CCR package provides:
    27 "BLD",7891,1,9,0)
     33"BLD",7883,1,12,0)
    2834 
    29 "BLD",7891,1,10,0)
     35"BLD",7883,1,13,0)
    3036EXPORT^C0CCCR
    31 "BLD",7891,1,11,0)
     37"BLD",7883,1,14,0)
    3238A command line interface to export a single patient's CCR to a host
    33 "BLD",7891,1,12,0)
     39"BLD",7883,1,15,0)
    3440directory by specifying the patient by name.
    35 "BLD",7891,1,13,0)
     41"BLD",7883,1,16,0)
    3642 
    37 "BLD",7891,1,14,0)
     43"BLD",7883,1,17,0)
    3844EXPORT^C0CCCD
    39 "BLD",7891,1,15,0)
     45"BLD",7883,1,18,0)
    4046A command line interface to export a single patient's CCD to a host
    41 "BLD",7891,1,16,0)
     47"BLD",7883,1,19,0)
    4248directory by specifying the patient by name. As an alternative to
    43 "BLD",7891,1,17,0)
     49"BLD",7883,1,20,0)
    4450generating the CCD directly, an XSLT transformation is available to
    45 "BLD",7891,1,18,0)
     51"BLD",7883,1,21,0)
    4652translate a CCR into a level 2 CCD. This tranformation has been tested
    47 "BLD",7891,1,19,0)
     53"BLD",7883,1,22,0)
    4854and produces a CCD with all currently supported sections of the CCR. The
    49 "BLD",7891,1,20,0)
     55"BLD",7883,1,23,0)
    5056EXPORT^C0CCCD only extracts the PROBLEMS section into a CCD.
    51 "BLD",7891,1,21,0)
     57"BLD",7883,1,24,0)
    5258 
    53 "BLD",7891,1,22,0)
     59"BLD",7883,1,25,0)
    5460XPAT^C0CCCR(DFN,OUTDIR,OUTFILE)
    55 "BLD",7891,1,23,0)
     61"BLD",7883,1,26,0)
    5662A command line and program interface to export a single patient's CCR
    57 "BLD",7891,1,24,0)
     63"BLD",7883,1,27,0)
    5864using the IEN of the patient in the ^DPT file (DFN).
    59 "BLD",7891,1,25,0)
     65"BLD",7883,1,28,0)
    6066OUTDIR specifies an existing directory on the Host system into which the
    61 "BLD",7891,1,26,0)
     67"BLD",7883,1,29,0)
    6268CCR XML document will be written. If OUTDIR is null (""), the output
    63 "BLD",7891,1,27,0)
     69"BLD",7883,1,30,0)
    6470directory name will be taken from ^TMP("C0CCCR","ODIR").
    65 "BLD",7891,1,28,0)
     71"BLD",7883,1,31,0)
    6672OUFILE specifies the host file name of the CCR XML document that will be
    67 "BLD",7891,1,29,0)
     73"BLD",7883,1,32,0)
    6874written for this patient. If OUTFILE is null ("") the document name will
    69 "BLD",7891,1,30,0)
     75"BLD",7883,1,33,0)
    7076default to PAT_x_CCR_V1.xml where x is the DFN of the patient.
    71 "BLD",7891,1,31,0)
     77"BLD",7883,1,34,0)
    7278 
    73 "BLD",7891,1,32,0)
     79"BLD",7883,1,35,0)
    7480CCRRPC(CCRGRTN,DFN,CCRPARMS,CCRPART)
    75 "BLD",7891,1,33,0)
     81"BLD",7883,1,36,0)
    7682An RPC and program interface to return in return array CCRGRTN (passed by
    77 "BLD",7891,1,34,0)
     83"BLD",7883,1,37,0)
    7884reference) a single patient's CCR.
    79 "BLD",7891,1,35,0)
     85"BLD",7883,1,38,0)
    8086DFN is the patient's IEN
    81 "BLD",7891,1,36,0)
     87"BLD",7883,1,39,0)
    8288CCRPART is what portion of the CCR should be returned. If "CCR" is
    83 "BLD",7891,1,37,0)
     89"BLD",7883,1,40,0)
    8490specified, the entire CCR will be returned. If "PROBLEMS", "VITALS", or
    85 "BLD",7891,1,38,0)
     91"BLD",7883,1,41,0)
    8692"MEDICATIONS" is specified, only that section of the CCR will be returned.
    87 "BLD",7891,1,39,0)
     93"BLD",7883,1,42,0)
    8894CCRPARMS ARE PARAMETERS THAT AFFECT THE EXTRACTION
    89 "BLD",7891,1,40,0)
     95"BLD",7883,1,43,0)
    9096IN THE FORM "PARM1:VALUE1^PARM2:VALUE2"
    91 "BLD",7891,1,41,0)
     97"BLD",7883,1,44,0)
    9298EXAMPLE: "LABLIMIT:T-60" TO LIMIT LAB EXTRACTION TO THE LAST 60 DAYS
    93 "BLD",7891,1,42,0)
     99"BLD",7883,1,45,0)
    94100SEE C0CPARMS FOR A COMPLETE LIST OF SUPPORTED PARAMETERS
    95 "BLD",7891,1,43,0)
     101"BLD",7883,1,46,0)
    96102 
    97 "BLD",7891,1,44,0)
     103"BLD",7883,1,47,0)
    98104ANALYZE^C0CRIMA(BGNDFN,DFNCNT,CCRPARMS)
    99 "BLD",7891,1,45,0)
     105"BLD",7883,1,48,0)
    100106A command line and program interface to analyze the data from multiple
    101 "BLD",7891,1,46,0)
     107"BLD",7883,1,49,0)
    102108patients into categories that can be batch extracted.
    103 "BLD",7891,1,47,0)
     109"BLD",7883,1,50,0)
    104110BGNDFN is the beginning DFN to be analyzed. If BGNDFN is null ("") its
    105 "BLD",7891,1,48,0)
     111"BLD",7883,1,51,0)
    106112value will be taken from ^TMP("C0CRIM","RESUME"). If this variable does
    107 "BLD",7891,1,49,0)
     113"BLD",7883,1,52,0)
    108114not exist, the routine will start with the first IEN in the patient file
    109 "BLD",7891,1,50,0)
     115"BLD",7883,1,53,0)
    110116^DPT. ^TMP("C0CRIM","RESUME") is updated to the "next" patient to be
    111 "BLD",7891,1,51,0)
     117"BLD",7883,1,54,0)
    112118analyzed on successful completion.
    113 "BLD",7891,1,52,0)
     119"BLD",7883,1,55,0)
    114120DFNCNT is the count of how many patient records will be analyzed in this
    115 "BLD",7891,1,53,0)
     121"BLD",7883,1,56,0)
    116122execution.
    117 "BLD",7891,1,54,0)
     123"BLD",7883,1,57,0)
    118124For example ANALYZE^C0CRIMA(1000,1000) would start at patient DFN 1000
    119 "BLD",7891,1,55,0)
     125"BLD",7883,1,58,0)
    120126and analyzes 1000 patient records. ANALYZE^C0CRIMA("",1000) would then
    121 "BLD",7891,1,56,0)
     127"BLD",7883,1,59,0)
    122128analyze the next 1000 patients. When the end of the patient file is
    123 "BLD",7891,1,57,0)
     129"BLD",7883,1,60,0)
    124130reached, the routine terminates with a message that RESET^C0CRIMA would
    125 "BLD",7891,1,58,0)
     131"BLD",7883,1,61,0)
    126132need to be called to restart the analysis.
    127 "BLD",7891,1,59,0)
     133"BLD",7883,1,62,0)
    128134 
    129 "BLD",7891,1,60,0)
     135"BLD",7883,1,63,0)
    130136The categories into which the records are analyzed consist of attribute
    131 "BLD",7891,1,61,0)
     137"BLD",7883,1,64,0)
    132138strings. The attributes represent characteristics of the variables that
    133 "BLD",7891,1,62,0)
     139"BLD",7883,1,65,0)
    134140can be extracted for a given patient into the CCR or the CCD. This
    135 "BLD",7891,1,63,0)
     141"BLD",7883,1,66,0)
    136142version supports the following attributes:
    137 "BLD",7891,1,64,0)
     143"BLD",7883,1,67,0)
    138144VITALS : the patient has variables for the VITALS section of the CCR/CCD
    139 "BLD",7891,1,65,0)
     145"BLD",7883,1,68,0)
    140146PROBLEMS : the patient has variables for the PROBLEMS section of the
    141 "BLD",7891,1,66,0)
     147"BLD",7883,1,69,0)
    142148CCR/CCD
    143 "BLD",7891,1,67,0)
     149"BLD",7883,1,70,0)
    144150MEDS : the patient has variables for the MEDICATIONS section of the
    145 "BLD",7891,1,68,0)
     151"BLD",7883,1,71,0)
    146152CCR/CCD
    147 "BLD",7891,1,69,0)
     153"BLD",7883,1,72,0)
    148154HEADER : the patient has variables for the HEADER section of the CCR/CCD.
    149 "BLD",7891,1,70,0)
     155"BLD",7883,1,73,0)
    150156All patients are marked with the HEADER attribute in this version.
    151 "BLD",7891,1,71,0)
     157"BLD",7883,1,74,0)
    152158NOTEXTRACTED : the CCR or CCD has not yet been produced/extracted for
    153 "BLD",7891,1,72,0)
     159"BLD",7883,1,75,0)
    154160this patient. All patient records are marked with the NOTEXTRACTED
    155 "BLD",7891,1,73,0)
     161"BLD",7883,1,76,0)
    156162attribute in this version for batch control processing (not implemented
    157 "BLD",7891,1,74,0)
     163"BLD",7883,1,77,0)
    158164in this version).
    159 "BLD",7891,1,75,0)
     165"BLD",7883,1,78,0)
    160166 
    161 "BLD",7891,1,76,0)
     167"BLD",7883,1,79,0)
    162168ANAZYZE^C0CRIMA calls the variable extraction routines that would be used
    163 "BLD",7891,1,77,0)
     169"BLD",7883,1,80,0)
    164170to produce a CCR or a CCD and saves the results to ^TMP("C0CRIM",DFN) for
    165 "BLD",7891,1,78,0)
     171"BLD",7883,1,81,0)
    166172each patient. In addition, the attribute string for each patient is saved
    167 "BLD",7891,1,79,0)
     173"BLD",7883,1,82,0)
    168174in ^TMP("C0CRIM","ATTR")
    169 "BLD",7891,1,80,0)
     175"BLD",7883,1,83,0)
    170176 
    171 "BLD",7891,1,81,0)
     177"BLD",7883,1,84,0)
    172178Categories are created as they first occur based on each unique
    173 "BLD",7891,1,82,0)
     179"BLD",7883,1,85,0)
    174180combination of attributes that is encountered. They are named after the
    175 "BLD",7891,1,83,0)
     181"BLD",7883,1,86,0)
    176182attribute table that is used for the analysis. This version supports only
    177 "BLD",7891,1,84,0)
     183"BLD",7883,1,87,0)
    178184the attribute table .RIMTBL. and the categories are named "RIMTBL_x". An
    179 "BLD",7891,1,85,0)
     185"BLD",7883,1,88,0)
    180186example set of categories from a demo systems is:
    181 "BLD",7891,1,86,0)
     187"BLD",7883,1,89,0)
    182188 
    183 "BLD",7891,1,87,0)
     189"BLD",7883,1,90,0)
    184190GTM>D CLIST^C0CRIMA
    185 "BLD",7891,1,88,0)
     191"BLD",7883,1,91,0)
    186192(RIMTBL_1:105) ^NOTEXTRACTED^HEADER^^^PROBLEMS^^^^^VITALS^^^^^MEDS
    187 "BLD",7891,1,89,0)
     193"BLD",7883,1,92,0)
    188194(RIMTBL_2:596) ^NOTEXTRACTED^HEADER^^^^^^^^VITALS
    189 "BLD",7891,1,90,0)
     195"BLD",7883,1,93,0)
    190196(RIMTBL_3:44) ^NOTEXTRACTED^HEADER^^^PROBLEMS^^^^^VITALS
    191 "BLD",7891,1,91,0)
     197"BLD",7883,1,94,0)
    192198(RIMTBL_4:821) ^NOTEXTRACTED^HEADER
    193 "BLD",7891,1,92,0)
     199"BLD",7883,1,95,0)
    194200(RIMTBL_5:18) ^NOTEXTRACTED^HEADER^^^^^^^^VITALS^^^^^MEDS
    195 "BLD",7891,1,93,0)
     201"BLD",7883,1,96,0)
    196202(RIMTBL_6:14) ^NOTEXTRACTED^HEADER^^^PROBLEMS
    197 "BLD",7891,1,94,0)
     203"BLD",7883,1,97,0)
    198204(RIMTBL_7:15) ^NOTEXTRACTED^HEADER^^^^^^^^^^^^^MEDS
    199 "BLD",7891,1,95,0)
     205"BLD",7883,1,98,0)
    200206(RIMTBL_8:5) ^NOTEXTRACTED^HEADER^^^PROBLEMS^^^^^^^^^^MEDS
    201 "BLD",7891,1,96,0)
     207"BLD",7883,1,99,0)
    202208 
    203 "BLD",7891,1,97,0)
     209"BLD",7883,1,100,0)
    204210for RIMTBL_1 in this example, 105 is the record count of patients who
    205 "BLD",7891,1,98,0)
     211"BLD",7883,1,101,0)
    206212have this combination of attributes. The list of patients for each
    207 "BLD",7891,1,99,0)
     213"BLD",7883,1,102,0)
    208214category is also maintained for batch extraction.
    209 "BLD",7891,1,100,0)
     215"BLD",7883,1,103,0)
    210216 
    211 "BLD",7891,1,101,0)
     217"BLD",7883,1,104,0)
    212218CLIST^C0CRIMA
    213 "BLD",7891,1,102,0)
     219"BLD",7883,1,105,0)
    214220A command line interface to show a summary of the categories, record
    215 "BLD",7891,1,103,0)
     221"BLD",7883,1,106,0)
    216222counts, and attributes that have been analyzed so far. It produces the
    217 "BLD",7891,1,104,0)
     223"BLD",7883,1,107,0)
    218224listing in the example above from information stored in
    219 "BLD",7891,1,105,0)
     225"BLD",7883,1,108,0)
    220226^TMP("C0CRIM","CATS","RIMTBL"). It is intended for future versions that
    221 "BLD",7891,1,106,0)
     227"BLD",7883,1,109,0)
    222228attribute tables be supported in addition to the default "RIMTBL".
    223 "BLD",7891,1,107,0)
     229"BLD",7883,1,110,0)
    224230 
    225 "BLD",7891,1,108,0)
     231"BLD",7883,1,111,0)
    226232CPAT^C0CRIMA(CPATCAT)
    227 "BLD",7891,1,109,0)
     233"BLD",7883,1,112,0)
    228234A command line interface which shows the DFN numbers of the patients
    229 "BLD",7891,1,110,0)
     235"BLD",7883,1,113,0)
    230236represented by the category CPATCAT. DFNs are listed 10 per line. For
    231 "BLD",7891,1,111,0)
     237"BLD",7883,1,114,0)
    232238example:
    233 "BLD",7891,1,112,0)
     239"BLD",7883,1,115,0)
    234240 
    235 "BLD",7891,1,113,0)
     241"BLD",7883,1,116,0)
    236242GTM>D CPAT^C0CRIMA("RIMTBL_1")
    237 "BLD",7891,1,114,0)
     243"BLD",7883,1,117,0)
    2382441 3 8 25 42 69 123 140 146 149
    239 "BLD",7891,1,115,0)
     245"BLD",7883,1,118,0)
    240246151 168 204 205 217 218 224 228 229 231
    241 "BLD",7891,1,116,0)
     247"BLD",7883,1,119,0)
    242248236 237 240 253 260 267 271 301 347 350
    243 "BLD",7891,1,117,0)
     249"BLD",7883,1,120,0)
    244250366 379 384 391 407 418 419 420 428 433
    245 "BLD",7891,1,118,0)
     251"BLD",7883,1,121,0)
    246252442 520 569 600 620 692 706 715 722 723
    247 "BLD",7891,1,119,0)
     253"BLD",7883,1,122,0)
    248254724 728 730 744 745 746 747 748 749 750
    249 "BLD",7891,1,120,0)
     255"BLD",7883,1,123,0)
    250256751 752 753 754 755 756 757 758 759 760
    251 "BLD",7891,1,121,0)
     257"BLD",7883,1,124,0)
    252258761 762 763 764 765 766 767 768 769 770
    253 "BLD",7891,1,122,0)
     259"BLD",7883,1,125,0)
    254260771 772 773 774 775 776 777 778 779 780
    255 "BLD",7891,1,123,0)
     261"BLD",7883,1,126,0)
    256262100000 100001 100002 100003 100004 100005 100006 100007 100008 100009
    257 "BLD",7891,1,124,0)
     263"BLD",7883,1,127,0)
    258264100010 100011 100012 100013 100014
    259 "BLD",7891,1,125,0)
     265"BLD",7883,1,128,0)
    260266 
    261 "BLD",7891,1,126,0)
     267"BLD",7883,1,129,0)
    262268These are the 105 patient records included in category "RIMTBL_1" from
    263 "BLD",7891,1,127,0)
     269"BLD",7883,1,130,0)
    264270the above example.
    265 "BLD",7891,1,128,0)
     271"BLD",7883,1,131,0)
    266272 
    267 "BLD",7891,1,129,0)
     273"BLD",7883,1,132,0)
    268274DPATV^C0CRIMA(DFN,"SECTION")
    269 "BLD",7891,1,130,0)
     275"BLD",7883,1,133,0)
    270276A command line interface to display the values of variables for a
    271 "BLD",7891,1,131,0)
     277"BLD",7883,1,134,0)
    272278patient. "SECTION" can be any of the CCR sections. ie
    273 "BLD",7891,1,132,0)
     279"BLD",7883,1,135,0)
    274280"ALERTS","RESULTS","MEDS". If SECTION is ommitted, all sections will be
    275 "BLD",7891,1,133,0)
     281"BLD",7883,1,136,0)
    276282shown. An example:
    277 "BLD",7891,1,134,0)
     283"BLD",7883,1,137,0)
    278284 
    279 "BLD",7891,1,135,0)
     285"BLD",7883,1,138,0)
    280286GTM>D DPATV^C0CRIMA(2,"PROBLEMS")
    281 "BLD",7891,1,136,0)
     287"BLD",7883,1,139,0)
    2822881 1^PROBLEMCODEVALUE^V18.0
    283 "BLD",7891,1,137,0)
     289"BLD",7883,1,140,0)
    2842902 1^PROBLEMCODINGVERSION^
    285 "BLD",7891,1,138,0)
     291"BLD",7883,1,141,0)
    2862923 1^PROBLEMCONDITION^P
    287 "BLD",7891,1,139,0)
     293"BLD",7883,1,142,0)
    2882944 1^PROBLEMDATEMOD^2005-07-19T00:00:00-05:00
    289 "BLD",7891,1,140,0)
     295"BLD",7883,1,143,0)
    2902965 1^PROBLEMDATEOFONSET^1700--T00:00:00-05:00
    291 "BLD",7891,1,141,0)
     297"BLD",7883,1,144,0)
    2922986 1^PROBLEMDESCRIPTION^Family History of Diabetes Mellitus (ICD-9-CM
    293 "BLD",7891,1,142,0)
     299"BLD",7883,1,145,0)
    294300V18.0)
    295 "BLD",7891,1,143,0)
     301"BLD",7883,1,146,0)
    2963027 1^PROBLEMDTREC^1701--T00:00:00-05:00
    297 "BLD",7891,1,144,0)
     303"BLD",7883,1,147,0)
    2983048 1^PROBLEMHASCMT^
    299 "BLD",7891,1,145,0)
     305"BLD",7883,1,148,0)
    3003069 1^PROBLEMIEN^8
    301 "BLD",7891,1,146,0)
     307"BLD",7883,1,149,0)
    30230810 1^PROBLEMINACT^1700--T00:00:00-05:00
    303 "BLD",7891,1,147,0)
     309"BLD",7883,1,150,0)
    304310 
    305 "BLD",7891,1,148,0)
     311"BLD",7883,1,151,0)
    306312DCCR^C0CCCR(DFN)
    307 "BLD",7891,1,149,0)
     313"BLD",7883,1,152,0)
    308314This will display the XML of a CCR that has been generated for a patient.
    309 "BLD",7891,1,150,0)
     315"BLD",7883,1,153,0)
    310316It is run after generating the CCR with XPAT^C0CCCR or XCPAT^C0CRIMA.
    311 "BLD",7891,1,151,0)
     317"BLD",7883,1,154,0)
    312318 
    313 "BLD",7891,1,152,0)
     319"BLD",7883,1,155,0)
    314320XCPAT^C0CRIMA(CPATCAT)
    315 "BLD",7891,1,153,0)
     321"BLD",7883,1,156,0)
    316322A command line interface to extract a batch of patient CCR documents that
    317 "BLD",7891,1,154,0)
     323"BLD",7883,1,157,0)
    318324are associated with the category CPATCAT. For example,
    319 "BLD",7891,1,155,0)
     325"BLD",7883,1,158,0)
    320326 
    321 "BLD",7891,1,156,0)
     327"BLD",7883,1,159,0)
    322328XCPAT^C0CRIMA("RIMTBL_1") to extract the CCR documents for the 105
    323 "BLD",7891,1,157,0)
     329"BLD",7883,1,160,0)
    324330patients in the above example.
    325 "BLD",7891,1,158,0)
     331"BLD",7883,1,161,0)
    326332 
    327 "BLD",7891,1,159,0)
     333"BLD",7883,1,162,0)
    328334RESET^C0CRIMA
    329 "BLD",7891,1,160,0)
     335"BLD",7883,1,163,0)
    330336A command line interface to kill all ANALYZE^C0CRIMA results stored so
    331 "BLD",7891,1,161,0)
     337"BLD",7883,1,164,0)
    332338far so that the analysis can be done again. It kills
    333 "BLD",7891,1,162,0)
     339"BLD",7883,1,165,0)
    334340^TMP("C0CRIM","RESUME") and all extraction variables that have been saved
    335 "BLD",7891,1,163,0)
     341"BLD",7883,1,166,0)
    336342in ^TMP("C0CRIM")
    337 "BLD",7891,1,164,0)
     343"BLD",7883,1,167,0)
    338344 
    339 "BLD",7891,1,165,0)
     345"BLD",7883,1,168,0)
    340346NOTES:
    341 "BLD",7891,1,166,0)
     347"BLD",7883,1,169,0)
    342348This version of the package is a prototype, and does not yet make use of
    343 "BLD",7891,1,167,0)
     349"BLD",7883,1,170,0)
    344350the standard VistA features that are appropriate for it to use.
    345 "BLD",7891,1,168,0)
     351"BLD",7883,1,171,0)
    346352 
    347 "BLD",7891,1,169,0)
     353"BLD",7883,1,172,0)
    348354^TMP("C0CCCR","ODIR") must be set manually to the output directory on the
    349 "BLD",7891,1,170,0)
     355"BLD",7883,1,173,0)
    350356Host System. It is intended that this be maintainable in a parameter file.
    351 "BLD",7891,1,171,0)
     357"BLD",7883,1,174,0)
    352358 
    353 "BLD",7891,1,172,0)
     359"BLD",7883,1,175,0)
    354360CCRRPC^C0CCCR and CCDRPC^C0CCCD are intended to be RPC interfaces to the
    355 "BLD",7891,1,173,0)
     361"BLD",7883,1,176,0)
    356362package but there is no entry for them in the RPC table and the RPC
    357 "BLD",7891,1,174,0)
     363"BLD",7883,1,177,0)
    358364method of access has not been tested.
    359 "BLD",7891,1,175,0)
     365"BLD",7883,1,178,0)
    360366 
    361 "BLD",7891,1,176,0)
     367"BLD",7883,1,179,0)
    362368Most of the command line interface functions in the package are intended
    363 "BLD",7891,1,177,0)
     369"BLD",7883,1,180,0)
    364370to also be made available as RPC calls. This will provide the ability to
    365 "BLD",7891,1,178,0)
     371"BLD",7883,1,181,0)
    366372invoke and control batch extraction and analysis via RPCs
    367 "BLD",7891,1,179,0)
     373"BLD",7883,1,182,0)
    368374 
    369 "BLD",7891,1,180,0)
     375"BLD",7883,1,183,0)
    370376The "RIM" variables and attributes that are now being stored in
    371 "BLD",7891,1,181,0)
     377"BLD",7883,1,184,0)
    372378^TMP("C0CRIM") are intended to be maintained in a standard FILEMAN
    373 "BLD",7891,1,182,0)
     379"BLD",7883,1,185,0)
    374380global, and to take advantage of FILEMAN indexing for efficient batch
    375 "BLD",7891,1,183,0)
     381"BLD",7883,1,186,0)
    376382analysis and processing.
    377 "BLD",7891,1,184,0)
     383"BLD",7883,1,187,0)
    378384 
    379 "BLD",7891,1,185,0)
     385"BLD",7883,1,188,0)
    380386It is intended that menu interfaces be provided in addition to command
    381 "BLD",7891,4,0)
     387"BLD",7883,4,0)
    382388^9.64PA^170.9^12
    383 "BLD",7891,4,170,0)
     389"BLD",7883,4,170,0)
    384390170
    385 "BLD",7891,4,170,222)
     391"BLD",7883,4,170,222)
    386392y^y^f^^n^^y^o^n
    387 "BLD",7891,4,170.101,0)
     393"BLD",7883,4,170.101,0)
    388394170.101
    389 "BLD",7891,4,170.101,222)
     395"BLD",7883,4,170.101,222)
    390396y^y^f^^n^^y^o^n
    391 "BLD",7891,4,170.9,0)
     397"BLD",7883,4,170.9,0)
    392398170.9
    393 "BLD",7891,4,170.9,222)
     399"BLD",7883,4,170.9,222)
    394400y^y^f^^n^^y^o^n
    395 "BLD",7891,4,171.101,0)
     401"BLD",7883,4,171.101,0)
    396402171.101
    397 "BLD",7891,4,171.101,222)
     403"BLD",7883,4,171.101,222)
    398404y^y^f^^^^n
    399 "BLD",7891,4,171.401,0)
     405"BLD",7883,4,171.401,0)
    400406171.401
    401 "BLD",7891,4,171.401,222)
     407"BLD",7883,4,171.401,222)
    402408y^y^f^^^^n
    403 "BLD",7891,4,175,0)
     409"BLD",7883,4,175,0)
    404410175
    405 "BLD",7891,4,175,222)
     411"BLD",7883,4,175,222)
    406412y^y^f^^^^n
    407 "BLD",7891,4,176.112,0)
     413"BLD",7883,4,176.112,0)
    408414176.112
    409 "BLD",7891,4,176.112,222)
     415"BLD",7883,4,176.112,222)
    410416y^y^f^^n^^y^o^n
    411 "BLD",7891,4,177.101,0)
     417"BLD",7883,4,177.101,0)
    412418177.101
    413 "BLD",7891,4,177.101,222)
     419"BLD",7883,4,177.101,222)
    414420y^y^f^^^^n
    415 "BLD",7891,4,177.201,0)
     421"BLD",7883,4,177.201,0)
    416422177.201
    417 "BLD",7891,4,177.201,222)
     423"BLD",7883,4,177.201,222)
    418424y^y^f^^n^^y^o^n
    419 "BLD",7891,4,177.301,0)
     425"BLD",7883,4,177.301,0)
    420426177.301
    421 "BLD",7891,4,177.301,222)
     427"BLD",7883,4,177.301,222)
    422428y^y^f^^^^n
    423 "BLD",7891,4,178.101,0)
     429"BLD",7883,4,178.101,0)
    424430178.101
    425 "BLD",7891,4,178.101,222)
     431"BLD",7883,4,178.101,222)
    426432y^y^f^^n^^y^o^n
    427 "BLD",7891,4,178.301,0)
     433"BLD",7883,4,178.301,0)
    428434178.301
    429 "BLD",7891,4,178.301,222)
     435"BLD",7883,4,178.301,222)
    430436y^y^f^^n^^y^o^n
    431 "BLD",7891,4,"B",170,170)
     437"BLD",7883,4,"B",170,170)
    432438
    433 "BLD",7891,4,"B",170.101,170.101)
     439"BLD",7883,4,"B",170.101,170.101)
    434440
    435 "BLD",7891,4,"B",170.9,170.9)
     441"BLD",7883,4,"B",170.9,170.9)
    436442
    437 "BLD",7891,4,"B",171.101,171.101)
     443"BLD",7883,4,"B",171.101,171.101)
    438444
    439 "BLD",7891,4,"B",171.401,171.401)
     445"BLD",7883,4,"B",171.401,171.401)
    440446
    441 "BLD",7891,4,"B",175,175)
     447"BLD",7883,4,"B",175,175)
    442448
    443 "BLD",7891,4,"B",176.112,176.112)
     449"BLD",7883,4,"B",176.112,176.112)
    444450
    445 "BLD",7891,4,"B",177.101,177.101)
     451"BLD",7883,4,"B",177.101,177.101)
    446452
    447 "BLD",7891,4,"B",177.201,177.201)
     453"BLD",7883,4,"B",177.201,177.201)
    448454
    449 "BLD",7891,4,"B",177.301,177.301)
     455"BLD",7883,4,"B",177.301,177.301)
    450456
    451 "BLD",7891,4,"B",178.101,178.101)
     457"BLD",7883,4,"B",178.101,178.101)
    452458
    453 "BLD",7891,4,"B",178.301,178.301)
     459"BLD",7883,4,"B",178.301,178.301)
    454460
    455 "BLD",7891,6.3)
    456 50
    457 "BLD",7891,"ABNS",0)
     461"BLD",7883,6.3)
     46251
     463"BLD",7883,"ABNS",0)
    458464^9.66A^^
    459 "BLD",7891,"ABPKG")
     465"BLD",7883,"ABPKG")
    460466n^n
    461 "BLD",7891,"INI")
     467"BLD",7883,"INI")
    462468PRE^C0CENV
    463 "BLD",7891,"INIT")
     469"BLD",7883,"INIT")
    464470POST^C0CENV
    465 "BLD",7891,"KRN",0)
     471"BLD",7883,"KRN",0)
    466472^9.67PA^779.2^20
    467 "BLD",7891,"KRN",.4,0)
     473"BLD",7883,"KRN",.4,0)
    468474.4
    469 "BLD",7891,"KRN",.401,0)
     475"BLD",7883,"KRN",.401,0)
    470476.401
    471 "BLD",7891,"KRN",.402,0)
     477"BLD",7883,"KRN",.402,0)
    472478.402
    473 "BLD",7891,"KRN",.403,0)
     479"BLD",7883,"KRN",.403,0)
    474480.403
    475 "BLD",7891,"KRN",.5,0)
     481"BLD",7883,"KRN",.5,0)
    476482.5
    477 "BLD",7891,"KRN",.84,0)
     483"BLD",7883,"KRN",.84,0)
    478484.84
    479 "BLD",7891,"KRN",3.6,0)
     485"BLD",7883,"KRN",3.6,0)
    4804863.6
    481 "BLD",7891,"KRN",3.8,0)
     487"BLD",7883,"KRN",3.8,0)
    4824883.8
    483 "BLD",7891,"KRN",9.2,0)
     489"BLD",7883,"KRN",9.2,0)
    4844909.2
    485 "BLD",7891,"KRN",9.8,0)
     491"BLD",7883,"KRN",9.8,0)
    4864929.8
    487 "BLD",7891,"KRN",9.8,"NM",0)
     493"BLD",7883,"KRN",9.8,"NM",0)
    488494^9.68A^110^79
    489 "BLD",7891,"KRN",9.8,"NM",22,0)
    490 C0CRXN^^0^B103277157
    491 "BLD",7891,"KRN",9.8,"NM",23,0)
    492 C0CRNF^^0^B195772222
    493 "BLD",7891,"KRN",9.8,"NM",24,0)
    494 C0CFM1^^0^B27048099
    495 "BLD",7891,"KRN",9.8,"NM",29,0)
    496 C0CPARMS^^0^B10161575
    497 "BLD",7891,"KRN",9.8,"NM",31,0)
    498 C0CFM2^^0^B102195978
    499 "BLD",7891,"KRN",9.8,"NM",34,0)
    500 C0CXPATH^^0^B521207435
    501 "BLD",7891,"KRN",9.8,"NM",35,0)
    502 C0CXPAT0^^0^B50736852
    503 "BLD",7891,"KRN",9.8,"NM",36,0)
    504 C0CVITAL^^0^B319933080
    505 "BLD",7891,"KRN",9.8,"NM",37,0)
    506 C0CUNIT^^0^B43465566
    507 "BLD",7891,"KRN",9.8,"NM",38,0)
    508 C0CRIMA^^0^B331901748
    509 "BLD",7891,"KRN",9.8,"NM",39,0)
    510 C0CPROBS^^0^B53281308
    511 "BLD",7891,"KRN",9.8,"NM",40,0)
    512 C0CLABS^^0^B282604886
    513 "BLD",7891,"KRN",9.8,"NM",41,0)
    514 C0CIMMU^^0^B20441765
    515 "BLD",7891,"KRN",9.8,"NM",42,0)
    516 C0CCCR0^^0^B790419172
    517 "BLD",7891,"KRN",9.8,"NM",43,0)
    518 C0CCCR^^0^B111682825
    519 "BLD",7891,"KRN",9.8,"NM",44,0)
    520 C0CCCD1^^0^B100634737
    521 "BLD",7891,"KRN",9.8,"NM",45,0)
    522 C0CCCD^^0^B114134049
    523 "BLD",7891,"KRN",9.8,"NM",46,0)
    524 C0CALERT^^0^B31627309
    525 "BLD",7891,"KRN",9.8,"NM",47,0)
    526 C0CACTOR^^0^B99733742
    527 "BLD",7891,"KRN",9.8,"NM",48,0)
    528 C0CMED^^0^B18939705
    529 "BLD",7891,"KRN",9.8,"NM",49,0)
    530 C0CMED1^^0^B113570971
    531 "BLD",7891,"KRN",9.8,"NM",50,0)
    532 C0CMED2^^0^B147041837
    533 "BLD",7891,"KRN",9.8,"NM",51,0)
    534 C0CMED3^^0^B172422279
    535 "BLD",7891,"KRN",9.8,"NM",52,0)
    536 C0CMED6^^0^B194349409
    537 "BLD",7891,"KRN",9.8,"NM",53,0)
    538 C0CDPT^^0^B45873061
    539 "BLD",7891,"KRN",9.8,"NM",54,0)
    540 C0CUTIL^^0^B27079469
    541 "BLD",7891,"KRN",9.8,"NM",55,0)
    542 C0CVA200^^0^B32092477
    543 "BLD",7891,"KRN",9.8,"NM",56,0)
    544 C0CSYS^^0^B3933593
    545 "BLD",7891,"KRN",9.8,"NM",57,0)
    546 C0CBAT^^0^B56971574
    547 "BLD",7891,"KRN",9.8,"NM",61,0)
    548 C0CSUB1^^0^B16280924
    549 "BLD",7891,"KRN",9.8,"NM",62,0)
    550 C0CLA7Q^^0^B21818572
    551 "BLD",7891,"KRN",9.8,"NM",63,0)
    552 C0CPROC^^0^B27869918
    553 "BLD",7891,"KRN",9.8,"NM",64,0)
    554 C0CMXP^^0^B77680190
    555 "BLD",7891,"KRN",9.8,"NM",65,0)
    556 C0CMXML^^0^B56456416
    557 "BLD",7891,"KRN",9.8,"NM",66,0)
    558 C0CVIT2^^0^B320700684
    559 "BLD",7891,"KRN",9.8,"NM",67,0)
    560 C0CIM2^^0^B20157375
    561 "BLD",7891,"KRN",9.8,"NM",68,0)
    562 C0CCPT^^0^B16531537
    563 "BLD",7891,"KRN",9.8,"NM",69,0)
    564 C0CSOAP^^0^B79899662
    565 "BLD",7891,"KRN",9.8,"NM",70,0)
    566 C0CENC^^0^B46321144
    567 "BLD",7891,"KRN",9.8,"NM",71,0)
    568 C0CCMT^^0^B6740701
    569 "BLD",7891,"KRN",9.8,"NM",72,0)
    570 C0CIN^^0^B30946883
    571 "BLD",7891,"KRN",9.8,"NM",73,0)
    572 C0CDIC^^0^B43527636
    573 "BLD",7891,"KRN",9.8,"NM",74,0)
    574 C0CDOM^^0^B86773980
    575 "BLD",7891,"KRN",9.8,"NM",75,0)
    576 C0CENV^^0^B25371113
    577 "BLD",7891,"KRN",9.8,"NM",76,0)
    578 C0CEVC^^0^B18388545
    579 "BLD",7891,"KRN",9.8,"NM",77,0)
    580 C0CEWD^^0^B5607678
    581 "BLD",7891,"KRN",9.8,"NM",78,0)
    582 C0CEWD1^^0^B6563070
    583 "BLD",7891,"KRN",9.8,"NM",79,0)
    584 C0CFM3^^0^B68203631
    585 "BLD",7891,"KRN",9.8,"NM",80,0)
    586 C0CLA7DD^^0^B66668579
    587 "BLD",7891,"KRN",9.8,"NM",81,0)
    588 C0CMAIL^^0^B92791623
    589 "BLD",7891,"KRN",9.8,"NM",82,0)
    590 C0CMAIL2^^0^B166788518
    591 "BLD",7891,"KRN",9.8,"NM",83,0)
    592 C0CMAIL3^^0^B224733815
    593 "BLD",7891,"KRN",9.8,"NM",84,0)
    594 C0CMCCD^^0^B73168233
    595 "BLD",7891,"KRN",9.8,"NM",85,0)
    596 C0CMED4^^0^B61058927
    597 "BLD",7891,"KRN",9.8,"NM",86,0)
    598 C0CMIME^^0^B99031395
    599 "BLD",7891,"KRN",9.8,"NM",87,0)
    600 C0CMXMLB^^0^B12065941
    601 "BLD",7891,"KRN",9.8,"NM",88,0)
    602 C0CNHIN^^0^B87973392
    603 "BLD",7891,"KRN",9.8,"NM",89,0)
    604 C0CNMED2^^0^B33217786
    605 "BLD",7891,"KRN",9.8,"NM",90,0)
    606 C0CNMED4^^0^B99762510
    607 "BLD",7891,"KRN",9.8,"NM",91,0)
    608 C0CORSLT^^0^B9647157
    609 "BLD",7891,"KRN",9.8,"NM",92,0)
    610 C0CPXRM^^0^B14904056
    611 "BLD",7891,"KRN",9.8,"NM",93,0)
     495"BLD",7883,"KRN",9.8,"NM",22,0)
     496C0CRXN^^0^B102255510
     497"BLD",7883,"KRN",9.8,"NM",23,0)
     498C0CRNF^^0^B194328331
     499"BLD",7883,"KRN",9.8,"NM",24,0)
     500C0CFM1^^0^B26826658
     501"BLD",7883,"KRN",9.8,"NM",29,0)
     502C0CPARMS^^0^B9948429
     503"BLD",7883,"KRN",9.8,"NM",31,0)
     504C0CFM2^^0^B99587435
     505"BLD",7883,"KRN",9.8,"NM",34,0)
     506C0CXPATH^^0^B518646177
     507"BLD",7883,"KRN",9.8,"NM",35,0)
     508C0CXPAT0^^0^B49945143
     509"BLD",7883,"KRN",9.8,"NM",36,0)
     510C0CVITAL^^0^B314693716
     511"BLD",7883,"KRN",9.8,"NM",37,0)
     512C0CUNIT^^0^B33370246
     513"BLD",7883,"KRN",9.8,"NM",38,0)
     514C0CRIMA^^0^B328577528
     515"BLD",7883,"KRN",9.8,"NM",39,0)
     516C0CPROBS^^0^B51600314
     517"BLD",7883,"KRN",9.8,"NM",40,0)
     518C0CLABS^^0^B279276475
     519"BLD",7883,"KRN",9.8,"NM",41,0)
     520C0CIMMU^^0^B19603373
     521"BLD",7883,"KRN",9.8,"NM",42,0)
     522C0CCCR0^^0^B785598655
     523"BLD",7883,"KRN",9.8,"NM",43,0)
     524C0CCCR^^0^B109879694
     525"BLD",7883,"KRN",9.8,"NM",44,0)
     526C0CCCD1^^0^B96013153
     527"BLD",7883,"KRN",9.8,"NM",45,0)
     528C0CCCD^^0^B89035344
     529"BLD",7883,"KRN",9.8,"NM",46,0)
     530C0CALERT^^0^B31119471
     531"BLD",7883,"KRN",9.8,"NM",47,0)
     532C0CACTOR^^0^B98169360
     533"BLD",7883,"KRN",9.8,"NM",48,0)
     534C0CMED^^0^B18524779
     535"BLD",7883,"KRN",9.8,"NM",49,0)
     536C0CMED1^^0^B112207077
     537"BLD",7883,"KRN",9.8,"NM",50,0)
     538C0CMED2^^0^B145401668
     539"BLD",7883,"KRN",9.8,"NM",51,0)
     540C0CMED3^^0^B170674827
     541"BLD",7883,"KRN",9.8,"NM",52,0)
     542C0CMED6^^0^B192343303
     543"BLD",7883,"KRN",9.8,"NM",53,0)
     544C0CDPT^^0^B46820265
     545"BLD",7883,"KRN",9.8,"NM",54,0)
     546C0CUTIL^^0^B26410609
     547"BLD",7883,"KRN",9.8,"NM",55,0)
     548C0CVA200^^0^B31814686
     549"BLD",7883,"KRN",9.8,"NM",56,0)
     550C0CSYS^^0^B3817459
     551"BLD",7883,"KRN",9.8,"NM",57,0)
     552C0CBAT^^0^B56229594
     553"BLD",7883,"KRN",9.8,"NM",61,0)
     554C0CSUB1^^0^B15609029
     555"BLD",7883,"KRN",9.8,"NM",62,0)
     556C0CLA7Q^^0^B24672517
     557"BLD",7883,"KRN",9.8,"NM",63,0)
     558C0CPROC^^0^B26886546
     559"BLD",7883,"KRN",9.8,"NM",64,0)
     560C0CMXP^^0^B76428333
     561"BLD",7883,"KRN",9.8,"NM",65,0)
     562C0CMXML^^0^B55227178
     563"BLD",7883,"KRN",9.8,"NM",66,0)
     564C0CVIT2^^0^B317310035
     565"BLD",7883,"KRN",9.8,"NM",67,0)
     566C0CIM2^^0^B19669149
     567"BLD",7883,"KRN",9.8,"NM",68,0)
     568C0CCPT^^0^B17485471
     569"BLD",7883,"KRN",9.8,"NM",69,0)
     570C0CSOAP^^0^B79012960
     571"BLD",7883,"KRN",9.8,"NM",70,0)
     572C0CENC^^0^B45258660
     573"BLD",7883,"KRN",9.8,"NM",71,0)
     574C0CCMT^^0^B6559679
     575"BLD",7883,"KRN",9.8,"NM",72,0)
     576C0CIN^^0^B30222275
     577"BLD",7883,"KRN",9.8,"NM",73,0)
     578C0CDIC^^0^B42907516
     579"BLD",7883,"KRN",9.8,"NM",74,0)
     580C0CDOM^^0^B86328529
     581"BLD",7883,"KRN",9.8,"NM",75,0)
     582C0CENV^^0^B28427348
     583"BLD",7883,"KRN",9.8,"NM",76,0)
     584C0CEVC^^0^B21455969
     585"BLD",7883,"KRN",9.8,"NM",77,0)
     586C0CEWD^^0^B5530676
     587"BLD",7883,"KRN",9.8,"NM",78,0)
     588C0CEWD1^^0^B6276162
     589"BLD",7883,"KRN",9.8,"NM",79,0)
     590C0CFM3^^0^B66472582
     591"BLD",7883,"KRN",9.8,"NM",80,0)
     592C0CLA7DD^^0^B72588185
     593"BLD",7883,"KRN",9.8,"NM",81,0)
     594C0CMAIL^^0^B91585320
     595"BLD",7883,"KRN",9.8,"NM",82,0)
     596C0CMAIL2^^0^B165067910
     597"BLD",7883,"KRN",9.8,"NM",83,0)
     598C0CMAIL3^^0^B222669398
     599"BLD",7883,"KRN",9.8,"NM",84,0)
     600C0CMCCD^^0^B71988241
     601"BLD",7883,"KRN",9.8,"NM",85,0)
     602C0CMED4^^0^B60079150
     603"BLD",7883,"KRN",9.8,"NM",86,0)
     604C0CMIME^^0^B97918768
     605"BLD",7883,"KRN",9.8,"NM",87,0)
     606C0CMXMLB^^0^B12346525
     607"BLD",7883,"KRN",9.8,"NM",88,0)
     608C0CNHIN^^0^B87084020
     609"BLD",7883,"KRN",9.8,"NM",89,0)
     610C0CNMED2^^0^B32627824
     611"BLD",7883,"KRN",9.8,"NM",90,0)
     612C0CNMED4^^0^B98251317
     613"BLD",7883,"KRN",9.8,"NM",91,0)
     614C0CORSLT^^0^B9272901
     615"BLD",7883,"KRN",9.8,"NM",92,0)
     616C0CPXRM^^0^B4357
     617"BLD",7883,"KRN",9.8,"NM",93,0)
    612618C0CQRY1^^0^B18992765
    613 "BLD",7891,"KRN",9.8,"NM",94,0)
    614 C0CQRY2^^0^B20465060
    615 "BLD",7891,"KRN",9.8,"NM",95,0)
    616 C0CRNFRP^^0^B91701220
    617 "BLD",7891,"KRN",9.8,"NM",96,0)
    618 C0CRPMS^^0^B16300714
    619 "BLD",7891,"KRN",9.8,"NM",97,0)
    620 C0CRXNRD^^0^B31474664
    621 "BLD",7891,"KRN",9.8,"NM",98,0)
    622 C0CSNOA^^0^B56032588
    623 "BLD",7891,"KRN",9.8,"NM",99,0)
    624 C0CVOBX1^^0^B12947698
    625 "BLD",7891,"KRN",9.8,"NM",100,0)
    626 C0CVORU^^0^B58596883
    627 "BLD",7891,"KRN",9.8,"NM",101,0)
    628 C0CXEWD^^0^B15380480
    629 "BLD",7891,"KRN",9.8,"NM",102,0)
    630 C0COVREL^^0^B18541513
    631 "BLD",7891,"KRN",9.8,"NM",103,0)
    632 C0COVRES^^0^B24677897
    633 "BLD",7891,"KRN",9.8,"NM",104,0)
    634 C0COVREU^^0^B79442187
    635 "BLD",7891,"KRN",9.8,"NM",105,0)
    636 C0CRAHL7^^0^B54192731
    637 "BLD",7891,"KRN",9.8,"NM",106,0)
    638 C0CRARPT^^0^B68379544
    639 "BLD",7891,"KRN",9.8,"NM",107,0)
    640 C0CSQMB^^0^B545540
    641 "BLD",7891,"KRN",9.8,"NM",108,0)
    642 C0CTIU^^0^B62323461
    643 "BLD",7891,"KRN",9.8,"NM",109,0)
    644 C0CTIU1^^0^B10596577
    645 "BLD",7891,"KRN",9.8,"NM",110,0)
    646 C0CVALID^^0^B2856461
    647 "BLD",7891,"KRN",9.8,"NM","B","C0CACTOR",47)
     619"BLD",7883,"KRN",9.8,"NM",94,0)
     620C0CQRY2^^0^B23443412
     621"BLD",7883,"KRN",9.8,"NM",95,0)
     622C0CRNFRP^^0^B90905910
     623"BLD",7883,"KRN",9.8,"NM",96,0)
     624C0CRPMS^^0^B15891746
     625"BLD",7883,"KRN",9.8,"NM",97,0)
     626C0CRXNRD^^0^B36296842
     627"BLD",7883,"KRN",9.8,"NM",98,0)
     628C0CSNOA^^0^B40683034
     629"BLD",7883,"KRN",9.8,"NM",99,0)
     630C0CVOBX1^^0^B14909630
     631"BLD",7883,"KRN",9.8,"NM",100,0)
     632C0CVORU^^0^B63096791
     633"BLD",7883,"KRN",9.8,"NM",101,0)
     634C0CXEWD^^0^B15053974
     635"BLD",7883,"KRN",9.8,"NM",102,0)
     636C0COVREL^^0^B19589538
     637"BLD",7883,"KRN",9.8,"NM",103,0)
     638C0COVRES^^0^B23183700
     639"BLD",7883,"KRN",9.8,"NM",104,0)
     640C0COVREU^^0^B78173648
     641"BLD",7883,"KRN",9.8,"NM",105,0)
     642C0CRAHL7^^0^B46426582
     643"BLD",7883,"KRN",9.8,"NM",106,0)
     644C0CRARPT^^0^B66576750
     645"BLD",7883,"KRN",9.8,"NM",107,0)
     646C0CSQMB^^0^B779536
     647"BLD",7883,"KRN",9.8,"NM",108,0)
     648C0CTIU^^0^B68529284
     649"BLD",7883,"KRN",9.8,"NM",109,0)
     650C0CTIU1^^0^B12758077
     651"BLD",7883,"KRN",9.8,"NM",110,0)
     652C0CVALID^^0^B3624866
     653"BLD",7883,"KRN",9.8,"NM","B","C0CACTOR",47)
    648654
    649 "BLD",7891,"KRN",9.8,"NM","B","C0CALERT",46)
     655"BLD",7883,"KRN",9.8,"NM","B","C0CALERT",46)
    650656
    651 "BLD",7891,"KRN",9.8,"NM","B","C0CBAT",57)
     657"BLD",7883,"KRN",9.8,"NM","B","C0CBAT",57)
    652658
    653 "BLD",7891,"KRN",9.8,"NM","B","C0CCCD",45)
     659"BLD",7883,"KRN",9.8,"NM","B","C0CCCD",45)
    654660
    655 "BLD",7891,"KRN",9.8,"NM","B","C0CCCD1",44)
     661"BLD",7883,"KRN",9.8,"NM","B","C0CCCD1",44)
    656662
    657 "BLD",7891,"KRN",9.8,"NM","B","C0CCCR",43)
     663"BLD",7883,"KRN",9.8,"NM","B","C0CCCR",43)
    658664
    659 "BLD",7891,"KRN",9.8,"NM","B","C0CCCR0",42)
     665"BLD",7883,"KRN",9.8,"NM","B","C0CCCR0",42)
    660666
    661 "BLD",7891,"KRN",9.8,"NM","B","C0CCMT",71)
     667"BLD",7883,"KRN",9.8,"NM","B","C0CCMT",71)
    662668
    663 "BLD",7891,"KRN",9.8,"NM","B","C0CCPT",68)
     669"BLD",7883,"KRN",9.8,"NM","B","C0CCPT",68)
    664670
    665 "BLD",7891,"KRN",9.8,"NM","B","C0CDIC",73)
     671"BLD",7883,"KRN",9.8,"NM","B","C0CDIC",73)
    666672
    667 "BLD",7891,"KRN",9.8,"NM","B","C0CDOM",74)
     673"BLD",7883,"KRN",9.8,"NM","B","C0CDOM",74)
    668674
    669 "BLD",7891,"KRN",9.8,"NM","B","C0CDPT",53)
     675"BLD",7883,"KRN",9.8,"NM","B","C0CDPT",53)
    670676
    671 "BLD",7891,"KRN",9.8,"NM","B","C0CENC",70)
     677"BLD",7883,"KRN",9.8,"NM","B","C0CENC",70)
    672678
    673 "BLD",7891,"KRN",9.8,"NM","B","C0CENV",75)
     679"BLD",7883,"KRN",9.8,"NM","B","C0CENV",75)
    674680
    675 "BLD",7891,"KRN",9.8,"NM","B","C0CEVC",76)
     681"BLD",7883,"KRN",9.8,"NM","B","C0CEVC",76)
    676682
    677 "BLD",7891,"KRN",9.8,"NM","B","C0CEWD",77)
     683"BLD",7883,"KRN",9.8,"NM","B","C0CEWD",77)
    678684
    679 "BLD",7891,"KRN",9.8,"NM","B","C0CEWD1",78)
     685"BLD",7883,"KRN",9.8,"NM","B","C0CEWD1",78)
    680686
    681 "BLD",7891,"KRN",9.8,"NM","B","C0CFM1",24)
     687"BLD",7883,"KRN",9.8,"NM","B","C0CFM1",24)
    682688
    683 "BLD",7891,"KRN",9.8,"NM","B","C0CFM2",31)
     689"BLD",7883,"KRN",9.8,"NM","B","C0CFM2",31)
    684690
    685 "BLD",7891,"KRN",9.8,"NM","B","C0CFM3",79)
     691"BLD",7883,"KRN",9.8,"NM","B","C0CFM3",79)
    686692
    687 "BLD",7891,"KRN",9.8,"NM","B","C0CIM2",67)
     693"BLD",7883,"KRN",9.8,"NM","B","C0CIM2",67)
    688694
    689 "BLD",7891,"KRN",9.8,"NM","B","C0CIMMU",41)
     695"BLD",7883,"KRN",9.8,"NM","B","C0CIMMU",41)
    690696
    691 "BLD",7891,"KRN",9.8,"NM","B","C0CIN",72)
     697"BLD",7883,"KRN",9.8,"NM","B","C0CIN",72)
    692698
    693 "BLD",7891,"KRN",9.8,"NM","B","C0CLA7DD",80)
     699"BLD",7883,"KRN",9.8,"NM","B","C0CLA7DD",80)
    694700
    695 "BLD",7891,"KRN",9.8,"NM","B","C0CLA7Q",62)
     701"BLD",7883,"KRN",9.8,"NM","B","C0CLA7Q",62)
    696702
    697 "BLD",7891,"KRN",9.8,"NM","B","C0CLABS",40)
     703"BLD",7883,"KRN",9.8,"NM","B","C0CLABS",40)
    698704
    699 "BLD",7891,"KRN",9.8,"NM","B","C0CMAIL",81)
     705"BLD",7883,"KRN",9.8,"NM","B","C0CMAIL",81)
    700706
    701 "BLD",7891,"KRN",9.8,"NM","B","C0CMAIL2",82)
     707"BLD",7883,"KRN",9.8,"NM","B","C0CMAIL2",82)
    702708
    703 "BLD",7891,"KRN",9.8,"NM","B","C0CMAIL3",83)
     709"BLD",7883,"KRN",9.8,"NM","B","C0CMAIL3",83)
    704710
    705 "BLD",7891,"KRN",9.8,"NM","B","C0CMCCD",84)
     711"BLD",7883,"KRN",9.8,"NM","B","C0CMCCD",84)
    706712
    707 "BLD",7891,"KRN",9.8,"NM","B","C0CMED",48)
     713"BLD",7883,"KRN",9.8,"NM","B","C0CMED",48)
    708714
    709 "BLD",7891,"KRN",9.8,"NM","B","C0CMED1",49)
     715"BLD",7883,"KRN",9.8,"NM","B","C0CMED1",49)
    710716
    711 "BLD",7891,"KRN",9.8,"NM","B","C0CMED2",50)
     717"BLD",7883,"KRN",9.8,"NM","B","C0CMED2",50)
    712718
    713 "BLD",7891,"KRN",9.8,"NM","B","C0CMED3",51)
     719"BLD",7883,"KRN",9.8,"NM","B","C0CMED3",51)
    714720
    715 "BLD",7891,"KRN",9.8,"NM","B","C0CMED4",85)
     721"BLD",7883,"KRN",9.8,"NM","B","C0CMED4",85)
    716722
    717 "BLD",7891,"KRN",9.8,"NM","B","C0CMED6",52)
     723"BLD",7883,"KRN",9.8,"NM","B","C0CMED6",52)
    718724
    719 "BLD",7891,"KRN",9.8,"NM","B","C0CMIME",86)
     725"BLD",7883,"KRN",9.8,"NM","B","C0CMIME",86)
    720726
    721 "BLD",7891,"KRN",9.8,"NM","B","C0CMXML",65)
     727"BLD",7883,"KRN",9.8,"NM","B","C0CMXML",65)
    722728
    723 "BLD",7891,"KRN",9.8,"NM","B","C0CMXMLB",87)
     729"BLD",7883,"KRN",9.8,"NM","B","C0CMXMLB",87)
    724730
    725 "BLD",7891,"KRN",9.8,"NM","B","C0CMXP",64)
     731"BLD",7883,"KRN",9.8,"NM","B","C0CMXP",64)
    726732
    727 "BLD",7891,"KRN",9.8,"NM","B","C0CNHIN",88)
     733"BLD",7883,"KRN",9.8,"NM","B","C0CNHIN",88)
    728734
    729 "BLD",7891,"KRN",9.8,"NM","B","C0CNMED2",89)
     735"BLD",7883,"KRN",9.8,"NM","B","C0CNMED2",89)
    730736
    731 "BLD",7891,"KRN",9.8,"NM","B","C0CNMED4",90)
     737"BLD",7883,"KRN",9.8,"NM","B","C0CNMED4",90)
    732738
    733 "BLD",7891,"KRN",9.8,"NM","B","C0CORSLT",91)
     739"BLD",7883,"KRN",9.8,"NM","B","C0CORSLT",91)
    734740
    735 "BLD",7891,"KRN",9.8,"NM","B","C0COVREL",102)
     741"BLD",7883,"KRN",9.8,"NM","B","C0COVREL",102)
    736742
    737 "BLD",7891,"KRN",9.8,"NM","B","C0COVRES",103)
     743"BLD",7883,"KRN",9.8,"NM","B","C0COVRES",103)
    738744
    739 "BLD",7891,"KRN",9.8,"NM","B","C0COVREU",104)
     745"BLD",7883,"KRN",9.8,"NM","B","C0COVREU",104)
    740746
    741 "BLD",7891,"KRN",9.8,"NM","B","C0CPARMS",29)
     747"BLD",7883,"KRN",9.8,"NM","B","C0CPARMS",29)
    742748
    743 "BLD",7891,"KRN",9.8,"NM","B","C0CPROBS",39)
     749"BLD",7883,"KRN",9.8,"NM","B","C0CPROBS",39)
    744750
    745 "BLD",7891,"KRN",9.8,"NM","B","C0CPROC",63)
     751"BLD",7883,"KRN",9.8,"NM","B","C0CPROC",63)
    746752
    747 "BLD",7891,"KRN",9.8,"NM","B","C0CPXRM",92)
     753"BLD",7883,"KRN",9.8,"NM","B","C0CPXRM",92)
    748754
    749 "BLD",7891,"KRN",9.8,"NM","B","C0CQRY1",93)
     755"BLD",7883,"KRN",9.8,"NM","B","C0CQRY1",93)
    750756
    751 "BLD",7891,"KRN",9.8,"NM","B","C0CQRY2",94)
     757"BLD",7883,"KRN",9.8,"NM","B","C0CQRY2",94)
    752758
    753 "BLD",7891,"KRN",9.8,"NM","B","C0CRAHL7",105)
     759"BLD",7883,"KRN",9.8,"NM","B","C0CRAHL7",105)
    754760
    755 "BLD",7891,"KRN",9.8,"NM","B","C0CRARPT",106)
     761"BLD",7883,"KRN",9.8,"NM","B","C0CRARPT",106)
    756762
    757 "BLD",7891,"KRN",9.8,"NM","B","C0CRIMA",38)
     763"BLD",7883,"KRN",9.8,"NM","B","C0CRIMA",38)
    758764
    759 "BLD",7891,"KRN",9.8,"NM","B","C0CRNF",23)
     765"BLD",7883,"KRN",9.8,"NM","B","C0CRNF",23)
    760766
    761 "BLD",7891,"KRN",9.8,"NM","B","C0CRNFRP",95)
     767"BLD",7883,"KRN",9.8,"NM","B","C0CRNFRP",95)
    762768
    763 "BLD",7891,"KRN",9.8,"NM","B","C0CRPMS",96)
     769"BLD",7883,"KRN",9.8,"NM","B","C0CRPMS",96)
    764770
    765 "BLD",7891,"KRN",9.8,"NM","B","C0CRXN",22)
     771"BLD",7883,"KRN",9.8,"NM","B","C0CRXN",22)
    766772
    767 "BLD",7891,"KRN",9.8,"NM","B","C0CRXNRD",97)
     773"BLD",7883,"KRN",9.8,"NM","B","C0CRXNRD",97)
    768774
    769 "BLD",7891,"KRN",9.8,"NM","B","C0CSNOA",98)
     775"BLD",7883,"KRN",9.8,"NM","B","C0CSNOA",98)
    770776
    771 "BLD",7891,"KRN",9.8,"NM","B","C0CSOAP",69)
     777"BLD",7883,"KRN",9.8,"NM","B","C0CSOAP",69)
    772778
    773 "BLD",7891,"KRN",9.8,"NM","B","C0CSQMB",107)
     779"BLD",7883,"KRN",9.8,"NM","B","C0CSQMB",107)
    774780
    775 "BLD",7891,"KRN",9.8,"NM","B","C0CSUB1",61)
     781"BLD",7883,"KRN",9.8,"NM","B","C0CSUB1",61)
    776782
    777 "BLD",7891,"KRN",9.8,"NM","B","C0CSYS",56)
     783"BLD",7883,"KRN",9.8,"NM","B","C0CSYS",56)
    778784
    779 "BLD",7891,"KRN",9.8,"NM","B","C0CTIU",108)
     785"BLD",7883,"KRN",9.8,"NM","B","C0CTIU",108)
    780786
    781 "BLD",7891,"KRN",9.8,"NM","B","C0CTIU1",109)
     787"BLD",7883,"KRN",9.8,"NM","B","C0CTIU1",109)
    782788
    783 "BLD",7891,"KRN",9.8,"NM","B","C0CUNIT",37)
     789"BLD",7883,"KRN",9.8,"NM","B","C0CUNIT",37)
    784790
    785 "BLD",7891,"KRN",9.8,"NM","B","C0CUTIL",54)
     791"BLD",7883,"KRN",9.8,"NM","B","C0CUTIL",54)
    786792
    787 "BLD",7891,"KRN",9.8,"NM","B","C0CVA200",55)
     793"BLD",7883,"KRN",9.8,"NM","B","C0CVA200",55)
    788794
    789 "BLD",7891,"KRN",9.8,"NM","B","C0CVALID",110)
     795"BLD",7883,"KRN",9.8,"NM","B","C0CVALID",110)
    790796
    791 "BLD",7891,"KRN",9.8,"NM","B","C0CVIT2",66)
     797"BLD",7883,"KRN",9.8,"NM","B","C0CVIT2",66)
    792798
    793 "BLD",7891,"KRN",9.8,"NM","B","C0CVITAL",36)
     799"BLD",7883,"KRN",9.8,"NM","B","C0CVITAL",36)
    794800
    795 "BLD",7891,"KRN",9.8,"NM","B","C0CVOBX1",99)
     801"BLD",7883,"KRN",9.8,"NM","B","C0CVOBX1",99)
    796802
    797 "BLD",7891,"KRN",9.8,"NM","B","C0CVORU",100)
     803"BLD",7883,"KRN",9.8,"NM","B","C0CVORU",100)
    798804
    799 "BLD",7891,"KRN",9.8,"NM","B","C0CXEWD",101)
     805"BLD",7883,"KRN",9.8,"NM","B","C0CXEWD",101)
    800806
    801 "BLD",7891,"KRN",9.8,"NM","B","C0CXPAT0",35)
     807"BLD",7883,"KRN",9.8,"NM","B","C0CXPAT0",35)
    802808
    803 "BLD",7891,"KRN",9.8,"NM","B","C0CXPATH",34)
     809"BLD",7883,"KRN",9.8,"NM","B","C0CXPATH",34)
    804810
    805 "BLD",7891,"KRN",19,0)
     811"BLD",7883,"KRN",19,0)
    80681219
    807 "BLD",7891,"KRN",19,"NM",0)
     813"BLD",7883,"KRN",19,"NM",0)
    808814^9.68A^10^10
    809 "BLD",7891,"KRN",19,"NM",1,0)
     815"BLD",7883,"KRN",19,"NM",1,0)
    810816C0C BATCH OPTIONS^^0
    811 "BLD",7891,"KRN",19,"NM",2,0)
     817"BLD",7883,"KRN",19,"NM",2,0)
    812818C0C CCR EXPORT BY PATIENT NAME^^0
    813 "BLD",7891,"KRN",19,"NM",3,0)
     819"BLD",7883,"KRN",19,"NM",3,0)
    814820C0C CCR MENU^^0
    815 "BLD",7891,"KRN",19,"NM",4,0)
     821"BLD",7883,"KRN",19,"NM",4,0)
    816822C0C DISPLAY ELEMENTS^^0
    817 "BLD",7891,"KRN",19,"NM",5,0)
     823"BLD",7883,"KRN",19,"NM",5,0)
    818824C0C DISPLAY PATIENT VARIABLES^^0
    819 "BLD",7891,"KRN",19,"NM",6,0)
     825"BLD",7883,"KRN",19,"NM",6,0)
    820826C0C KILL BATCH JOB^^0
    821 "BLD",7891,"KRN",19,"NM",7,0)
     827"BLD",7883,"KRN",19,"NM",7,0)
    822828C0C LIST RIM CATEGORIES^^0
    823 "BLD",7891,"KRN",19,"NM",8,0)
     829"BLD",7883,"KRN",19,"NM",8,0)
    824830C0C START CCR BATCH PROCESSING^^0
    825 "BLD",7891,"KRN",19,"NM",9,0)
     831"BLD",7883,"KRN",19,"NM",9,0)
    826832C0C STATUS OF CCR BATCH^^0
    827 "BLD",7891,"KRN",19,"NM",10,0)
     833"BLD",7883,"KRN",19,"NM",10,0)
    828834C0C CCR RPC^^0
    829 "BLD",7891,"KRN",19,"NM","B","C0C BATCH OPTIONS",1)
     835"BLD",7883,"KRN",19,"NM","B","C0C BATCH OPTIONS",1)
    830836
    831 "BLD",7891,"KRN",19,"NM","B","C0C CCR EXPORT BY PATIENT NAME",2)
     837"BLD",7883,"KRN",19,"NM","B","C0C CCR EXPORT BY PATIENT NAME",2)
    832838
    833 "BLD",7891,"KRN",19,"NM","B","C0C CCR MENU",3)
     839"BLD",7883,"KRN",19,"NM","B","C0C CCR MENU",3)
    834840
    835 "BLD",7891,"KRN",19,"NM","B","C0C CCR RPC",10)
     841"BLD",7883,"KRN",19,"NM","B","C0C CCR RPC",10)
    836842
    837 "BLD",7891,"KRN",19,"NM","B","C0C DISPLAY ELEMENTS",4)
     843"BLD",7883,"KRN",19,"NM","B","C0C DISPLAY ELEMENTS",4)
    838844
    839 "BLD",7891,"KRN",19,"NM","B","C0C DISPLAY PATIENT VARIABLES",5)
     845"BLD",7883,"KRN",19,"NM","B","C0C DISPLAY PATIENT VARIABLES",5)
    840846
    841 "BLD",7891,"KRN",19,"NM","B","C0C KILL BATCH JOB",6)
     847"BLD",7883,"KRN",19,"NM","B","C0C KILL BATCH JOB",6)
    842848
    843 "BLD",7891,"KRN",19,"NM","B","C0C LIST RIM CATEGORIES",7)
     849"BLD",7883,"KRN",19,"NM","B","C0C LIST RIM CATEGORIES",7)
    844850
    845 "BLD",7891,"KRN",19,"NM","B","C0C START CCR BATCH PROCESSING",8)
     851"BLD",7883,"KRN",19,"NM","B","C0C START CCR BATCH PROCESSING",8)
    846852
    847 "BLD",7891,"KRN",19,"NM","B","C0C STATUS OF CCR BATCH",9)
     853"BLD",7883,"KRN",19,"NM","B","C0C STATUS OF CCR BATCH",9)
    848854
    849 "BLD",7891,"KRN",19.1,0)
     855"BLD",7883,"KRN",19.1,0)
    85085619.1
    851 "BLD",7891,"KRN",101,0)
     857"BLD",7883,"KRN",101,0)
    852858101
    853 "BLD",7891,"KRN",409.61,0)
     859"BLD",7883,"KRN",409.61,0)
    854860409.61
    855 "BLD",7891,"KRN",771,0)
     861"BLD",7883,"KRN",771,0)
    856862771
    857 "BLD",7891,"KRN",779.2,0)
     863"BLD",7883,"KRN",779.2,0)
    858864779.2
    859 "BLD",7891,"KRN",870,0)
     865"BLD",7883,"KRN",870,0)
    860866870
    861 "BLD",7891,"KRN",8989.51,0)
     867"BLD",7883,"KRN",8989.51,0)
    8628688989.51
    863 "BLD",7891,"KRN",8989.52,0)
     869"BLD",7883,"KRN",8989.52,0)
    8648708989.52
    865 "BLD",7891,"KRN",8994,0)
     871"BLD",7883,"KRN",8994,0)
    8668728994
    867 "BLD",7891,"KRN",8994,"NM",0)
     873"BLD",7883,"KRN",8994,"NM",0)
    868874^9.68A^1^1
    869 "BLD",7891,"KRN",8994,"NM",1,0)
     875"BLD",7883,"KRN",8994,"NM",1,0)
    870876C0C CCR RPC^^0
    871 "BLD",7891,"KRN",8994,"NM","B","C0C CCR RPC",1)
     877"BLD",7883,"KRN",8994,"NM","B","C0C CCR RPC",1)
    872878
    873 "BLD",7891,"KRN","B",.4,.4)
     879"BLD",7883,"KRN","B",.4,.4)
    874880
    875 "BLD",7891,"KRN","B",.401,.401)
     881"BLD",7883,"KRN","B",.401,.401)
    876882
    877 "BLD",7891,"KRN","B",.402,.402)
     883"BLD",7883,"KRN","B",.402,.402)
    878884
    879 "BLD",7891,"KRN","B",.403,.403)
     885"BLD",7883,"KRN","B",.403,.403)
    880886
    881 "BLD",7891,"KRN","B",.5,.5)
     887"BLD",7883,"KRN","B",.5,.5)
    882888
    883 "BLD",7891,"KRN","B",.84,.84)
     889"BLD",7883,"KRN","B",.84,.84)
    884890
    885 "BLD",7891,"KRN","B",3.6,3.6)
     891"BLD",7883,"KRN","B",3.6,3.6)
    886892
    887 "BLD",7891,"KRN","B",3.8,3.8)
     893"BLD",7883,"KRN","B",3.8,3.8)
    888894
    889 "BLD",7891,"KRN","B",9.2,9.2)
     895"BLD",7883,"KRN","B",9.2,9.2)
    890896
    891 "BLD",7891,"KRN","B",9.8,9.8)
     897"BLD",7883,"KRN","B",9.8,9.8)
    892898
    893 "BLD",7891,"KRN","B",19,19)
     899"BLD",7883,"KRN","B",19,19)
    894900
    895 "BLD",7891,"KRN","B",19.1,19.1)
     901"BLD",7883,"KRN","B",19.1,19.1)
    896902
    897 "BLD",7891,"KRN","B",101,101)
     903"BLD",7883,"KRN","B",101,101)
    898904
    899 "BLD",7891,"KRN","B",409.61,409.61)
     905"BLD",7883,"KRN","B",409.61,409.61)
    900906
    901 "BLD",7891,"KRN","B",771,771)
     907"BLD",7883,"KRN","B",771,771)
    902908
    903 "BLD",7891,"KRN","B",779.2,779.2)
     909"BLD",7883,"KRN","B",779.2,779.2)
    904910
    905 "BLD",7891,"KRN","B",870,870)
     911"BLD",7883,"KRN","B",870,870)
    906912
    907 "BLD",7891,"KRN","B",8989.51,8989.51)
     913"BLD",7883,"KRN","B",8989.51,8989.51)
    908914
    909 "BLD",7891,"KRN","B",8989.52,8989.52)
     915"BLD",7883,"KRN","B",8989.52,8989.52)
    910916
    911 "BLD",7891,"KRN","B",8994,8994)
     917"BLD",7883,"KRN","B",8994,8994)
    912918
    913 "BLD",7891,"PRE")
     919"BLD",7883,"PRE")
    914920C0CENV
    915 "BLD",7891,"QUES",0)
     921"BLD",7883,"QUES",0)
    916922^9.62^^
    917 "BLD",7891,"REQB",0)
     923"BLD",7883,"REQB",0)
    918924^9.611^2^2
    919 "BLD",7891,"REQB",1,0)
     925"BLD",7883,"REQB",1,0)
    920926NHIN 1.0^2
    921 "BLD",7891,"REQB",2,0)
     927"BLD",7883,"REQB",2,0)
    922928NHIN*1.0*1^2
    923 "BLD",7891,"REQB","B","NHIN 1.0",1)
     929"BLD",7883,"REQB","B","NHIN 1.0",1)
    924930
    925 "BLD",7891,"REQB","B","NHIN*1.0*1",2)
     931"BLD",7883,"REQB","B","NHIN*1.0*1",2)
    926932
    927933"DATA",170,1,0)
     
    9034890354S X=DA(1)
    9034990355"KEY",178.101,178.101,"A",0)
    90350 178.101^A^P^558
     90356178.101^A^P^554
    9035190357"KEY",178.101,178.101,"A",2,0)
    9035290358^.312IA^2^2
     
    9035790363"KEYPTR",178.101,178.101,"A")
    9035890364178.101^C
    90359 "KRN",19,10999,-1)
     90365"KRN",19,10988,-1)
    90360903660^9
    90361 "KRN",19,10999,0)
     90367"KRN",19,10988,0)
    9036290368C0C STATUS OF CCR BATCH^STATUS OF CCR BATCH^^I^^^^^^^^
    90363 "KRN",19,10999,30)
     90369"KRN",19,10988,30)
    9036490370C0CB(
    90365 "KRN",19,10999,31)
     90371"KRN",19,10988,31)
    9036690372AEMQ
    90367 "KRN",19,10999,63)
     90373"KRN",19,10988,63)
    9036890374[C
    90369 "KRN",19,10999,80)
     90375"KRN",19,10988,80)
    9037090376C0CB(
    90371 "KRN",19,10999,"U")
     90377"KRN",19,10988,"U")
    9037290378STATUS OF CCR BATCH
    90373 "KRN",19,11000,-1)
     90379"KRN",19,10989,-1)
    90374903800^8
    90375 "KRN",19,11000,0)
     90381"KRN",19,10989,0)
    9037690382C0C START CCR BATCH PROCESSING^BEGIN CCR BATCH PROCESSING^^A^^^^^^^^^^1
    90377 "KRN",19,11000,20)
     90383"KRN",19,10989,20)
    9037890384D START^C0CBAT
    90379 "KRN",19,11000,"U")
     90385"KRN",19,10989,"U")
    9038090386BEGIN CCR BATCH PROCESSING
    90381 "KRN",19,11001,-1)
     90387"KRN",19,10990,-1)
    90382903880^1
    90383 "KRN",19,11001,0)
     90389"KRN",19,10990,0)
    9038490390C0C BATCH OPTIONS^BATCH CCR OPTIONS^^M^^^^^^^^
    90385 "KRN",19,11001,10,0)
     90391"KRN",19,10990,10,0)
    9038690392^19.01IP^3^3
    90387 "KRN",19,11001,10,1,0)
    90388 11000
    90389 "KRN",19,11001,10,1,"^")
     90393"KRN",19,10990,10,1,0)
     9039410989
     90395"KRN",19,10990,10,1,"^")
    9039090396C0C START CCR BATCH PROCESSING
    90391 "KRN",19,11001,10,2,0)
    90392 10999
    90393 "KRN",19,11001,10,2,"^")
     90397"KRN",19,10990,10,2,0)
     9039810988
     90399"KRN",19,10990,10,2,"^")
    9039490400C0C STATUS OF CCR BATCH
    90395 "KRN",19,11001,10,3,0)
    90396 11007
    90397 "KRN",19,11001,10,3,"^")
     90401"KRN",19,10990,10,3,0)
     9040210996
     90403"KRN",19,10990,10,3,"^")
    9039890404C0C KILL BATCH JOB
    90399 "KRN",19,11001,99)
    90400 62633,35113
    90401 "KRN",19,11001,"U")
     90405"KRN",19,10990,99)
     9040662759,57174
     90407"KRN",19,10990,"U")
    9040290408BATCH CCR OPTIONS
    90403 "KRN",19,11002,-1)
     90409"KRN",19,10991,-1)
    90404904100^3
    90405 "KRN",19,11002,0)
     90411"KRN",19,10991,0)
    9040690412C0C CCR MENU^CCR MENU^^M^^^^^^^^
    90407 "KRN",19,11002,10,0)
     90413"KRN",19,10991,10,0)
    9040890414^19.01IP^5^5
    90409 "KRN",19,11002,10,1,0)
    90410 11001
    90411 "KRN",19,11002,10,1,"^")
     90415"KRN",19,10991,10,1,0)
     9041610990
     90417"KRN",19,10991,10,1,"^")
    9041290418C0C BATCH OPTIONS
    90413 "KRN",19,11002,10,2,0)
    90414 11003
    90415 "KRN",19,11002,10,2,"^")
     90419"KRN",19,10991,10,2,0)
     9042010992
     90421"KRN",19,10991,10,2,"^")
    9041690422C0C CCR EXPORT BY PATIENT NAME
    90417 "KRN",19,11002,10,3,0)
    90418 11005
    90419 "KRN",19,11002,10,3,"^")
     90423"KRN",19,10991,10,3,0)
     9042410994
     90425"KRN",19,10991,10,3,"^")
    9042090426C0C DISPLAY ELEMENTS
    90421 "KRN",19,11002,10,4,0)
    90422 11004
    90423 "KRN",19,11002,10,4,"^")
     90427"KRN",19,10991,10,4,0)
     9042810993
     90429"KRN",19,10991,10,4,"^")
    9042490430C0C DISPLAY PATIENT VARIABLES
    90425 "KRN",19,11002,10,5,0)
    90426 11006
    90427 "KRN",19,11002,10,5,"^")
     90431"KRN",19,10991,10,5,0)
     9043210995
     90433"KRN",19,10991,10,5,"^")
    9042890434C0C LIST RIM CATEGORIES
    90429 "KRN",19,11002,99)
    90430 62633,35113
    90431 "KRN",19,11002,"U")
     90435"KRN",19,10991,99)
     9043662759,57174
     90437"KRN",19,10991,"U")
    9043290438CCR MENU
    90433 "KRN",19,11003,-1)
     90439"KRN",19,10992,-1)
    90434904400^2
    90435 "KRN",19,11003,0)
     90441"KRN",19,10992,0)
    9043690442C0C CCR EXPORT BY PATIENT NAME^CCR EXPORT BY PATIENT NAME^^A^^^^^^^^^^1
    90437 "KRN",19,11003,20)
     90443"KRN",19,10992,20)
    9043890444D EXPORT^C0CCCR
    90439 "KRN",19,11003,"U")
     90445"KRN",19,10992,"U")
    9044090446CCR EXPORT BY PATIENT NAME
    90441 "KRN",19,11004,-1)
     90447"KRN",19,10993,-1)
    90442904480^5
    90443 "KRN",19,11004,0)
     90449"KRN",19,10993,0)
    9044490450C0C DISPLAY PATIENT VARIABLES^VARIABLES DISPLAY^^A^^^^^^^^^^1^1^^
    90445 "KRN",19,11004,15)
     90451"KRN",19,10993,15)
    9044690452D DPATV^C0CRIMA($P(Y,U,1))
    90447 "KRN",19,11004,20)
     90453"KRN",19,10993,20)
    9044890454S DIC=2,DIC(0)="AEMQ" D ^DIC I Y<1 Q
    90449 "KRN",19,11004,26)
     90455"KRN",19,10993,26)
    9045090456
    90451 "KRN",19,11004,"U")
     90457"KRN",19,10993,"U")
    9045290458VARIABLES DISPLAY
    90453 "KRN",19,11005,-1)
     90459"KRN",19,10994,-1)
    90454904600^4
    90455 "KRN",19,11005,0)
     90461"KRN",19,10994,0)
    9045690462C0C DISPLAY ELEMENTS^ELEMENT DISPLAY^^I^^^^^^^^^^
    90457 "KRN",19,11005,20)
     90463"KRN",19,10994,20)
    9045890464
    90459 "KRN",19,11005,30)
     90465"KRN",19,10994,30)
    9046090466C0CE(
    90461 "KRN",19,11005,31)
     90467"KRN",19,10994,31)
    9046290468AEMQ
    90463 "KRN",19,11005,63)
     90469"KRN",19,10994,63)
    9046490470[C
    90465 "KRN",19,11005,80)
     90471"KRN",19,10994,80)
    9046690472C0CE(
    90467 "KRN",19,11005,"U")
     90473"KRN",19,10994,"U")
    9046890474ELEMENT DISPLAY
    90469 "KRN",19,11006,-1)
     90475"KRN",19,10995,-1)
    90470904760^7
    90471 "KRN",19,11006,0)
     90477"KRN",19,10995,0)
    9047290478C0C LIST RIM CATEGORIES^LIST RIM CATEGORIES^^A^^^^^^^^^^1
    90473 "KRN",19,11006,20)
     90479"KRN",19,10995,20)
    9047490480D CLIST^C0CRIMA
    90475 "KRN",19,11006,"U")
     90481"KRN",19,10995,"U")
    9047690482LIST RIM CATEGORIES
    90477 "KRN",19,11007,-1)
     90483"KRN",19,10996,-1)
    90478904840^6
    90479 "KRN",19,11007,0)
     90485"KRN",19,10996,0)
    9048090486C0C KILL BATCH JOB^KILL CCR BATCH PROCESSING^^A^^^^^^^^^^1
    90481 "KRN",19,11007,20)
     90487"KRN",19,10996,20)
    9048290488D STOP^C0CBAT
    90483 "KRN",19,11007,"U")
     90489"KRN",19,10996,"U")
    9048490490KILL CCR BATCH PROCESSING
    90485 "KRN",19,11008,-1)
     90491"KRN",19,10997,-1)
    90486904920^10
    90487 "KRN",19,11008,0)
     90493"KRN",19,10997,0)
    9048890494C0C CCR RPC^CCR RPC^^B^^^^^^^^^y
    90489 "KRN",19,11008,"RPC",0)
     90495"KRN",19,10997,"RPC",0)
    9049090496^19.05P^1^1
    90491 "KRN",19,11008,"RPC",1,0)
     90497"KRN",19,10997,"RPC",1,0)
    9049290498C0C CCR RPC
    90493 "KRN",19,11008,"U")
     90499"KRN",19,10997,"U")
    9049490500CCR RPC
    90495 "KRN",8994,2518,-1)
     90501"KRN",8994,2411,-1)
    90496905020^1
    90497 "KRN",8994,2518,0)
     90503"KRN",8994,2411,0)
    9049890504C0C CCR RPC^CCRRPC^C0CCCR^2^P
    90499 "KRN",8994,2518,1,0)
     90505"KRN",8994,2411,1,0)
    9050090506^8994.01^1^1^3090717^^
    90501 "KRN",8994,2518,1,1,0)
     90507"KRN",8994,2411,1,1,0)
    9050290508RPC TO RETURN A PATIENT'S CCR
    90503 "KRN",8994,2518,2,0)
     90509"KRN",8994,2411,2,0)
    9050490510^8994.02A^3^3
    90505 "KRN",8994,2518,2,1,0)
     90511"KRN",8994,2411,2,1,0)
    9050690512DFN^1^30^1^1
    90507 "KRN",8994,2518,2,1,1,0)
     90513"KRN",8994,2411,2,1,1,0)
    9050890514^^1^1^3090707^
    90509 "KRN",8994,2518,2,1,1,1,0)
     90515"KRN",8994,2411,2,1,1,1,0)
    9051090516PATIENT RECORD NUMBER
    90511 "KRN",8994,2518,2,2,0)
     90517"KRN",8994,2411,2,2,0)
    9051290518CCRPARMS^1^200^0^2
    90513 "KRN",8994,2518,2,2,1,0)
     90519"KRN",8994,2411,2,2,1,0)
    9051490520^^1^1^3090707^
    90515 "KRN",8994,2518,2,2,1,1,0)
     90521"KRN",8994,2411,2,2,1,1,0)
    9051690522PARAMETERS TO OVERRIDE DEFAULTS FOR EXTRACTING THE CCR
    90517 "KRN",8994,2518,2,3,0)
     90523"KRN",8994,2411,2,3,0)
    9051890524CCRPART^1^20^^3
    90519 "KRN",8994,2518,2,"B","CCRPARM",2)
     90525"KRN",8994,2411,2,"B","CCRPARM",2)
    9052090526
    90521 "KRN",8994,2518,2,"B","CCRPARMS",2)
     90527"KRN",8994,2411,2,"B","CCRPARMS",2)
    9052290528
    90523 "KRN",8994,2518,2,"B","CCRPART",3)
     90529"KRN",8994,2411,2,"B","CCRPART",3)
    9052490530
    90525 "KRN",8994,2518,2,"B","DFN",1)
     90531"KRN",8994,2411,2,"B","DFN",1)
    9052690532
    90527 "KRN",8994,2518,2,"PARAMSEQ",1,1)
     90533"KRN",8994,2411,2,"PARAMSEQ",1,1)
    9052890534
    90529 "KRN",8994,2518,2,"PARAMSEQ",2,2)
     90535"KRN",8994,2411,2,"PARAMSEQ",2,2)
    9053090536
    90531 "KRN",8994,2518,2,"PARAMSEQ",3,3)
     90537"KRN",8994,2411,2,"PARAMSEQ",3,3)
    9053290538
    9053390539"MBREQ")
     
    9054190547"ORD",18,19,0)
    9054290548OPTION
    90543 "PKG",213,-1)
     90549"PKG",210,-1)
    90544905501^1
    90545 "PKG",213,0)
     90551"PKG",210,0)
    9054690552CCD/CCR GENERATION UTILITIES^C0C^Utilities for the Generation of the CCD/C32/CCR
    90547 "PKG",213,20,0)
     90553"PKG",210,20,0)
    9054890554^9.402P^^
    90549 "PKG",213,22,0)
     90555"PKG",210,22,0)
    9055090556^9.49I^1^1
    90551 "PKG",213,22,1,0)
    90552 1.2^3120625^3120625^8
    90553 "PKG",213,22,1,1,0)
    90554 ^^185^185^3120625
    90555 "PKG",213,22,1,1,1,0)
     90557"PKG",210,22,1,0)
     905581.2^3121030^3121029^8
     90559"PKG",210,22,1,1,0)
     90560^^188^188^3121030
     90561"PKG",210,22,1,1,1,0)
     90562Licensed under AGPL v3. For complete license text, see
     90563"PKG",210,22,1,1,2,0)
     90564http://www.gnu.org/licenses/agpl-3.0.html
     90565"PKG",210,22,1,1,3,0)
     90566 
     90567"PKG",210,22,1,1,4,0)
    9055690568CCR Project release v1.2
    90557 "PKG",213,22,1,1,2,0)
     90569"PKG",210,22,1,1,5,0)
    9055890570 
    90559 "PKG",213,22,1,1,3,0)
     90571"PKG",210,22,1,1,6,0)
    9056090572The purpose of the CCR package is to provide support for exporting and
    90561 "PKG",213,22,1,1,4,0)
     90573"PKG",210,22,1,1,7,0)
    9056290574eventually importing patient information from/to VistA in XML documents
    90563 "PKG",213,22,1,1,5,0)
     90575"PKG",210,22,1,1,8,0)
    9056490576conforming to the Continuity of Care Record (CCR - ASTM) and Continuity
    90565 "PKG",213,22,1,1,6,0)
     90577"PKG",210,22,1,1,9,0)
    9056690578of Care Document (CCD - HL7) standards.
    90567 "PKG",213,22,1,1,7,0)
     90579"PKG",210,22,1,1,10,0)
    9056890580 
    90569 "PKG",213,22,1,1,8,0)
     90581"PKG",210,22,1,1,11,0)
    9057090582This version of the CCR package provides:
    90571 "PKG",213,22,1,1,9,0)
     90583"PKG",210,22,1,1,12,0)
    9057290584 
    90573 "PKG",213,22,1,1,10,0)
     90585"PKG",210,22,1,1,13,0)
    9057490586EXPORT^C0CCCR
    90575 "PKG",213,22,1,1,11,0)
     90587"PKG",210,22,1,1,14,0)
    9057690588A command line interface to export a single patient's CCR to a host
    90577 "PKG",213,22,1,1,12,0)
     90589"PKG",210,22,1,1,15,0)
    9057890590directory by specifying the patient by name.
    90579 "PKG",213,22,1,1,13,0)
     90591"PKG",210,22,1,1,16,0)
    9058090592 
    90581 "PKG",213,22,1,1,14,0)
     90593"PKG",210,22,1,1,17,0)
    9058290594EXPORT^C0CCCD
    90583 "PKG",213,22,1,1,15,0)
     90595"PKG",210,22,1,1,18,0)
    9058490596A command line interface to export a single patient's CCD to a host
    90585 "PKG",213,22,1,1,16,0)
     90597"PKG",210,22,1,1,19,0)
    9058690598directory by specifying the patient by name. As an alternative to
    90587 "PKG",213,22,1,1,17,0)
     90599"PKG",210,22,1,1,20,0)
    9058890600generating the CCD directly, an XSLT transformation is available to
    90589 "PKG",213,22,1,1,18,0)
     90601"PKG",210,22,1,1,21,0)
    9059090602translate a CCR into a level 2 CCD. This tranformation has been tested
    90591 "PKG",213,22,1,1,19,0)
     90603"PKG",210,22,1,1,22,0)
    9059290604and produces a CCD with all currently supported sections of the CCR. The
    90593 "PKG",213,22,1,1,20,0)
     90605"PKG",210,22,1,1,23,0)
    9059490606EXPORT^C0CCCD only extracts the PROBLEMS section into a CCD.
    90595 "PKG",213,22,1,1,21,0)
     90607"PKG",210,22,1,1,24,0)
    9059690608 
    90597 "PKG",213,22,1,1,22,0)
     90609"PKG",210,22,1,1,25,0)
    9059890610XPAT^C0CCCR(DFN,OUTDIR,OUTFILE)
    90599 "PKG",213,22,1,1,23,0)
     90611"PKG",210,22,1,1,26,0)
    9060090612A command line and program interface to export a single patient's CCR
    90601 "PKG",213,22,1,1,24,0)
     90613"PKG",210,22,1,1,27,0)
    9060290614using the IEN of the patient in the ^DPT file (DFN).
    90603 "PKG",213,22,1,1,25,0)
     90615"PKG",210,22,1,1,28,0)
    9060490616OUTDIR specifies an existing directory on the Host system into which the
    90605 "PKG",213,22,1,1,26,0)
     90617"PKG",210,22,1,1,29,0)
    9060690618CCR XML document will be written. If OUTDIR is null (""), the output
    90607 "PKG",213,22,1,1,27,0)
     90619"PKG",210,22,1,1,30,0)
    9060890620directory name will be taken from ^TMP("C0CCCR","ODIR").
    90609 "PKG",213,22,1,1,28,0)
     90621"PKG",210,22,1,1,31,0)
    9061090622OUFILE specifies the host file name of the CCR XML document that will be
    90611 "PKG",213,22,1,1,29,0)
     90623"PKG",210,22,1,1,32,0)
    9061290624written for this patient. If OUTFILE is null ("") the document name will
    90613 "PKG",213,22,1,1,30,0)
     90625"PKG",210,22,1,1,33,0)
    9061490626default to PAT_x_CCR_V1.xml where x is the DFN of the patient.
    90615 "PKG",213,22,1,1,31,0)
     90627"PKG",210,22,1,1,34,0)
    9061690628 
    90617 "PKG",213,22,1,1,32,0)
     90629"PKG",210,22,1,1,35,0)
    9061890630CCRRPC(CCRGRTN,DFN,CCRPARMS,CCRPART)
    90619 "PKG",213,22,1,1,33,0)
     90631"PKG",210,22,1,1,36,0)
    9062090632An RPC and program interface to return in return array CCRGRTN (passed by
    90621 "PKG",213,22,1,1,34,0)
     90633"PKG",210,22,1,1,37,0)
    9062290634reference) a single patient's CCR.
    90623 "PKG",213,22,1,1,35,0)
     90635"PKG",210,22,1,1,38,0)
    9062490636DFN is the patient's IEN
    90625 "PKG",213,22,1,1,36,0)
     90637"PKG",210,22,1,1,39,0)
    9062690638CCRPART is what portion of the CCR should be returned. If "CCR" is
    90627 "PKG",213,22,1,1,37,0)
     90639"PKG",210,22,1,1,40,0)
    9062890640specified, the entire CCR will be returned. If "PROBLEMS", "VITALS", or
    90629 "PKG",213,22,1,1,38,0)
     90641"PKG",210,22,1,1,41,0)
    9063090642"MEDICATIONS" is specified, only that section of the CCR will be returned.
    90631 "PKG",213,22,1,1,39,0)
     90643"PKG",210,22,1,1,42,0)
    9063290644CCRPARMS ARE PARAMETERS THAT AFFECT THE EXTRACTION
    90633 "PKG",213,22,1,1,40,0)
     90645"PKG",210,22,1,1,43,0)
    9063490646IN THE FORM "PARM1:VALUE1^PARM2:VALUE2"
    90635 "PKG",213,22,1,1,41,0)
     90647"PKG",210,22,1,1,44,0)
    9063690648EXAMPLE: "LABLIMIT:T-60" TO LIMIT LAB EXTRACTION TO THE LAST 60 DAYS
    90637 "PKG",213,22,1,1,42,0)
     90649"PKG",210,22,1,1,45,0)
    9063890650SEE C0CPARMS FOR A COMPLETE LIST OF SUPPORTED PARAMETERS
    90639 "PKG",213,22,1,1,43,0)
     90651"PKG",210,22,1,1,46,0)
    9064090652 
    90641 "PKG",213,22,1,1,44,0)
     90653"PKG",210,22,1,1,47,0)
    9064290654ANALYZE^C0CRIMA(BGNDFN,DFNCNT,CCRPARMS)
    90643 "PKG",213,22,1,1,45,0)
     90655"PKG",210,22,1,1,48,0)
    9064490656A command line and program interface to analyze the data from multiple
    90645 "PKG",213,22,1,1,46,0)
     90657"PKG",210,22,1,1,49,0)
    9064690658patients into categories that can be batch extracted.
    90647 "PKG",213,22,1,1,47,0)
     90659"PKG",210,22,1,1,50,0)
    9064890660BGNDFN is the beginning DFN to be analyzed. If BGNDFN is null ("") its
    90649 "PKG",213,22,1,1,48,0)
     90661"PKG",210,22,1,1,51,0)
    9065090662value will be taken from ^TMP("C0CRIM","RESUME"). If this variable does
    90651 "PKG",213,22,1,1,49,0)
     90663"PKG",210,22,1,1,52,0)
    9065290664not exist, the routine will start with the first IEN in the patient file
    90653 "PKG",213,22,1,1,50,0)
     90665"PKG",210,22,1,1,53,0)
    9065490666^DPT. ^TMP("C0CRIM","RESUME") is updated to the "next" patient to be
    90655 "PKG",213,22,1,1,51,0)
     90667"PKG",210,22,1,1,54,0)
    9065690668analyzed on successful completion.
    90657 "PKG",213,22,1,1,52,0)
     90669"PKG",210,22,1,1,55,0)
    9065890670DFNCNT is the count of how many patient records will be analyzed in this
    90659 "PKG",213,22,1,1,53,0)
     90671"PKG",210,22,1,1,56,0)
    9066090672execution.
    90661 "PKG",213,22,1,1,54,0)
     90673"PKG",210,22,1,1,57,0)
    9066290674For example ANALYZE^C0CRIMA(1000,1000) would start at patient DFN 1000
    90663 "PKG",213,22,1,1,55,0)
     90675"PKG",210,22,1,1,58,0)
    9066490676and analyzes 1000 patient records. ANALYZE^C0CRIMA("",1000) would then
    90665 "PKG",213,22,1,1,56,0)
     90677"PKG",210,22,1,1,59,0)
    9066690678analyze the next 1000 patients. When the end of the patient file is
    90667 "PKG",213,22,1,1,57,0)
     90679"PKG",210,22,1,1,60,0)
    9066890680reached, the routine terminates with a message that RESET^C0CRIMA would
    90669 "PKG",213,22,1,1,58,0)
     90681"PKG",210,22,1,1,61,0)
    9067090682need to be called to restart the analysis.
    90671 "PKG",213,22,1,1,59,0)
     90683"PKG",210,22,1,1,62,0)
    9067290684 
    90673 "PKG",213,22,1,1,60,0)
     90685"PKG",210,22,1,1,63,0)
    9067490686The categories into which the records are analyzed consist of attribute
    90675 "PKG",213,22,1,1,61,0)
     90687"PKG",210,22,1,1,64,0)
    9067690688strings. The attributes represent characteristics of the variables that
    90677 "PKG",213,22,1,1,62,0)
     90689"PKG",210,22,1,1,65,0)
    9067890690can be extracted for a given patient into the CCR or the CCD. This
    90679 "PKG",213,22,1,1,63,0)
     90691"PKG",210,22,1,1,66,0)
    9068090692version supports the following attributes:
    90681 "PKG",213,22,1,1,64,0)
     90693"PKG",210,22,1,1,67,0)
    9068290694VITALS : the patient has variables for the VITALS section of the CCR/CCD
    90683 "PKG",213,22,1,1,65,0)
     90695"PKG",210,22,1,1,68,0)
    9068490696PROBLEMS : the patient has variables for the PROBLEMS section of the
    90685 "PKG",213,22,1,1,66,0)
     90697"PKG",210,22,1,1,69,0)
    9068690698CCR/CCD
    90687 "PKG",213,22,1,1,67,0)
     90699"PKG",210,22,1,1,70,0)
    9068890700MEDS : the patient has variables for the MEDICATIONS section of the
    90689 "PKG",213,22,1,1,68,0)
     90701"PKG",210,22,1,1,71,0)
    9069090702CCR/CCD
    90691 "PKG",213,22,1,1,69,0)
     90703"PKG",210,22,1,1,72,0)
    9069290704HEADER : the patient has variables for the HEADER section of the CCR/CCD.
    90693 "PKG",213,22,1,1,70,0)
     90705"PKG",210,22,1,1,73,0)
    9069490706All patients are marked with the HEADER attribute in this version.
    90695 "PKG",213,22,1,1,71,0)
     90707"PKG",210,22,1,1,74,0)
    9069690708NOTEXTRACTED : the CCR or CCD has not yet been produced/extracted for
    90697 "PKG",213,22,1,1,72,0)
     90709"PKG",210,22,1,1,75,0)
    9069890710this patient. All patient records are marked with the NOTEXTRACTED
    90699 "PKG",213,22,1,1,73,0)
     90711"PKG",210,22,1,1,76,0)
    9070090712attribute in this version for batch control processing (not implemented
    90701 "PKG",213,22,1,1,74,0)
     90713"PKG",210,22,1,1,77,0)
    9070290714in this version).
    90703 "PKG",213,22,1,1,75,0)
     90715"PKG",210,22,1,1,78,0)
    9070490716 
    90705 "PKG",213,22,1,1,76,0)
     90717"PKG",210,22,1,1,79,0)
    9070690718ANAZYZE^C0CRIMA calls the variable extraction routines that would be used
    90707 "PKG",213,22,1,1,77,0)
     90719"PKG",210,22,1,1,80,0)
    9070890720to produce a CCR or a CCD and saves the results to ^TMP("C0CRIM",DFN) for
    90709 "PKG",213,22,1,1,78,0)
     90721"PKG",210,22,1,1,81,0)
    9071090722each patient. In addition, the attribute string for each patient is saved
    90711 "PKG",213,22,1,1,79,0)
     90723"PKG",210,22,1,1,82,0)
    9071290724in ^TMP("C0CRIM","ATTR")
    90713 "PKG",213,22,1,1,80,0)
     90725"PKG",210,22,1,1,83,0)
    9071490726 
    90715 "PKG",213,22,1,1,81,0)
     90727"PKG",210,22,1,1,84,0)
    9071690728Categories are created as they first occur based on each unique
    90717 "PKG",213,22,1,1,82,0)
     90729"PKG",210,22,1,1,85,0)
    9071890730combination of attributes that is encountered. They are named after the
    90719 "PKG",213,22,1,1,83,0)
     90731"PKG",210,22,1,1,86,0)
    9072090732attribute table that is used for the analysis. This version supports only
    90721 "PKG",213,22,1,1,84,0)
     90733"PKG",210,22,1,1,87,0)
    9072290734the attribute table .RIMTBL. and the categories are named "RIMTBL_x". An
    90723 "PKG",213,22,1,1,85,0)
     90735"PKG",210,22,1,1,88,0)
    9072490736example set of categories from a demo systems is:
    90725 "PKG",213,22,1,1,86,0)
     90737"PKG",210,22,1,1,89,0)
    9072690738 
    90727 "PKG",213,22,1,1,87,0)
     90739"PKG",210,22,1,1,90,0)
    9072890740GTM>D CLIST^C0CRIMA
    90729 "PKG",213,22,1,1,88,0)
     90741"PKG",210,22,1,1,91,0)
    9073090742(RIMTBL_1:105) ^NOTEXTRACTED^HEADER^^^PROBLEMS^^^^^VITALS^^^^^MEDS
    90731 "PKG",213,22,1,1,89,0)
     90743"PKG",210,22,1,1,92,0)
    9073290744(RIMTBL_2:596) ^NOTEXTRACTED^HEADER^^^^^^^^VITALS
    90733 "PKG",213,22,1,1,90,0)
     90745"PKG",210,22,1,1,93,0)
    9073490746(RIMTBL_3:44) ^NOTEXTRACTED^HEADER^^^PROBLEMS^^^^^VITALS
    90735 "PKG",213,22,1,1,91,0)
     90747"PKG",210,22,1,1,94,0)
    9073690748(RIMTBL_4:821) ^NOTEXTRACTED^HEADER
    90737 "PKG",213,22,1,1,92,0)
     90749"PKG",210,22,1,1,95,0)
    9073890750(RIMTBL_5:18) ^NOTEXTRACTED^HEADER^^^^^^^^VITALS^^^^^MEDS
    90739 "PKG",213,22,1,1,93,0)
     90751"PKG",210,22,1,1,96,0)
    9074090752(RIMTBL_6:14) ^NOTEXTRACTED^HEADER^^^PROBLEMS
    90741 "PKG",213,22,1,1,94,0)
     90753"PKG",210,22,1,1,97,0)
    9074290754(RIMTBL_7:15) ^NOTEXTRACTED^HEADER^^^^^^^^^^^^^MEDS
    90743 "PKG",213,22,1,1,95,0)
     90755"PKG",210,22,1,1,98,0)
    9074490756(RIMTBL_8:5) ^NOTEXTRACTED^HEADER^^^PROBLEMS^^^^^^^^^^MEDS
    90745 "PKG",213,22,1,1,96,0)
     90757"PKG",210,22,1,1,99,0)
    9074690758 
    90747 "PKG",213,22,1,1,97,0)
     90759"PKG",210,22,1,1,100,0)
    9074890760for RIMTBL_1 in this example, 105 is the record count of patients who
    90749 "PKG",213,22,1,1,98,0)
     90761"PKG",210,22,1,1,101,0)
    9075090762have this combination of attributes. The list of patients for each
    90751 "PKG",213,22,1,1,99,0)
     90763"PKG",210,22,1,1,102,0)
    9075290764category is also maintained for batch extraction.
    90753 "PKG",213,22,1,1,100,0)
     90765"PKG",210,22,1,1,103,0)
    9075490766 
    90755 "PKG",213,22,1,1,101,0)
     90767"PKG",210,22,1,1,104,0)
    9075690768CLIST^C0CRIMA
    90757 "PKG",213,22,1,1,102,0)
     90769"PKG",210,22,1,1,105,0)
    9075890770A command line interface to show a summary of the categories, record
    90759 "PKG",213,22,1,1,103,0)
     90771"PKG",210,22,1,1,106,0)
    9076090772counts, and attributes that have been analyzed so far. It produces the
    90761 "PKG",213,22,1,1,104,0)
     90773"PKG",210,22,1,1,107,0)
    9076290774listing in the example above from information stored in
    90763 "PKG",213,22,1,1,105,0)
     90775"PKG",210,22,1,1,108,0)
    9076490776^TMP("C0CRIM","CATS","RIMTBL"). It is intended for future versions that
    90765 "PKG",213,22,1,1,106,0)
     90777"PKG",210,22,1,1,109,0)
    9076690778attribute tables be supported in addition to the default "RIMTBL".
    90767 "PKG",213,22,1,1,107,0)
     90779"PKG",210,22,1,1,110,0)
    9076890780 
    90769 "PKG",213,22,1,1,108,0)
     90781"PKG",210,22,1,1,111,0)
    9077090782CPAT^C0CRIMA(CPATCAT)
    90771 "PKG",213,22,1,1,109,0)
     90783"PKG",210,22,1,1,112,0)
    9077290784A command line interface which shows the DFN numbers of the patients
    90773 "PKG",213,22,1,1,110,0)
     90785"PKG",210,22,1,1,113,0)
    9077490786represented by the category CPATCAT. DFNs are listed 10 per line. For
    90775 "PKG",213,22,1,1,111,0)
     90787"PKG",210,22,1,1,114,0)
    9077690788example:
    90777 "PKG",213,22,1,1,112,0)
     90789"PKG",210,22,1,1,115,0)
    9077890790 
    90779 "PKG",213,22,1,1,113,0)
     90791"PKG",210,22,1,1,116,0)
    9078090792GTM>D CPAT^C0CRIMA("RIMTBL_1")
    90781 "PKG",213,22,1,1,114,0)
     90793"PKG",210,22,1,1,117,0)
    90782907941 3 8 25 42 69 123 140 146 149
    90783 "PKG",213,22,1,1,115,0)
     90795"PKG",210,22,1,1,118,0)
    9078490796151 168 204 205 217 218 224 228 229 231
    90785 "PKG",213,22,1,1,116,0)
     90797"PKG",210,22,1,1,119,0)
    9078690798236 237 240 253 260 267 271 301 347 350
    90787 "PKG",213,22,1,1,117,0)
     90799"PKG",210,22,1,1,120,0)
    9078890800366 379 384 391 407 418 419 420 428 433
    90789 "PKG",213,22,1,1,118,0)
     90801"PKG",210,22,1,1,121,0)
    9079090802442 520 569 600 620 692 706 715 722 723
    90791 "PKG",213,22,1,1,119,0)
     90803"PKG",210,22,1,1,122,0)
    9079290804724 728 730 744 745 746 747 748 749 750
    90793 "PKG",213,22,1,1,120,0)
     90805"PKG",210,22,1,1,123,0)
    9079490806751 752 753 754 755 756 757 758 759 760
    90795 "PKG",213,22,1,1,121,0)
     90807"PKG",210,22,1,1,124,0)
    9079690808761 762 763 764 765 766 767 768 769 770
    90797 "PKG",213,22,1,1,122,0)
     90809"PKG",210,22,1,1,125,0)
    9079890810771 772 773 774 775 776 777 778 779 780
    90799 "PKG",213,22,1,1,123,0)
     90811"PKG",210,22,1,1,126,0)
    9080090812100000 100001 100002 100003 100004 100005 100006 100007 100008 100009
    90801 "PKG",213,22,1,1,124,0)
     90813"PKG",210,22,1,1,127,0)
    9080290814100010 100011 100012 100013 100014
    90803 "PKG",213,22,1,1,125,0)
     90815"PKG",210,22,1,1,128,0)
    9080490816 
    90805 "PKG",213,22,1,1,126,0)
     90817"PKG",210,22,1,1,129,0)
    9080690818These are the 105 patient records included in category "RIMTBL_1" from
    90807 "PKG",213,22,1,1,127,0)
     90819"PKG",210,22,1,1,130,0)
    9080890820the above example.
    90809 "PKG",213,22,1,1,128,0)
     90821"PKG",210,22,1,1,131,0)
    9081090822 
    90811 "PKG",213,22,1,1,129,0)
     90823"PKG",210,22,1,1,132,0)
    9081290824DPATV^C0CRIMA(DFN,"SECTION")
    90813 "PKG",213,22,1,1,130,0)
     90825"PKG",210,22,1,1,133,0)
    9081490826A command line interface to display the values of variables for a
    90815 "PKG",213,22,1,1,131,0)
     90827"PKG",210,22,1,1,134,0)
    9081690828patient. "SECTION" can be any of the CCR sections. ie
    90817 "PKG",213,22,1,1,132,0)
     90829"PKG",210,22,1,1,135,0)
    9081890830"ALERTS","RESULTS","MEDS". If SECTION is ommitted, all sections will be
    90819 "PKG",213,22,1,1,133,0)
     90831"PKG",210,22,1,1,136,0)
    9082090832shown. An example:
    90821 "PKG",213,22,1,1,134,0)
     90833"PKG",210,22,1,1,137,0)
    9082290834 
    90823 "PKG",213,22,1,1,135,0)
     90835"PKG",210,22,1,1,138,0)
    9082490836GTM>D DPATV^C0CRIMA(2,"PROBLEMS")
    90825 "PKG",213,22,1,1,136,0)
     90837"PKG",210,22,1,1,139,0)
    90826908381 1^PROBLEMCODEVALUE^V18.0
    90827 "PKG",213,22,1,1,137,0)
     90839"PKG",210,22,1,1,140,0)
    90828908402 1^PROBLEMCODINGVERSION^
    90829 "PKG",213,22,1,1,138,0)
     90841"PKG",210,22,1,1,141,0)
    90830908423 1^PROBLEMCONDITION^P
    90831 "PKG",213,22,1,1,139,0)
     90843"PKG",210,22,1,1,142,0)
    90832908444 1^PROBLEMDATEMOD^2005-07-19T00:00:00-05:00
    90833 "PKG",213,22,1,1,140,0)
     90845"PKG",210,22,1,1,143,0)
    90834908465 1^PROBLEMDATEOFONSET^1700--T00:00:00-05:00
    90835 "PKG",213,22,1,1,141,0)
     90847"PKG",210,22,1,1,144,0)
    90836908486 1^PROBLEMDESCRIPTION^Family History of Diabetes Mellitus (ICD-9-CM
    90837 "PKG",213,22,1,1,142,0)
     90849"PKG",210,22,1,1,145,0)
    9083890850V18.0)
    90839 "PKG",213,22,1,1,143,0)
     90851"PKG",210,22,1,1,146,0)
    90840908527 1^PROBLEMDTREC^1701--T00:00:00-05:00
    90841 "PKG",213,22,1,1,144,0)
     90853"PKG",210,22,1,1,147,0)
    90842908548 1^PROBLEMHASCMT^
    90843 "PKG",213,22,1,1,145,0)
     90855"PKG",210,22,1,1,148,0)
    90844908569 1^PROBLEMIEN^8
    90845 "PKG",213,22,1,1,146,0)
     90857"PKG",210,22,1,1,149,0)
    908469085810 1^PROBLEMINACT^1700--T00:00:00-05:00
    90847 "PKG",213,22,1,1,147,0)
     90859"PKG",210,22,1,1,150,0)
    9084890860 
    90849 "PKG",213,22,1,1,148,0)
     90861"PKG",210,22,1,1,151,0)
    9085090862DCCR^C0CCCR(DFN)
    90851 "PKG",213,22,1,1,149,0)
     90863"PKG",210,22,1,1,152,0)
    9085290864This will display the XML of a CCR that has been generated for a patient.
    90853 "PKG",213,22,1,1,150,0)
     90865"PKG",210,22,1,1,153,0)
    9085490866It is run after generating the CCR with XPAT^C0CCCR or XCPAT^C0CRIMA.
    90855 "PKG",213,22,1,1,151,0)
     90867"PKG",210,22,1,1,154,0)
    9085690868 
    90857 "PKG",213,22,1,1,152,0)
     90869"PKG",210,22,1,1,155,0)
    9085890870XCPAT^C0CRIMA(CPATCAT)
    90859 "PKG",213,22,1,1,153,0)
     90871"PKG",210,22,1,1,156,0)
    9086090872A command line interface to extract a batch of patient CCR documents that
    90861 "PKG",213,22,1,1,154,0)
     90873"PKG",210,22,1,1,157,0)
    9086290874are associated with the category CPATCAT. For example,
    90863 "PKG",213,22,1,1,155,0)
     90875"PKG",210,22,1,1,158,0)
    9086490876 
    90865 "PKG",213,22,1,1,156,0)
     90877"PKG",210,22,1,1,159,0)
    9086690878XCPAT^C0CRIMA("RIMTBL_1") to extract the CCR documents for the 105
    90867 "PKG",213,22,1,1,157,0)
     90879"PKG",210,22,1,1,160,0)
    9086890880patients in the above example.
    90869 "PKG",213,22,1,1,158,0)
     90881"PKG",210,22,1,1,161,0)
    9087090882 
    90871 "PKG",213,22,1,1,159,0)
     90883"PKG",210,22,1,1,162,0)
    9087290884RESET^C0CRIMA
    90873 "PKG",213,22,1,1,160,0)
     90885"PKG",210,22,1,1,163,0)
    9087490886A command line interface to kill all ANALYZE^C0CRIMA results stored so
    90875 "PKG",213,22,1,1,161,0)
     90887"PKG",210,22,1,1,164,0)
    9087690888far so that the analysis can be done again. It kills
    90877 "PKG",213,22,1,1,162,0)
     90889"PKG",210,22,1,1,165,0)
    9087890890^TMP("C0CRIM","RESUME") and all extraction variables that have been saved
    90879 "PKG",213,22,1,1,163,0)
     90891"PKG",210,22,1,1,166,0)
    9088090892in ^TMP("C0CRIM")
    90881 "PKG",213,22,1,1,164,0)
     90893"PKG",210,22,1,1,167,0)
    9088290894 
    90883 "PKG",213,22,1,1,165,0)
     90895"PKG",210,22,1,1,168,0)
    9088490896NOTES:
    90885 "PKG",213,22,1,1,166,0)
     90897"PKG",210,22,1,1,169,0)
    9088690898This version of the package is a prototype, and does not yet make use of
    90887 "PKG",213,22,1,1,167,0)
     90899"PKG",210,22,1,1,170,0)
    9088890900the standard VistA features that are appropriate for it to use.
    90889 "PKG",213,22,1,1,168,0)
     90901"PKG",210,22,1,1,171,0)
    9089090902 
    90891 "PKG",213,22,1,1,169,0)
     90903"PKG",210,22,1,1,172,0)
    9089290904^TMP("C0CCCR","ODIR") must be set manually to the output directory on the
    90893 "PKG",213,22,1,1,170,0)
     90905"PKG",210,22,1,1,173,0)
    9089490906Host System. It is intended that this be maintainable in a parameter file.
    90895 "PKG",213,22,1,1,171,0)
     90907"PKG",210,22,1,1,174,0)
    9089690908 
    90897 "PKG",213,22,1,1,172,0)
     90909"PKG",210,22,1,1,175,0)
    9089890910CCRRPC^C0CCCR and CCDRPC^C0CCCD are intended to be RPC interfaces to the
    90899 "PKG",213,22,1,1,173,0)
     90911"PKG",210,22,1,1,176,0)
    9090090912package but there is no entry for them in the RPC table and the RPC
    90901 "PKG",213,22,1,1,174,0)
     90913"PKG",210,22,1,1,177,0)
    9090290914method of access has not been tested.
    90903 "PKG",213,22,1,1,175,0)
     90915"PKG",210,22,1,1,178,0)
    9090490916 
    90905 "PKG",213,22,1,1,176,0)
     90917"PKG",210,22,1,1,179,0)
    9090690918Most of the command line interface functions in the package are intended
    90907 "PKG",213,22,1,1,177,0)
     90919"PKG",210,22,1,1,180,0)
    9090890920to also be made available as RPC calls. This will provide the ability to
    90909 "PKG",213,22,1,1,178,0)
     90921"PKG",210,22,1,1,181,0)
    9091090922invoke and control batch extraction and analysis via RPCs
    90911 "PKG",213,22,1,1,179,0)
     90923"PKG",210,22,1,1,182,0)
    9091290924 
    90913 "PKG",213,22,1,1,180,0)
     90925"PKG",210,22,1,1,183,0)
    9091490926The "RIM" variables and attributes that are now being stored in
    90915 "PKG",213,22,1,1,181,0)
     90927"PKG",210,22,1,1,184,0)
    9091690928^TMP("C0CRIM") are intended to be maintained in a standard FILEMAN
    90917 "PKG",213,22,1,1,182,0)
     90929"PKG",210,22,1,1,185,0)
    9091890930global, and to take advantage of FILEMAN indexing for efficient batch
    90919 "PKG",213,22,1,1,183,0)
     90931"PKG",210,22,1,1,186,0)
    9092090932analysis and processing.
    90921 "PKG",213,22,1,1,184,0)
     90933"PKG",210,22,1,1,187,0)
    9092290934 
    90923 "PKG",213,22,1,1,185,0)
     90935"PKG",210,22,1,1,188,0)
    9092490936It is intended that menu interfaces be provided in addition to command
    90925 "PKG",213,"VERSION")
     90937"PKG",210,"VERSION")
    90926909381.2
    9092790939"PRE")
     
    910009101279
    9100191013"RTN","C0CACTOR")
    91002 0^47^B99733742
     910140^47^B98169360
    9100391015"RTN","C0CACTOR",1,0)
    91004 C0CACTOR  ; CCDCCR/GPL - CCR/CCD PROCESSING FOR ACTORS ; 7/3/08
     91016C0CACTOR  ; CCDCCR/GPL - CCR/CCD PROCESSING FOR ACTORS ; 7/3/08 ; 10/29/12 4:04pm
    9100591017"RTN","C0CACTOR",2,0)
    91006  ;;1.2;C0C;;May 11, 2012;Build 50
     91018 ;;1.2;CCD/CCR GENERATION UTILITIES;;Oct 30, 2012;Build 51
    9100791019"RTN","C0CACTOR",3,0)
    9100891020 ;Copyright 2008,2009 George Lilly, University of Minnesota.
    9100991021"RTN","C0CACTOR",4,0)
    91010  ;Licensed under the terms of the GNU General Public License.
     91022 ;
    9101191023"RTN","C0CACTOR",5,0)
    91012  ;See attached copy of the License.
     91024 ; This program is free software: you can redistribute it and/or modify
    9101391025"RTN","C0CACTOR",6,0)
    91014  ;
     91026 ; it under the terms of the GNU Affero General Public License as
    9101591027"RTN","C0CACTOR",7,0)
    91016  ; This program is free software; you can redistribute it and/or modify
     91028 ; published by the Free Software Foundation, either version 3 of the
    9101791029"RTN","C0CACTOR",8,0)
    91018  ; it under the terms of the GNU General Public License as published by
     91030 ; License, or (at your option) any later version.
    9101991031"RTN","C0CACTOR",9,0)
    91020  ; the Free Software Foundation; either version 2 of the License, or
     91032 ;
    9102191033"RTN","C0CACTOR",10,0)
    91022  ; (at your option) any later version.
     91034 ; This program is distributed in the hope that it will be useful,
    9102391035"RTN","C0CACTOR",11,0)
    91024  ;
     91036 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
    9102591037"RTN","C0CACTOR",12,0)
    91026  ; This program is distributed in the hope that it will be useful,
     91038 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    9102791039"RTN","C0CACTOR",13,0)
    91028  ; but WITHOUT ANY WARRANTY; without even the implied warranty of
     91040 ; GNU Affero General Public License for more details.
    9102991041"RTN","C0CACTOR",14,0)
    91030  ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     91042 ;
    9103191043"RTN","C0CACTOR",15,0)
    91032  ; GNU General Public License for more details.
     91044 ; You should have received a copy of the GNU Affero General Public License
    9103391045"RTN","C0CACTOR",16,0)
    91034  ;
     91046 ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    9103591047"RTN","C0CACTOR",17,0)
    91036  ; You should have received a copy of the GNU General Public License along
     91048 ;
    9103791049"RTN","C0CACTOR",18,0)
    91038  ; with this program; if not, write to the Free Software Foundation, Inc.,
     91050 ;  PROCESS THE ACTORS SECTION OF THE CCR
    9103991051"RTN","C0CACTOR",19,0)
    91040  ; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     91052 ;
    9104191053"RTN","C0CACTOR",20,0)
    91042  ;
     91054 ; ===Revision History===
    9104391055"RTN","C0CACTOR",21,0)
    91044  ;  PROCESS THE ACTORS SECTION OF THE CCR
     91056 ; 0.1 Initial Writing of Skeleton--GPL
    9104591057"RTN","C0CACTOR",22,0)
    91046  ;
     91058 ; 0.2 Patient Data Extraction--SMH
    9104791059"RTN","C0CACTOR",23,0)
    91048  ; ===Revision History===
     91060 ; 0.3 Information System Info Extraction--SMH
    9104991061"RTN","C0CACTOR",24,0)
    91050  ; 0.1 Initial Writing of Skeleton--GPL
     91062 ; 0.4 Patient data rouine refactored; adjustments here--SMH
    9105191063"RTN","C0CACTOR",25,0)
    91052  ; 0.2 Patient Data Extraction--SMH
     91064 ;
    9105391065"RTN","C0CACTOR",26,0)
    91054  ; 0.3 Information System Info Extraction--SMH
     91066EXTRACT(IPXML,ALST,AXML) ; EXTRACT ACTOR FROM ALST INTO PROVIDED XML TEMPLATE
    9105591067"RTN","C0CACTOR",27,0)
    91056  ; 0.4 Patient data rouine refactored; adjustments here--SMH
     91068 ; IPXML is the Input Actor Template into which we  substitute values
    9105791069"RTN","C0CACTOR",28,0)
    91058  ;
     91070 ; This is straight XML. Values to be substituted are in @@VAL@@ format.
    9105991071"RTN","C0CACTOR",29,0)
    91060 EXTRACT(IPXML,ALST,AXML) ; EXTRACT ACTOR FROM ALST INTO PROVIDED XML TEMPLATE
     91072 ; ALST is the actor list global generated by ACTLST^C0CCCR and has format:
    9106191073"RTN","C0CACTOR",30,0)
    91062  ; IPXML is the Input Actor Template into which we  substitute values
     91074 ; ^TMP(7542,1,"ACTORS",0)=Count
    9106391075"RTN","C0CACTOR",31,0)
    91064  ; This is straight XML. Values to be substituted are in @@VAL@@ format.
     91076 ; ^TMP(7542,1,"ACTORS",n)="ActorID^ActorType^ActorIEN"
    9106591077"RTN","C0CACTOR",32,0)
    91066  ; ALST is the actor list global generated by ACTLST^C0CCCR and has format:
     91078 ; ActorType is an enum containing either "PROVIDER" "PATIENT" "SYSTEM"
    9106791079"RTN","C0CACTOR",33,0)
    91068  ; ^TMP(7542,1,"ACTORS",0)=Count
     91080 ; AXML is the output arrary, to contain XML.
    9106991081"RTN","C0CACTOR",34,0)
    91070  ; ^TMP(7542,1,"ACTORS",n)="ActorID^ActorType^ActorIEN"
     91082 ;
    9107191083"RTN","C0CACTOR",35,0)
    91072  ; ActorType is an enum containing either "PROVIDER" "PATIENT" "SYSTEM"
     91084 N I,J,AMAP,AOID,ATYP,AIEN
    9107391085"RTN","C0CACTOR",36,0)
    91074  ; AXML is the output arrary, to contain XML.
     91086 D CP^C0CXPATH(IPXML,AXML) ; MAKE A COPY OF ACTORS XML
    9107591087"RTN","C0CACTOR",37,0)
    91076  ;
     91088 D REPLACE^C0CXPATH(AXML,"","//Actors") ; DELETE THE INSIDES
    9107791089"RTN","C0CACTOR",38,0)
    91078  N I,J,AMAP,AOID,ATYP,AIEN
     91090 I DEBUG W "PROCESSING ACTORS ",!
    9107991091"RTN","C0CACTOR",39,0)
    91080  D CP^C0CXPATH(IPXML,AXML) ; MAKE A COPY OF ACTORS XML
     91092 F I=1:1:@ALST@(0) D  ; PROCESS ALL ACTORS IN THE LIST
    9108191093"RTN","C0CACTOR",40,0)
    91082  D REPLACE^C0CXPATH(AXML,"","//Actors") ; DELETE THE INSIDES
     91094 . I @ALST@(I)["@@" Q  ; NOT A VALID ACTOR
    9108391095"RTN","C0CACTOR",41,0)
    91084  I DEBUG W "PROCESSING ACTORS ",!
     91096 . S AOID=$P(@ALST@(I),"^",1) ; ACTOR OBJECT ID
    9108591097"RTN","C0CACTOR",42,0)
    91086  F I=1:1:@ALST@(0) D  ; PROCESS ALL ACTORS IN THE LIST
     91098 . S ATYP=$P(@ALST@(I),"^",2) ; ACTOR TYPE
    9108791099"RTN","C0CACTOR",43,0)
    91088  . I @ALST@(I)["@@" Q  ; NOT A VALID ACTOR
     91100 . S AIEN=$P(@ALST@(I),"^",3) ; ACTOR RECORD NUMBER
    9108991101"RTN","C0CACTOR",44,0)
    91090  . S AOID=$P(@ALST@(I),"^",1) ; ACTOR OBJECT ID
     91102 . I AIEN="" D  Q  ; IEN CAN'T BE NULL
    9109191103"RTN","C0CACTOR",45,0)
    91092  . S ATYP=$P(@ALST@(I),"^",2) ; ACTOR TYPE
     91104 . . W "WARING NUL ACTOR: ",ATYP,!
    9109391105"RTN","C0CACTOR",46,0)
    91094  . S AIEN=$P(@ALST@(I),"^",3) ; ACTOR RECORD NUMBER
     91106 . I ATYP="" Q  ; NOT A VALID ACTOR
    9109591107"RTN","C0CACTOR",47,0)
    91096  . I AIEN="" D  Q  ; IEN CAN'T BE NULL
     91108 . ;
    9109791109"RTN","C0CACTOR",48,0)
    91098  . . W "WARING NUL ACTOR: ",ATYP,!
     91110 . I DEBUG W AOID_" "_ATYP_" "_AIEN,!
    9109991111"RTN","C0CACTOR",49,0)
    91100  . I ATYP="" Q  ; NOT A VALID ACTOR
     91112 . I ATYP="PATIENT" D  ; PATIENT ACTOR TYPE
    9110191113"RTN","C0CACTOR",50,0)
     91114 . . D QUERY^C0CXPATH(IPXML,"//Actors/ACTOR-PATIENT","ATMP")
     91115"RTN","C0CACTOR",51,0)
     91116 . . D PATIENT("ATMP",AIEN,AOID,"ATMP2")
     91117"RTN","C0CACTOR",52,0)
    9110291118 . ;
    91103 "RTN","C0CACTOR",51,0)
    91104  . I DEBUG W AOID_" "_ATYP_" "_AIEN,!
    91105 "RTN","C0CACTOR",52,0)
    91106  . I ATYP="PATIENT" D  ; PATIENT ACTOR TYPE
    9110791119"RTN","C0CACTOR",53,0)
    91108  . . D QUERY^C0CXPATH(IPXML,"//Actors/ACTOR-PATIENT","ATMP")
     91120 . I ATYP="SYSTEM" D  ; SYSTEM ACTOR TYPE
    9110991121"RTN","C0CACTOR",54,0)
    91110  . . D PATIENT("ATMP",AIEN,AOID,"ATMP2")
     91122 . . D QUERY^C0CXPATH(IPXML,"//Actors/ACTOR-SYSTEM","ATMP")
    9111191123"RTN","C0CACTOR",55,0)
     91124 . . D SYSTEM("ATMP",AIEN,AOID,"ATMP2")
     91125"RTN","C0CACTOR",56,0)
    9111291126 . ;
    91113 "RTN","C0CACTOR",56,0)
    91114  . I ATYP="SYSTEM" D  ; SYSTEM ACTOR TYPE
    9111591127"RTN","C0CACTOR",57,0)
    91116  . . D QUERY^C0CXPATH(IPXML,"//Actors/ACTOR-SYSTEM","ATMP")
     91128 . I ATYP="NOK" D  ; NOK ACTOR TYPE
    9111791129"RTN","C0CACTOR",58,0)
    91118  . . D SYSTEM("ATMP",AIEN,AOID,"ATMP2")
     91130 . . D QUERY^C0CXPATH(IPXML,"//Actors/ACTOR-NOK","ATMP")
    9111991131"RTN","C0CACTOR",59,0)
     91132 . . D NOK("ATMP",AIEN,AOID,"ATMP2")
     91133"RTN","C0CACTOR",60,0)
    9112091134 . ;
    91121 "RTN","C0CACTOR",60,0)
    91122  . I ATYP="NOK" D  ; NOK ACTOR TYPE
    9112391135"RTN","C0CACTOR",61,0)
    91124  . . D QUERY^C0CXPATH(IPXML,"//Actors/ACTOR-NOK","ATMP")
     91136 . I ATYP="PROVIDER" D  ; PROVIDER ACTOR TYPE
    9112591137"RTN","C0CACTOR",62,0)
    91126  . . D NOK("ATMP",AIEN,AOID,"ATMP2")
     91138 . . D QUERY^C0CXPATH(IPXML,"//Actors/ACTOR-PROVIDER","ATMP")
    9112791139"RTN","C0CACTOR",63,0)
     91140 . . D PROVIDER("ATMP",AIEN,AOID,"ATMP2")
     91141"RTN","C0CACTOR",64,0)
    9112891142 . ;
    91129 "RTN","C0CACTOR",64,0)
    91130  . I ATYP="PROVIDER" D  ; PROVIDER ACTOR TYPE
    9113191143"RTN","C0CACTOR",65,0)
    91132  . . D QUERY^C0CXPATH(IPXML,"//Actors/ACTOR-PROVIDER","ATMP")
     91144 . I ATYP="ORGANIZATION" D  ; PROVIDER ACTOR TYPE
    9113391145"RTN","C0CACTOR",66,0)
    91134  . . D PROVIDER("ATMP",AIEN,AOID,"ATMP2")
     91146 . . D QUERY^C0CXPATH(IPXML,"//Actors/ACTOR-ORG","ATMP")
    9113591147"RTN","C0CACTOR",67,0)
     91148 . . D ORG("ATMP",AIEN,AOID,"ATMP2")
     91149"RTN","C0CACTOR",68,0)
    9113691150 . ;
    91137 "RTN","C0CACTOR",68,0)
    91138  . I ATYP="ORGANIZATION" D  ; PROVIDER ACTOR TYPE
    9113991151"RTN","C0CACTOR",69,0)
    91140  . . D QUERY^C0CXPATH(IPXML,"//Actors/ACTOR-ORG","ATMP")
     91152 . W "PROCESSING:",ATYP," ",AIEN,!
    9114191153"RTN","C0CACTOR",70,0)
    91142  . . D ORG("ATMP",AIEN,AOID,"ATMP2")
     91154 . ;I @ATMP2@(0)=0 Q  ; NOTHING RETURNED, SKIP THIS ONE
    9114391155"RTN","C0CACTOR",71,0)
    91144  . ;
     91156 . D INSINNER^C0CXPATH(AXML,"ATMP2") ; INSERT INTO ROOT
    9114591157"RTN","C0CACTOR",72,0)
    91146  . W "PROCESSING:",ATYP," ",AIEN,!
     91158 . K ATYP,AIEN,AOID,ATMP,ATMP2 ; BE SURE TO GET THE NEXT ONE
    9114791159"RTN","C0CACTOR",73,0)
    91148  . ;I @ATMP2@(0)=0 Q  ; NOTHING RETURNED, SKIP THIS ONE
     91160 ;
    9114991161"RTN","C0CACTOR",74,0)
    91150  . D INSINNER^C0CXPATH(AXML,"ATMP2") ; INSERT INTO ROOT
     91162 N ACTTMP
    9115191163"RTN","C0CACTOR",75,0)
    91152  . K ATYP,AIEN,AOID,ATMP,ATMP2 ; BE SURE TO GET THE NEXT ONE
     91164 D MISSING^C0CXPATH(AXML,"ACTTMP") ; SEARCH XML FOR MISSING VARS
    9115391165"RTN","C0CACTOR",76,0)
    91154  ;
     91166 I ACTTMP(0)>0  D  ; IF THERE ARE MISSING VARS -
    9115591167"RTN","C0CACTOR",77,0)
    91156  N ACTTMP
     91168 . ; STRINGS MARKED AS @@X@@
    9115791169"RTN","C0CACTOR",78,0)
    91158  D MISSING^C0CXPATH(AXML,"ACTTMP") ; SEARCH XML FOR MISSING VARS
     91170 . W "ACTORS Missing list: ",!
    9115991171"RTN","C0CACTOR",79,0)
    91160  I ACTTMP(0)>0  D  ; IF THERE ARE MISSING VARS -
     91172 . F I=1:1:ACTTMP(0) W ACTTMP(I),!
    9116191173"RTN","C0CACTOR",80,0)
    91162  . ; STRINGS MARKED AS @@X@@
     91174 Q
    9116391175"RTN","C0CACTOR",81,0)
    91164  . W "ACTORS Missing list: ",!
     91176 ;
    9116591177"RTN","C0CACTOR",82,0)
    91166  . F I=1:1:ACTTMP(0) W ACTTMP(I),!
     91178PATIENT(INXML,AIEN,AOID,OUTXML) ; PROCESS A PATIENT ACTOR
    9116791179"RTN","C0CACTOR",83,0)
     91180 I DEBUG W "PROCESSING ACTOR PATIENT ",AIEN,!
     91181"RTN","C0CACTOR",84,0)
     91182 ;GPL SEPARATED EXTRACT FROM MAP FOR PROCESSING PATIENTS - TO MAKE
     91183"RTN","C0CACTOR",85,0)
     91184 ; CODE REUSABLE FROM ERX
     91185"RTN","C0CACTOR",86,0)
     91186 N AMAP
     91187"RTN","C0CACTOR",87,0)
     91188 S AMAP=$NA(^TMP($J,"AMAP"))
     91189"RTN","C0CACTOR",88,0)
     91190 K @AMAP
     91191"RTN","C0CACTOR",89,0)
     91192 D PEXTRACT(AMAP,AIEN,AOID) ;EXTRACT THE PATIENT ACTOR
     91193"RTN","C0CACTOR",90,0)
     91194 I $P($$SITE^VASITE(),U,2)="OROVILLE HOSPITAL" S C0CDE=1
     91195"RTN","C0CACTOR",91,0)
     91196 I $G(C0CDE)'="" D DEIDENT(AMAP,AIEN) ; DEIDENTIFY THE CCR
     91197"RTN","C0CACTOR",92,0)
     91198 D MAP(INXML,AMAP,OUTXML) ;MAP TO XML
     91199"RTN","C0CACTOR",93,0)
     91200 K @AMAP ; CLEAN UP BEHIND US
     91201"RTN","C0CACTOR",94,0)
    9116891202 Q
    91169 "RTN","C0CACTOR",84,0)
    91170  ;
    91171 "RTN","C0CACTOR",85,0)
    91172 PATIENT(INXML,AIEN,AOID,OUTXML) ; PROCESS A PATIENT ACTOR
    91173 "RTN","C0CACTOR",86,0)
    91174  I DEBUG W "PROCESSING ACTOR PATIENT ",AIEN,!
    91175 "RTN","C0CACTOR",87,0)
    91176  ;GPL SEPARATED EXTRACT FROM MAP FOR PROCESSING PATIENTS - TO MAKE
    91177 "RTN","C0CACTOR",88,0)
    91178  ; CODE REUSABLE FROM ERX
    91179 "RTN","C0CACTOR",89,0)
    91180  N AMAP
    91181 "RTN","C0CACTOR",90,0)
    91182  S AMAP=$NA(^TMP($J,"AMAP"))
    91183 "RTN","C0CACTOR",91,0)
    91184  K @AMAP
    91185 "RTN","C0CACTOR",92,0)
    91186  D PEXTRACT(AMAP,AIEN,AOID) ;EXTRACT THE PATIENT ACTOR
    91187 "RTN","C0CACTOR",93,0)
    91188  I $P($$SITE^VASITE(),U,2)="OROVILLE HOSPITAL" S C0CDE=1
    91189 "RTN","C0CACTOR",94,0)
    91190  I $G(C0CDE)'="" D DEIDENT(AMAP,AIEN) ; DEIDENTIFY THE CCR
    9119191203"RTN","C0CACTOR",95,0)
    91192  D MAP(INXML,AMAP,OUTXML) ;MAP TO XML
     91204 ;
    9119391205"RTN","C0CACTOR",96,0)
    91194  K @AMAP ; CLEAN UP BEHIND US
     91206DEIDENT(GPL,ZDFN) ; QUICK WAY TO DEIDENTIFY THE CCR
    9119591207"RTN","C0CACTOR",97,0)
     91208 S @GPL@("ACTORADDRESSCITY")="ALTON"
     91209"RTN","C0CACTOR",98,0)
     91210 S @GPL@("ACTORADDRESSLINE1")="1234 Somewhere Lane"
     91211"RTN","C0CACTOR",99,0)
     91212 S @GPL@("ACTORADDRESSLINE2")=""
     91213"RTN","C0CACTOR",100,0)
     91214 S @GPL@("ACTORADDRESSSOURCEID")="ACTORPATIENT_"_ZDFN
     91215"RTN","C0CACTOR",101,0)
     91216 S @GPL@("ACTORADDRESSSTATE")="KANSAS"
     91217"RTN","C0CACTOR",102,0)
     91218 S @GPL@("ACTORADDRESSTYPE")="Home"
     91219"RTN","C0CACTOR",103,0)
     91220 S @GPL@("ACTORADDRESSZIPCODE")=67623
     91221"RTN","C0CACTOR",104,0)
     91222 S @GPL@("ACTORCELLTEL")=""
     91223"RTN","C0CACTOR",105,0)
     91224 S @GPL@("ACTORCELLTELTEXT")=""
     91225"RTN","C0CACTOR",106,0)
     91226 S @GPL@("ACTORDATEOFBIRTH")="1957-12-25"
     91227"RTN","C0CACTOR",107,0)
     91228 S @GPL@("ACTOREMAIL")=""
     91229"RTN","C0CACTOR",108,0)
     91230 S @GPL@("ACTORFAMILYNAME")="ZZ PATIENT"_ZDFN
     91231"RTN","C0CACTOR",109,0)
     91232 ;S @GPL@("ACTORGENDER")="MALE"
     91233"RTN","C0CACTOR",110,0)
     91234 S @GPL@("ACTORGIVENNAME")="TEST"_ZDFN
     91235"RTN","C0CACTOR",111,0)
     91236 S @GPL@("ACTORIEN")=2
     91237"RTN","C0CACTOR",112,0)
     91238 S @GPL@("ACTORMIDDLENAME")="TWO"
     91239"RTN","C0CACTOR",113,0)
     91240 S @GPL@("ACTOROBJECTID")="ACTORPATIENT_"_ZDFN
     91241"RTN","C0CACTOR",114,0)
     91242 S @GPL@("ACTORRESTEL")="888-555-1212"
     91243"RTN","C0CACTOR",115,0)
     91244 S @GPL@("ACTORRESTELTEXT")="Residential Telephone"
     91245"RTN","C0CACTOR",116,0)
     91246 S @GPL@("ACTORSOURCEID")="ACTORSYSTEM_1"
     91247"RTN","C0CACTOR",117,0)
     91248 S @GPL@("ACTORSSN")="769122557P"
     91249"RTN","C0CACTOR",118,0)
     91250 S @GPL@("ACTORSSNSOURCEID")="ACTORPATIENT_"_ZDFN
     91251"RTN","C0CACTOR",119,0)
     91252 S @GPL@("ACTORSSNTEXT")="SSN"
     91253"RTN","C0CACTOR",120,0)
     91254 S @GPL@("ACTORSUFFIXNAME")=""
     91255"RTN","C0CACTOR",121,0)
     91256 S @GPL@("ACTORWORKTEL")="888-121-1212"
     91257"RTN","C0CACTOR",122,0)
     91258 S @GPL@("ACTORWORKTELTEXT")="Work Telephone"
     91259"RTN","C0CACTOR",123,0)
    9119691260 Q
    91197 "RTN","C0CACTOR",98,0)
    91198  ;
    91199 "RTN","C0CACTOR",99,0)
    91200 DEIDENT(GPL,ZDFN) ; QUICK WAY TO DEIDENTIFY THE CCR
    91201 "RTN","C0CACTOR",100,0)
    91202  S @GPL@("ACTORADDRESSCITY")="ALTON"
    91203 "RTN","C0CACTOR",101,0)
    91204  S @GPL@("ACTORADDRESSLINE1")="1234 Somewhere Lane"
    91205 "RTN","C0CACTOR",102,0)
    91206  S @GPL@("ACTORADDRESSLINE2")=""
    91207 "RTN","C0CACTOR",103,0)
    91208  S @GPL@("ACTORADDRESSSOURCEID")="ACTORPATIENT_"_ZDFN
    91209 "RTN","C0CACTOR",104,0)
    91210  S @GPL@("ACTORADDRESSSTATE")="KANSAS"
    91211 "RTN","C0CACTOR",105,0)
    91212  S @GPL@("ACTORADDRESSTYPE")="Home"
    91213 "RTN","C0CACTOR",106,0)
    91214  S @GPL@("ACTORADDRESSZIPCODE")=67623
    91215 "RTN","C0CACTOR",107,0)
    91216  S @GPL@("ACTORCELLTEL")=""
    91217 "RTN","C0CACTOR",108,0)
    91218  S @GPL@("ACTORCELLTELTEXT")=""
    91219 "RTN","C0CACTOR",109,0)
    91220  S @GPL@("ACTORDATEOFBIRTH")="1957-12-25"
    91221 "RTN","C0CACTOR",110,0)
    91222  S @GPL@("ACTOREMAIL")=""
    91223 "RTN","C0CACTOR",111,0)
    91224  S @GPL@("ACTORFAMILYNAME")="ZZ PATIENT"_ZDFN
    91225 "RTN","C0CACTOR",112,0)
    91226  ;S @GPL@("ACTORGENDER")="MALE"
    91227 "RTN","C0CACTOR",113,0)
    91228  S @GPL@("ACTORGIVENNAME")="TEST"_ZDFN
    91229 "RTN","C0CACTOR",114,0)
    91230  S @GPL@("ACTORIEN")=2
    91231 "RTN","C0CACTOR",115,0)
    91232  S @GPL@("ACTORMIDDLENAME")="TWO"
    91233 "RTN","C0CACTOR",116,0)
    91234  S @GPL@("ACTOROBJECTID")="ACTORPATIENT_"_ZDFN
    91235 "RTN","C0CACTOR",117,0)
    91236  S @GPL@("ACTORRESTEL")="888-555-1212"
    91237 "RTN","C0CACTOR",118,0)
    91238  S @GPL@("ACTORRESTELTEXT")="Residential Telephone"
    91239 "RTN","C0CACTOR",119,0)
    91240  S @GPL@("ACTORSOURCEID")="ACTORSYSTEM_1"
    91241 "RTN","C0CACTOR",120,0)
    91242  S @GPL@("ACTORSSN")="769122557P"
    91243 "RTN","C0CACTOR",121,0)
    91244  S @GPL@("ACTORSSNSOURCEID")="ACTORPATIENT_"_ZDFN
    91245 "RTN","C0CACTOR",122,0)
    91246  S @GPL@("ACTORSSNTEXT")="SSN"
    91247 "RTN","C0CACTOR",123,0)
    91248  S @GPL@("ACTORSUFFIXNAME")=""
    9124991261"RTN","C0CACTOR",124,0)
    91250  S @GPL@("ACTORWORKTEL")="888-121-1212"
     91262 ;
    9125191263"RTN","C0CACTOR",125,0)
    91252  S @GPL@("ACTORWORKTELTEXT")="Work Telephone"
     91264PEXTRACT(AMAP,AIEN,AOID) ; EXTRACT TO RETURN ARRAY RARY PASSED BY NAME
    9125391265"RTN","C0CACTOR",126,0)
     91266 N ZX
     91267"RTN","C0CACTOR",127,0)
     91268 S @AMAP@("ACTOROBJECTID")=AOID ;ACTOR OBJECT ID
     91269"RTN","C0CACTOR",128,0)
     91270 S @AMAP@("ACTORGIVENNAME")=$$GIVEN^C0CDPT(AIEN)
     91271"RTN","C0CACTOR",129,0)
     91272 S @AMAP@("ACTORMIDDLENAME")=$$MIDDLE^C0CDPT(AIEN)
     91273"RTN","C0CACTOR",130,0)
     91274 S @AMAP@("ACTORFAMILYNAME")=$$FAMILY^C0CDPT(AIEN)
     91275"RTN","C0CACTOR",131,0)
     91276 S @AMAP@("ACTORDATEOFBIRTH")=$$DOB^C0CDPT(AIEN)
     91277"RTN","C0CACTOR",132,0)
     91278 S @AMAP@("ACTORGENDER")=$P($$GENDER^C0CDPT(AIEN),U,2)
     91279"RTN","C0CACTOR",133,0)
     91280 S @AMAP@("ACTORGENDERCODE")=$P($$GENDER^C0CDPT(AIEN),U,1)
     91281"RTN","C0CACTOR",134,0)
     91282 S @AMAP@("ACTORSSN")=""
     91283"RTN","C0CACTOR",135,0)
     91284 S @AMAP@("ACTORSSNTEXT")=""
     91285"RTN","C0CACTOR",136,0)
     91286 S @AMAP@("ACTORSSNSOURCEID")=""
     91287"RTN","C0CACTOR",137,0)
     91288 S X="MSCDPTID" ; ROUTINE TO TEST FOR MRN ON OPENVISTA
     91289"RTN","C0CACTOR",138,0)
     91290 X ^%ZOSF("TEST") ; TEST TO SEE IF THE ROUTINE EXISTS
     91291"RTN","C0CACTOR",139,0)
     91292 I $T S MRN=$$^MSCDPTID(DFN) ;TEST FOR MRN ON OPENVISTA ;GPL
     91293"RTN","C0CACTOR",140,0)
     91294 I $G(MRN)'="" D  ; IF MRN IS PRESENT
     91295"RTN","C0CACTOR",141,0)
     91296 . S @AMAP@("ACTORSSN")=MRN
     91297"RTN","C0CACTOR",142,0)
     91298 . S @AMAP@("ACTORSSNTEXT")="MRN"
     91299"RTN","C0CACTOR",143,0)
     91300 . S @AMAP@("ACTORSSNSOURCEID")=AOID
     91301"RTN","C0CACTOR",144,0)
     91302 E  D  ; NO MRN, USE SSN
     91303"RTN","C0CACTOR",145,0)
     91304 . S ZX=$$SSN^C0CDPT(AIEN)
     91305"RTN","C0CACTOR",146,0)
     91306 . I ZX'="" D  ; IF THERE IS A SSN IN THE RECORD
     91307"RTN","C0CACTOR",147,0)
     91308 . . S @AMAP@("ACTORSSN")=ZX
     91309"RTN","C0CACTOR",148,0)
     91310 . . S @AMAP@("ACTORSSNTEXT")="SSN"
     91311"RTN","C0CACTOR",149,0)
     91312 . . S @AMAP@("ACTORSSNSOURCEID")=AOID
     91313"RTN","C0CACTOR",150,0)
     91314 S @AMAP@("ACTORADDRESSTYPE")=$$ADDRTYPE^C0CDPT(AIEN)
     91315"RTN","C0CACTOR",151,0)
     91316 S @AMAP@("ACTORADDRESSLINE1")=$$ADDR1^C0CDPT(AIEN)
     91317"RTN","C0CACTOR",152,0)
     91318 S @AMAP@("ACTORADDRESSLINE2")=$$ADDR2^C0CDPT(AIEN)
     91319"RTN","C0CACTOR",153,0)
     91320 S @AMAP@("ACTORADDRESSCITY")=$$CITY^C0CDPT(AIEN)
     91321"RTN","C0CACTOR",154,0)
     91322 S @AMAP@("ACTORADDRESSSTATE")=$$STATE^C0CDPT(AIEN)
     91323"RTN","C0CACTOR",155,0)
     91324 S @AMAP@("ACTORADDRESSZIPCODE")=$$ZIP^C0CDPT(AIEN)
     91325"RTN","C0CACTOR",156,0)
     91326 S @AMAP@("ACTORRESTEL")=""
     91327"RTN","C0CACTOR",157,0)
     91328 S @AMAP@("ACTORRESTELTEXT")=""
     91329"RTN","C0CACTOR",158,0)
     91330 S ZX=$$RESTEL^C0CDPT(AIEN)
     91331"RTN","C0CACTOR",159,0)
     91332 I ZX'="" D  ; IF THERE IS A RESIDENT PHONE IN THE RECORD
     91333"RTN","C0CACTOR",160,0)
     91334 . S @AMAP@("ACTORRESTEL")=ZX
     91335"RTN","C0CACTOR",161,0)
     91336 . S @AMAP@("ACTORRESTELTEXT")="Residential Telephone"
     91337"RTN","C0CACTOR",162,0)
     91338 S @AMAP@("ACTORWORKTEL")=""
     91339"RTN","C0CACTOR",163,0)
     91340 S @AMAP@("ACTORWORKTELTEXT")=""
     91341"RTN","C0CACTOR",164,0)
     91342 S ZX=$$WORKTEL^C0CDPT(AIEN)
     91343"RTN","C0CACTOR",165,0)
     91344 I ZX'="" D  ; IF THERE IS A RESIDENT PHONE IN THE RECORD
     91345"RTN","C0CACTOR",166,0)
     91346 . S @AMAP@("ACTORWORKTEL")=ZX
     91347"RTN","C0CACTOR",167,0)
     91348 . S @AMAP@("ACTORWORKTELTEXT")="Work Telephone"
     91349"RTN","C0CACTOR",168,0)
     91350 S @AMAP@("ACTORCELLTEL")=""
     91351"RTN","C0CACTOR",169,0)
     91352 S @AMAP@("ACTORCELLTELTEXT")=""
     91353"RTN","C0CACTOR",170,0)
     91354 S ZX=$$CELLTEL^C0CDPT(AIEN)
     91355"RTN","C0CACTOR",171,0)
     91356 I ZX'="" D  ; IF THERE IS A CELL PHONE IN THE RECORD
     91357"RTN","C0CACTOR",172,0)
     91358 . S @AMAP@("ACTORCELLTEL")=ZX
     91359"RTN","C0CACTOR",173,0)
     91360 . S @AMAP@("ACTORCELLTELTEXT")="Cell Phone"
     91361"RTN","C0CACTOR",174,0)
     91362 S @AMAP@("ACTOREMAIL")=$$EMAIL^C0CDPT(AIEN)
     91363"RTN","C0CACTOR",175,0)
     91364 S @AMAP@("ACTORADDRESSSOURCEID")=AOID
     91365"RTN","C0CACTOR",176,0)
     91366 S @AMAP@("ACTORIEN")=AIEN
     91367"RTN","C0CACTOR",177,0)
     91368 S @AMAP@("ACTORSUFFIXNAME")="" ; DOES VISTA STORE THE SUFFIX
     91369"RTN","C0CACTOR",178,0)
     91370 S @AMAP@("ACTORSOURCEID")="ACTORSYSTEM_1" ; THE SYSTEM IS THE SOURCE
     91371"RTN","C0CACTOR",179,0)
    9125491372 Q
    91255 "RTN","C0CACTOR",127,0)
    91256  ;
    91257 "RTN","C0CACTOR",128,0)
    91258 PEXTRACT(AMAP,AIEN,AOID) ; EXTRACT TO RETURN ARRAY RARY PASSED BY NAME
    91259 "RTN","C0CACTOR",129,0)
    91260  N ZX
    91261 "RTN","C0CACTOR",130,0)
    91262  S @AMAP@("ACTOROBJECTID")=AOID ;ACTOR OBJECT ID
    91263 "RTN","C0CACTOR",131,0)
    91264  S @AMAP@("ACTORGIVENNAME")=$$GIVEN^C0CDPT(AIEN)
    91265 "RTN","C0CACTOR",132,0)
    91266  S @AMAP@("ACTORMIDDLENAME")=$$MIDDLE^C0CDPT(AIEN)
    91267 "RTN","C0CACTOR",133,0)
    91268  S @AMAP@("ACTORFAMILYNAME")=$$FAMILY^C0CDPT(AIEN)
    91269 "RTN","C0CACTOR",134,0)
    91270  S @AMAP@("ACTORDATEOFBIRTH")=$$DOB^C0CDPT(AIEN)
    91271 "RTN","C0CACTOR",135,0)
    91272  S @AMAP@("ACTORGENDER")=$P($$GENDER^C0CDPT(AIEN),U,2)
    91273 "RTN","C0CACTOR",136,0)
    91274  S @AMAP@("ACTORGENDERCODE")=$P($$GENDER^C0CDPT(AIEN),U,1)
    91275 "RTN","C0CACTOR",137,0)
    91276  S @AMAP@("ACTORSSN")=""
    91277 "RTN","C0CACTOR",138,0)
    91278  S @AMAP@("ACTORSSNTEXT")=""
    91279 "RTN","C0CACTOR",139,0)
    91280  S @AMAP@("ACTORSSNSOURCEID")=""
    91281 "RTN","C0CACTOR",140,0)
    91282  S X="MSCDPTID" ; ROUTINE TO TEST FOR MRN ON OPENVISTA
    91283 "RTN","C0CACTOR",141,0)
    91284  X ^%ZOSF("TEST") ; TEST TO SEE IF THE ROUTINE EXISTS
    91285 "RTN","C0CACTOR",142,0)
    91286  I $T S MRN=$$^MSCDPTID(DFN) ;TEST FOR MRN ON OPENVISTA ;GPL
    91287 "RTN","C0CACTOR",143,0)
    91288  I $G(MRN)'="" D  ; IF MRN IS PRESENT
    91289 "RTN","C0CACTOR",144,0)
    91290  . S @AMAP@("ACTORSSN")=MRN
    91291 "RTN","C0CACTOR",145,0)
    91292  . S @AMAP@("ACTORSSNTEXT")="MRN"
    91293 "RTN","C0CACTOR",146,0)
    91294  . S @AMAP@("ACTORSSNSOURCEID")=AOID
    91295 "RTN","C0CACTOR",147,0)
    91296  E  D  ; NO MRN, USE SSN
    91297 "RTN","C0CACTOR",148,0)
    91298  . S ZX=$$SSN^C0CDPT(AIEN)
    91299 "RTN","C0CACTOR",149,0)
    91300  . I ZX'="" D  ; IF THERE IS A SSN IN THE RECORD
    91301 "RTN","C0CACTOR",150,0)
    91302  . . S @AMAP@("ACTORSSN")=ZX
    91303 "RTN","C0CACTOR",151,0)
    91304  . . S @AMAP@("ACTORSSNTEXT")="SSN"
    91305 "RTN","C0CACTOR",152,0)
    91306  . . S @AMAP@("ACTORSSNSOURCEID")=AOID
    91307 "RTN","C0CACTOR",153,0)
    91308  S @AMAP@("ACTORADDRESSTYPE")=$$ADDRTYPE^C0CDPT(AIEN)
    91309 "RTN","C0CACTOR",154,0)
    91310  S @AMAP@("ACTORADDRESSLINE1")=$$ADDR1^C0CDPT(AIEN)
    91311 "RTN","C0CACTOR",155,0)
    91312  S @AMAP@("ACTORADDRESSLINE2")=$$ADDR2^C0CDPT(AIEN)
    91313 "RTN","C0CACTOR",156,0)
    91314  S @AMAP@("ACTORADDRESSCITY")=$$CITY^C0CDPT(AIEN)
    91315 "RTN","C0CACTOR",157,0)
    91316  S @AMAP@("ACTORADDRESSSTATE")=$$STATE^C0CDPT(AIEN)
    91317 "RTN","C0CACTOR",158,0)
    91318  S @AMAP@("ACTORADDRESSZIPCODE")=$$ZIP^C0CDPT(AIEN)
    91319 "RTN","C0CACTOR",159,0)
    91320  S @AMAP@("ACTORRESTEL")=""
    91321 "RTN","C0CACTOR",160,0)
    91322  S @AMAP@("ACTORRESTELTEXT")=""
    91323 "RTN","C0CACTOR",161,0)
    91324  S ZX=$$RESTEL^C0CDPT(AIEN)
    91325 "RTN","C0CACTOR",162,0)
    91326  I ZX'="" D  ; IF THERE IS A RESIDENT PHONE IN THE RECORD
    91327 "RTN","C0CACTOR",163,0)
    91328  . S @AMAP@("ACTORRESTEL")=ZX
    91329 "RTN","C0CACTOR",164,0)
    91330  . S @AMAP@("ACTORRESTELTEXT")="Residential Telephone"
    91331 "RTN","C0CACTOR",165,0)
    91332  S @AMAP@("ACTORWORKTEL")=""
    91333 "RTN","C0CACTOR",166,0)
    91334  S @AMAP@("ACTORWORKTELTEXT")=""
    91335 "RTN","C0CACTOR",167,0)
    91336  S ZX=$$WORKTEL^C0CDPT(AIEN)
    91337 "RTN","C0CACTOR",168,0)
    91338  I ZX'="" D  ; IF THERE IS A RESIDENT PHONE IN THE RECORD
    91339 "RTN","C0CACTOR",169,0)
    91340  . S @AMAP@("ACTORWORKTEL")=ZX
    91341 "RTN","C0CACTOR",170,0)
    91342  . S @AMAP@("ACTORWORKTELTEXT")="Work Telephone"
    91343 "RTN","C0CACTOR",171,0)
    91344  S @AMAP@("ACTORCELLTEL")=""
    91345 "RTN","C0CACTOR",172,0)
    91346  S @AMAP@("ACTORCELLTELTEXT")=""
    91347 "RTN","C0CACTOR",173,0)
    91348  S ZX=$$CELLTEL^C0CDPT(AIEN)
    91349 "RTN","C0CACTOR",174,0)
    91350  I ZX'="" D  ; IF THERE IS A CELL PHONE IN THE RECORD
    91351 "RTN","C0CACTOR",175,0)
    91352  . S @AMAP@("ACTORCELLTEL")=ZX
    91353 "RTN","C0CACTOR",176,0)
    91354  . S @AMAP@("ACTORCELLTELTEXT")="Cell Phone"
    91355 "RTN","C0CACTOR",177,0)
    91356  S @AMAP@("ACTOREMAIL")=$$EMAIL^C0CDPT(AIEN)
    91357 "RTN","C0CACTOR",178,0)
    91358  S @AMAP@("ACTORADDRESSSOURCEID")=AOID
    91359 "RTN","C0CACTOR",179,0)
    91360  S @AMAP@("ACTORIEN")=AIEN
    9136191373"RTN","C0CACTOR",180,0)
    91362  S @AMAP@("ACTORSUFFIXNAME")="" ; DOES VISTA STORE THE SUFFIX
     91374 ;
    9136391375"RTN","C0CACTOR",181,0)
    91364  S @AMAP@("ACTORSOURCEID")="ACTORSYSTEM_1" ; THE SYSTEM IS THE SOURCE
     91376MAP(INXML,AMAP,OUTXML) ;MAP ANY ACTOR TO XML
    9136591377"RTN","C0CACTOR",182,0)
     91378 D MAP^C0CXPATH(INXML,AMAP,OUTXML) ; MAP THE VARIABLE
     91379"RTN","C0CACTOR",183,0)
    9136691380 Q
    91367 "RTN","C0CACTOR",183,0)
    91368  ;
    9136991381"RTN","C0CACTOR",184,0)
    91370 MAP(INXML,AMAP,OUTXML) ;MAP ANY ACTOR TO XML
     91382 ;
    9137191383"RTN","C0CACTOR",185,0)
    91372  D MAP^C0CXPATH(INXML,AMAP,OUTXML) ; MAP THE VARIABLE
     91384SYSTEM(INXML,AIEN,AOID,OUTXML) ; PROCESS A SYSTEM ACTOR
    9137391385"RTN","C0CACTOR",186,0)
    91374  Q
     91386     ;
    9137591387"RTN","C0CACTOR",187,0)
    91376  ;
     91388     ; N AMAP
    9137791389"RTN","C0CACTOR",188,0)
    91378 SYSTEM(INXML,AIEN,AOID,OUTXML) ; PROCESS A SYSTEM ACTOR
     91390     S AMAP=$NA(^TMP($J,"AMAP"))
    9137991391"RTN","C0CACTOR",189,0)
     91392     K @AMAP
     91393"RTN","C0CACTOR",190,0)
     91394     S @AMAP@("ACTOROBJECTID")=AOID ;ACTOR OBJECT ID
     91395"RTN","C0CACTOR",191,0)
     91396     S @AMAP@("ACTORINFOSYSNAME")=$$SYSNAME^C0CSYS
     91397"RTN","C0CACTOR",192,0)
     91398     S @AMAP@("ACTORINFOSYSVER")=$$SYSVER^C0CSYS
     91399"RTN","C0CACTOR",193,0)
     91400     S @AMAP@("ACTORINFOSYSSOURCEID")=AOID
     91401"RTN","C0CACTOR",194,0)
     91402     D MAP^C0CXPATH(INXML,AMAP,OUTXML) ; MAP THE VARIABLE
     91403"RTN","C0CACTOR",195,0)
     91404     Q
     91405"RTN","C0CACTOR",196,0)
    9138091406     ;
    91381 "RTN","C0CACTOR",190,0)
     91407"RTN","C0CACTOR",197,0)
     91408NOK(INXML,AIEN,AOID,OUTXML) ; PROCESS A NEXT OF KIN TYPE ACTOR
     91409"RTN","C0CACTOR",198,0)
     91410     ;
     91411"RTN","C0CACTOR",199,0)
    9138291412     ; N AMAP
    91383 "RTN","C0CACTOR",191,0)
     91413"RTN","C0CACTOR",200,0)
    9138491414     S AMAP=$NA(^TMP($J,"AMAP"))
    91385 "RTN","C0CACTOR",192,0)
     91415"RTN","C0CACTOR",201,0)
    9138691416     K @AMAP
    91387 "RTN","C0CACTOR",193,0)
     91417"RTN","C0CACTOR",202,0)
    9138891418     S @AMAP@("ACTOROBJECTID")=AOID ;ACTOR OBJECT ID
    91389 "RTN","C0CACTOR",194,0)
    91390      S @AMAP@("ACTORINFOSYSNAME")=$$SYSNAME^C0CSYS
    91391 "RTN","C0CACTOR",195,0)
    91392      S @AMAP@("ACTORINFOSYSVER")=$$SYSVER^C0CSYS
    91393 "RTN","C0CACTOR",196,0)
    91394      S @AMAP@("ACTORINFOSYSSOURCEID")=AOID
    91395 "RTN","C0CACTOR",197,0)
     91419"RTN","C0CACTOR",203,0)
     91420     S @AMAP@("ACTORDISPLAYNAME")=""
     91421"RTN","C0CACTOR",204,0)
     91422     S @AMAP@("ACTORRELATION")=""
     91423"RTN","C0CACTOR",205,0)
     91424     S @AMAP@("ACTORRELATIONSOURCEID")=""
     91425"RTN","C0CACTOR",206,0)
     91426     S @AMAP@("ACTORSOURCEID")="ACTORSYSTEM_1" ; THE SYSTEM IS THE SOURCE
     91427"RTN","C0CACTOR",207,0)
    9139691428     D MAP^C0CXPATH(INXML,AMAP,OUTXML) ; MAP THE VARIABLE
    91397 "RTN","C0CACTOR",198,0)
     91429"RTN","C0CACTOR",208,0)
    9139891430     Q
    91399 "RTN","C0CACTOR",199,0)
     91431"RTN","C0CACTOR",209,0)
    9140091432     ;
    91401 "RTN","C0CACTOR",200,0)
    91402 NOK(INXML,AIEN,AOID,OUTXML) ; PROCESS A NEXT OF KIN TYPE ACTOR
    91403 "RTN","C0CACTOR",201,0)
     91433"RTN","C0CACTOR",210,0)
     91434ORG(INXML,AIEN,AOID,OUTXML) ; PROCESS AN ORGANIZATION TYPE ACTOR
     91435"RTN","C0CACTOR",211,0)
    9140491436     ;
    91405 "RTN","C0CACTOR",202,0)
     91437"RTN","C0CACTOR",212,0)
     91438     N AMAP,ZIEN,ZSITE
     91439"RTN","C0CACTOR",213,0)
     91440     S AMAP=$NA(^TMP($J,"AMAP"))
     91441"RTN","C0CACTOR",214,0)
     91442     K @AMAP
     91443"RTN","C0CACTOR",215,0)
     91444     S @AMAP@("ACTOROBJECTID")=AOID ;ACTOR OBJECT ID
     91445"RTN","C0CACTOR",216,0)
     91446     S ZSITE=$$SITE^VASITE ; SITE FORMAT IEN^NAME^DATE
     91447"RTN","C0CACTOR",217,0)
     91448     S ZIEN=$P(ZSITE,"^",1)
     91449"RTN","C0CACTOR",218,0)
     91450     S @AMAP@("ORGANIZATIONNAME")=$P(ZSITE,U,2)
     91451"RTN","C0CACTOR",219,0)
     91452     S @AMAP@("ACTORSOURCEID")="ACTORSYSTEM_1"
     91453"RTN","C0CACTOR",220,0)
     91454     S @AMAP@("ACTORADDRESSTYPE")="Office"
     91455"RTN","C0CACTOR",221,0)
     91456     S @AMAP@("ACTORADDRESSLINE1")=$$GET1^DIQ(4,ZIEN_",",1.01)
     91457"RTN","C0CACTOR",222,0)
     91458     S @AMAP@("ACTORADDRESSLINE2")=$$GET1^DIQ(4,ZIEN_",",1.02)
     91459"RTN","C0CACTOR",223,0)
     91460     S @AMAP@("ACTORADDRESSCITY")=$$GET1^DIQ(4,ZIEN_",",1.03)
     91461"RTN","C0CACTOR",224,0)
     91462     S @AMAP@("ACTORADDRESSSTATE")=$$GET1^DIQ(4,ZIEN_",",.02)
     91463"RTN","C0CACTOR",225,0)
     91464     S @AMAP@("ACTORPOSTALCODE")=$$GET1^DIQ(4,ZIEN_",",1.04)
     91465"RTN","C0CACTOR",226,0)
     91466     S @AMAP@("ACTORTELEPHONE")=""
     91467"RTN","C0CACTOR",227,0)
     91468     S @AMAP@("ACTORTELEPHONETYPE")=""
     91469"RTN","C0CACTOR",228,0)
     91470     S ZX=$$GET1^DIQ(4.03,"1,"_ZIEN_",",.03)
     91471"RTN","C0CACTOR",229,0)
     91472     I ZX'="" D  ; THERE IS A PHONE NUMBER AVAILABLE
     91473"RTN","C0CACTOR",230,0)
     91474     . S @AMAP@("ACTORTELEPHONE")=ZX
     91475"RTN","C0CACTOR",231,0)
     91476     . S @AMAP@("ACTORTELEPHONETYPE")="Office"
     91477"RTN","C0CACTOR",232,0)
     91478     D MAP^C0CXPATH(INXML,AMAP,OUTXML) ; MAP THE VARIABLE
     91479"RTN","C0CACTOR",233,0)
     91480     K @AMAP
     91481"RTN","C0CACTOR",234,0)
     91482     Q
     91483"RTN","C0CACTOR",235,0)
     91484     ;
     91485"RTN","C0CACTOR",236,0)
     91486PROVIDER(INXML,AIEN,AOID,OUTXML) ; PROCESS A PROVIDER TYPE ACTOR
     91487"RTN","C0CACTOR",237,0)
     91488     ;
     91489"RTN","C0CACTOR",238,0)
    9140691490     ; N AMAP
    91407 "RTN","C0CACTOR",203,0)
     91491"RTN","C0CACTOR",239,0)
    9140891492     S AMAP=$NA(^TMP($J,"AMAP"))
    91409 "RTN","C0CACTOR",204,0)
     91493"RTN","C0CACTOR",240,0)
    9141091494     K @AMAP
    91411 "RTN","C0CACTOR",205,0)
     91495"RTN","C0CACTOR",241,0)
     91496     I '$D(^VA(200,AIEN,0)) D  Q  ; IF NO PROVIDER RECORD (SHOULDN'T HAPPEN)
     91497"RTN","C0CACTOR",242,0)
     91498     . W "WARNING - MISSING PROVIDER: ",AIEN,!
     91499"RTN","C0CACTOR",243,0)
     91500     . S @OUTXML@(0)=0 ; SIGNAL NO OUTPUT
     91501"RTN","C0CACTOR",244,0)
    9141291502     S @AMAP@("ACTOROBJECTID")=AOID ;ACTOR OBJECT ID
    91413 "RTN","C0CACTOR",206,0)
    91414      S @AMAP@("ACTORDISPLAYNAME")=""
    91415 "RTN","C0CACTOR",207,0)
    91416      S @AMAP@("ACTORRELATION")=""
    91417 "RTN","C0CACTOR",208,0)
    91418      S @AMAP@("ACTORRELATIONSOURCEID")=""
    91419 "RTN","C0CACTOR",209,0)
     91503"RTN","C0CACTOR",245,0)
     91504     S @AMAP@("ACTORGIVENNAME")=$$GIVEN^C0CVA200(AIEN)
     91505"RTN","C0CACTOR",246,0)
     91506     S @AMAP@("ACTORMIDDLENAME")=$$MIDDLE^C0CVA200(AIEN)
     91507"RTN","C0CACTOR",247,0)
     91508     S @AMAP@("ACTORFAMILYNAME")=$$FAMILY^C0CVA200(AIEN)
     91509"RTN","C0CACTOR",248,0)
     91510     S @AMAP@("ACTORTITLE")=$$TITLE^C0CVA200(AIEN)
     91511"RTN","C0CACTOR",249,0)
     91512     S @AMAP@("IDTYPE")=$P($$NPI^C0CVA200(AIEN),U,1)
     91513"RTN","C0CACTOR",250,0)
     91514     S @AMAP@("ID")=$P($$NPI^C0CVA200(AIEN),U,2)
     91515"RTN","C0CACTOR",251,0)
     91516     S @AMAP@("IDDESC")=$P($$NPI^C0CVA200(AIEN),U,3)
     91517"RTN","C0CACTOR",252,0)
     91518     S @AMAP@("ACTORSPECIALITY")=$$SPEC^C0CVA200(AIEN)
     91519"RTN","C0CACTOR",253,0)
     91520     S @AMAP@("ACTORADDRESSTYPE")=$$ADDTYPE^C0CVA200(AIEN)
     91521"RTN","C0CACTOR",254,0)
     91522     S @AMAP@("ACTORADDRESSLINE1")=$$ADDLINE1^C0CVA200(AIEN)
     91523"RTN","C0CACTOR",255,0)
     91524     S @AMAP@("ACTORADDRESSCITY")=$$CITY^C0CVA200(AIEN)
     91525"RTN","C0CACTOR",256,0)
     91526     S @AMAP@("ACTORADDRESSSTATE")=$$STATE^C0CVA200(AIEN)
     91527"RTN","C0CACTOR",257,0)
     91528     S @AMAP@("ACTORPOSTALCODE")=$$POSTCODE^C0CVA200(AIEN)
     91529"RTN","C0CACTOR",258,0)
     91530     S @AMAP@("ACTORTELEPHONE")=""
     91531"RTN","C0CACTOR",259,0)
     91532     S @AMAP@("ACTORTELEPHONETYPE")=""
     91533"RTN","C0CACTOR",260,0)
     91534     S ZX=$$TEL^C0CVA200(AIEN)
     91535"RTN","C0CACTOR",261,0)
     91536     I ZX'="" D  ; THERE IS A PHONE NUMBER AVAILABLE
     91537"RTN","C0CACTOR",262,0)
     91538     . S @AMAP@("ACTORTELEPHONE")=ZX
     91539"RTN","C0CACTOR",263,0)
     91540     . S @AMAP@("ACTORTELEPHONETYPE")=$$TELTYPE^C0CVA200(AIEN)
     91541"RTN","C0CACTOR",264,0)
     91542     S @AMAP@("ACTOREMAIL")=$$EMAIL^C0CVA200(AIEN)
     91543"RTN","C0CACTOR",265,0)
     91544     S @AMAP@("ACTORADDRESSSOURCEID")="ACTORSYSTEM_1"
     91545"RTN","C0CACTOR",266,0)
    9142091546     S @AMAP@("ACTORSOURCEID")="ACTORSYSTEM_1" ; THE SYSTEM IS THE SOURCE
    91421 "RTN","C0CACTOR",210,0)
     91547"RTN","C0CACTOR",267,0)
     91548     S @AMAP@("ACTORORGLINK")="ACTORORGANIZATION_1"
     91549"RTN","C0CACTOR",268,0)
    9142291550     D MAP^C0CXPATH(INXML,AMAP,OUTXML) ; MAP THE VARIABLE
    91423 "RTN","C0CACTOR",211,0)
     91551"RTN","C0CACTOR",269,0)
    9142491552     Q
    91425 "RTN","C0CACTOR",212,0)
    91426      ;
    91427 "RTN","C0CACTOR",213,0)
    91428 ORG(INXML,AIEN,AOID,OUTXML) ; PROCESS AN ORGANIZATION TYPE ACTOR
    91429 "RTN","C0CACTOR",214,0)
    91430      ;
    91431 "RTN","C0CACTOR",215,0)
    91432      N AMAP,ZIEN,ZSITE
    91433 "RTN","C0CACTOR",216,0)
    91434      S AMAP=$NA(^TMP($J,"AMAP"))
    91435 "RTN","C0CACTOR",217,0)
    91436      K @AMAP
    91437 "RTN","C0CACTOR",218,0)
    91438      S @AMAP@("ACTOROBJECTID")=AOID ;ACTOR OBJECT ID
    91439 "RTN","C0CACTOR",219,0)
    91440      S ZSITE=$$SITE^VASITE ; SITE FORMAT IEN^NAME^DATE
    91441 "RTN","C0CACTOR",220,0)
    91442      S ZIEN=$P(ZSITE,"^",1)
    91443 "RTN","C0CACTOR",221,0)
    91444      S @AMAP@("ORGANIZATIONNAME")=$P(ZSITE,U,2)
    91445 "RTN","C0CACTOR",222,0)
    91446      S @AMAP@("ACTORSOURCEID")="ACTORSYSTEM_1"
    91447 "RTN","C0CACTOR",223,0)
    91448      S @AMAP@("ACTORADDRESSTYPE")="Office"
    91449 "RTN","C0CACTOR",224,0)
    91450      S @AMAP@("ACTORADDRESSLINE1")=$$GET1^DIQ(4,ZIEN_",",1.01)
    91451 "RTN","C0CACTOR",225,0)
    91452      S @AMAP@("ACTORADDRESSLINE2")=$$GET1^DIQ(4,ZIEN_",",1.02)
    91453 "RTN","C0CACTOR",226,0)
    91454      S @AMAP@("ACTORADDRESSCITY")=$$GET1^DIQ(4,ZIEN_",",1.03)
    91455 "RTN","C0CACTOR",227,0)
    91456      S @AMAP@("ACTORADDRESSSTATE")=$$GET1^DIQ(4,ZIEN_",",.02)
    91457 "RTN","C0CACTOR",228,0)
    91458      S @AMAP@("ACTORPOSTALCODE")=$$GET1^DIQ(4,ZIEN_",",1.04)
    91459 "RTN","C0CACTOR",229,0)
    91460      S @AMAP@("ACTORTELEPHONE")=""
    91461 "RTN","C0CACTOR",230,0)
    91462      S @AMAP@("ACTORTELEPHONETYPE")=""
    91463 "RTN","C0CACTOR",231,0)
    91464      S ZX=$$GET1^DIQ(4.03,"1,"_ZIEN_",",.03)
    91465 "RTN","C0CACTOR",232,0)
    91466      I ZX'="" D  ; THERE IS A PHONE NUMBER AVAILABLE
    91467 "RTN","C0CACTOR",233,0)
    91468      . S @AMAP@("ACTORTELEPHONE")=ZX
    91469 "RTN","C0CACTOR",234,0)
    91470      . S @AMAP@("ACTORTELEPHONETYPE")="Office"
    91471 "RTN","C0CACTOR",235,0)
    91472      D MAP^C0CXPATH(INXML,AMAP,OUTXML) ; MAP THE VARIABLE
    91473 "RTN","C0CACTOR",236,0)
    91474      K @AMAP
    91475 "RTN","C0CACTOR",237,0)
    91476      Q
    91477 "RTN","C0CACTOR",238,0)
    91478      ;
    91479 "RTN","C0CACTOR",239,0)
    91480 PROVIDER(INXML,AIEN,AOID,OUTXML) ; PROCESS A PROVIDER TYPE ACTOR
    91481 "RTN","C0CACTOR",240,0)
    91482      ;
    91483 "RTN","C0CACTOR",241,0)
    91484      ; N AMAP
    91485 "RTN","C0CACTOR",242,0)
    91486      S AMAP=$NA(^TMP($J,"AMAP"))
    91487 "RTN","C0CACTOR",243,0)
    91488      K @AMAP
    91489 "RTN","C0CACTOR",244,0)
    91490      I '$D(^VA(200,AIEN,0)) D  Q  ; IF NO PROVIDER RECORD (SHOULDN'T HAPPEN)
    91491 "RTN","C0CACTOR",245,0)
    91492      . W "WARNING - MISSING PROVIDER: ",AIEN,!
    91493 "RTN","C0CACTOR",246,0)
    91494      . S @OUTXML@(0)=0 ; SIGNAL NO OUTPUT
    91495 "RTN","C0CACTOR",247,0)
    91496      S @AMAP@("ACTOROBJECTID")=AOID ;ACTOR OBJECT ID
    91497 "RTN","C0CACTOR",248,0)
    91498      S @AMAP@("ACTORGIVENNAME")=$$GIVEN^C0CVA200(AIEN)
    91499 "RTN","C0CACTOR",249,0)
    91500      S @AMAP@("ACTORMIDDLENAME")=$$MIDDLE^C0CVA200(AIEN)
    91501 "RTN","C0CACTOR",250,0)
    91502      S @AMAP@("ACTORFAMILYNAME")=$$FAMILY^C0CVA200(AIEN)
    91503 "RTN","C0CACTOR",251,0)
    91504      S @AMAP@("ACTORTITLE")=$$TITLE^C0CVA200(AIEN)
    91505 "RTN","C0CACTOR",252,0)
    91506      S @AMAP@("IDTYPE")=$P($$NPI^C0CVA200(AIEN),U,1)
    91507 "RTN","C0CACTOR",253,0)
    91508      S @AMAP@("ID")=$P($$NPI^C0CVA200(AIEN),U,2)
    91509 "RTN","C0CACTOR",254,0)
    91510      S @AMAP@("IDDESC")=$P($$NPI^C0CVA200(AIEN),U,3)
    91511 "RTN","C0CACTOR",255,0)
    91512      S @AMAP@("ACTORSPECIALITY")=$$SPEC^C0CVA200(AIEN)
    91513 "RTN","C0CACTOR",256,0)
    91514      S @AMAP@("ACTORADDRESSTYPE")=$$ADDTYPE^C0CVA200(AIEN)
    91515 "RTN","C0CACTOR",257,0)
    91516      S @AMAP@("ACTORADDRESSLINE1")=$$ADDLINE1^C0CVA200(AIEN)
    91517 "RTN","C0CACTOR",258,0)
    91518      S @AMAP@("ACTORADDRESSCITY")=$$CITY^C0CVA200(AIEN)
    91519 "RTN","C0CACTOR",259,0)
    91520      S @AMAP@("ACTORADDRESSSTATE")=$$STATE^C0CVA200(AIEN)
    91521 "RTN","C0CACTOR",260,0)
    91522      S @AMAP@("ACTORPOSTALCODE")=$$POSTCODE^C0CVA200(AIEN)
    91523 "RTN","C0CACTOR",261,0)
    91524      S @AMAP@("ACTORTELEPHONE")=""
    91525 "RTN","C0CACTOR",262,0)
    91526      S @AMAP@("ACTORTELEPHONETYPE")=""
    91527 "RTN","C0CACTOR",263,0)
    91528      S ZX=$$TEL^C0CVA200(AIEN)
    91529 "RTN","C0CACTOR",264,0)
    91530      I ZX'="" D  ; THERE IS A PHONE NUMBER AVAILABLE
    91531 "RTN","C0CACTOR",265,0)
    91532      . S @AMAP@("ACTORTELEPHONE")=ZX
    91533 "RTN","C0CACTOR",266,0)
    91534      . S @AMAP@("ACTORTELEPHONETYPE")=$$TELTYPE^C0CVA200(AIEN)
    91535 "RTN","C0CACTOR",267,0)
    91536      S @AMAP@("ACTOREMAIL")=$$EMAIL^C0CVA200(AIEN)
    91537 "RTN","C0CACTOR",268,0)
    91538      S @AMAP@("ACTORADDRESSSOURCEID")="ACTORSYSTEM_1"
    91539 "RTN","C0CACTOR",269,0)
    91540      S @AMAP@("ACTORSOURCEID")="ACTORSYSTEM_1" ; THE SYSTEM IS THE SOURCE
    9154191553"RTN","C0CACTOR",270,0)
    91542      S @AMAP@("ACTORORGLINK")="ACTORORGANIZATION_1"
    91543 "RTN","C0CACTOR",271,0)
    91544      D MAP^C0CXPATH(INXML,AMAP,OUTXML) ; MAP THE VARIABLE
    91545 "RTN","C0CACTOR",272,0)
    91546      Q
    91547 "RTN","C0CACTOR",273,0)
    9154891554     ;
    9154991555"RTN","C0CALERT")
    91550 0^46^B31627309
     915560^46^B31119471
    9155191557"RTN","C0CALERT",1,0)
    91552 C0CALERT  ; CCDCCR/CKU/GPL - CCR/CCD PROCESSING FOR ALERTS ; 09/11/08
     91558C0CALERT  ; CCDCCR/CKU/GPL - CCR/CCD PROCESSING FOR ALERTS ; 09/11/08 ; 10/29/12 4:04pm
    9155391559"RTN","C0CALERT",2,0)
    91554  ;;1.2;C0C;;May 11, 2012;Build 50
     91560 ;;1.2;CCD/CCR GENERATION UTILITIES;;Oct 30, 2012;Build 51
    9155591561"RTN","C0CALERT",3,0)
    9155691562 ;Copyright 2008,2009 George Lilly, University of Minnesota and others.
    9155791563"RTN","C0CALERT",4,0)
    91558  ;Licensed under the terms of the GNU General Public License.
     91564 ;
    9155991565"RTN","C0CALERT",5,0)
    91560  ;See attached copy of the License.
     91566 ; This program is free software: you can redistribute it and/or modify
    9156191567"RTN","C0CALERT",6,0)
    91562  ;
     91568 ; it under the terms of the GNU Affero General Public License as
    9156391569"RTN","C0CALERT",7,0)
    91564  ;This program is free software; you can redistribute it and/or modify
     91570 ; published by the Free Software Foundation, either version 3 of the
    9156591571"RTN","C0CALERT",8,0)
    91566  ;it under the terms of the GNU General Public License as published by
     91572 ; License, or (at your option) any later version.
    9156791573"RTN","C0CALERT",9,0)
    91568  ;the Free Software Foundation; either version 2 of the License, or
     91574 ;
    9156991575"RTN","C0CALERT",10,0)
    91570  ;(at your option) any later version.
     91576 ; This program is distributed in the hope that it will be useful,
    9157191577"RTN","C0CALERT",11,0)
    91572  ;
     91578 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
    9157391579"RTN","C0CALERT",12,0)
    91574  ;This program is distributed in the hope that it will be useful,
     91580 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    9157591581"RTN","C0CALERT",13,0)
    91576  ;but WITHOUT ANY WARRANTY; without even the implied warranty of
     91582 ; GNU Affero General Public License for more details.
    9157791583"RTN","C0CALERT",14,0)
    91578  ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     91584 ;
    9157991585"RTN","C0CALERT",15,0)
    91580  ;GNU General Public License for more details.
     91586 ; You should have received a copy of the GNU Affero General Public License
    9158191587"RTN","C0CALERT",16,0)
    91582  ;
     91588 ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    9158391589"RTN","C0CALERT",17,0)
    91584  ;You should have received a copy of the GNU General Public License along
     91590 ;
    9158591591"RTN","C0CALERT",18,0)
    91586  ;with this program; if not, write to the Free Software Foundation, Inc.,
     91592 ;
    9158791593"RTN","C0CALERT",19,0)
    91588  ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     91594 W "NO ENTRY FROM TOP",!
    9158991595"RTN","C0CALERT",20,0)
    91590  ;
     91596 Q
    9159191597"RTN","C0CALERT",21,0)
    91592  W "NO ENTRY FROM TOP",!
     91598 ;
    9159391599"RTN","C0CALERT",22,0)
     91600EXTRACT(ALTXML,DFN,ALTOUTXML,CALLBK) ; EXTRACT ALERTS INTO  XML TEMPLATE
     91601"RTN","C0CALERT",23,0)
     91602 ; CALLBACK IF PROVIDED IS CALLED FOR EACH ALLERGY BEFORE MAPPING
     91603"RTN","C0CALERT",24,0)
     91604 ; ALTXML AND ALTOUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED
     91605"RTN","C0CALERT",25,0)
     91606 ;
     91607"RTN","C0CALERT",26,0)
     91608 ; GET ADVERSE REACTIONS AND ALLERGIES
     91609"RTN","C0CALERT",27,0)
     91610 ; N GMRA,GMRAL ; FOR DEBUGGING, DON'T NEW THESE VARIABLES
     91611"RTN","C0CALERT",28,0)
     91612 S GMRA="0^0^111"
     91613"RTN","C0CALERT",29,0)
     91614 D EN1^GMRADPT
     91615"RTN","C0CALERT",30,0)
     91616 I $G(GMRAL)'=1 D  Q  ; NO ALLERGIES FOUND THUS *QUIT*
     91617"RTN","C0CALERT",31,0)
     91618 . S @ALTOUTXML@(0)=0
     91619"RTN","C0CALERT",32,0)
     91620 ; DEFINE MAPPING
     91621"RTN","C0CALERT",33,0)
     91622 N ALTTVMAP,ALTVMAP,ALTTARYTMP,ALTARYTMP
     91623"RTN","C0CALERT",34,0)
     91624 S ALTTVMAP=$NA(^TMP("C0CCCR",$J,"ALERTS"))
     91625"RTN","C0CALERT",35,0)
     91626 S ALTTARYTMP=$NA(^TMP("C0CCCR",$J,"ALERTSARYTMP"))
     91627"RTN","C0CALERT",36,0)
     91628 K @ALTTVMAP,@ALTTARYTMP
     91629"RTN","C0CALERT",37,0)
     91630 N ALTTMP,ALTCNT S ALTG=$NA(GMRAL),ALTCNT=1
     91631"RTN","C0CALERT",38,0)
     91632 S ALTTMP="" ;
     91633"RTN","C0CALERT",39,0)
     91634 F  S ALTTMP=$O(@ALTG@(ALTTMP)) Q:ALTTMP=""  D  ; CHANGED TO $O BY GPL
     91635"RTN","C0CALERT",40,0)
     91636 . W "ALTTMP="_ALTTMP,!
     91637"RTN","C0CALERT",41,0)
     91638 . ; I $QS(ALTTMP,2)="S" W !,"S FOUND",! Q
     91639"RTN","C0CALERT",42,0)
     91640 . S ALTVMAP=$NA(@ALTTVMAP@(ALTCNT))
     91641"RTN","C0CALERT",43,0)
     91642 . K @ALTVMAP
     91643"RTN","C0CALERT",44,0)
     91644 . S @ALTVMAP@("ALERTOBJECTID")="ALERT"_ALTCNT
     91645"RTN","C0CALERT",45,0)
     91646 . N A1 S A1=@ALTG@(ALTTMP) ; ALL THE PIECES
     91647"RTN","C0CALERT",46,0)
     91648 . I $D(CALLBK) D @CALLBK ;CALLBACK FOR EPRESCRIBING
     91649"RTN","C0CALERT",47,0)
     91650 . N A2 S A2=$$GET1^DIQ(120.8,ALTTMP,"MECHANISM","I") ; MECHANISM
     91651"RTN","C0CALERT",48,0)
     91652 . N A3 S A3=$P(A1,U,5) ; ADVERSE FLAG
     91653"RTN","C0CALERT",49,0)
     91654 . N ADT S ADT="Patient has an " ; X $ZINT H 5
     91655"RTN","C0CALERT",50,0)
     91656 . S ADT=ADT_$S(A2="P":"ADVERSE",A2="A":"ALLERGIC",1:"UNKNOWN")
     91657"RTN","C0CALERT",51,0)
     91658 . S ADT=ADT_" reaction to "_$P(@ALTG@(ALTTMP),U,2)_"."
     91659"RTN","C0CALERT",52,0)
     91660 . S @ALTVMAP@("ALERTDESCRIPTIONTEXT")=ADT
     91661"RTN","C0CALERT",53,0)
     91662 . N ADTY S ADTY=$S(A2="P":"Adverse Reaction",A2="A":"Allergy",1:"") ;
     91663"RTN","C0CALERT",54,0)
     91664 . S @ALTVMAP@("ALERTTYPE")=ADTY ; type of allergy
     91665"RTN","C0CALERT",55,0)
     91666 . N ALTCDE ; SNOMED CODE THE THE ALERT
     91667"RTN","C0CALERT",56,0)
     91668 . S ALTCDE=$S(A2="P":"282100009",A2="A":"416098002",1:"") ; IF NOT ADVERSE, IT IS ALLERGIC
     91669"RTN","C0CALERT",57,0)
     91670 . S @ALTVMAP@("ALERTCODEVALUE")=ALTCDE ;
     91671"RTN","C0CALERT",58,0)
     91672 . ; WILL USE 418634005 FOR ALLERGIC REACTION TO A SUBSTANCE
     91673"RTN","C0CALERT",59,0)
     91674 . ; AND  282100009 FOR ADVERSE REACTION TO A SUBSTANCE
     91675"RTN","C0CALERT",60,0)
     91676 . I ALTCDE'="" D  ; IF THERE IS A CODE
     91677"RTN","C0CALERT",61,0)
     91678 . . S @ALTVMAP@("ALERTCODESYSTEM")="SNOMED CT"
     91679"RTN","C0CALERT",62,0)
     91680 . . S @ALTVMAP@("ALERTCODESYSTEMVERSION")="2008"
     91681"RTN","C0CALERT",63,0)
     91682 . E  D  ; SET TO NULL
     91683"RTN","C0CALERT",64,0)
     91684 . . S @ALTVMAP@("ALERTCODESYSTEM")=""
     91685"RTN","C0CALERT",65,0)
     91686 . . S @ALTVMAP@("ALERTCODESYSTEMVERSION")=""
     91687"RTN","C0CALERT",66,0)
     91688 . S @ALTVMAP@("ALERTSTATUSTEXT")="" ; WHERE DO WE GET THIS?
     91689"RTN","C0CALERT",67,0)
     91690 . N ALTPROV S ALTPROV=$P(^GMR(120.8,ALTTMP,0),U,5) ; SOURCE PROVIDER IEN
     91691"RTN","C0CALERT",68,0)
     91692 . I ALTPROV'="" D  ; PROVIDER PROVIDEED
     91693"RTN","C0CALERT",69,0)
     91694 . . S @ALTVMAP@("ALERTSOURCEID")="ACTORPROVIDER_"_ALTPROV
     91695"RTN","C0CALERT",70,0)
     91696 . E  S @ALTVMAP@("ALERTSOURCEID")="" ; SOURCE NULL - SHOULD NOT HAPPEN
     91697"RTN","C0CALERT",71,0)
     91698 . W "RUNNING ALERTS, PROVIDER: ",@ALTVMAP@("ALERTSOURCEID"),!
     91699"RTN","C0CALERT",72,0)
     91700 . N ACGL1,ACGFI,ACIEN,ACVUID,ACNM,ACTMP
     91701"RTN","C0CALERT",73,0)
     91702 . S ACGL1=$P(@ALTG@(ALTTMP),U,9) ; ADDRESS OF THE REACTANT XX;GLB(YY.Z,
     91703"RTN","C0CALERT",74,0)
     91704 . S ACGFI=$$PRSGLB($P(ACGL1,";",2)) ; FILE NUMBER
     91705"RTN","C0CALERT",75,0)
     91706 . S ACIEN=$P(ACGL1,";",1) ; IEN OF REACTANT
     91707"RTN","C0CALERT",76,0)
     91708 . S ACVUID=$$GET1^DIQ(ACGFI,ACIEN,"VUID") ; VUID OF THE REACTANT
     91709"RTN","C0CALERT",77,0)
     91710 . S @ALTVMAP@("ALERTAGENTPRODUCTOBJECTID")="PRODUCT_"_ACIEN ; IE OF REACTANT
     91711"RTN","C0CALERT",78,0)
     91712 . S @ALTVMAP@("ALERTAGENTPRODUCTSOURCEID")="" ; WHERE DO WE GET THIS?
     91713"RTN","C0CALERT",79,0)
     91714 . S ACNM=$P(@ALTG@(ALTTMP),U,2) ; REACTANT
     91715"RTN","C0CALERT",80,0)
     91716 . S @ALTVMAP@("ALERTAGENTPRODUCTNAMETEXT")=ACNM
     91717"RTN","C0CALERT",81,0)
     91718 . N ZC,ZCD,ZCDS,ZCDSV ; CODE,CODE SYSTEM,CODE VERSION
     91719"RTN","C0CALERT",82,0)
     91720 . S (ZC,ZCD,ZCDS,ZCDSV)="" ; INITIALIZE
     91721"RTN","C0CALERT",83,0)
     91722 . I ACVUID'="" D  ; IF VUID IS NOT NULL
     91723"RTN","C0CALERT",84,0)
     91724 . . S ZC=$$CODE^C0CUTIL(ACVUID)
     91725"RTN","C0CALERT",85,0)
     91726 . . S ZCD=$P(ZC,"^",1) ; CODE TO USE
     91727"RTN","C0CALERT",86,0)
     91728 . . S ZCDS=$P(ZC,"^",2) ; CODING SYSTEM - RXNORM OR VUID
     91729"RTN","C0CALERT",87,0)
     91730 . . S ZCDSV=$P(ZC,"^",3) ; CODING SYSTEM VERSION
     91731"RTN","C0CALERT",88,0)
     91732 . E  D  ; IF REACTANT CODE VALUE IS NULL
     91733"RTN","C0CALERT",89,0)
     91734 . . I $G(DUZ("AG"))="I" D  ; IF WE ARE RUNNING ON RPMS
     91735"RTN","C0CALERT",90,0)
     91736 . . . S ACTMP=$O(^C0CCODES(176.112,"C",ACNM,0)) ;
     91737"RTN","C0CALERT",91,0)
     91738 . . . W "RPMS NAME FOUND",ACNM," ",ACTMP,!
     91739"RTN","C0CALERT",92,0)
     91740 . . S @ALTVMAP@("ALERTAGENTPRODUCTCODESYSTEM")=""
     91741"RTN","C0CALERT",93,0)
     91742 . . S @ALTVMAP@("ALERTAGENTPRODUCTCODEVALUE")=""
     91743"RTN","C0CALERT",94,0)
     91744 . S @ALTVMAP@("ALERTAGENTPRODUCTCODEVALUE")=ZCD
     91745"RTN","C0CALERT",95,0)
     91746 . S @ALTVMAP@("ALERTAGENTPRODUCTCODESYSTEM")=ZCDS
     91747"RTN","C0CALERT",96,0)
     91748 . S @ALTVMAP@("ALERTAGENTPRODUCTNAMETEXT")=ACNM_" "_ZCDS_": "_ZCD
     91749"RTN","C0CALERT",97,0)
     91750 . S @ALTVMAP@("ALERTDESCRIPTIONTEXT")=ADT_" "_ZCDS_": "_ZCD
     91751"RTN","C0CALERT",98,0)
     91752 . ; REACTIONS - THIS SHOULD BE MULTIPLE, IS SINGLE NOW
     91753"RTN","C0CALERT",99,0)
     91754 . N ARTMP,ARIEN,ARDES,ARVUID
     91755"RTN","C0CALERT",100,0)
     91756 . S (ARTMP,ARDES,ARVUID)=""
     91757"RTN","C0CALERT",101,0)
     91758 . I $D(@ALTG@(ALTTMP,"S",1)) D  ; IF REACTION EXISTS
     91759"RTN","C0CALERT",102,0)
     91760 . . S ARTMP=@ALTG@(ALTTMP,"S",1)
     91761"RTN","C0CALERT",103,0)
     91762 . . W "REACTION:",ARTMP,!
     91763"RTN","C0CALERT",104,0)
     91764 . . S ARIEN=$P(ARTMP,";",2)
     91765"RTN","C0CALERT",105,0)
     91766 . . S ARDES=$P(ARTMP,";",1)
     91767"RTN","C0CALERT",106,0)
     91768 . . S ARVUID=$$GET1^DIQ(120.83,ARIEN,"VUID")
     91769"RTN","C0CALERT",107,0)
     91770 . S @ALTVMAP@("ALERTREACTIOINDESCRIPTIONTEXT")=ARDES
     91771"RTN","C0CALERT",108,0)
     91772 . I ARVUID'="" D  ; IF REACTION VUID IS NOT NULL
     91773"RTN","C0CALERT",109,0)
     91774 . . S @ALTVMAP@("ALERTREACTIONCODEVALUE")=ARVUID
     91775"RTN","C0CALERT",110,0)
     91776 . . S @ALTVMAP@("ALERTREACTIONCODESYSTEM")="VUID"
     91777"RTN","C0CALERT",111,0)
     91778 . E  D  ; IF IT IS NULL DON'T SET CODE SYSTEM
     91779"RTN","C0CALERT",112,0)
     91780 . . S @ALTVMAP@("ALERTREACTIONCODEVALUE")=""
     91781"RTN","C0CALERT",113,0)
     91782 . . S @ALTVMAP@("ALERTREACTIONCODESYSTEM")=""
     91783"RTN","C0CALERT",114,0)
     91784 . S ALTARYTMP=$NA(@ALTTARYTMP@(ALTCNT))
     91785"RTN","C0CALERT",115,0)
     91786 . ; NOW GO TO THE GLOBAL TO GET THE DATE/TIME AND BETTER DESCRIPTION
     91787"RTN","C0CALERT",116,0)
     91788 . N C0CG1,C0CT ; ARRAY FOR VALUES FROM GLOBAL
     91789"RTN","C0CALERT",117,0)
     91790 . D GETN1^C0CRNF("C0CG1",120.8,ALTTMP,"") ;GET VALUES BY NAME
     91791"RTN","C0CALERT",118,0)
     91792 . S C0CT=$$ZVALUEI^C0CRNF("ORIGINATION DATE/TIME","C0CG1")
     91793"RTN","C0CALERT",119,0)
     91794 . S @ALTVMAP@("ALERTDATETIME")=$$FMDTOUTC^C0CUTIL(C0CT,"DT")
     91795"RTN","C0CALERT",120,0)
     91796 . K @ALTARYTMP
     91797"RTN","C0CALERT",121,0)
     91798 . D MAP^C0CXPATH(ALTXML,ALTVMAP,ALTARYTMP)
     91799"RTN","C0CALERT",122,0)
     91800 . I ALTCNT=1 D CP^C0CXPATH(ALTARYTMP,ALTOUTXML)
     91801"RTN","C0CALERT",123,0)
     91802 . I ALTCNT>1 D INSINNER^C0CXPATH(ALTOUTXML,ALTARYTMP)
     91803"RTN","C0CALERT",124,0)
     91804 . S ALTCNT=ALTCNT+1
     91805"RTN","C0CALERT",125,0)
     91806 S @ALTTVMAP@(0)=ALTCNT-1 ; RECORD THE NUMBER OF ALERTS
     91807"RTN","C0CALERT",126,0)
    9159491808 Q
    91595 "RTN","C0CALERT",23,0)
    91596  ;
    91597 "RTN","C0CALERT",24,0)
    91598 EXTRACT(ALTXML,DFN,ALTOUTXML,CALLBK) ; EXTRACT ALERTS INTO  XML TEMPLATE
    91599 "RTN","C0CALERT",25,0)
    91600  ; CALLBACK IF PROVIDED IS CALLED FOR EACH ALLERGY BEFORE MAPPING
    91601 "RTN","C0CALERT",26,0)
    91602  ; ALTXML AND ALTOUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED
    91603 "RTN","C0CALERT",27,0)
    91604  ;
    91605 "RTN","C0CALERT",28,0)
    91606  ; GET ADVERSE REACTIONS AND ALLERGIES
    91607 "RTN","C0CALERT",29,0)
    91608  ; N GMRA,GMRAL ; FOR DEBUGGING, DON'T NEW THESE VARIABLES
    91609 "RTN","C0CALERT",30,0)
    91610  S GMRA="0^0^111"
    91611 "RTN","C0CALERT",31,0)
    91612  D EN1^GMRADPT
    91613 "RTN","C0CALERT",32,0)
    91614  I $G(GMRAL)'=1 D  Q ; NO ALLERGIES FOUND THUS *QUIT*
    91615 "RTN","C0CALERT",33,0)
    91616  . S @ALTOUTXML@(0)=0
    91617 "RTN","C0CALERT",34,0)
    91618  ; DEFINE MAPPING
    91619 "RTN","C0CALERT",35,0)
    91620  N ALTTVMAP,ALTVMAP,ALTTARYTMP,ALTARYTMP
    91621 "RTN","C0CALERT",36,0)
    91622  S ALTTVMAP=$NA(^TMP("C0CCCR",$J,"ALERTS"))
    91623 "RTN","C0CALERT",37,0)
    91624  S ALTTARYTMP=$NA(^TMP("C0CCCR",$J,"ALERTSARYTMP"))
    91625 "RTN","C0CALERT",38,0)
    91626  K @ALTTVMAP,@ALTTARYTMP
    91627 "RTN","C0CALERT",39,0)
    91628  N ALTTMP,ALTCNT S ALTG=$NA(GMRAL),ALTCNT=1
    91629 "RTN","C0CALERT",40,0)
    91630  S ALTTMP="" ;
    91631 "RTN","C0CALERT",41,0)
    91632  F  S ALTTMP=$O(@ALTG@(ALTTMP)) Q:ALTTMP=""  D  ; CHANGED TO $O BY GPL
    91633 "RTN","C0CALERT",42,0)
    91634  . W "ALTTMP="_ALTTMP,!
    91635 "RTN","C0CALERT",43,0)
    91636  . ; I $QS(ALTTMP,2)="S" W !,"S FOUND",! Q
    91637 "RTN","C0CALERT",44,0)
    91638  . S ALTVMAP=$NA(@ALTTVMAP@(ALTCNT))
    91639 "RTN","C0CALERT",45,0)
    91640  . K @ALTVMAP
    91641 "RTN","C0CALERT",46,0)
    91642  . S @ALTVMAP@("ALERTOBJECTID")="ALERT"_ALTCNT
    91643 "RTN","C0CALERT",47,0)
    91644  . N A1 S A1=@ALTG@(ALTTMP) ; ALL THE PIECES
    91645 "RTN","C0CALERT",48,0)
    91646  . I $D(CALLBK) D @CALLBK ;CALLBACK FOR EPRESCRIBING
    91647 "RTN","C0CALERT",49,0)
    91648  . N A2 S A2=$$GET1^DIQ(120.8,ALTTMP,"MECHANISM","I") ; MECHANISM
    91649 "RTN","C0CALERT",50,0)
    91650  . N A3 S A3=$P(A1,U,5) ; ADVERSE FLAG
    91651 "RTN","C0CALERT",51,0)
    91652  . N ADT S ADT="Patient has an " ; X $ZINT H 5
    91653 "RTN","C0CALERT",52,0)
    91654  . S ADT=ADT_$S(A2="P":"ADVERSE",A2="A":"ALLERGIC",1:"UNKNOWN")
    91655 "RTN","C0CALERT",53,0)
    91656  . S ADT=ADT_" reaction to "_$P(@ALTG@(ALTTMP),U,2)_"."
    91657 "RTN","C0CALERT",54,0)
    91658  . S @ALTVMAP@("ALERTDESCRIPTIONTEXT")=ADT
    91659 "RTN","C0CALERT",55,0)
    91660  . N ADTY S ADTY=$S(A2="P":"Adverse Reaction",A2="A":"Allergy",1:"") ;
    91661 "RTN","C0CALERT",56,0)
    91662  . S @ALTVMAP@("ALERTTYPE")=ADTY ; type of allergy
    91663 "RTN","C0CALERT",57,0)
    91664  . N ALTCDE ; SNOMED CODE THE THE ALERT
    91665 "RTN","C0CALERT",58,0)
    91666  . S ALTCDE=$S(A2="P":"282100009",A2="A":"416098002",1:"") ; IF NOT ADVERSE, IT IS ALLERGIC
    91667 "RTN","C0CALERT",59,0)
    91668  . S @ALTVMAP@("ALERTCODEVALUE")=ALTCDE ;
    91669 "RTN","C0CALERT",60,0)
    91670  . ; WILL USE 418634005 FOR ALLERGIC REACTION TO A SUBSTANCE
    91671 "RTN","C0CALERT",61,0)
    91672  . ; AND  282100009 FOR ADVERSE REACTION TO A SUBSTANCE
    91673 "RTN","C0CALERT",62,0)
    91674  . I ALTCDE'="" D  ; IF THERE IS A CODE
    91675 "RTN","C0CALERT",63,0)
    91676  . . S @ALTVMAP@("ALERTCODESYSTEM")="SNOMED CT"
    91677 "RTN","C0CALERT",64,0)
    91678  . . S @ALTVMAP@("ALERTCODESYSTEMVERSION")="2008"
    91679 "RTN","C0CALERT",65,0)
    91680  . E  D  ; SET TO NULL
    91681 "RTN","C0CALERT",66,0)
    91682  . . S @ALTVMAP@("ALERTCODESYSTEM")=""
    91683 "RTN","C0CALERT",67,0)
    91684  . . S @ALTVMAP@("ALERTCODESYSTEMVERSION")=""
    91685 "RTN","C0CALERT",68,0)
    91686  . S @ALTVMAP@("ALERTSTATUSTEXT")="" ; WHERE DO WE GET THIS?
    91687 "RTN","C0CALERT",69,0)
    91688  . N ALTPROV S ALTPROV=$P(^GMR(120.8,ALTTMP,0),U,5) ; SOURCE PROVIDER IEN
    91689 "RTN","C0CALERT",70,0)
    91690  . I ALTPROV'="" D  ; PROVIDER PROVIDEED
    91691 "RTN","C0CALERT",71,0)
    91692  . . S @ALTVMAP@("ALERTSOURCEID")="ACTORPROVIDER_"_ALTPROV
    91693 "RTN","C0CALERT",72,0)
    91694  . E  S @ALTVMAP@("ALERTSOURCEID")="" ; SOURCE NULL - SHOULD NOT HAPPEN
    91695 "RTN","C0CALERT",73,0)
    91696  . W "RUNNING ALERTS, PROVIDER: ",@ALTVMAP@("ALERTSOURCEID"),!
    91697 "RTN","C0CALERT",74,0)
    91698  . N ACGL1,ACGFI,ACIEN,ACVUID,ACNM,ACTMP
    91699 "RTN","C0CALERT",75,0)
    91700  . S ACGL1=$P(@ALTG@(ALTTMP),U,9) ; ADDRESS OF THE REACTANT XX;GLB(YY.Z,
    91701 "RTN","C0CALERT",76,0)
    91702  . S ACGFI=$$PRSGLB($P(ACGL1,";",2)) ; FILE NUMBER
    91703 "RTN","C0CALERT",77,0)
    91704  . S ACIEN=$P(ACGL1,";",1) ; IEN OF REACTANT
    91705 "RTN","C0CALERT",78,0)
    91706  . S ACVUID=$$GET1^DIQ(ACGFI,ACIEN,"VUID") ; VUID OF THE REACTANT
    91707 "RTN","C0CALERT",79,0)
    91708  . S @ALTVMAP@("ALERTAGENTPRODUCTOBJECTID")="PRODUCT_"_ACIEN ; IE OF REACTANT
    91709 "RTN","C0CALERT",80,0)
    91710  . S @ALTVMAP@("ALERTAGENTPRODUCTSOURCEID")="" ; WHERE DO WE GET THIS?
    91711 "RTN","C0CALERT",81,0)
    91712  . S ACNM=$P(@ALTG@(ALTTMP),U,2) ; REACTANT
    91713 "RTN","C0CALERT",82,0)
    91714  . S @ALTVMAP@("ALERTAGENTPRODUCTNAMETEXT")=ACNM
    91715 "RTN","C0CALERT",83,0)
    91716  . N ZC,ZCD,ZCDS,ZCDSV ; CODE,CODE SYSTEM,CODE VERSION
    91717 "RTN","C0CALERT",84,0)
    91718  . S (ZC,ZCD,ZCDS,ZCDSV)="" ; INITIALIZE
    91719 "RTN","C0CALERT",85,0)
    91720  . I ACVUID'="" D  ; IF VUID IS NOT NULL
    91721 "RTN","C0CALERT",86,0)
    91722  . . S ZC=$$CODE^C0CUTIL(ACVUID)
    91723 "RTN","C0CALERT",87,0)
    91724  . . S ZCD=$P(ZC,"^",1) ; CODE TO USE
    91725 "RTN","C0CALERT",88,0)
    91726  . . S ZCDS=$P(ZC,"^",2) ; CODING SYSTEM - RXNORM OR VUID
    91727 "RTN","C0CALERT",89,0)
    91728  . . S ZCDSV=$P(ZC,"^",3) ; CODING SYSTEM VERSION
    91729 "RTN","C0CALERT",90,0)
    91730  . E  D  ; IF REACTANT CODE VALUE IS NULL
    91731 "RTN","C0CALERT",91,0)
    91732  . . I $G(DUZ("AG"))="I" D  ; IF WE ARE RUNNING ON RPMS
    91733 "RTN","C0CALERT",92,0)
    91734  . . . S ACTMP=$O(^C0CCODES(176.112,"C",ACNM,0)) ;
    91735 "RTN","C0CALERT",93,0)
    91736  . . . W "RPMS NAME FOUND",ACNM," ",ACTMP,!
    91737 "RTN","C0CALERT",94,0)
    91738  . . S @ALTVMAP@("ALERTAGENTPRODUCTCODESYSTEM")=""
    91739 "RTN","C0CALERT",95,0)
    91740  . . S @ALTVMAP@("ALERTAGENTPRODUCTCODEVALUE")=""
    91741 "RTN","C0CALERT",96,0)
    91742  . S @ALTVMAP@("ALERTAGENTPRODUCTCODEVALUE")=ZCD
    91743 "RTN","C0CALERT",97,0)
    91744  . S @ALTVMAP@("ALERTAGENTPRODUCTCODESYSTEM")=ZCDS
    91745 "RTN","C0CALERT",98,0)
    91746  . S @ALTVMAP@("ALERTAGENTPRODUCTNAMETEXT")=ACNM_" "_ZCDS_": "_ZCD
    91747 "RTN","C0CALERT",99,0)
    91748  . S @ALTVMAP@("ALERTDESCRIPTIONTEXT")=ADT_" "_ZCDS_": "_ZCD
    91749 "RTN","C0CALERT",100,0)
    91750  . ; REACTIONS - THIS SHOULD BE MULTIPLE, IS SINGLE NOW
    91751 "RTN","C0CALERT",101,0)
    91752  . N ARTMP,ARIEN,ARDES,ARVUID
    91753 "RTN","C0CALERT",102,0)
    91754  . S (ARTMP,ARDES,ARVUID)=""
    91755 "RTN","C0CALERT",103,0)
    91756  . I $D(@ALTG@(ALTTMP,"S",1)) D  ; IF REACTION EXISTS
    91757 "RTN","C0CALERT",104,0)
    91758  . . S ARTMP=@ALTG@(ALTTMP,"S",1)
    91759 "RTN","C0CALERT",105,0)
    91760  . . W "REACTION:",ARTMP,!
    91761 "RTN","C0CALERT",106,0)
    91762  . . S ARIEN=$P(ARTMP,";",2)
    91763 "RTN","C0CALERT",107,0)
    91764  . . S ARDES=$P(ARTMP,";",1)
    91765 "RTN","C0CALERT",108,0)
    91766  . . S ARVUID=$$GET1^DIQ(120.83,ARIEN,"VUID")
    91767 "RTN","C0CALERT",109,0)
    91768  . S @ALTVMAP@("ALERTREACTIOINDESCRIPTIONTEXT")=ARDES
    91769 "RTN","C0CALERT",110,0)
    91770  . I ARVUID'="" D  ; IF REACTION VUID IS NOT NULL
    91771 "RTN","C0CALERT",111,0)
    91772  . . S @ALTVMAP@("ALERTREACTIONCODEVALUE")=ARVUID
    91773 "RTN","C0CALERT",112,0)
    91774  . . S @ALTVMAP@("ALERTREACTIONCODESYSTEM")="VUID"
    91775 "RTN","C0CALERT",113,0)
    91776  . E  D  ; IF IT IS NULL DON'T SET CODE SYSTEM
    91777 "RTN","C0CALERT",114,0)
    91778  . . S @ALTVMAP@("ALERTREACTIONCODEVALUE")=""
    91779 "RTN","C0CALERT",115,0)
    91780  . . S @ALTVMAP@("ALERTREACTIONCODESYSTEM")=""
    91781 "RTN","C0CALERT",116,0)
    91782  . S ALTARYTMP=$NA(@ALTTARYTMP@(ALTCNT))
    91783 "RTN","C0CALERT",117,0)
    91784  . ; NOW GO TO THE GLOBAL TO GET THE DATE/TIME AND BETTER DESCRIPTION
    91785 "RTN","C0CALERT",118,0)
    91786  . N C0CG1,C0CT ; ARRAY FOR VALUES FROM GLOBAL
    91787 "RTN","C0CALERT",119,0)
    91788  . D GETN1^C0CRNF("C0CG1",120.8,ALTTMP,"") ;GET VALUES BY NAME
    91789 "RTN","C0CALERT",120,0)
    91790  . S C0CT=$$ZVALUEI^C0CRNF("ORIGINATION DATE/TIME","C0CG1")
    91791 "RTN","C0CALERT",121,0)
    91792  . S @ALTVMAP@("ALERTDATETIME")=$$FMDTOUTC^C0CUTIL(C0CT,"DT")
    91793 "RTN","C0CALERT",122,0)
    91794  . K @ALTARYTMP
    91795 "RTN","C0CALERT",123,0)
    91796  . D MAP^C0CXPATH(ALTXML,ALTVMAP,ALTARYTMP)
    91797 "RTN","C0CALERT",124,0)
    91798  . I ALTCNT=1 D CP^C0CXPATH(ALTARYTMP,ALTOUTXML)
    91799 "RTN","C0CALERT",125,0)
    91800  . I ALTCNT>1 D INSINNER^C0CXPATH(ALTOUTXML,ALTARYTMP)
    91801 "RTN","C0CALERT",126,0)
    91802  . S ALTCNT=ALTCNT+1
    9180391809"RTN","C0CALERT",127,0)
    91804  S @ALTTVMAP@(0)=ALTCNT-1 ; RECORD THE NUMBER OF ALERTS
     91810PRSGLB(INGLB) ; EXTRINSIC TO PARSE GLOBALS AND RETURN THE FILE NUMBER
    9180591811"RTN","C0CALERT",128,0)
    91806  Q
     91812 ; INGLB IS OF THE FORM: PSNDF(50.6,
    9180791813"RTN","C0CALERT",129,0)
    91808 PRSGLB(INGLB) ; EXTRINSIC TO PARSE GLOBALS AND RETURN THE FILE NUMBER
     91814 ; RETURN 50.6
    9180991815"RTN","C0CALERT",130,0)
    91810  ; INGLB IS OF THE FORM: PSNDF(50.6,
    91811 "RTN","C0CALERT",131,0)
    91812  ; RETURN 50.6
    91813 "RTN","C0CALERT",132,0)
    9181491816 Q $P($P(INGLB,"(",2),",",1)  ;
    9181591817"RTN","C0CBAT")
    91816 0^57^B56971574
     918180^57^B56229594
    9181791819"RTN","C0CBAT",1,0)
    9181891820C0CBAT   ; CCDCCR/GPL - CCR Batch utilities; 4/21/09
    9181991821"RTN","C0CBAT",2,0)
    91820  ;;1.2;C0C;;May 11, 2012;Build 50
     91822 ;;1.2;CCD/CCR GENERATION UTILITIES;;Oct 30, 2012;Build 51
    9182191823"RTN","C0CBAT",3,0)
    91822  ;Copyright 2009 George Lilly.  Licensed under the terms of the GNU
     91824 ;Copyright 2009 George Lilly. 
    9182391825"RTN","C0CBAT",4,0)
    91824  ;General Public License See attached copy of the License.
     91826 ;
    9182591827"RTN","C0CBAT",5,0)
    91826  ;
     91828 ; This program is free software: you can redistribute it and/or modify
    9182791829"RTN","C0CBAT",6,0)
    91828  ;This program is free software; you can redistribute it and/or modify
     91830 ; it under the terms of the GNU Affero General Public License as
    9182991831"RTN","C0CBAT",7,0)
    91830  ;it under the terms of the GNU General Public License as published by
     91832 ; published by the Free Software Foundation, either version 3 of the
    9183191833"RTN","C0CBAT",8,0)
    91832  ;the Free Software Foundation; either version 2 of the License, or
     91834 ; License, or (at your option) any later version.
    9183391835"RTN","C0CBAT",9,0)
    91834  ;(at your option) any later version.
     91836 ;
    9183591837"RTN","C0CBAT",10,0)
    91836  ;
     91838 ; This program is distributed in the hope that it will be useful,
    9183791839"RTN","C0CBAT",11,0)
    91838  ;This program is distributed in the hope that it will be useful,
     91840 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
    9183991841"RTN","C0CBAT",12,0)
    91840  ;but WITHOUT ANY WARRANTY; without even the implied warranty of
     91842 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    9184191843"RTN","C0CBAT",13,0)
    91842  ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     91844 ; GNU Affero General Public License for more details.
    9184391845"RTN","C0CBAT",14,0)
    91844  ;GNU General Public License for more details.
     91846 ;
    9184591847"RTN","C0CBAT",15,0)
    91846  ;
     91848 ; You should have received a copy of the GNU Affero General Public License
    9184791849"RTN","C0CBAT",16,0)
    91848  ;You should have received a copy of the GNU General Public License along
     91850 ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    9184991851"RTN","C0CBAT",17,0)
    91850  ;with this program; if not, write to the Free Software Foundation, Inc.,
     91852 ;
    9185191853"RTN","C0CBAT",18,0)
    91852  ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     91854 ;
    9185391855"RTN","C0CBAT",19,0)
    91854  ;
     91856 W "This is the CCR Batch Utility Library ",!
    9185591857"RTN","C0CBAT",20,0)
    91856  W "This is the CCR Batch Utility Library ",!
     91858 Q
    9185791859"RTN","C0CBAT",21,0)
     91860 ;
     91861"RTN","C0CBAT",22,0)
     91862STOP ; STOP A CURRENTLY RUNNING BATCH JOB
     91863"RTN","C0CBAT",23,0)
     91864 I '$D(^TMP("C0CBAT","RUNNING")) Q  ;
     91865"RTN","C0CBAT",24,0)
     91866 W !,!,"HALTING CCR BATCH",!
     91867"RTN","C0CBAT",25,0)
     91868 S ^TMP("C0CBAT","STOP")="" ; SIGNAL JOB TO TERMINATE
     91869"RTN","C0CBAT",26,0)
     91870 H 10 ; WAIT TEN SECONDS FOR SIGNAL TO BE RECEIVED
     91871"RTN","C0CBAT",27,0)
     91872 I '$D(^TMP("C0CBAT","STOP")) D  ; SIGNAL RECEIVED
     91873"RTN","C0CBAT",28,0)
     91874 . W "CCR BATCH JOB TERMINATING",!
     91875"RTN","C0CBAT",29,0)
     91876 E  D  ;
     91877"RTN","C0CBAT",30,0)
     91878 . K ^TMP("C0CBAT","STOP") ; STOP SIGNALING
     91879"RTN","C0CBAT",31,0)
     91880 . W !,"BATCH PROCESSING APPARENTLY NOT RUNNING",!
     91881"RTN","C0CBAT",32,0)
    9185891882 Q
    91859 "RTN","C0CBAT",22,0)
    91860  ;
    91861 "RTN","C0CBAT",23,0)
    91862 STOP ; STOP A CURRENTLY RUNNING BATCH JOB
    91863 "RTN","C0CBAT",24,0)
    91864  I '$D(^TMP("C0CBAT","RUNNING")) Q  ;
    91865 "RTN","C0CBAT",25,0)
    91866  W !,!,"HALTING CCR BATCH",!
    91867 "RTN","C0CBAT",26,0)
    91868  S ^TMP("C0CBAT","STOP")="" ; SIGNAL JOB TO TERMINATE
    91869 "RTN","C0CBAT",27,0)
    91870  H 10 ; WAIT TEN SECONDS FOR SIGNAL TO BE RECEIVED
    91871 "RTN","C0CBAT",28,0)
    91872  I '$D(^TMP("C0CBAT","STOP")) D  ; SIGNAL RECEIVED
    91873 "RTN","C0CBAT",29,0)
    91874  . W "CCR BATCH JOB TERMINATING",!
    91875 "RTN","C0CBAT",30,0)
    91876  E  D  ;
    91877 "RTN","C0CBAT",31,0)
    91878  . K ^TMP("C0CBAT","STOP") ; STOP SIGNALING
    91879 "RTN","C0CBAT",32,0)
    91880  . W !,"BATCH PROCESSING APPARENTLY NOT RUNNING",!
    9188191883"RTN","C0CBAT",33,0)
     91884 ;
     91885"RTN","C0CBAT",34,0)
     91886START ; STARTS A TAKSMAN CCR BATCH JOB - FOR USE IN A MENU OPTION
     91887"RTN","C0CBAT",35,0)
     91888 ;
     91889"RTN","C0CBAT",36,0)
     91890 I $D(^TMP("C0CBAT","RUNNING")) D  Q  ; ONLY ONE ALLOWED AT A TIME
     91891"RTN","C0CBAT",37,0)
     91892 . W !,"CCR BATCH ALREADY RUNNING",!
     91893"RTN","C0CBAT",38,0)
     91894 . W !,"STOP FIRST WITH STOP^C0CBAT",!
     91895"RTN","C0CBAT",39,0)
     91896 N ZTRTN,ZTDESC,ZTDTH,ZTSAVE,ZTSK,ZTIO
     91897"RTN","C0CBAT",40,0)
     91898 S ZTRTN="EN^C0CBAT",ZTDESC="CCR Batch"
     91899"RTN","C0CBAT",41,0)
     91900 S ZTDTH=$H ;
     91901"RTN","C0CBAT",42,0)
     91902 ;S ZTDTH=$S(($P(ZTDTH,",",2)+10)\86400:(1+ZTDTH)_","_((($P(ZTDTH,",",2)+10)#86400)/100000),1:(+ZTDTH)_","_($P(ZTDTH,",",2)+10))
     91903"RTN","C0CBAT",43,0)
     91904 S ZTSAVE("C0C")="",ZTSAVE("C0C*")=""
     91905"RTN","C0CBAT",44,0)
     91906 S ZTIO="NULL" ;
     91907"RTN","C0CBAT",45,0)
     91908 W !,!,"CCR BATCH JOB STARTED",!
     91909"RTN","C0CBAT",46,0)
     91910 D ^%ZTLOAD
     91911"RTN","C0CBAT",47,0)
    9188291912 Q
    91883 "RTN","C0CBAT",34,0)
    91884  ;
    91885 "RTN","C0CBAT",35,0)
    91886 START ; STARTS A TAKSMAN CCR BATCH JOB - FOR USE IN A MENU OPTION
    91887 "RTN","C0CBAT",36,0)
    91888  ;
    91889 "RTN","C0CBAT",37,0)
    91890  I $D(^TMP("C0CBAT","RUNNING")) D  Q  ; ONLY ONE ALLOWED AT A TIME
    91891 "RTN","C0CBAT",38,0)
    91892  . W !,"CCR BATCH ALREADY RUNNING",!
    91893 "RTN","C0CBAT",39,0)
    91894  . W !,"STOP FIRST WITH STOP^C0CBAT",!
    91895 "RTN","C0CBAT",40,0)
    91896  N ZTRTN,ZTDESC,ZTDTH,ZTSAVE,ZTSK,ZTIO
    91897 "RTN","C0CBAT",41,0)
    91898  S ZTRTN="EN^C0CBAT",ZTDESC="CCR Batch"
    91899 "RTN","C0CBAT",42,0)
    91900  S ZTDTH=$H ;
    91901 "RTN","C0CBAT",43,0)
    91902  ;S ZTDTH=$S(($P(ZTDTH,",",2)+10)\86400:(1+ZTDTH)_","_((($P(ZTDTH,",",2)+10)#86400)/100000),1:(+ZTDTH)_","_($P(ZTDTH,",",2)+10))
    91903 "RTN","C0CBAT",44,0)
    91904  S ZTSAVE("C0C")="",ZTSAVE("C0C*")=""
    91905 "RTN","C0CBAT",45,0)
    91906  S ZTIO="NULL" ;
    91907 "RTN","C0CBAT",46,0)
    91908  W !,!,"CCR BATCH JOB STARTED",!
    91909 "RTN","C0CBAT",47,0)
    91910  D ^%ZTLOAD
    9191191913"RTN","C0CBAT",48,0)
     91914 ;
     91915"RTN","C0CBAT",49,0)
     91916EN ; BATCH ENTRY POINT
     91917"RTN","C0CBAT",50,0)
     91918 ; PROCESSES THE SUBSCRIPTION FILE, EXTRACTING CCR VARIABLES FOR EACH
     91919"RTN","C0CBAT",51,0)
     91920 ; PATIENT WITH AN ACTIVE SUBSCRIPTION, AND IF CHECKSUMS INDICATE A CHANGE,
     91921"RTN","C0CBAT",52,0)
     91922 ; GENERATES A NEW CCR FOR THE PATIENT
     91923"RTN","C0CBAT",53,0)
     91924 ; UPDATES THE E2 CCR ELEMENTS FILE
     91925"RTN","C0CBAT",54,0)
     91926 ;
     91927"RTN","C0CBAT",55,0)
     91928 S C0CQT=1 ; QUIET MODE
     91929"RTN","C0CBAT",56,0)
     91930 I $D(^TMP("C0CBAT","RUNNING")) Q  ; ONLY ONE AT A TIME
     91931"RTN","C0CBAT",57,0)
     91932 S ^TMP("C0CBAT","RUNNING")="" ; RUNNING SIGNAL
     91933"RTN","C0CBAT",58,0)
     91934 S C0CBDT=$$NOW^XLFDT ; DATE OF THIS RUN
     91935"RTN","C0CBAT",59,0)
     91936 S C0CBF=177.301 ; FILE NUMBER OF C0C BATCH CONTROL FILE
     91937"RTN","C0CBAT",60,0)
     91938 S C0CBFR=177.3013 ; FILE NUMBER OF UPDATE SUBFILE
     91939"RTN","C0CBAT",61,0)
     91940 S C0CBB=$NA(^TMP("C0CBATCH",C0CBDT)) ; BATCH WORK AREA
     91941"RTN","C0CBAT",62,0)
     91942 I $D(@C0CBB@(0)) D  ; ERROR SHOULDN'T EXIST
     91943"RTN","C0CBAT",63,0)
     91944 . W "WORK AREA ERROR",!
     91945"RTN","C0CBAT",64,0)
     91946 . S $EC=",U1,"
     91947"RTN","C0CBAT",65,0)
     91948 S @C0CBB@(0)="V22" ; VERSION USED TO CREATE THIS WORK AREA
     91949"RTN","C0CBAT",66,0)
     91950 S C0CBH=$NA(@C0CBB@("HOTLIST")) ; BASE FOR HOT LIST
     91951"RTN","C0CBAT",67,0)
     91952 S C0CBS=$NA(^C0CS("B")) ; SUBSCRIPTION LIST BASE
     91953"RTN","C0CBAT",68,0)
     91954 ;I $D(^C0CB("B",C0CDT)) D  ; BATCH RECORD EXISTS
     91955"RTN","C0CBAT",69,0)
     91956 ;. H 10 ; HANG 10 SECONDS
     91957"RTN","C0CBAT",70,0)
     91958 ;. S C0CBDT=$$NOW^XLFDT ; NEW DATE FOR THIS RUN
     91959"RTN","C0CBAT",71,0)
     91960 ;. I $D(^C0CB("B",C0CDT)) B ;DIDN'T WORK
     91961"RTN","C0CBAT",72,0)
     91962 D BLDHOT(C0CBH) ; BUILD THE HOT LIST
     91963"RTN","C0CBAT",73,0)
     91964 S C0CHN=$$COUNT(C0CBH) ;COUNT NUMBER IN HOT LIST
     91965"RTN","C0CBAT",74,0)
     91966 S C0CSN=$$COUNT(C0CBS) ;COUNT NUMBER OF PATIENTS WITH SUBSCRIPTIONS
     91967"RTN","C0CBAT",75,0)
     91968 S C0CFDA(C0CBF,"+1,",.01)=C0CBDT ; DATE KEY OF BATCH CONTROL
     91969"RTN","C0CBAT",76,0)
     91970 S C0CFDA(C0CBF,"+1,",.02)=C0CBDT ; BATCH ID IS DATE IN STRING FORM
     91971"RTN","C0CBAT",77,0)
     91972 S C0CFDA(C0CBF,"+1,",1)=C0CSN ; TOTAL SUBSCRIPTIONS
     91973"RTN","C0CBAT",78,0)
     91974 S C0CFDA(C0CBF,"+1,",2)=C0CHN ; TOTAL HOT LIST
     91975"RTN","C0CBAT",79,0)
     91976 D UPDIE ; CREATE THE BATCH RECORD
     91977"RTN","C0CBAT",80,0)
     91978 S C0CIEN=$O(^C0CB("B",C0CBDT,""))
     91979"RTN","C0CBAT",81,0)
     91980 S (C0CN,C0CNH)=0 ; COUNTERS FOR TOTAL AND HOT LIST
     91981"RTN","C0CBAT",82,0)
     91982 S C0CBCUR="" ; CURRENT PATIENT
     91983"RTN","C0CBAT",83,0)
     91984 S C0CSTOP=0 ; STOP FLAG FOR HALTING BATCH SET ^TMP("C0CBAT","STOP")=""
     91985"RTN","C0CBAT",84,0)
     91986 ;F  S C0CBCUR=$O(@C0CBH@(C0CBCUR),-1) Q:C0CBCUR=""  D  ; HOT LIST LATEST FIRST
     91987"RTN","C0CBAT",85,0)
     91988 F  S C0CBCUR=$O(@C0CBH@(C0CBCUR)) Q:(C0CSTOP)!(C0CBCUR="")  D  ; HOT LIST FIRST
     91989"RTN","C0CBAT",86,0)
     91990 . D ANALYZE^C0CRIMA(C0CBCUR,1,"LABLIMIT:T-900^VITLIMIT:T-900")
     91991"RTN","C0CBAT",87,0)
     91992 . I $G(C0CCHK) D  ;
     91993"RTN","C0CBAT",88,0)
     91994 . . D PUTRIM^C0CFM2(C0CBCUR)
     91995"RTN","C0CBAT",89,0)
     91996 . . D XPAT^C0CCCR(C0CBCUR) ; IF VARIABLES HAVE CHANGED GENERATE CCR
     91997"RTN","C0CBAT",90,0)
     91998 . . K C0CFDA
     91999"RTN","C0CBAT",91,0)
     92000 . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",.01)=C0CBCUR
     92001"RTN","C0CBAT",92,0)
     92002 . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",1)="Y"
     92003"RTN","C0CBAT",93,0)
     92004 . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",2)=$G(^TMP("C0CCCR","FNAME",C0CBCUR))
     92005"RTN","C0CBAT",94,0)
     92006 . . D UPDIE ; CREATE UPDATE SUBFILE
     92007"RTN","C0CBAT",95,0)
     92008 . S C0CN=C0CN+1 ; INCREMENT NUMBER IN TOTAL
     92009"RTN","C0CBAT",96,0)
     92010 . S C0CNH=C0CNH+1 ; INCREMENT HOT LIST TOTAL
     92011"RTN","C0CBAT",97,0)
     92012 . S C0CFDA(C0CBF,C0CIEN_",",1.1)=C0CN ;UPDATE TOTAL PROGRESS
     92013"RTN","C0CBAT",98,0)
     92014 . S C0CFDA(C0CBF,C0CIEN_",",2.1)=C0CNH ; UPDATE HOT LIST PROGRESS
     92015"RTN","C0CBAT",99,0)
     92016 . S C0CNOW=$$NOW^XLFDT
     92017"RTN","C0CBAT",100,0)
     92018 . S C0CFDA(C0CBF,C0CIEN_",",4)=C0CNOW ; LAST UPDATED FIELD
     92019"RTN","C0CBAT",101,0)
     92020 . S C0CELPS=$$FMDIFF^XLFDT(C0CNOW,C0CBDT,2) ; DIFFERENCE IN SECONDS
     92021"RTN","C0CBAT",102,0)
     92022 . S C0CAVG=C0CELPS/C0CN ; AVERAGE ELAPSED TIME
     92023"RTN","C0CBAT",103,0)
     92024 . S C0CFDA(C0CBF,C0CIEN_",",4.1)=C0CAVG ; AVERAGE ELAPSED TIME
     92025"RTN","C0CBAT",104,0)
     92026 . S C0CETOT=C0CAVG*C0CSN ; EST TOT ELASPSED TIME
     92027"RTN","C0CBAT",105,0)
     92028 . S C0CEST=$$FMADD^XLFDT(C0CBDT,0,0,0,C0CETOT) ; ADD SECONDS TO BATCH START
     92029"RTN","C0CBAT",106,0)
     92030 . S C0CFDA(C0CBF,C0CIEN_",",4.2)=C0CEST ;ESTIMATED COMPLETION TIME
     92031"RTN","C0CBAT",107,0)
     92032 . S C0CFDA(C0CBF,C0CIEN_",",5)=C0CBCUR ; LAST RECORD PROCESSED
     92033"RTN","C0CBAT",108,0)
     92034 . D UPDIE ;
     92035"RTN","C0CBAT",109,0)
     92036 . I $D(^TMP("C0CBAT","STOP")) D  ; IF STOP SIGNAL DETECTED
     92037"RTN","C0CBAT",110,0)
     92038 . . S C0CSTOP=1
     92039"RTN","C0CBAT",111,0)
     92040 . . K ^TMP("C0CBAT","STOP") ; SIGNAL RECEIVED
     92041"RTN","C0CBAT",112,0)
     92042 . H 1 ; GIVE OTHERS A CHANCE
     92043"RTN","C0CBAT",113,0)
     92044 F  S C0CBCUR=$O(@C0CBS@(C0CBCUR)) Q:(C0CSTOP)!(C0CBCUR="")  D  ; SUBS LIST
     92045"RTN","C0CBAT",114,0)
     92046 . I $D(@C0CBH@(C0CBCUR)) Q  ; SKIP IF IN HOT LIST - ALREADY DONE
     92047"RTN","C0CBAT",115,0)
     92048 . D ANALYZE^C0CRIMA(C0CBCUR,1,"LABLIMIT:T-760^VITLIMIT:T-760")
     92049"RTN","C0CBAT",116,0)
     92050 . I $G(C0CCHK) D  ; IF CHECKSUMS HAVE CHANGED
     92051"RTN","C0CBAT",117,0)
     92052 . . D PUTRIM^C0CFM2(C0CBCUR)
     92053"RTN","C0CBAT",118,0)
     92054 . . D XPAT^C0CCCR(C0CBCUR) ; IF VARIABLES HAVE CHANGED GENERATE CCR
     92055"RTN","C0CBAT",119,0)
     92056 . . K C0CFDA
     92057"RTN","C0CBAT",120,0)
     92058 . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",.01)=C0CBCUR
     92059"RTN","C0CBAT",121,0)
     92060 . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",1)="Y"
     92061"RTN","C0CBAT",122,0)
     92062 . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",2)=$G(^TMP("C0CCCR","FNAME",C0CBCUR))
     92063"RTN","C0CBAT",123,0)
     92064 . . D UPDIE ; CREATE UPDATE SUBFILE
     92065"RTN","C0CBAT",124,0)
     92066 . S C0CN=C0CN+1 ; INCREMENT NUMBER IN TOTAL
     92067"RTN","C0CBAT",125,0)
     92068 . S C0CFDA(C0CBF,C0CIEN_",",1.1)=C0CN ;UPDATE TOTAL PROGRESS
     92069"RTN","C0CBAT",126,0)
     92070 . S C0CNOW=$$NOW^XLFDT
     92071"RTN","C0CBAT",127,0)
     92072 . S C0CFDA(C0CBF,C0CIEN_",",4)=C0CNOW ; LAST UPDATED FIELD
     92073"RTN","C0CBAT",128,0)
     92074 . S C0CELPS=$$FMDIFF^XLFDT(C0CNOW,C0CBDT,2) ; DIFFERENCE IN SECONDS
     92075"RTN","C0CBAT",129,0)
     92076 . S C0CAVG=C0CELPS/C0CN ; AVERAGE ELAPSED TIME
     92077"RTN","C0CBAT",130,0)
     92078 . S C0CFDA(C0CBF,C0CIEN_",",4.1)=C0CAVG ; AVERAGE ELAPSED TIME
     92079"RTN","C0CBAT",131,0)
     92080 . S C0CETOT=C0CAVG*C0CSN ; EST TOT ELASPSED TIME
     92081"RTN","C0CBAT",132,0)
     92082 . S C0CEST=$$FMADD^XLFDT(C0CBDT,0,0,0,C0CETOT) ; ADD SECONDS TO BATCH START
     92083"RTN","C0CBAT",133,0)
     92084 . S C0CFDA(C0CBF,C0CIEN_",",4.2)=C0CEST ;ESTIMATED COMPLETION TIME
     92085"RTN","C0CBAT",134,0)
     92086 . S C0CFDA(C0CBF,C0CIEN_",",5)=C0CBCUR ;
     92087"RTN","C0CBAT",135,0)
     92088 . D UPDIE ;
     92089"RTN","C0CBAT",136,0)
     92090 . I $D(^TMP("C0CBAT","STOP")) D  ; IF STOP SIGNAL DETECTED
     92091"RTN","C0CBAT",137,0)
     92092 . . S C0CSTOP=1
     92093"RTN","C0CBAT",138,0)
     92094 . . K ^TMP("C0CBAT","STOP") ; SIGNAL RECEIVED
     92095"RTN","C0CBAT",139,0)
     92096 . H 1 ; GIVE IT A BREAK
     92097"RTN","C0CBAT",140,0)
     92098 I (C0CSTOP) S C0CDISP="KILLED"
     92099"RTN","C0CBAT",141,0)
     92100 E  S C0CDISP="FINISHED"
     92101"RTN","C0CBAT",142,0)
     92102 S C0CFDA(C0CBF,C0CIEN_",",6)=C0CDISP
     92103"RTN","C0CBAT",143,0)
     92104 D UPDIE ; SET DISPOSITION FIELD
     92105"RTN","C0CBAT",144,0)
     92106 K ^TMP("C0CBAT","RUNNING")
     92107"RTN","C0CBAT",145,0)
    9191292108 Q
    91913 "RTN","C0CBAT",49,0)
    91914  ;
    91915 "RTN","C0CBAT",50,0)
    91916 EN ; BATCH ENTRY POINT
    91917 "RTN","C0CBAT",51,0)
    91918  ; PROCESSES THE SUBSCRIPTION FILE, EXTRACTING CCR VARIABLES FOR EACH
    91919 "RTN","C0CBAT",52,0)
    91920  ; PATIENT WITH AN ACTIVE SUBSCRIPTION, AND IF CHECKSUMS INDICATE A CHANGE,
    91921 "RTN","C0CBAT",53,0)
    91922  ; GENERATES A NEW CCR FOR THE PATIENT
    91923 "RTN","C0CBAT",54,0)
    91924  ; UPDATES THE E2 CCR ELEMENTS FILE
    91925 "RTN","C0CBAT",55,0)
    91926  ;
    91927 "RTN","C0CBAT",56,0)
    91928  S C0CQT=1 ; QUIET MODE
    91929 "RTN","C0CBAT",57,0)
    91930  I $D(^TMP("C0CBAT","RUNNING")) Q  ; ONLY ONE AT A TIME
    91931 "RTN","C0CBAT",58,0)
    91932  S ^TMP("C0CBAT","RUNNING")="" ; RUNNING SIGNAL
    91933 "RTN","C0CBAT",59,0)
    91934  S C0CBDT=$$NOW^XLFDT ; DATE OF THIS RUN
    91935 "RTN","C0CBAT",60,0)
    91936  S C0CBF=177.301 ; FILE NUMBER OF C0C BATCH CONTROL FILE
    91937 "RTN","C0CBAT",61,0)
    91938  S C0CBFR=177.3013 ; FILE NUMBER OF UPDATE SUBFILE
    91939 "RTN","C0CBAT",62,0)
    91940  S C0CBB=$NA(^TMP("C0CBATCH",C0CBDT)) ; BATCH WORK AREA
    91941 "RTN","C0CBAT",63,0)
    91942  I $D(@C0CBB@(0)) D  ; ERROR SHOULDN'T EXIST
    91943 "RTN","C0CBAT",64,0)
    91944  . W "WORK AREA ERROR",!
    91945 "RTN","C0CBAT",65,0)
    91946  . B
    91947 "RTN","C0CBAT",66,0)
    91948  S @C0CBB@(0)="V22" ; VERSION USED TO CREATE THIS WORK AREA
    91949 "RTN","C0CBAT",67,0)
    91950  S C0CBH=$NA(@C0CBB@("HOTLIST")) ; BASE FOR HOT LIST
    91951 "RTN","C0CBAT",68,0)
    91952  S C0CBS=$NA(^C0CS("B")) ; SUBSCRIPTION LIST BASE
    91953 "RTN","C0CBAT",69,0)
    91954  ;I $D(^C0CB("B",C0CDT)) D  ; BATCH RECORD EXISTS
    91955 "RTN","C0CBAT",70,0)
    91956  ;. H 10 ; HANG 10 SECONDS
    91957 "RTN","C0CBAT",71,0)
    91958  ;. S C0CBDT=$$NOW^XLFDT ; NEW DATE FOR THIS RUN
    91959 "RTN","C0CBAT",72,0)
    91960  ;. I $D(^C0CB("B",C0CDT)) B ;DIDN'T WORK
    91961 "RTN","C0CBAT",73,0)
    91962  D BLDHOT(C0CBH) ; BUILD THE HOT LIST
    91963 "RTN","C0CBAT",74,0)
    91964  S C0CHN=$$COUNT(C0CBH) ;COUNT NUMBER IN HOT LIST
    91965 "RTN","C0CBAT",75,0)
    91966  S C0CSN=$$COUNT(C0CBS) ;COUNT NUMBER OF PATIENTS WITH SUBSCRIPTIONS
    91967 "RTN","C0CBAT",76,0)
    91968  S C0CFDA(C0CBF,"+1,",.01)=C0CBDT ; DATE KEY OF BATCH CONTROL
    91969 "RTN","C0CBAT",77,0)
    91970  S C0CFDA(C0CBF,"+1,",.02)=C0CBDT ; BATCH ID IS DATE IN STRING FORM
    91971 "RTN","C0CBAT",78,0)
    91972  S C0CFDA(C0CBF,"+1,",1)=C0CSN ; TOTAL SUBSCRIPTIONS
    91973 "RTN","C0CBAT",79,0)
    91974  S C0CFDA(C0CBF,"+1,",2)=C0CHN ; TOTAL HOT LIST
    91975 "RTN","C0CBAT",80,0)
    91976  D UPDIE ; CREATE THE BATCH RECORD
    91977 "RTN","C0CBAT",81,0)
    91978  S C0CIEN=$O(^C0CB("B",C0CBDT,""))
    91979 "RTN","C0CBAT",82,0)
    91980  S (C0CN,C0CNH)=0 ; COUNTERS FOR TOTAL AND HOT LIST
    91981 "RTN","C0CBAT",83,0)
    91982  S C0CBCUR="" ; CURRENT PATIENT
    91983 "RTN","C0CBAT",84,0)
    91984  S C0CSTOP=0 ; STOP FLAG FOR HALTING BATCH SET ^TMP("C0CBAT","STOP")=""
    91985 "RTN","C0CBAT",85,0)
    91986  ;F  S C0CBCUR=$O(@C0CBH@(C0CBCUR),-1) Q:C0CBCUR=""  D  ; HOT LIST LATEST FIRST
    91987 "RTN","C0CBAT",86,0)
    91988  F  S C0CBCUR=$O(@C0CBH@(C0CBCUR)) Q:(C0CSTOP)!(C0CBCUR="")  D  ; HOT LIST FIRST
    91989 "RTN","C0CBAT",87,0)
    91990  . D ANALYZE^C0CRIMA(C0CBCUR,1,"LABLIMIT:T-900^VITLIMIT:T-900")
    91991 "RTN","C0CBAT",88,0)
    91992  . I $G(C0CCHK) D  ;
    91993 "RTN","C0CBAT",89,0)
    91994  . . D PUTRIM^C0CFM2(C0CBCUR)
    91995 "RTN","C0CBAT",90,0)
    91996  . . D XPAT^C0CCCR(C0CBCUR) ; IF VARIABLES HAVE CHANGED GENERATE CCR
    91997 "RTN","C0CBAT",91,0)
    91998  . . K C0CFDA
    91999 "RTN","C0CBAT",92,0)
    92000  . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",.01)=C0CBCUR
    92001 "RTN","C0CBAT",93,0)
    92002  . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",1)="Y"
    92003 "RTN","C0CBAT",94,0)
    92004  . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",2)=$G(^TMP("C0CCCR","FNAME",C0CBCUR))
    92005 "RTN","C0CBAT",95,0)
    92006  . . D UPDIE ; CREATE UPDATE SUBFILE
    92007 "RTN","C0CBAT",96,0)
    92008  . S C0CN=C0CN+1 ; INCREMENT NUMBER IN TOTAL
    92009 "RTN","C0CBAT",97,0)
    92010  . S C0CNH=C0CNH+1 ; INCREMENT HOT LIST TOTAL
    92011 "RTN","C0CBAT",98,0)
    92012  . S C0CFDA(C0CBF,C0CIEN_",",1.1)=C0CN ;UPDATE TOTAL PROGRESS
    92013 "RTN","C0CBAT",99,0)
    92014  . S C0CFDA(C0CBF,C0CIEN_",",2.1)=C0CNH ; UPDATE HOT LIST PROGRESS
    92015 "RTN","C0CBAT",100,0)
    92016  . S C0CNOW=$$NOW^XLFDT
    92017 "RTN","C0CBAT",101,0)
    92018  . S C0CFDA(C0CBF,C0CIEN_",",4)=C0CNOW ; LAST UPDATED FIELD
    92019 "RTN","C0CBAT",102,0)
    92020  . S C0CELPS=$$FMDIFF^XLFDT(C0CNOW,C0CBDT,2) ; DIFFERENCE IN SECONDS
    92021 "RTN","C0CBAT",103,0)
    92022  . S C0CAVG=C0CELPS/C0CN ; AVERAGE ELAPSED TIME
    92023 "RTN","C0CBAT",104,0)
    92024  . S C0CFDA(C0CBF,C0CIEN_",",4.1)=C0CAVG ; AVERAGE ELAPSED TIME
    92025 "RTN","C0CBAT",105,0)
    92026  . S C0CETOT=C0CAVG*C0CSN ; EST TOT ELASPSED TIME
    92027 "RTN","C0CBAT",106,0)
    92028  . S C0CEST=$$FMADD^XLFDT(C0CBDT,0,0,0,C0CETOT) ; ADD SECONDS TO BATCH START
    92029 "RTN","C0CBAT",107,0)
    92030  . S C0CFDA(C0CBF,C0CIEN_",",4.2)=C0CEST ;ESTIMATED COMPLETION TIME
    92031 "RTN","C0CBAT",108,0)
    92032  . S C0CFDA(C0CBF,C0CIEN_",",5)=C0CBCUR ; LAST RECORD PROCESSED
    92033 "RTN","C0CBAT",109,0)
    92034  . D UPDIE ;
    92035 "RTN","C0CBAT",110,0)
    92036  . I $D(^TMP("C0CBAT","STOP")) D  ; IF STOP SIGNAL DETECTED
    92037 "RTN","C0CBAT",111,0)
    92038  . . S C0CSTOP=1
    92039 "RTN","C0CBAT",112,0)
    92040  . . K ^TMP("C0CBAT","STOP") ; SIGNAL RECEIVED
    92041 "RTN","C0CBAT",113,0)
    92042  . H 1 ; GIVE OTHERS A CHANCE
    92043 "RTN","C0CBAT",114,0)
    92044  F  S C0CBCUR=$O(@C0CBS@(C0CBCUR)) Q:(C0CSTOP)!(C0CBCUR="")  D  ; SUBS LIST
    92045 "RTN","C0CBAT",115,0)
    92046  . I $D(@C0CBH@(C0CBCUR)) Q  ; SKIP IF IN HOT LIST - ALREADY DONE
    92047 "RTN","C0CBAT",116,0)
    92048  . D ANALYZE^C0CRIMA(C0CBCUR,1,"LABLIMIT:T-760^VITLIMIT:T-760")
    92049 "RTN","C0CBAT",117,0)
    92050  . I $G(C0CCHK) D  ; IF CHECKSUMS HAVE CHANGED
    92051 "RTN","C0CBAT",118,0)
    92052  . . D PUTRIM^C0CFM2(C0CBCUR)
    92053 "RTN","C0CBAT",119,0)
    92054  . . D XPAT^C0CCCR(C0CBCUR) ; IF VARIABLES HAVE CHANGED GENERATE CCR
    92055 "RTN","C0CBAT",120,0)
    92056  . . K C0CFDA
    92057 "RTN","C0CBAT",121,0)
    92058  . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",.01)=C0CBCUR
    92059 "RTN","C0CBAT",122,0)
    92060  . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",1)="Y"
    92061 "RTN","C0CBAT",123,0)
    92062  . . S C0CFDA(C0CBFR,"+1,"_C0CIEN_",",2)=$G(^TMP("C0CCCR","FNAME",C0CBCUR))
    92063 "RTN","C0CBAT",124,0)
    92064  . . D UPDIE ; CREATE UPDATE SUBFILE
    92065 "RTN","C0CBAT",125,0)
    92066  . S C0CN=C0CN+1 ; INCREMENT NUMBER IN TOTAL
    92067 "RTN","C0CBAT",126,0)
    92068  . S C0CFDA(C0CBF,C0CIEN_",",1.1)=C0CN ;UPDATE TOTAL PROGRESS
    92069 "RTN","C0CBAT",127,0)
    92070  . S C0CNOW=$$NOW^XLFDT
    92071 "RTN","C0CBAT",128,0)
    92072  . S C0CFDA(C0CBF,C0CIEN_",",4)=C0CNOW ; LAST UPDATED FIELD
    92073 "RTN","C0CBAT",129,0)
    92074  . S C0CELPS=$$FMDIFF^XLFDT(C0CNOW,C0CBDT,2) ; DIFFERENCE IN SECONDS
    92075 "RTN","C0CBAT",130,0)
    92076  . S C0CAVG=C0CELPS/C0CN ; AVERAGE ELAPSED TIME
    92077 "RTN","C0CBAT",131,0)
    92078  . S C0CFDA(C0CBF,C0CIEN_",",4.1)=C0CAVG ; AVERAGE ELAPSED TIME
    92079 "RTN","C0CBAT",132,0)
    92080  . S C0CETOT=C0CAVG*C0CSN ; EST TOT ELASPSED TIME
    92081 "RTN","C0CBAT",133,0)
    92082  . S C0CEST=$$FMADD^XLFDT(C0CBDT,0,0,0,C0CETOT) ; ADD SECONDS TO BATCH START
    92083 "RTN","C0CBAT",134,0)
    92084  . S C0CFDA(C0CBF,C0CIEN_",",4.2)=C0CEST ;ESTIMATED COMPLETION TIME
    92085 "RTN","C0CBAT",135,0)
    92086  . S C0CFDA(C0CBF,C0CIEN_",",5)=C0CBCUR ;
    92087 "RTN","C0CBAT",136,0)
    92088  . D UPDIE ;
    92089 "RTN","C0CBAT",137,0)
    92090  . I $D(^TMP("C0CBAT","STOP")) D  ; IF STOP SIGNAL DETECTED
    92091 "RTN","C0CBAT",138,0)
    92092  . . S C0CSTOP=1
    92093 "RTN","C0CBAT",139,0)
    92094  . . K ^TMP("C0CBAT","STOP") ; SIGNAL RECEIVED
    92095 "RTN","C0CBAT",140,0)
    92096  . H 1 ; GIVE IT A BREAK
    92097 "RTN","C0CBAT",141,0)
    92098  I (C0CSTOP) S C0CDISP="KILLED"
    92099 "RTN","C0CBAT",142,0)
    92100  E  S C0CDISP="FINISHED"
    92101 "RTN","C0CBAT",143,0)
    92102  S C0CFDA(C0CBF,C0CIEN_",",6)=C0CDISP
    92103 "RTN","C0CBAT",144,0)
    92104  D UPDIE ; SET DISPOSITION FIELD
    92105 "RTN","C0CBAT",145,0)
    92106  K ^TMP("C0CBAT","RUNNING")
    9210792109"RTN","C0CBAT",146,0)
     92110 ;
     92111"RTN","C0CBAT",147,0)
     92112BLDHOT(ZHB) ; BUILD HOT LIST AT GLOBAL ZHB, PASSED BY NAME
     92113"RTN","C0CBAT",148,0)
     92114 ; SEARCHS FOR PATIENTS IN THE "AC" INDEX OF THE ORDER FILE
     92115"RTN","C0CBAT",149,0)
     92116 N ZDFN
     92117"RTN","C0CBAT",150,0)
     92118 S ZDFN=""
     92119"RTN","C0CBAT",151,0)
     92120 F  S ZDFN=$O(^OR(100,"AC",ZDFN)) Q:ZDFN=""  D  ; ALL PATIENTS IN THE AC INDX
     92121"RTN","C0CBAT",152,0)
     92122 . S ZZDFN=$P(ZDFN,";",1) ; FORMAT IS "N;DPT("
     92123"RTN","C0CBAT",153,0)
     92124 . I '$D(@C0CBS@(ZZDFN)) Q  ; SKIP IF NOT IN SUBSCRIPTION LIST
     92125"RTN","C0CBAT",154,0)
     92126 . S @ZHB@(ZZDFN)="" ;ADD PATIENT TO THE HOT LIST
     92127"RTN","C0CBAT",155,0)
    9210892128 Q
    92109 "RTN","C0CBAT",147,0)
    92110  ;
    92111 "RTN","C0CBAT",148,0)
    92112 BLDHOT(ZHB) ; BUILD HOT LIST AT GLOBAL ZHB, PASSED BY NAME
    92113 "RTN","C0CBAT",149,0)
    92114  ; SEARCHS FOR PATIENTS IN THE "AC" INDEX OF THE ORDER FILE
    92115 "RTN","C0CBAT",150,0)
    92116  N ZDFN
    92117 "RTN","C0CBAT",151,0)
    92118  S ZDFN=""
    92119 "RTN","C0CBAT",152,0)
    92120  F  S ZDFN=$O(^OR(100,"AC",ZDFN)) Q:ZDFN=""  D  ; ALL PATIENTS IN THE AC INDX
    92121 "RTN","C0CBAT",153,0)
    92122  . S ZZDFN=$P(ZDFN,";",1) ; FORMAT IS "N;DPT("
    92123 "RTN","C0CBAT",154,0)
    92124  . I '$D(@C0CBS@(ZZDFN)) Q  ; SKIP IF NOT IN SUBSCRIPTION LIST
    92125 "RTN","C0CBAT",155,0)
    92126  . S @ZHB@(ZZDFN)="" ;ADD PATIENT TO THE HOT LIST
    9212792129"RTN","C0CBAT",156,0)
     92130 ;
     92131"RTN","C0CBAT",157,0)
     92132COUNT(ZB) ; EXTRINSIC THAT RETURNS THE NUMBER OF ARRAY ELEMENTS
     92133"RTN","C0CBAT",158,0)
     92134 N ZI,ZN
     92135"RTN","C0CBAT",159,0)
     92136 S ZN=0
     92137"RTN","C0CBAT",160,0)
     92138 S ZI=""
     92139"RTN","C0CBAT",161,0)
     92140 F  S ZI=$O(@ZB@(ZI)) Q:ZI=""  D  ;
     92141"RTN","C0CBAT",162,0)
     92142 . S ZN=ZN+1
     92143"RTN","C0CBAT",163,0)
     92144 Q ZN
     92145"RTN","C0CBAT",164,0)
     92146 ;
     92147"RTN","C0CBAT",165,0)
     92148UVARPTR(ZVAR,ZTYP) ;EXTRINSIC WHICH RETURNS THE POINTER TO ZVAR IN THE
     92149"RTN","C0CBAT",166,0)
     92150 ; CCR DICTIONARY. IT IS LAYGO, AS IT WILL ADD THE VARIABLE TO
     92151"RTN","C0CBAT",167,0)
     92152 ; THE CCR DICTIONARY IF IT IS NOT THERE. ZTYP IS REQUIRED FOR LAYGO
     92153"RTN","C0CBAT",168,0)
     92154 ;
     92155"RTN","C0CBAT",169,0)
     92156 N ZCCRD,ZVARN,C0CFDA2
     92157"RTN","C0CBAT",170,0)
     92158 S ZCCRD=170 ; FILE NUMBER FOR CCR DICTIONARY
     92159"RTN","C0CBAT",171,0)
     92160 S ZVARN=$O(^C0CDIC(170,"B",ZVAR,"")) ;FIND IEN OF VARIABLE
     92161"RTN","C0CBAT",172,0)
     92162 I ZVARN="" D  ; VARIABLE NOT IN CCR DICTIONARY - ADD IT
     92163"RTN","C0CBAT",173,0)
     92164 . I '$D(ZTYP) D  Q  ; WON'T ADD A VARIABLE WITHOUT A TYPE
     92165"RTN","C0CBAT",174,0)
     92166 . . W "CANNOT ADD VARIABLE WITHOUT A TYPE: ",ZVAR,!
     92167"RTN","C0CBAT",175,0)
     92168 . S C0CFDA2(ZCCRD,"?+1,",.01)=ZVAR ; NAME OF NEW VARIABLE
     92169"RTN","C0CBAT",176,0)
     92170 . S C0CFDA2(ZCCRD,"?+1,",12)=ZTYP ; TYPE EXTERNAL OF NEW VARIABLE
     92171"RTN","C0CBAT",177,0)
     92172 . D CLEAN^DILF ;MAKE SURE ERRORS ARE CLEAN
     92173"RTN","C0CBAT",178,0)
     92174 . D UPDATE^DIE("E","C0CFDA2","","ZERR") ;ADD VAR TO CCR DICTIONARY
     92175"RTN","C0CBAT",179,0)
     92176 . I $D(ZERR) D  ; LAYGO ERROR
     92177"RTN","C0CBAT",180,0)
     92178 . . W "ERROR ADDING "_ZC0CI_" TO CCR DICTIONARY",!
     92179"RTN","C0CBAT",181,0)
     92180 . E  D  ;
     92181"RTN","C0CBAT",182,0)
     92182 . . D CLEAN^DILF ; CLEAN UP
     92183"RTN","C0CBAT",183,0)
     92184 . . S ZVARN=$O(^C0CDIC(170,"B",ZVAR,"")) ;FIND IEN OF VARIABLE
     92185"RTN","C0CBAT",184,0)
     92186 . . W "ADDED ",ZVAR," TO CCR DICTIONARY, IEN:",ZVARN,!
     92187"RTN","C0CBAT",185,0)
     92188 Q ZVARN
     92189"RTN","C0CBAT",186,0)
     92190 ;
     92191"RTN","C0CBAT",187,0)
     92192UPDIE ; INTERNAL ROUTINE TO CALL UPDATE^DIE AND CHECK FOR ERRORS
     92193"RTN","C0CBAT",188,0)
     92194 K ZERR
     92195"RTN","C0CBAT",189,0)
     92196 D CLEAN^DILF
     92197"RTN","C0CBAT",190,0)
     92198 D UPDATE^DIE("","C0CFDA","","ZERR")
     92199"RTN","C0CBAT",191,0)
     92200 I $D(ZERR) S $EC=",U1,"
     92201"RTN","C0CBAT",192,0)
     92202 K C0CFDA
     92203"RTN","C0CBAT",193,0)
    9212892204 Q
    92129 "RTN","C0CBAT",157,0)
    92130  ;
    92131 "RTN","C0CBAT",158,0)
    92132 COUNT(ZB) ; EXTRINSIC THAT RETURNS THE NUMBER OF ARRAY ELEMENTS
    92133 "RTN","C0CBAT",159,0)
    92134  N ZI,ZN
    92135 "RTN","C0CBAT",160,0)
    92136  S ZN=0
    92137 "RTN","C0CBAT",161,0)
    92138  S ZI=""
    92139 "RTN","C0CBAT",162,0)
    92140  F  S ZI=$O(@ZB@(ZI)) Q:ZI=""  D  ;
    92141 "RTN","C0CBAT",163,0)
    92142  . S ZN=ZN+1
    92143 "RTN","C0CBAT",164,0)
    92144  Q ZN
    92145 "RTN","C0CBAT",165,0)
    92146  ;
    92147 "RTN","C0CBAT",166,0)
    92148 UPDIEVARPTR(ZVAR,ZTYP) ;EXTRINSIC WHICH RETURNS THE POINTER TO ZVAR IN THE
    92149 "RTN","C0CBAT",167,0)
    92150  ; CCR DICTIONARY. IT IS LAYGO, AS IT WILL ADD THE VARIABLE TO
    92151 "RTN","C0CBAT",168,0)
    92152  ; THE CCR DICTIONARY IF IT IS NOT THERE. ZTYP IS REQUIRED FOR LAYGO
    92153 "RTN","C0CBAT",169,0)
    92154  ;
    92155 "RTN","C0CBAT",170,0)
    92156  N ZCCRD,ZVARN,C0CFDA2
    92157 "RTN","C0CBAT",171,0)
    92158  S ZCCRD=170 ; FILE NUMBER FOR CCR DICTIONARY
    92159 "RTN","C0CBAT",172,0)
    92160  S ZVARN=$O(^C0CDIC(170,"B",ZVAR,"")) ;FIND IEN OF VARIABLE
    92161 "RTN","C0CBAT",173,0)
    92162  I ZVARN="" D  ; VARIABLE NOT IN CCR DICTIONARY - ADD IT
    92163 "RTN","C0CBAT",174,0)
    92164  . I '$D(ZTYP) D  Q  ; WON'T ADD A VARIABLE WITHOUT A TYPE
    92165 "RTN","C0CBAT",175,0)
    92166  . . W "CANNOT ADD VARIABLE WITHOUT A TYPE: ",ZVAR,!
    92167 "RTN","C0CBAT",176,0)
    92168  . S C0CFDA2(ZCCRD,"?+1,",.01)=ZVAR ; NAME OF NEW VARIABLE
    92169 "RTN","C0CBAT",177,0)
    92170  . S C0CFDA2(ZCCRD,"?+1,",12)=ZTYP ; TYPE EXTERNAL OF NEW VARIABLE
    92171 "RTN","C0CBAT",178,0)
    92172  . D CLEAN^DILF ;MAKE SURE ERRORS ARE CLEAN
    92173 "RTN","C0CBAT",179,0)
    92174  . D UPDATE^DIE("E","C0CFDA2","","ZERR") ;ADD VAR TO CCR DICTIONARY
    92175 "RTN","C0CBAT",180,0)
    92176  . I $D(ZERR) D  ; LAYGO ERROR
    92177 "RTN","C0CBAT",181,0)
    92178  . . W "ERROR ADDING "_ZC0CI_" TO CCR DICTIONARY",!
    92179 "RTN","C0CBAT",182,0)
    92180  . E  D  ;
    92181 "RTN","C0CBAT",183,0)
    92182  . . D CLEAN^DILF ; CLEAN UP
    92183 "RTN","C0CBAT",184,0)
    92184  . . S ZVARN=$O(^C0CDIC(170,"B",ZVAR,"")) ;FIND IEN OF VARIABLE
    92185 "RTN","C0CBAT",185,0)
    92186  . . W "ADDED ",ZVAR," TO CCR DICTIONARY, IEN:",ZVARN,!
    92187 "RTN","C0CBAT",186,0)
    92188  Q ZVARN
    92189 "RTN","C0CBAT",187,0)
    92190  ;
    92191 "RTN","C0CBAT",188,0)
    92192 UPDIE ; INTERNAL ROUTINE TO CALL UPDATE^DIE AND CHECK FOR ERRORS
    92193 "RTN","C0CBAT",189,0)
    92194  K ZERR
    92195 "RTN","C0CBAT",190,0)
    92196  D CLEAN^DILF
    92197 "RTN","C0CBAT",191,0)
    92198  D UPDATE^DIE("","C0CFDA","","ZERR")
    92199 "RTN","C0CBAT",192,0)
    92200  I $D(ZERR) D  ;
    92201 "RTN","C0CBAT",193,0)
    92202  . W "ERROR",!
    9220392205"RTN","C0CBAT",194,0)
    92204  . ZWR ZERR
     92206 ;
    9220592207"RTN","C0CBAT",195,0)
    92206  . B
     92208SETFDA(C0CSN,C0CSV) ; INTERNAL ROUTINE TO MAKE AN FDA ENTRY FOR FIELD C0CSN
    9220792209"RTN","C0CBAT",196,0)
    92208  K C0CFDA
     92210 ; TO SET TO VALUE C0CSV.
    9220992211"RTN","C0CBAT",197,0)
     92212 ; C0CFDA,C0CC,C0CZX ARE ASSUMED FROM THE CALLING ROUTINE
     92213"RTN","C0CBAT",198,0)
     92214 ; C0CSN,C0CSV ARE PASSED BY VALUE
     92215"RTN","C0CBAT",199,0)
     92216 ;
     92217"RTN","C0CBAT",200,0)
     92218 N C0CSI,C0CSJ
     92219"RTN","C0CBAT",201,0)
     92220 S C0CSI=$$ZFILE(C0CSN,"C0CC") ; FILE NUMBER
     92221"RTN","C0CBAT",202,0)
     92222 S C0CSJ=$$ZFIELD(C0CSN,"C0CC") ; FIELD NUMBER
     92223"RTN","C0CBAT",203,0)
     92224 S C0CFDA(C0CSI,C0CZX_",",C0CSJ)=C0CSV
     92225"RTN","C0CBAT",204,0)
    9221092226 Q
    92211 "RTN","C0CBAT",198,0)
    92212  ;
    92213 "RTN","C0CBAT",199,0)
    92214 SETFDA(C0CSN,C0CSV) ; INTERNAL ROUTINE TO MAKE AN FDA ENTRY FOR FIELD C0CSN
    92215 "RTN","C0CBAT",200,0)
    92216  ; TO SET TO VALUE C0CSV.
    92217 "RTN","C0CBAT",201,0)
    92218  ; C0CFDA,C0CC,C0CZX ARE ASSUMED FROM THE CALLING ROUTINE
    92219 "RTN","C0CBAT",202,0)
    92220  ; C0CSN,C0CSV ARE PASSED BY VALUE
    92221 "RTN","C0CBAT",203,0)
    92222  ;
    92223 "RTN","C0CBAT",204,0)
    92224  N C0CSI,C0CSJ
    9222592227"RTN","C0CBAT",205,0)
    92226  S C0CSI=$$ZFILE(C0CSN,"C0CC") ; FILE NUMBER
     92228ZFILE(ZFN,ZTAB) ; EXTRINSIC TO RETURN FILE NUMBER FOR FIELD NAME PASSED
    9222792229"RTN","C0CBAT",206,0)
    92228  S C0CSJ=$$ZFIELD(C0CSN,"C0CC") ; FIELD NUMBER
     92230 ; BY VALUE IN ZFN. FILE NUMBER IS PIECE 1 OF C0CA(ZFN)
    9222992231"RTN","C0CBAT",207,0)
    92230  S C0CFDA(C0CSI,C0CZX_",",C0CSJ)=C0CSV
     92232 ; IF ZTAB IS NULL, IT DEFAULTS TO C0CA
    9223192233"RTN","C0CBAT",208,0)
    92232  Q
     92234 I '$D(ZTAB) S ZTAB="C0CA"
    9223392235"RTN","C0CBAT",209,0)
    92234 ZFILE(ZFN,ZTAB) ; EXTRINSIC TO RETURN FILE NUMBER FOR FIELD NAME PASSED
     92236 N ZR
    9223592237"RTN","C0CBAT",210,0)
    92236  ; BY VALUE IN ZFN. FILE NUMBER IS PIECE 1 OF C0CA(ZFN)
     92238 I $D(@ZTAB@(ZFN)) S ZR=$P(@ZTAB@(ZFN),"^",1)
    9223792239"RTN","C0CBAT",211,0)
     92240 E  S ZR=""
     92241"RTN","C0CBAT",212,0)
     92242 Q ZR
     92243"RTN","C0CBAT",213,0)
     92244ZFIELD(ZFN,ZTAB) ;EXTRINSIC TO RETURN FIELD NUMBER FOR FIELD NAME PASSED
     92245"RTN","C0CBAT",214,0)
     92246 ; BY VALUE IN ZFN. FILE NUMBER IS PIECE 2 OF C0CA(ZFN)
     92247"RTN","C0CBAT",215,0)
    9223892248 ; IF ZTAB IS NULL, IT DEFAULTS TO C0CA
    92239 "RTN","C0CBAT",212,0)
     92249"RTN","C0CBAT",216,0)
    9224092250 I '$D(ZTAB) S ZTAB="C0CA"
    92241 "RTN","C0CBAT",213,0)
     92251"RTN","C0CBAT",217,0)
    9224292252 N ZR
    92243 "RTN","C0CBAT",214,0)
    92244  I $D(@ZTAB@(ZFN)) S ZR=$P(@ZTAB@(ZFN),"^",1)
    92245 "RTN","C0CBAT",215,0)
     92253"RTN","C0CBAT",218,0)
     92254 I $D(@ZTAB@(ZFN)) S ZR=$P(@ZTAB@(ZFN),"^",2)
     92255"RTN","C0CBAT",219,0)
    9224692256 E  S ZR=""
    92247 "RTN","C0CBAT",216,0)
     92257"RTN","C0CBAT",220,0)
    9224892258 Q ZR
    92249 "RTN","C0CBAT",217,0)
    92250 ZFIELD(ZFN,ZTAB) ;EXTRINSIC TO RETURN FIELD NUMBER FOR FIELD NAME PASSED
    92251 "RTN","C0CBAT",218,0)
    92252  ; BY VALUE IN ZFN. FILE NUMBER IS PIECE 2 OF C0CA(ZFN)
    92253 "RTN","C0CBAT",219,0)
     92259"RTN","C0CBAT",221,0)
     92260 ;
     92261"RTN","C0CBAT",222,0)
     92262ZVALUE(ZFN,ZTAB) ;EXTRINSIC TO RETURN VALUE FOR FIELD NAME PASSED
     92263"RTN","C0CBAT",223,0)
     92264 ; BY VALUE IN ZFN. FILE NUMBER IS PIECE 3 OF C0CA(ZFN)
     92265"RTN","C0CBAT",224,0)
    9225492266 ; IF ZTAB IS NULL, IT DEFAULTS TO C0CA
    92255 "RTN","C0CBAT",220,0)
     92267"RTN","C0CBAT",225,0)
    9225692268 I '$D(ZTAB) S ZTAB="C0CA"
    92257 "RTN","C0CBAT",221,0)
     92269"RTN","C0CBAT",226,0)
    9225892270 N ZR
    92259 "RTN","C0CBAT",222,0)
    92260  I $D(@ZTAB@(ZFN)) S ZR=$P(@ZTAB@(ZFN),"^",2)
    92261 "RTN","C0CBAT",223,0)
     92271"RTN","C0CBAT",227,0)
     92272 I $D(@ZTAB@(ZFN)) S ZR=$P(@ZTAB@(ZFN),"^",3)
     92273"RTN","C0CBAT",228,0)
    9226292274 E  S ZR=""
    92263 "RTN","C0CBAT",224,0)
     92275"RTN","C0CBAT",229,0)
    9226492276 Q ZR
    92265 "RTN","C0CBAT",225,0)
    92266  ;
    92267 "RTN","C0CBAT",226,0)
    92268 ZVALUE(ZFN,ZTAB) ;EXTRINSIC TO RETURN VALUE FOR FIELD NAME PASSED
    92269 "RTN","C0CBAT",227,0)
    92270  ; BY VALUE IN ZFN. FILE NUMBER IS PIECE 3 OF C0CA(ZFN)
    92271 "RTN","C0CBAT",228,0)
    92272  ; IF ZTAB IS NULL, IT DEFAULTS TO C0CA
    92273 "RTN","C0CBAT",229,0)
    92274  I '$D(ZTAB) S ZTAB="C0CA"
    9227592277"RTN","C0CBAT",230,0)
    92276  N ZR
    92277 "RTN","C0CBAT",231,0)
    92278  I $D(@ZTAB@(ZFN)) S ZR=$P(@ZTAB@(ZFN),"^",3)
    92279 "RTN","C0CBAT",232,0)
    92280  E  S ZR=""
    92281 "RTN","C0CBAT",233,0)
    92282  Q ZR
    92283 "RTN","C0CBAT",234,0)
    9228492278 ;
    9228592279"RTN","C0CCCD")
    92286 0^45^B114134049
     922800^45^B89035344
    9228792281"RTN","C0CCCD",1,0)
    9228892282C0CCCD   ; CCDCCR/GPL - CCD MAIN PROCESSING; 6/6/08
    9228992283"RTN","C0CCCD",2,0)
    92290  ;;1.2;C0C;;May 11, 2012;Build 50
     92284 ;;1.2;CCD/CCR GENERATION UTILITIES;;Oct 30, 2012;Build 51
    9229192285"RTN","C0CCCD",3,0)
    9229292286 ;Copyright 2008,2009 George Lilly, University of Minnesota.
    9229392287"RTN","C0CCCD",4,0)
    92294  ;Licensed under the terms of the GNU General Public License.
     92288 ;
    9229592289"RTN","C0CCCD",5,0)
    92296  ;See attached copy of the License.
     92290 ; This program is free software: you can redistribute it and/or modify
    9229792291"RTN","C0CCCD",6,0)
    92298  ;
     92292 ; it under the terms of the GNU Affero General Public License as
    9229992293"RTN","C0CCCD",7,0)
    92300  ;This program is free software; you can redistribute it and/or modify
     92294 ; published by the Free Software Foundation, either version 3 of the
    9230192295"RTN","C0CCCD",8,0)
    92302  ;it under the terms of the GNU General Public License as published by
     92296 ; License, or (at your option) any later version.
    9230392297"RTN","C0CCCD",9,0)
    92304  ;the Free Software Foundation; either version 2 of the License, or
     92298 ;
    9230592299"RTN","C0CCCD",10,0)
    92306  ;(at your option) any later version.
     92300 ; This program is distributed in the hope that it will be useful,
    9230792301"RTN","C0CCCD",11,0)
    92308  ;
     92302 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
    9230992303"RTN","C0CCCD",12,0)
    92310  ;This program is distributed in the hope that it will be useful,
     92304 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    9231192305"RTN","C0CCCD",13,0)
    92312  ;but WITHOUT ANY WARRANTY; without even the implied warranty of
     92306 ; GNU Affero General Public License for more details.
    9231392307"RTN","C0CCCD",14,0)
    92314  ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     92308 ;
    9231592309"RTN","C0CCCD",15,0)
    92316  ;GNU General Public License for more details.
     92310 ; You should have received a copy of the GNU Affero General Public License
    9231792311"RTN","C0CCCD",16,0)
    92318  ;
     92312 ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    9231992313"RTN","C0CCCD",17,0)
    92320  ;You should have received a copy of the GNU General Public License along
     92314 ;
    9232192315"RTN","C0CCCD",18,0)
    92322  ;with this program; if not, write to the Free Software Foundation, Inc.,
     92316 ; EXPORT A CCR
    9232392317"RTN","C0CCCD",19,0)
    92324  ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     92318 ;
    9232592319"RTN","C0CCCD",20,0)
    92326  ;
     92320EXPORT   ; EXPORT ENTRY POINT FOR CCR
    9232792321"RTN","C0CCCD",21,0)
    92328  ; EXPORT A CCR
     92322 ; Select a patient.
    9232992323"RTN","C0CCCD",22,0)
    92330  ;
     92324 S DIC=2,DIC(0)="AEMQ" D ^DIC
    9233192325"RTN","C0CCCD",23,0)
    92332 EXPORT   ; EXPORT ENTRY POINT FOR CCR
     92326 I Y<1 Q  ; EXIT
    9233392327"RTN","C0CCCD",24,0)
    92334        ; Select a patient.
     92328 S DFN=$P(Y,U,1) ; SET THE PATIENT
    9233592329"RTN","C0CCCD",25,0)
    92336        S DIC=2,DIC(0)="AEMQ" D ^DIC
     92330 D XPAT(DFN,"","") ; EXPORT TO A FILE
    9233792331"RTN","C0CCCD",26,0)
    92338        I Y<1 Q  ; EXIT
     92332 Q
    9233992333"RTN","C0CCCD",27,0)
    92340        S DFN=$P(Y,U,1) ; SET THE PATIENT
     92334 ;
    9234192335"RTN","C0CCCD",28,0)
    92342        D XPAT(DFN,"","") ; EXPORT TO A FILE
     92336XPAT(DFN,DIR,FN) ; EXPORT ONE PATIENT TO A FILE
    9234392337"RTN","C0CCCD",29,0)
    92344        Q
     92338 ; DIR IS THE DIRECTORY, DEFAULTS IF NULL TO ^TMP("C0CCCR","ODIR")
    9234592339"RTN","C0CCCD",30,0)
    92346        ;
     92340 ; FN IS FILE NAME, DEFAULTS IF NULL
    9234792341"RTN","C0CCCD",31,0)
    92348 XPAT(DFN,DIR,FN) ; EXPORT ONE PATIENT TO A FILE
     92342 ; N CCDGLO
    9234992343"RTN","C0CCCD",32,0)
    92350        ; DIR IS THE DIRECTORY, DEFAULTS IF NULL TO ^TMP("C0CCCR","ODIR")
     92344 D CCDRPC(.CCDGLO,DFN,"CCD","","","")
    9235192345"RTN","C0CCCD",33,0)
    92352        ; FN IS FILE NAME, DEFAULTS IF NULL
     92346 S OARY=$NA(^TMP("C0CCCR",$J,DFN,"CCD",1))
    9235392347"RTN","C0CCCD",34,0)
    92354        ; N CCDGLO
     92348 S ONAM=FN
    9235592349"RTN","C0CCCD",35,0)
    92356        D CCDRPC(.CCDGLO,DFN,"CCD","","","")
     92350 I FN="" S ONAM="PAT_"_DFN_"_CCD_V1.xml"
    9235792351"RTN","C0CCCD",36,0)
    92358        S OARY=$NA(^TMP("C0CCCR",$J,DFN,"CCD",1))
     92352 S ODIRGLB=$NA(^TMP("C0CCCR","ODIR"))
    9235992353"RTN","C0CCCD",37,0)
    92360        S ONAM=FN
     92354 I '$D(@ODIRGLB) D  ; IF NOT ODIR HAS BEEN SET
    9236192355"RTN","C0CCCD",38,0)
    92362        I FN="" S ONAM="PAT_"_DFN_"_CCD_V1.xml"
     92356 . S @ODIRGLB="/home/glilly/CCROUT"
    9236392357"RTN","C0CCCD",39,0)
    92364        S ODIRGLB=$NA(^TMP("C0CCCR","ODIR"))
     92358 . ;S @ODIRGLB="/home/cedwards/"
    9236592359"RTN","C0CCCD",40,0)
    92366        I '$D(@ODIRGLB) D  ; IF NOT ODIR HAS BEEN SET
     92360 . ;S @ODIRGLB="/opt/wv/p/"
    9236792361"RTN","C0CCCD",41,0)
    92368        . S @ODIRGLB="/home/glilly/CCROUT"
     92362 S ODIR=DIR
    9236992363"RTN","C0CCCD",42,0)
    92370        . ;S @ODIRGLB="/home/cedwards/"
     92364 I DIR="" S ODIR=@ODIRGLB
    9237192365"RTN","C0CCCD",43,0)
    92372        . ;S @ODIRGLB="/opt/wv/p/"
     92366 N ZY
    9237392367"RTN","C0CCCD",44,0)
    92374        S ODIR=DIR
     92368 S ZY=$$OUTPUT^C0CXPATH(OARY,ONAM,ODIR)
    9237592369"RTN","C0CCCD",45,0)
    92376        I DIR="" S ODIR=@ODIRGLB
     92370 W $P(ZY,U,2)
    9237792371"RTN","C0CCCD",46,0)
    92378        N ZY
     92372 Q
    9237992373"RTN","C0CCCD",47,0)
    92380        S ZY=$$OUTPUT^C0CXPATH(OARY,ONAM,ODIR)
     92374 ;
    9238192375"RTN","C0CCCD",48,0)
    92382        W $P(ZY,U,2)
     92376CCDRPC(CCRGRTN,DFN,CCRPART,TIME1,TIME2,HDRARY)  ;RPC ENTRY POINT FOR CCR OUTPUT
    9238392377"RTN","C0CCCD",49,0)
    92384        Q
     92378 ; CCRGRTN IS RETURN ARRAY PASSED BY NAME
    9238592379"RTN","C0CCCD",50,0)
    92386        ;
     92380 ; DFN IS PATIENT IEN
    9238792381"RTN","C0CCCD",51,0)
    92388 CCDRPC(CCRGRTN,DFN,CCRPART,TIME1,TIME2,HDRARY)  ;RPC ENTRY POINT FOR CCR OUTPUT
     92382 ; CCRPART IS "CCR" FOR ENTIRE CCR, OR SECTION NAME FOR A PART
    9238992383"RTN","C0CCCD",52,0)
    92390     ; CCRGRTN IS RETURN ARRAY PASSED BY NAME
     92384 ;   OF THE CCR BODY.. PARTS INCLUDE "PROBLEMS" "VITALS" ETC
    9239192385"RTN","C0CCCD",53,0)
    92392     ; DFN IS PATIENT IEN
     92386 ; TIME1 IS STARTING TIME TO INCLUDE - NULL MEANS ALL
    9239392387"RTN","C0CCCD",54,0)
    92394     ; CCRPART IS "CCR" FOR ENTIRE CCR, OR SECTION NAME FOR A PART
     92388 ; TIME2 IS ENDING TIME TO INCLUDE TIME IS FILEMAN TIME
    9239592389"RTN","C0CCCD",55,0)
    92396     ;   OF THE CCR BODY.. PARTS INCLUDE "PROBLEMS" "VITALS" ETC
     92390 ; - NULL MEANS NOW
    9239792391"RTN","C0CCCD",56,0)
    92398     ; TIME1 IS STARTING TIME TO INCLUDE - NULL MEANS ALL
     92392 ; HDRARY IS THE HEADER ARRAY DEFINING THE "FROM" AND
    9239992393"RTN","C0CCCD",57,0)
    92400     ; TIME2 IS ENDING TIME TO INCLUDE TIME IS FILEMAN TIME
     92394 ;    "TO" VARIABLES
    9240192395"RTN","C0CCCD",58,0)
    92402     ; - NULL MEANS NOW
     92396 ;    IF NULL WILL DEFAULT TO "FROM" ORGANIZATION AND "TO" DFN
    9240392397"RTN","C0CCCD",59,0)
    92404     ; HDRARY IS THE HEADER ARRAY DEFINING THE "FROM" AND
     92398 I '$D(DEBUG) S DEBUG=0
    9240592399"RTN","C0CCCD",60,0)
    92406     ;    "TO" VARIABLES
     92400 N CCD S CCD=0 ; FLAG FOR PROCESSING A CCD
    9240792401"RTN","C0CCCD",61,0)
    92408     ;    IF NULL WILL DEFAULT TO "FROM" ORGANIZATION AND "TO" DFN
     92402 I CCRPART="CCD" S CCD=1 ; WE ARE PROCESSING A CCD
    9240992403"RTN","C0CCCD",62,0)
    92410     I '$D(DEBUG) S DEBUG=0
     92404 S TGLOBAL=$NA(^TMP("C0CCCR",$J,"TEMPLATE")) ; GLOBAL FOR STORING TEMPLATE
    9241192405"RTN","C0CCCD",63,0)
    92412     N CCD S CCD=0 ; FLAG FOR PROCESSING A CCD
     92406 I CCD S CCDGLO=$NA(^TMP("C0CCCR",$J,DFN,"CCD")) ; GLOBAL FOR THE CCD
    9241392407"RTN","C0CCCD",64,0)
    92414     I CCRPART="CCD" S CCD=1 ; WE ARE PROCESSING A CCD
     92408 E  S CCDGLO=$NA(^TMP("C0CCCR",$J,DFN,"CCR")) ; GLOBAL FOR BUILDING THE CCR
    9241592409"RTN","C0CCCD",65,0)
    92416     S TGLOBAL=$NA(^TMP("C0CCCR",$J,"TEMPLATE")) ; GLOBAL FOR STORING TEMPLATE
     92410 S ACTGLO=$NA(^TMP("C0CCCR",$J,DFN,"ACTORS")) ; GLOBAL FOR ALL ACTORS
    9241792411"RTN","C0CCCD",66,0)
    92418     I CCD S CCDGLO=$NA(^TMP("C0CCCR",$J,DFN,"CCD")) ; GLOBAL FOR THE CCD
     92412 ; TO GET PART OF THE CCR RETURNED, PASS CCRPART="PROBLEMS" ETC
    9241992413"RTN","C0CCCD",67,0)
    92420     E  S CCDGLO=$NA(^TMP("C0CCCR",$J,DFN,"CCR")) ; GLOBAL FOR BUILDING THE CCR
     92414 S CCRGRTN=$NA(^TMP("C0CCCR",$J,DFN,CCRPART)) ; RTN GLO NM OF PART OR ALL
    9242192415"RTN","C0CCCD",68,0)
    92422     S ACTGLO=$NA(^TMP("C0CCCR",$J,DFN,"ACTORS")) ; GLOBAL FOR ALL ACTORS
     92416 I CCD D LOAD^C0CCCD1(TGLOBAL)  ; LOAD THE CCR TEMPLATE
    9242392417"RTN","C0CCCD",69,0)
    92424     ; TO GET PART OF THE CCR RETURNED, PASS CCRPART="PROBLEMS" ETC
     92418 E  D LOAD^C0CCCR0(TGLOBAL)  ; LOAD THE CCR TEMPLATE
    9242592419"RTN","C0CCCD",70,0)
    92426     S CCRGRTN=$NA(^TMP("C0CCCR",$J,DFN,CCRPART)) ; RTN GLO NM OF PART OR ALL
     92420 D CP^C0CXPATH(TGLOBAL,CCDGLO) ; COPY THE TEMPLATE TO CCR GLOBAL
    9242792421"RTN","C0CCCD",71,0)
    92428     I CCD D LOAD^C0CCCD1(TGLOBAL)  ; LOAD THE CCR TEMPLATE
     92422 N CAPSAVE,CAPSAVE2 ; FOR HOLDING THE CCD ROOT LINES
    9242992423"RTN","C0CCCD",72,0)
    92430     E  D LOAD^C0CCCR0(TGLOBAL)  ; LOAD THE CCR TEMPLATE
     92424 S CAPSAVE=@TGLOBAL@(3) ; SAVE THE CCD ROOT
    9243192425"RTN","C0CCCD",73,0)
    92432     D CP^C0CXPATH(TGLOBAL,CCDGLO) ; COPY THE TEMPLATE TO CCR GLOBAL
     92426 S CAPSAVE2=@TGLOBAL@(@TGLOBAL@(0)) ; SAVE LAST LINE OF CCD
    9243392427"RTN","C0CCCD",74,0)
    92434     N CAPSAVE,CAPSAVE2 ; FOR HOLDING THE CCD ROOT LINES
     92428 S @CCDGLO@(3)="<ContinuityOfCareRecord>" ; CAP WITH CCR ROOT
    9243592429"RTN","C0CCCD",75,0)
    92436     S CAPSAVE=@TGLOBAL@(3) ; SAVE THE CCD ROOT
     92430 S @TGLOBAL@(3)=@CCDGLO@(3) ; CAP THE TEMPLATE TOO
    9243792431"RTN","C0CCCD",76,0)
    92438     S CAPSAVE2=@TGLOBAL@(@TGLOBAL@(0)) ; SAVE LAST LINE OF CCD
     92432 S @CCDGLO@(@CCDGLO@(0))="</ContinuityOfCareRecord>" ; FINISH CAP
    9243992433"RTN","C0CCCD",77,0)
    92440     S @CCDGLO@(3)="<ContinuityOfCareRecord>" ; CAP WITH CCR ROOT
     92434 S @TGLOBAL@(@TGLOBAL@(0))="</ContinuityOfCareRecord>" ; FINISH CAP TEMP
    9244192435"RTN","C0CCCD",78,0)
    92442     S @TGLOBAL@(3)=@CCDGLO@(3) ; CAP THE TEMPLATE TOO
     92436 ;
    9244392437"RTN","C0CCCD",79,0)
    92444     S @CCDGLO@(@CCDGLO@(0))="</ContinuityOfCareRecord>" ; FINISH CAP
     92438 ; DELETE THE BODY, ACTORS AND SIGNATURES SECTIONS FROM GLOBAL
    9244592439"RTN","C0CCCD",80,0)
    92446     S @TGLOBAL@(@TGLOBAL@(0))="</ContinuityOfCareRecord>" ; FINISH CAP TEMP
     92440 ; THESE WILL BE POPULATED AFTER CALLS TO THE XPATH ROUTINES
    9244792441"RTN","C0CCCD",81,0)
    92448     ;
     92442 D REPLACE^C0CXPATH(CCDGLO,"","//ContinuityOfCareRecord/Body")
    9244992443"RTN","C0CCCD",82,0)
    92450     ; DELETE THE BODY, ACTORS AND SIGNATURES SECTIONS FROM GLOBAL
     92444 D REPLACE^C0CXPATH(CCDGLO,"","//ContinuityOfCareRecord/Actors")
    9245192445"RTN","C0CCCD",83,0)
    92452     ; THESE WILL BE POPULATED AFTER CALLS TO THE XPATH ROUTINES
     92446 I 'CCD D REPLACE^C0CXPATH(CCDGLO,"","//ContinuityOfCareRecord/Signatures")
    9245392447"RTN","C0CCCD",84,0)
    92454     D REPLACE^C0CXPATH(CCDGLO,"","//ContinuityOfCareRecord/Body")
     92448 I DEBUG F I=1:1:@CCDGLO@(0) W @CCDGLO@(I),!
    9245592449"RTN","C0CCCD",85,0)
    92456     D REPLACE^C0CXPATH(CCDGLO,"","//ContinuityOfCareRecord/Actors")
     92450 ;
    9245792451"RTN","C0CCCD",86,0)
    92458     I 'CCD D REPLACE^C0CXPATH(CCDGLO,"","//ContinuityOfCareRecord/Signatures")
     92452 I 'CCD D HDRMAP(CCDGLO,DFN,HDRARY) ; MAP HEADER VARIABLES
    9245992453"RTN","C0CCCD",87,0)
    92460     I DEBUG F I=1:1:@CCDGLO@(0) W @CCDGLO@(I),!
     92454 ; MAPPING THE PATIENT PORTION OF THE CDA HEADER
    9246192455"RTN","C0CCCD",88,0)
    92462     ;
     92456 S ZZX="//ContinuityOfCareRecord/recordTarget/patientRole/patient"
    9246392457"RTN","C0CCCD",89,0)
    92464     I 'CCD D HDRMAP(CCDGLO,DFN,HDRARY) ; MAP HEADER VARIABLES
     92458 D QUERY^C0CXPATH(CCDGLO,ZZX,"ACTT1")
    9246592459"RTN","C0CCCD",90,0)
    92466     ; MAPPING THE PATIENT PORTION OF THE CDA HEADER
     92460 D PATIENT^C0CACTOR("ACTT1",DFN,"ACTORPATIENT_"_DFN,"ACTT2") ; MAP PATIENT
    9246792461"RTN","C0CCCD",91,0)
    92468     S ZZX="//ContinuityOfCareRecord/recordTarget/patientRole/patient"
     92462 I DEBUG D PARY^C0CXPATH("ACTT2")
    9246992463"RTN","C0CCCD",92,0)
    92470     D QUERY^C0CXPATH(CCDGLO,ZZX,"ACTT1")
     92464 D REPLACE^C0CXPATH(CCDGLO,"ACTT2",ZZX)
    9247192465"RTN","C0CCCD",93,0)
    92472     D PATIENT^C0CACTOR("ACTT1",DFN,"ACTORPATIENT_"_DFN,"ACTT2") ; MAP PATIENT
     92466 I DEBUG D PARY^C0CXPATH(CCDGLO)
    9247392467"RTN","C0CCCD",94,0)
    92474     I DEBUG D PARY^C0CXPATH("ACTT2")
     92468 K ACTT1 K ACCT2
    9247592469"RTN","C0CCCD",95,0)
    92476     D REPLACE^C0CXPATH(CCDGLO,"ACTT2",ZZX)
     92470 ; MAPPING THE PROVIDER ORGANIZATION,AUTHOR,INFORMANT,CUSTODIAN CDA HEADER
    9247792471"RTN","C0CCCD",96,0)
    92478     I DEBUG D PARY^C0CXPATH(CCDGLO)
     92472 ; FOR NOW, THEY ARE ALL THE SAME AND RESOLVE TO ORGANIZATION
    9247992473"RTN","C0CCCD",97,0)
    92480     K ACTT1 K ACCT2
     92474 D ORG^C0CACTOR(CCDGLO,DFN,"ACTORPATIENTORGANIZATION","ACTT2") ; MAP ORG
    9248192475"RTN","C0CCCD",98,0)
    92482     ; MAPPING THE PROVIDER ORGANIZATION,AUTHOR,INFORMANT,CUSTODIAN CDA HEADER
     92476 D CP^C0CXPATH("ACTT2",CCDGLO)
    9248392477"RTN","C0CCCD",99,0)
    92484     ; FOR NOW, THEY ARE ALL THE SAME AND RESOLVE TO ORGANIZATION
     92478 ;
    9248592479"RTN","C0CCCD",100,0)
    92486     D ORG^C0CACTOR(CCDGLO,DFN,"ACTORPATIENTORGANIZATION","ACTT2") ; MAP ORG
     92480 K ^TMP("C0CCCR",$J,"CCRSTEP") ; KILL GLOBAL PRIOR TO ADDING TO IT
    9248792481"RTN","C0CCCD",101,0)
    92488     D CP^C0CXPATH("ACTT2",CCDGLO)
     92482 S CCRXTAB=$NA(^TMP("C0CCCR",$J,"CCRSTEP")) ; GLOBAL TO STORE CCR STEPS
    9248992483"RTN","C0CCCD",102,0)
    92490     ;
     92484 D INITSTPS(CCRXTAB) ; INITIALIZED CCR PROCESSING STEPS
    9249192485"RTN","C0CCCD",103,0)
    92492     K ^TMP("C0CCCR",$J,"CCRSTEP") ; KILL GLOBAL PRIOR TO ADDING TO IT
     92486 N I,XI,TAG,RTN,CALL,XPATH,IXML,OXML,INXML,CCRBLD
    9249392487"RTN","C0CCCD",104,0)
    92494     S CCRXTAB=$NA(^TMP("C0CCCR",$J,"CCRSTEP")) ; GLOBAL TO STORE CCR STEPS
     92488 F I=1:1:@CCRXTAB@(0)  D  ; PROCESS THE CCR BODY SECTIONS
    9249592489"RTN","C0CCCD",105,0)
    92496     D INITSTPS(CCRXTAB) ; INITIALIZED CCR PROCESSING STEPS
     92490 . S XI=@CCRXTAB@(I) ; CALL COPONENTS TO PARSE
    9249792491"RTN","C0CCCD",106,0)
    92498     N I,XI,TAG,RTN,CALL,XPATH,IXML,OXML,INXML,CCRBLD
     92492 . S RTN=$P(XI,";",2) ; NAME OF ROUTINE TO CALL
    9249992493"RTN","C0CCCD",107,0)
    92500     F I=1:1:@CCRXTAB@(0)  D  ; PROCESS THE CCR BODY SECTIONS
     92494 . S TAG=$P(XI,";",1) ; LABEL INSIDE ROUTINE TO CALL
    9250192495"RTN","C0CCCD",108,0)
    92502     . S XI=@CCRXTAB@(I) ; CALL COPONENTS TO PARSE
     92496 . S XPATH=$P(XI,";",3) ; XPATH TO XML TO PASS TO ROUTINE
    9250392497"RTN","C0CCCD",109,0)
    92504     . S RTN=$P(XI,";",2) ; NAME OF ROUTINE TO CALL
     92498 . D QUERY^C0CXPATH(TGLOBAL,XPATH,"INXML") ; EXTRACT XML TO PASS
    9250592499"RTN","C0CCCD",110,0)
    92506     . S TAG=$P(XI,";",1) ; LABEL INSIDE ROUTINE TO CALL
     92500 . S IXML="INXML"
    9250792501"RTN","C0CCCD",111,0)
    92508     . S XPATH=$P(XI,";",3) ; XPATH TO XML TO PASS TO ROUTINE
     92502 . I CCD D SHAVE(IXML) ; REMOVE ALL BUT REPEATING PARTS OF TEMPLATE SECTION
    9250992503"RTN","C0CCCD",112,0)
    92510     . D QUERY^C0CXPATH(TGLOBAL,XPATH,"INXML") ; EXTRACT XML TO PASS
     92504 . S OXML=$P(XI,";",4) ; ARRAY FOR SECTION VALUES
    9251192505"RTN","C0CCCD",113,0)
    92512     . S IXML="INXML"
     92506 . ; W OXML,!
    9251392507"RTN","C0CCCD",114,0)
    92514     . I CCD D SHAVE(IXML) ; REMOVE ALL BUT REPEATING PARTS OF TEMPLATE SECTION
     92508 . S CALL="D "_TAG_"^"_RTN_"(IXML,DFN,OXML)" ; SETUP THE CALL
    9251592509"RTN","C0CCCD",115,0)
    92516     . S OXML=$P(XI,";",4) ; ARRAY FOR SECTION VALUES
     92510 . W "RUNNING ",CALL,!
    9251792511"RTN","C0CCCD",116,0)
    92518     . ; W OXML,!
     92512 . X CALL
    9251992513"RTN","C0CCCD",117,0)
    92520     . S CALL="D "_TAG_"^"_RTN_"(IXML,DFN,OXML)" ; SETUP THE CALL
     92514 . I @OXML@(0)'=0 D  ; THERE IS A RESULT
    9252192515"RTN","C0CCCD",118,0)
    92522     . W "RUNNING ",CALL,!
     92516 . . I CCD D QUERY^C0CXPATH(TGLOBAL,XPATH,"ITMP") ; XML TO UNSHAVE WITH
    9252392517"RTN","C0CCCD",119,0)
    92524     . X CALL
     92518 . . I CCD D UNSHAVE("ITMP",OXML)
    9252592519"RTN","C0CCCD",120,0)
    92526     . I @OXML@(0)'=0 D  ; THERE IS A RESULT
     92520 . . I CCD D UNMARK^C0CXPATH(OXML) ; REMOVE THE CCR MARKUP FROM SECTION
    9252792521"RTN","C0CCCD",121,0)
    92528     . . I CCD D QUERY^C0CXPATH(TGLOBAL,XPATH,"ITMP") ; XML TO UNSHAVE WITH
     92522 . ; NOW INSERT THE RESULTS IN THE CCR BUFFER
    9252992523"RTN","C0CCCD",122,0)
    92530     . . I CCD D UNSHAVE("ITMP",OXML)
     92524 . D INSERT^C0CXPATH(CCDGLO,OXML,"//ContinuityOfCareRecord/Body")
    9253192525"RTN","C0CCCD",123,0)
    92532     . . I CCD D UNMARK^C0CXPATH(OXML) ; REMOVE THE CCR MARKUP FROM SECTION
     92526 . I DEBUG F C0CI=1:1:@OXML@(0) W @OXML@(C0CI),!
    9253392527"RTN","C0CCCD",124,0)
    92534     . ; NOW INSERT THE RESULTS IN THE CCR BUFFER
     92528 ; NEED TO ADD BACK IN ACTOR PROCESSING AFTER WE FIGURE OUT LINKAGE
    9253592529"RTN","C0CCCD",125,0)
    92536     . D INSERT^C0CXPATH(CCDGLO,OXML,"//ContinuityOfCareRecord/Body")
     92530 ; D ACTLST^C0CCCR(CCDGLO,ACTGLO) ; GEN THE ACTOR LIST
    9253792531"RTN","C0CCCD",126,0)
    92538     . I DEBUG F C0CI=1:1:@OXML@(0) W @OXML@(C0CI),!
     92532 ; D QUERY^C0CXPATH(TGLOBAL,"//ContinuityOfCareRecord/Actors","ACTT")
    9253992533"RTN","C0CCCD",127,0)
    92540     ; NEED TO ADD BACK IN ACTOR PROCESSING AFTER WE FIGURE OUT LINKAGE
     92534 ; D EXTRACT^C0CACTOR("ACTT",ACTGLO,"ACTT2")
    9254192535"RTN","C0CCCD",128,0)
    92542     ; D ACTLST^C0CCCR(CCDGLO,ACTGLO) ; GEN THE ACTOR LIST
     92536 ; D INSINNER^C0CXPATH(CCDGLO,"ACTT2","//ContinuityOfCareRecord/Actors")
    9254392537"RTN","C0CCCD",129,0)
    92544     ; D QUERY^C0CXPATH(TGLOBAL,"//ContinuityOfCareRecord/Actors","ACTT")
     92538 N I,J,DONE S DONE=0
    9254592539"RTN","C0CCCD",130,0)
    92546     ; D EXTRACT^C0CACTOR("ACTT",ACTGLO,"ACTT2")
     92540 F I=0:0 D  Q:DONE  ; DELETE UNTIL ALL EMPTY ELEMENTS ARE GONE
    9254792541"RTN","C0CCCD",131,0)
    92548     ; D INSINNER^C0CXPATH(CCDGLO,"ACTT2","//ContinuityOfCareRecord/Actors")
     92542 . S J=$$TRIM^C0CXPATH(CCDGLO) ; DELETE EMPTY ELEMENTS
    9254992543"RTN","C0CCCD",132,0)
    92550     N I,J,DONE S DONE=0
     92544 . W "TRIMMED",J,!
    9255192545"RTN","C0CCCD",133,0)
    92552     F I=0:0 D  Q:DONE  ; DELETE UNTIL ALL EMPTY ELEMENTS ARE GONE
     92546 . I J=0 S DONE=1 ; DONE WHEN TRIM RETURNS FALSE
    9255392547"RTN","C0CCCD",134,0)
    92554     . S J=$$TRIM^C0CXPATH(CCDGLO) ; DELETE EMPTY ELEMENTS
     92548 I CCD D  ; TURN THE BODY INTO A CCD COMPONENT
    9255592549"RTN","C0CCCD",135,0)
    92556     . W "TRIMMED",J,!
     92550 . N I
    9255792551"RTN","C0CCCD",136,0)
    92558     . I J=0 S DONE=1 ; DONE WHEN TRIM RETURNS FALSE
     92552 . F I=1:1:@CCDGLO@(0) D  ; SEARCH THROUGH THE ENTIRE ARRAY
    9255992553"RTN","C0CCCD",137,0)
    92560     I CCD D  ; TURN THE BODY INTO A CCD COMPONENT
     92554 . . I @CCDGLO@(I)["<Body>" D  ; REPLACE BODY MARKUP
    9256192555"RTN","C0CCCD",138,0)
    92562     . N I
     92556 . . . S @CCDGLO@(I)="<component><structuredBody>" ; WITH CCD EQ
    9256392557"RTN","C0CCCD",139,0)
    92564     . F I=1:1:@CCDGLO@(0) D  ; SEARCH THROUGH THE ENTIRE ARRAY
     92558 . . I @CCDGLO@(I)["</Body>" D  ; REPLACE BODY MARKUP
    9256592559"RTN","C0CCCD",140,0)
    92566     . . I @CCDGLO@(I)["<Body>" D  ; REPLACE BODY MARKUP
     92560 . . . S @CCDGLO@(I)="</structuredBody></component>"
    9256792561"RTN","C0CCCD",141,0)
    92568     . . . S @CCDGLO@(I)="<component><structuredBody>" ; WITH CCD EQ
     92562 S @CCDGLO@(3)=CAPSAVE ; UNCAP - TURN IT BACK INTO A CCD
    9256992563"RTN","C0CCCD",142,0)
    92570     . . I @CCDGLO@(I)["</Body>" D  ; REPLACE BODY MARKUP
     92564 S @CCDGLO@(@CCDGLO@(0))=CAPSAVE2 ; UNCAP LAST LINE
    9257192565"RTN","C0CCCD",143,0)
    92572     . . . S @CCDGLO@(I)="</structuredBody></component>"
     92566 Q
    9257392567"RTN","C0CCCD",144,0)
    92574     S @CCDGLO@(3)=CAPSAVE ; UNCAP - TURN IT BACK INTO A CCD
     92568 ;
    9257592569"RTN","C0CCCD",145,0)
    92576     S @CCDGLO@(@CCDGLO@(0))=CAPSAVE2 ; UNCAP LAST LINE
     92570INITSTPS(TAB)  ; INITIALIZE CCR PROCESSING STEPS
    9257792571"RTN","C0CCCD",146,0)
    92578     Q
     92572 ; TAB IS PASSED BY NAME
    9257992573"RTN","C0CCCD",147,0)
    92580     ;
     92574 W "TAB= ",TAB,!
    9258192575"RTN","C0CCCD",148,0)
    92582 INITSTPS(TAB)  ; INITIALIZE CCR PROCESSING STEPS
     92576 ; ORDER FOR CCR IS PROBLEMS,FAMILYHISTORY,SOCIALHISTORY,MEDICATIONS,VITALSIGNS,RESULTS,HEALTHCAREPROVIDERS
    9258392577"RTN","C0CCCD",149,0)
    92584     ; TAB IS PASSED BY NAME
     92578 D PUSH^C0CXPATH(TAB,"EXTRACT;C0CPROBS;//ContinuityOfCareRecord/Body/Problems;^TMP(""C0CCCR"",$J,DFN,""PROBLEMS"")")
    9258592579"RTN","C0CCCD",150,0)
    92586     W "TAB= ",TAB,!
     92580 ;D PUSH^C0CXPATH(TAB,"EXTRACT;C0CMED;//ContinuityOfCareRecord/Body/Medications;^TMP(""C0CCCR"",$J,DFN,""MEDICATIONS"")")
    9258792581"RTN","C0CCCD",151,0)
    92588     ; ORDER FOR CCR IS PROBLEMS,FAMILYHISTORY,SOCIALHISTORY,MEDICATIONS,VITALSIGNS,RESULTS,HEALTHCAREPROVIDERS
     92582 I 'CCD D PUSH^C0CXPATH(TAB,"EXTRACT;C0CVITAL;//ContinuityOfCareRecord/Body/VitalSigns;^TMP(""C0CCCR"",$J,DFN,""VITALS"")")
    9258992583"RTN","C0CCCD",152,0)
    92590     D PUSH^C0CXPATH(TAB,"EXTRACT;C0CPROBS;//ContinuityOfCareRecord/Body/Problems;^TMP(""C0CCCR"",$J,DFN,""PROBLEMS"")")
     92584 Q
    9259192585"RTN","C0CCCD",153,0)
    92592     ;D PUSH^C0CXPATH(TAB,"EXTRACT;C0CMED;//ContinuityOfCareRecord/Body/Medications;^TMP(""C0CCCR"",$J,DFN,""MEDICATIONS"")")
     92586 ;
    9259392587"RTN","C0CCCD",154,0)
    92594     I 'CCD D PUSH^C0CXPATH(TAB,"EXTRACT;C0CVITAL;//ContinuityOfCareRecord/Body/VitalSigns;^TMP(""C0CCCR"",$J,DFN,""VITALS"")")
     92588SHAVE(SHXML) ; REMOVES THE 2-6 AND N-1 AND N-2 LINES FROM A COMPONENT
    9259592589"RTN","C0CCCD",155,0)
    92596     Q
     92590 ; NEEDED TO EXPOSE THE REPEATING PARTS FOR GENERATION
    9259792591"RTN","C0CCCD",156,0)
    92598     ;
     92592 N SHTMP,SHBLD ; TEMP ARRAY AND BUILD LIST
    9259992593"RTN","C0CCCD",157,0)
    92600 SHAVE(SHXML) ; REMOVES THE 2-6 AND N-1 AND N-2 LINES FROM A COMPONENT
     92594 W SHXML,!
    9260192595"RTN","C0CCCD",158,0)
    92602     ; NEEDED TO EXPOSE THE REPEATING PARTS FOR GENERATION
     92596 W @SHXML@(1),!
    9260392597"RTN","C0CCCD",159,0)
    92604     N SHTMP,SHBLD ; TEMP ARRAY AND BUILD LIST
     92598 D QUEUE^C0CXPATH("SHBLD",SHXML,1,1) ; THE FIRST LINE IS NEEDED
    9260592599"RTN","C0CCCD",160,0)
    92606     W SHXML,!
     92600 D QUEUE^C0CXPATH("SHBLD",SHXML,7,@SHXML@(0)-3) ; REPEATING PART
    9260792601"RTN","C0CCCD",161,0)
    92608     W @SHXML@(1),!
     92602 D QUEUE^C0CXPATH("SHBLD",SHXML,@SHXML@(0),@SHXML@(0)) ; LAST LINE
    9260992603"RTN","C0CCCD",162,0)
    92610     D QUEUE^C0CXPATH("SHBLD",SHXML,1,1) ; THE FIRST LINE IS NEEDED
     92604 D PARY^C0CXPATH("SHBLD") ; PRINT BUILD LIST
    9261192605"RTN","C0CCCD",163,0)
    92612     D QUEUE^C0CXPATH("SHBLD",SHXML,7,@SHXML@(0)-3) ; REPEATING PART
     92606 D BUILD^C0CXPATH("SHBLD","SHTMP") ; BUILD EDITED SECTION
    9261392607"RTN","C0CCCD",164,0)
    92614     D QUEUE^C0CXPATH("SHBLD",SHXML,@SHXML@(0),@SHXML@(0)) ; LAST LINE
     92608 D CP^C0CXPATH("SHTMP",SHXML) ; COPY RESULT TO PASSED ARRAY
    9261592609"RTN","C0CCCD",165,0)
    92616     D PARY^C0CXPATH("SHBLD") ; PRINT BUILD LIST
     92610 Q
    9261792611"RTN","C0CCCD",166,0)
    92618     D BUILD^C0CXPATH("SHBLD","SHTMP") ; BUILD EDITED SECTION
     92612 ;
    9261992613"RTN","C0CCCD",167,0)
    92620     D CP^C0CXPATH("SHTMP",SHXML) ; COPY RESULT TO PASSED ARRAY
     92614UNSHAVE(ORIGXML,SHXML) ; REPLACES THE 2-6 AND N-1 AND N-2 LINES FROM TEMPLATE
    9262192615"RTN","C0CCCD",168,0)
    92622     Q
     92616 ; NEEDED TO RESTORM FIXED TOP AND BOTTOM OF THE COMPONENT XML
    9262392617"RTN","C0CCCD",169,0)
    92624     ;
     92618 N SHTMP,SHBLD ; TEMP ARRAY AND BUILD LIST
    9262592619"RTN","C0CCCD",170,0)
    92626 UNSHAVE(ORIGXML,SHXML) ; REPLACES THE 2-6 AND N-1 AND N-2 LINES FROM TEMPLATE
     92620 W SHXML,!
    9262792621"RTN","C0CCCD",171,0)
    92628     ; NEEDED TO RESTORM FIXED TOP AND BOTTOM OF THE COMPONENT XML
     92622 W @SHXML@(1),!
    9262992623"RTN","C0CCCD",172,0)
    92630     N SHTMP,SHBLD ; TEMP ARRAY AND BUILD LIST
     92624 D QUEUE^C0CXPATH("SHBLD",ORIGXML,1,6) ; FIRST 6 LINES OF TEMPLATE
    9263192625"RTN","C0CCCD",173,0)
    92632     W SHXML,!
     92626 D QUEUE^C0CXPATH("SHBLD",SHXML,2,@SHXML@(0)-1) ; INS ALL BUT FIRST/LAST
    9263392627"RTN","C0CCCD",174,0)
    92634     W @SHXML@(1),!
     92628 D QUEUE^C0CXPATH("SHBLD",ORIGXML,@ORIGXML@(0)-2,@ORIGXML@(0)) ; FROM TEMP
    9263592629"RTN","C0CCCD",175,0)
    92636     D QUEUE^C0CXPATH("SHBLD",ORIGXML,1,6) ; FIRST 6 LINES OF TEMPLATE
     92630 D PARY^C0CXPATH("SHBLD") ; PRINT BUILD LIST
    9263792631"RTN","C0CCCD",176,0)
    92638     D QUEUE^C0CXPATH("SHBLD",SHXML,2,@SHXML@(0)-1) ; INS ALL BUT FIRST/LAST
     92632 D BUILD^C0CXPATH("SHBLD","SHTMP") ; BUILD EDITED SECTION
    9263992633"RTN","C0CCCD",177,0)
    92640     D QUEUE^C0CXPATH("SHBLD",ORIGXML,@ORIGXML@(0)-2,@ORIGXML@(0)) ; FROM TEMP
     92634 D CP^C0CXPATH("SHTMP",SHXML) ; COPY RESULT TO PASSED ARRAY
    9264192635"RTN","C0CCCD",178,0)
    92642     D PARY^C0CXPATH("SHBLD") ; PRINT BUILD LIST
     92636 Q
    9264392637"RTN","C0CCCD",179,0)
    92644     D BUILD^C0CXPATH("SHBLD","SHTMP") ; BUILD EDITED SECTION
     92638 ;
    9264592639"RTN","C0CCCD",180,0)
    92646     D CP^C0CXPATH("SHTMP",SHXML) ; COPY RESULT TO PASSED ARRAY
     92640HDRMAP(CXML,DFN,IHDR)   ; MAP HEADER VARIABLES: FROM, TO ECT
    9264792641"RTN","C0CCCD",181,0)
    92648     Q
     92642 N VMAP S VMAP=$NA(^TMP("C0CCCR",$J,DFN,"HEADER"))
    9264992643"RTN","C0CCCD",182,0)
    92650     ;
     92644 ; K @VMAP
    9265192645"RTN","C0CCCD",183,0)
    92652 HDRMAP(CXML,DFN,IHDR)   ; MAP HEADER VARIABLES: FROM, TO ECT
     92646 S @VMAP@("DATETIME")=$$FMDTOUTC^C0CUTIL($$NOW^XLFDT,"DT")
    9265392647"RTN","C0CCCD",184,0)
    92654     N VMAP S VMAP=$NA(^TMP("C0CCCR",$J,DFN,"HEADER"))
     92648 I IHDR="" D  ; HEADER ARRAY IS NOT PROVIDED, USE DEFAULTS
    9265592649"RTN","C0CCCD",185,0)
    92656     ; K @VMAP
     92650 . S @VMAP@("ACTORPATIENT")="ACTORPATIENT_"_DFN
    9265792651"RTN","C0CCCD",186,0)
    92658     S @VMAP@("DATETIME")=$$FMDTOUTC^C0CUTIL($$NOW^XLFDT,"DT")
     92652 . S @VMAP@("ACTORFROM")="ACTORORGANIZATION_"_DUZ ; FROM DUZ - ???
    9265992653"RTN","C0CCCD",187,0)
    92660     I IHDR="" D  ; HEADER ARRAY IS NOT PROVIDED, USE DEFAULTS
     92654 . S @VMAP@("ACTORFROM2")="ACTORSYSTEM_1" ; SECOND FROM IS THE SYSTEM
    9266192655"RTN","C0CCCD",188,0)
    92662     . S @VMAP@("ACTORPATIENT")="ACTORPATIENT_"_DFN
     92656 . S @VMAP@("ACTORTO")="ACTORPATIENT_"_DFN  ; FOR TEST PURPOSES
    9266392657"RTN","C0CCCD",189,0)
    92664     . S @VMAP@("ACTORFROM")="ACTORORGANIZATION_"_DUZ ; FROM DUZ - ???
     92658 . S @VMAP@("PURPOSEDESCRIPTION")="CEND PHR"  ; FOR TEST PURPOSES
    9266592659"RTN","C0CCCD",190,0)
    92666     . S @VMAP@("ACTORFROM2")="ACTORSYSTEM_1" ; SECOND FROM IS THE SYSTEM
     92660 . S @VMAP@("ACTORTOTEXT")="Patient"  ; FOR TEST PURPOSES
    9266792661"RTN","C0CCCD",191,0)
    92668     . S @VMAP@("ACTORTO")="ACTORPATIENT_"_DFN  ; FOR TEST PURPOSES
     92662 . ; THIS IS THE USE CASE FOR THE PHR WHERE "TO" IS THE PATIENT
    9266992663"RTN","C0CCCD",192,0)
    92670     . S @VMAP@("PURPOSEDESCRIPTION")="CEND PHR"  ; FOR TEST PURPOSES
     92664 I IHDR'="" D  ; HEADER VALUES ARE PROVIDED
    9267192665"RTN","C0CCCD",193,0)
    92672     . S @VMAP@("ACTORTOTEXT")="Patient"  ; FOR TEST PURPOSES
     92666 . D CP^C0CXPATH(IHDR,VMAP) ; COPY HEADER VARIABLES TO MAP ARRAY
    9267392667"RTN","C0CCCD",194,0)
    92674     . ; THIS IS THE USE CASE FOR THE PHR WHERE "TO" IS THE PATIENT
     92668 N CTMP
    9267592669"RTN","C0CCCD",195,0)
    92676     I IHDR'="" D  ; HEADER VALUES ARE PROVIDED
     92670 D MAP^C0CXPATH(CXML,VMAP,"CTMP")
    9267792671"RTN","C0CCCD",196,0)
    92678     . D CP^C0CXPATH(IHDR,VMAP) ; COPY HEADER VARIABLES TO MAP ARRAY
     92672 D CP^C0CXPATH("CTMP",CXML)
    9267992673"RTN","C0CCCD",197,0)
    92680     N CTMP
     92674 Q
    9268192675"RTN","C0CCCD",198,0)
    92682     D MAP^C0CXPATH(CXML,VMAP,"CTMP")
     92676 ;
    9268392677"RTN","C0CCCD",199,0)
    92684     D CP^C0CXPATH("CTMP",CXML)
     92678ACTLST(AXML,ACTRTN) ; RETURN THE ACTOR LIST FOR THE XML IN AXML
    9268592679"RTN","C0CCCD",200,0)
    92686     Q
     92680 ; AXML AND ACTRTN ARE PASSED BY NAME
    9268792681"RTN","C0CCCD",201,0)
    92688     ;
     92682 ; EACH ACTOR RECORD HAS 3 PARTS - IE IF OBJECTID=ACTORPATIENT_2
    9268992683"RTN","C0CCCD",202,0)
    92690 ACTLST(AXML,ACTRTN) ; RETURN THE ACTOR LIST FOR THE XML IN AXML
     92684 ; P1= OBJECTID - ACTORPATIENT_2
    9269192685"RTN","C0CCCD",203,0)
    92692     ; AXML AND ACTRTN ARE PASSED BY NAME
     92686 ; P2= OBJECT TYPE - PATIENT OR PROVIDER OR SOFTWARE
    9269392687"RTN","C0CCCD",204,0)
    92694     ; EACH ACTOR RECORD HAS 3 PARTS - IE IF OBJECTID=ACTORPATIENT_2
     92688 ;OR INSTITUTION
    9269592689"RTN","C0CCCD",205,0)
    92696     ; P1= OBJECTID - ACTORPATIENT_2
     92690 ;  OR PERSON(IN PATIENT FILE IE NOK)
    9269792691"RTN","C0CCCD",206,0)
    92698     ; P2= OBJECT TYPE - PATIENT OR PROVIDER OR SOFTWARE
     92692 ; P3= IEN RECORD NUMBER FOR ACTOR - 2
    9269992693"RTN","C0CCCD",207,0)
    92700     ;OR INSTITUTION
     92694 N I,J,K,L
    9270192695"RTN","C0CCCD",208,0)
    92702     ;  OR PERSON(IN PATIENT FILE IE NOK)
     92696 K @ACTRTN ; CLEAR RETURN ARRAY
    9270392697"RTN","C0CCCD",209,0)
    92704     ; P3= IEN RECORD NUMBER FOR ACTOR - 2
     92698 F I=1:1:@AXML@(0) D  ; SCAN ALL LINES
    9270592699"RTN","C0CCCD",210,0)
    92706     N I,J,K,L
     92700 . I @AXML@(I)?.E1"<ActorID>".E D  ; THERE IS AN ACTOR THIS LINE
    9270792701"RTN","C0CCCD",211,0)
    92708     K @ACTRTN ; CLEAR RETURN ARRAY
     92702 . . S J=$P($P(@AXML@(I),"<ActorID>",2),"</ActorID>",1)
    9270992703"RTN","C0CCCD",212,0)
    92710     F I=1:1:@AXML@(0) D  ; SCAN ALL LINES
     92704 . . W "<ActorID>=>",J,!
    9271192705"RTN","C0CCCD",213,0)
    92712     . I @AXML@(I)?.E1"<ActorID>".E D  ; THERE IS AN ACTOR THIS LINE
     92706 . . I J'="" S K(J)="" ; HASHING ACTOR
    9271392707"RTN","C0CCCD",214,0)
    92714     . . S J=$P($P(@AXML@(I),"<ActorID>",2),"</ActorID>",1)
     92708 . . ;  TO GET RID OF DUPLICATES
    9271592709"RTN","C0CCCD",215,0)
    92716     . . W "<ActorID>=>",J,!
     92710 S I="" ; GOING TO $O THROUGH THE HASH
    9271792711"RTN","C0CCCD",216,0)
    92718     . . I J'="" S K(J)="" ; HASHING ACTOR
     92712 F J=0:0 D  Q:$O(K(I))=""  ;
    9271992713"RTN","C0CCCD",217,0)
    92720     . . ;  TO GET RID OF DUPLICATES
     92714 . S I=$O(K(I)) ; WALK THROUGH THE HASH OF ACTORS
    9272192715"RTN","C0CCCD",218,0)
    92722     S I="" ; GOING TO $O THROUGH THE HASH
     92716 . S $P(L,U,1)=I ; FIRST PIECE IS THE OBJECT ID
    9272392717"RTN","C0CCCD",219,0)
    92724     F J=0:0 D  Q:$O(K(I))=""  ;
     92718 . S $P(L,U,2)=$P($P(I,"ACTOR",2),"_",1) ; ACTOR TYPE
    9272592719"RTN","C0CCCD",220,0)
    92726     . S I=$O(K(I)) ; WALK THROUGH THE HASH OF ACTORS
     92720 . S $P(L,U,3)=$P(I,"_",2) ; IEN RECORD NUMBER FOR ACTOR
    9272792721"RTN","C0CCCD",221,0)
    92728     . S $P(L,U,1)=I ; FIRST PIECE IS THE OBJECT ID
     92722 . D PUSH^C0CXPATH(ACTRTN,L) ; ADD THE ACTOR TO THE RETURN ARRAY
    9272992723"RTN","C0CCCD",222,0)
    92730     . S $P(L,U,2)=$P($P(I,"ACTOR",2),"_",1) ; ACTOR TYPE
     92724 Q
    9273192725"RTN","C0CCCD",223,0)
    92732     . S $P(L,U,3)=$P(I,"_",2) ; IEN RECORD NUMBER FOR ACTOR
     92726 ;
    9273392727"RTN","C0CCCD",224,0)
    92734     . D PUSH^C0CXPATH(ACTRTN,L) ; ADD THE ACTOR TO THE RETURN ARRAY
     92728TEST ; RUN ALL THE TEST CASES
    9273592729"RTN","C0CCCD",225,0)
    92736     Q
     92730 D TESTALL^C0CUNIT("C0CCCR")
    9273792731"RTN","C0CCCD",226,0)
    92738     ;
     92732 Q
    9273992733"RTN","C0CCCD",227,0)
    92740 TEST ; RUN ALL THE TEST CASES
     92734 ;
    9274192735"RTN","C0CCCD",228,0)
    92742   D TESTALL^C0CUNIT("C0CCCR")
     92736ZTEST(WHICH)  ; RUN ONE SET OF TESTS
    9274392737"RTN","C0CCCD",229,0)
    92744   Q
     92738 N ZTMP
    9274592739"RTN","C0CCCD",230,0)
    92746   ;
     92740 D ZLOAD^C0CUNIT("ZTMP","C0CCCR")
    9274792741"RTN","C0CCCD",231,0)
    92748 ZTEST(WHICH)  ; RUN ONE SET OF TESTS
     92742 D ZTEST^C0CUNIT(.ZTMP,WHICH)
    9274992743"RTN","C0CCCD",232,0)
    92750   N ZTMP
     92744 Q
    9275192745"RTN","C0CCCD",233,0)
    92752   D ZLOAD^C0CUNIT("ZTMP","C0CCCR")
     92746 ;
    9275392747"RTN","C0CCCD",234,0)
    92754   D ZTEST^C0CUNIT(.ZTMP,WHICH)
     92748TLIST  ; LIST THE TESTS
    9275592749"RTN","C0CCCD",235,0)
    92756   Q
     92750 N ZTMP
    9275792751"RTN","C0CCCD",236,0)
    92758   ;
     92752 D ZLOAD^C0CUNIT("ZTMP","C0CCCR")
    9275992753"RTN","C0CCCD",237,0)
    92760 TLIST  ; LIST THE TESTS
     92754 D TLIST^C0CUNIT(.ZTMP)
    9276192755"RTN","C0CCCD",238,0)
    92762   N ZTMP
     92756 Q
    9276392757"RTN","C0CCCD",239,0)
    92764   D ZLOAD^C0CUNIT("ZTMP","C0CCCR")
     92758 ;
    9276592759"RTN","C0CCCD",240,0)
    92766   D TLIST^C0CUNIT(.ZTMP)
     92760 ;;><TEST>
    9276792761"RTN","C0CCCD",241,0)
    92768   Q
     92762 ;;><PROBLEMS>
    9276992763"RTN","C0CCCD",242,0)
    92770   ;
     92764 ;;>>>K C0C S C0C=""
    9277192765"RTN","C0CCCD",243,0)
    92772  ;;><TEST>
     92766 ;;>>>D CCRRPC^C0CCCR(.C0C,"2","PROBLEMS","","","")
    9277392767"RTN","C0CCCD",244,0)
    92774  ;;><PROBLEMS>
     92768 ;;>>?@C0C@(@C0C@(0))["</Problems>"
    9277592769"RTN","C0CCCD",245,0)
     92770 ;;><VITALS>
     92771"RTN","C0CCCD",246,0)
    9277692772 ;;>>>K C0C S C0C=""
    92777 "RTN","C0CCCD",246,0)
    92778  ;;>>>D CCRRPC^C0CCCR(.C0C,"2","PROBLEMS","","","")
    9277992773"RTN","C0CCCD",247,0)
    92780  ;;>>?@C0C@(@C0C@(0))["</Problems>"
     92774 ;;>>>D CCRRPC^C0CCCR(.C0C,"2","VITALS","","","")
    9278192775"RTN","C0CCCD",248,0)
    92782  ;;><VITALS>
     92776 ;;>>?@C0C@(@C0C@(0))["</VitalSigns>"
    9278392777"RTN","C0CCCD",249,0)
     92778 ;;><CCR>
     92779"RTN","C0CCCD",250,0)
    9278492780 ;;>>>K C0C S C0C=""
    92785 "RTN","C0CCCD",250,0)
    92786  ;;>>>D CCRRPC^C0CCCR(.C0C,"2","VITALS","","","")
    9278792781"RTN","C0CCCD",251,0)
    92788  ;;>>?@C0C@(@C0C@(0))["</VitalSigns>"
     92782 ;;>>>D CCRRPC^C0CCCR(.C0C,"2","CCR","","","")
    9278992783"RTN","C0CCCD",252,0)
    92790  ;;><CCR>
     92784 ;;>>?@C0C@(@C0C@(0))["</ContinuityOfCareRecord>"
    9279192785"RTN","C0CCCD",253,0)
     92786 ;;><ACTLST>
     92787"RTN","C0CCCD",254,0)
    9279292788 ;;>>>K C0C S C0C=""
    92793 "RTN","C0CCCD",254,0)
     92789"RTN","C0CCCD",255,0)
    9279492790 ;;>>>D CCRRPC^C0CCCR(.C0C,"2","CCR","","","")
    92795 "RTN","C0CCCD",255,0)
     92791"RTN","C0CCCD",256,0)
     92792 ;;>>>D ACTLST^C0CCCR(C0C,"ACTTEST")
     92793"RTN","C0CCCD",257,0)
     92794 ;;><ACTORS>
     92795"RTN","C0CCCD",258,0)
     92796 ;;>>>D ZTEST^C0CCCR("ACTLST")
     92797"RTN","C0CCCD",259,0)
     92798 ;;>>>D QUERY^C0CXPATH(TGLOBAL,"//ContinuityOfCareRecord/Actors","G2")
     92799"RTN","C0CCCD",260,0)
     92800 ;;>>>D EXTRACT^C0CACTOR("G2","ACTTEST","G3")
     92801"RTN","C0CCCD",261,0)
     92802 ;;>>?G3(G3(0))["</Actors>"
     92803"RTN","C0CCCD",262,0)
     92804 ;;><TRIM>
     92805"RTN","C0CCCD",263,0)
     92806 ;;>>>D ZTEST^C0CCCR("CCR")
     92807"RTN","C0CCCD",264,0)
     92808 ;;>>>W $$TRIM^C0CXPATH(CCDGLO)
     92809"RTN","C0CCCD",265,0)
     92810 ;;><CCD>
     92811"RTN","C0CCCD",266,0)
     92812 ;;>>>K C0C S C0C=""
     92813"RTN","C0CCCD",267,0)
     92814 ;;>>>D CCRRPC^C0CCCR(.C0C,"2","CCD","","","")
     92815"RTN","C0CCCD",268,0)
    9279692816 ;;>>?@C0C@(@C0C@(0))["</ContinuityOfCareRecord>"
    92797 "RTN","C0CCCD",256,0)
    92798  ;;><ACTLST>
    92799 "RTN","C0CCCD",257,0)
    92800  ;;>>>K C0C S C0C=""
    92801 "RTN","C0CCCD",258,0)
    92802  ;;>>>D CCRRPC^C0CCCR(.C0C,"2","CCR","","","")
    92803 "RTN","C0CCCD",259,0)
    92804  ;;>>>D ACTLST^C0CCCR(C0C,"ACTTEST")
    92805 "RTN","C0CCCD",260,0)
    92806  ;;><ACTORS>
    92807 "RTN","C0CCCD",261,0)
    92808  ;;>>>D ZTEST^C0CCCR("ACTLST")
    92809 "RTN","C0CCCD",262,0)
    92810  ;;>>>D QUERY^C0CXPATH(TGLOBAL,"//ContinuityOfCareRecord/Actors","G2")
    92811 "RTN","C0CCCD",263,0)
    92812  ;;>>>D EXTRACT^C0CACTOR("G2","ACTTEST","G3")
    92813 "RTN","C0CCCD",264,0)
    92814  ;;>>?G3(G3(0))["</Actors>"
    92815 "RTN","C0CCCD",265,0)
    92816  ;;><TRIM>
    92817 "RTN","C0CCCD",266,0)
    92818  ;;>>>D ZTEST^C0CCCR("CCR")
    92819 "RTN","C0CCCD",267,0)
    92820  ;;>>>W $$TRIM^C0CXPATH(CCDGLO)
    92821 "RTN","C0CCCD",268,0)
    92822  ;;><CCD>
    9282392817"RTN","C0CCCD",269,0)
    92824  ;;>>>K C0C S C0C=""
    92825 "RTN","C0CCCD",270,0)
    92826  ;;>>>D CCRRPC^C0CCCR(.C0C,"2","CCD","","","")
    92827 "RTN","C0CCCD",271,0)
    92828  ;;>>?@C0C@(@C0C@(0))["</ContinuityOfCareRecord>"
    92829 "RTN","C0CCCD",272,0)
    9283092818 ;;></TEST>
    9283192819"RTN","C0CCCD1")
    92832 0^44^B100634737
     928200^44^B96013153
    9283392821"RTN","C0CCCD1",1,0)
    9283492822C0CCCD1 ; CCDCCR/GPL - CCD TEMPLATE AND ACCESS ROUTINES; 6/7/08
    9283592823"RTN","C0CCCD1",2,0)
    92836  ;;1.2;C0C;;May 11, 2012;Build 50
     92824 ;;1.2;CCD/CCR GENERATION UTILITIES;;Oct 30, 2012;Build 51
    9283792825"RTN","C0CCCD1",3,0)
    9283892826 ;Copyright 2008,2009 George Lilly, University of Minnesota.
    9283992827"RTN","C0CCCD1",4,0)
    92840  ;Licensed under the terms of the GNU General Public License.
     92828 ;
    9284192829"RTN","C0CCCD1",5,0)
    92842  ;See attached copy of the License.
     92830 ; This program is free software: you can redistribute it and/or modify
    9284392831"RTN","C0CCCD1",6,0)
    92844  ;
     92832 ; it under the terms of the GNU Affero General Public License as
    9284592833"RTN","C0CCCD1",7,0)
    92846  ;This program is free software; you can redistribute it and/or modify
     92834 ; published by the Free Software Foundation, either version 3 of the
    9284792835"RTN","C0CCCD1",8,0)
    92848  ;it under the terms of the GNU General Public License as published by
     92836 ; License, or (at your option) any later version.
    9284992837"RTN","C0CCCD1",9,0)
    92850  ;the Free Software Foundation; either version 2 of the License, or
     92838 ;
    9285192839"RTN","C0CCCD1",10,0)
    92852  ;(at your option) any later version.
     92840 ; This program is distributed in the hope that it will be useful,
    9285392841"RTN","C0CCCD1",11,0)
    92854  ;
     92842 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
    9285592843"RTN","C0CCCD1",12,0)
    92856  ;This program is distributed in the hope that it will be useful,
     92844 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    9285792845"RTN","C0CCCD1",13,0)
    92858  ;but WITHOUT ANY WARRANTY; without even the implied warranty of
     92846 ; GNU Affero General Public License for more details.
    9285992847"RTN","C0CCCD1",14,0)
    92860  ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     92848 ;
    9286192849"RTN","C0CCCD1",15,0)
    92862  ;GNU General Public License for more details.
     92850 ; You should have received a copy of the GNU Affero General Public License
    9286392851"RTN","C0CCCD1",16,0)
    92864  ;
     92852 ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    9286592853"RTN","C0CCCD1",17,0)
    92866  ;You should have received a copy of the GNU General Public License along
     92854 ;
    9286792855"RTN","C0CCCD1",18,0)
    92868  ;with this program; if not, write to the Free Software Foundation, Inc.,
     92856 ;
    9286992857"RTN","C0CCCD1",19,0)
    92870  ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     92858 W "This is a CCD TEMPLATE with processing routines",!
    9287192859"RTN","C0CCCD1",20,0)
    92872  ;
     92860 W !
    9287392861"RTN","C0CCCD1",21,0)
    92874           W "This is a CCD TEMPLATE with processing routines",!
     92862 Q
    9287592863"RTN","C0CCCD1",22,0)
    92876           W !
     92864 ;
    9287792865"RTN","C0CCCD1",23,0)
    92878           Q
     92866ZT(ZARY,BAT,LINE) ; private routine to add a line to the ZARY array
    9287992867"RTN","C0CCCD1",24,0)
    92880           ;
     92868 ; ZARY IS PASSED BY NAME
    9288192869"RTN","C0CCCD1",25,0)
    92882 ZT(ZARY,BAT,LINE) ; private routine to add a line to the ZARY array
     92870 ; BAT is a string identifying the section
    9288392871"RTN","C0CCCD1",26,0)
    92884           ; ZARY IS PASSED BY NAME
     92872 ; LINE is a test which will evaluate to true or false
    9288592873"RTN","C0CCCD1",27,0)
    92886           ; BAT is a string identifying the section
     92874 ; I '$G(@ZARY) D  ; IF ZARY DOES NOT EXIST '
    9288792875"RTN","C0CCCD1",28,0)
    92888           ; LINE is a test which will evaluate to true or false
     92876 ; . S @ZARY@(0)=0 ; initially there are no elements
    9288992877"RTN","C0CCCD1",29,0)
    92890           ; I '$G(@ZARY) D  ; IF ZARY DOES NOT EXIST '
     92878 ; . W "GOT HERE LOADING "_LINE,!
    9289192879"RTN","C0CCCD1",30,0)
    92892           ; . S @ZARY@(0)=0 ; initially there are no elements
     92880 N CNT ; count of array elements
    9289392881"RTN","C0CCCD1",31,0)
    92894           ; . W "GOT HERE LOADING "_LINE,!
     92882 S CNT=@ZARY@(0) ; contains array count
    9289592883"RTN","C0CCCD1",32,0)
    92896           N CNT ; count of array elements
     92884 S CNT=CNT+1 ; increment count
    9289792885"RTN","C0CCCD1",33,0)
    92898           S CNT=@ZARY@(0) ; contains array count
     92886 S @ZARY@(CNT)=LINE ; put the line in the array
    9289992887"RTN","C0CCCD1",34,0)
    92900           S CNT=CNT+1 ; increment count
     92888 ; S @ZARY@(BAT,CNT)="" ; index the test by battery
    9290192889"RTN","C0CCCD1",35,0)
    92902           S @ZARY@(CNT)=LINE ; put the line in the array
     92890 S @ZARY@(0)=CNT ; update the array counter
    9290392891"RTN","C0CCCD1",36,0)
    92904           ; S @ZARY@(BAT,CNT)="" ; index the test by battery
     92892 Q
    9290592893"RTN","C0CCCD1",37,0)
    92906           S @ZARY@(0)=CNT ; update the array counter
     92894 ;
    9290792895"RTN","C0CCCD1",38,0)
    92908           Q
     92896ZLOAD(ZARY,ROUTINE) ; load tests into ZARY which is passed by reference
    9290992897"RTN","C0CCCD1",39,0)
    92910           ;
     92898 ; ZARY IS PASSED BY NAME
    9291192899"RTN","C0CCCD1",40,0)
    92912 ZLOAD(ZARY,ROUTINE) ; load tests into ZARY which is passed by reference
     92900 ; ZARY = name of the root, closed array format (e.g., "^TMP($J)")
    9291392901"RTN","C0CCCD1",41,0)
    92914           ; ZARY IS PASSED BY NAME
     92902 ; ROUTINE = NAME OF THE ROUTINE - PASSED BY VALUE
    9291592903"RTN","C0CCCD1",42,0)
    92916           ; ZARY = name of the root, closed array format (e.g., "^TMP($J)")
     92904 K @ZARY S @ZARY=""
    9291792905"RTN","C0CCCD1",43,0)
    92918           ; ROUTINE = NAME OF THE ROUTINE - PASSED BY VALUE
     92906 S @ZARY@(0)=0 ; initialize array count
    9291992907"RTN","C0CCCD1",44,0)
    92920           K @ZARY S @ZARY=""
     92908 N LINE,LABEL,BODY
    9292192909"RTN","C0CCCD1",45,0)
    92922           S @ZARY@(0)=0 ; initialize array count
     92910 N INTEST S INTEST=0 ; switch for in the TEMPLATE section
    9292392911"RTN","C0CCCD1",46,0)
    92924           N LINE,LABEL,BODY
     92912 N SECTION S SECTION="[anonymous]" ; NO section LABEL
    9292592913"RTN","C0CCCD1",47,0)
    92926           N INTEST S INTEST=0 ; switch for in the TEMPLATE section
     92914 ;
    9292792915"RTN","C0CCCD1",48,0)
    92928           N SECTION S SECTION="[anonymous]" ; NO section LABEL
     92916 N NUM F NUM=1:1 S LINE=$T(+NUM^@ROUTINE) Q:LINE=""  D
    9292992917"RTN","C0CCCD1",49,0)
    92930           ;
     92918 . I LINE?." "1";<TEMPLATE>".E S INTEST=1 ; entering section
    9293192919"RTN","C0CCCD1",50,0)
    92932           N NUM F NUM=1:1 S LINE=$T(+NUM^@ROUTINE) Q:LINE=""  D
     92920 . I LINE?." "1";</TEMPLATE>".E S INTEST=0 ; leaving section
    9293392921"RTN","C0CCCD1",51,0)
    92934           . I LINE?." "1";<TEMPLATE>".E S INTEST=1 ; entering section
     92922 . I INTEST  D  ; within the section
    9293592923"RTN","C0CCCD1",52,0)
    92936           . I LINE?." "1";</TEMPLATE>".E S INTEST=0 ; leaving section
     92924 . . I LINE?." "1";><".E  D  ; sub-section name found
    9293792925"RTN","C0CCCD1",53,0)
    92938           . I INTEST  D  ; within the section
     92926 . . . S SECTION=$P($P(LINE,";><",2),">",1) ; pull out name
    9293992927"RTN","C0CCCD1",54,0)
    92940           . . I LINE?." "1";><".E  D  ; sub-section name found
     92928 . . I LINE?." "1";;".E  D  ; line found
    9294192929"RTN","C0CCCD1",55,0)
    92942           . . . S SECTION=$P($P(LINE,";><",2),">",1) ; pull out name
     92930 . . . D ZT(ZARY,SECTION,$P(LINE,";;",2)) ; put the line in the array
    9294392931"RTN","C0CCCD1",56,0)
    92944           . . I LINE?." "1";;".E  D  ; line found
     92932 Q
    9294592933"RTN","C0CCCD1",57,0)
    92946           . . . D ZT(ZARY,SECTION,$P(LINE,";;",2)) ; put the line in the array
     92934 ;
    9294792935"RTN","C0CCCD1",58,0)
    92948           Q
     92936LOAD(ARY) ; LOAD A CCR TEMPLATE INTO ARY PASSED BY NAME
    9294992937"RTN","C0CCCD1",59,0)
    92950           ;
     92938 D ZLOAD(ARY,"C0CCCD1")
    9295192939"RTN","C0CCCD1",60,0)
    92952 LOAD(ARY) ; LOAD A CCR TEMPLATE INTO ARY PASSED BY NAME
     92940 ; ZWR @ARY
    9295392941"RTN","C0CCCD1",61,0)
    92954           D ZLOAD(ARY,"C0CCCD1")
     92942 Q
    9295592943"RTN","C0CCCD1",62,0)
    92956           ; ZWR @ARY
     92944 ;
    9295792945"RTN","C0CCCD1",63,0)
    92958           Q
     92946TRMCCD    ; ROUTINE TO BE WRITTEN TO REMOVE CCR MARKUP FROM CCD
    9295992947"RTN","C0CCCD1",64,0)
    92960           ;
     92948 Q
    9296192949"RTN","C0CCCD1",65,0)
    92962 TRMCCD    ; ROUTINE TO BE WRITTEN TO REMOVE CCR MARKUP FROM CCD
     92950MARKUP ;<MARKUP>
    9296392951"RTN","C0CCCD1",66,0)
    92964           Q
     92952 ;;<Body>
    9296592953"RTN","C0CCCD1",67,0)
    92966 MARKUP ;<MARKUP>
     92954 ;;<Problems>
    9296792955"RTN","C0CCCD1",68,0)
     92956 ;;</Problems>
     92957"RTN","C0CCCD1",69,0)
     92958 ;;<FamilyHistory>
     92959"RTN","C0CCCD1",70,0)
     92960 ;;</FamilyHistory>
     92961"RTN","C0CCCD1",71,0)
     92962 ;;<SocialHistory>
     92963"RTN","C0CCCD1",72,0)
     92964 ;;</SocialHistory>
     92965"RTN","C0CCCD1",73,0)
     92966 ;;<Alerts>
     92967"RTN","C0CCCD1",74,0)
     92968 ;;</Alerts>
     92969"RTN","C0CCCD1",75,0)
     92970 ;;<Medications>
     92971"RTN","C0CCCD1",76,0)
     92972 ;;</Medications>
     92973"RTN","C0CCCD1",77,0)
     92974 ;;<VitalSigns>
     92975"RTN","C0CCCD1",78,0)
     92976 ;;</VitalSigns>
     92977"RTN","C0CCCD1",79,0)
     92978 ;;<Results>
     92979"RTN","C0CCCD1",80,0)
     92980 ;;</Results>
     92981"RTN","C0CCCD1",81,0)
     92982 ;;</Body>
     92983"RTN","C0CCCD1",82,0)
     92984 ;;</ContinuityOfCareRecord>
     92985"RTN","C0CCCD1",83,0)
     92986 ;</MARKUP>
     92987"RTN","C0CCCD1",84,0)
     92988 ;;<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
     92989"RTN","C0CCCD1",85,0)
     92990 ;;</ClinicalDocument>
     92991"RTN","C0CCCD1",86,0)
     92992 Q
     92993"RTN","C0CCCD1",87,0)
     92994 ;
     92995"RTN","C0CCCD1",88,0)
     92996 ;<TEMPLATE>
     92997"RTN","C0CCCD1",89,0)
     92998 ;;<?xml version="1.0"?>
     92999"RTN","C0CCCD1",90,0)
     93000 ;;<?xml-stylesheet type="text/xsl" href="CCD.xsl"?>
     93001"RTN","C0CCCD1",91,0)
     93002 ;;<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
     93003"RTN","C0CCCD1",92,0)
     93004 ;;<typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
     93005"RTN","C0CCCD1",93,0)
     93006 ;;<templateId root="2.16.840.1.113883.10.20.1"/>
     93007"RTN","C0CCCD1",94,0)
     93008 ;;<id root="db734647-fc99-424c-a864-7e3cda82e703"/>
     93009"RTN","C0CCCD1",95,0)
     93010 ;;<code code="34133-9" codeSystem="2.16.840.1.113883.6.1" displayName="Summarization of episode note"/>
     93011"RTN","C0CCCD1",96,0)
     93012 ;;<title>Continuity of Care Document</title>
     93013"RTN","C0CCCD1",97,0)
     93014 ;;<effectiveTime value="20000407130000+0500"/>
     93015"RTN","C0CCCD1",98,0)
     93016 ;;<confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25"/>
     93017"RTN","C0CCCD1",99,0)
     93018 ;;<languageCode code="en-US"/>
     93019"RTN","C0CCCD1",100,0)
     93020 ;;<recordTarget>
     93021"RTN","C0CCCD1",101,0)
     93022 ;;<patientRole>
     93023"RTN","C0CCCD1",102,0)
     93024 ;;<id extension="@@ACTORIEN@@" root="2.16.840.1.113883.19.5"/>
     93025"RTN","C0CCCD1",103,0)
     93026 ;;<patient>
     93027"RTN","C0CCCD1",104,0)
     93028 ;;<name>
     93029"RTN","C0CCCD1",105,0)
     93030 ;;<given>@@ACTORGIVENNAME@@</given>
     93031"RTN","C0CCCD1",106,0)
     93032 ;;<family>@@ACTORFAMILYNAME@@</family>
     93033"RTN","C0CCCD1",107,0)
     93034 ;;<suffix>@@ACTORSUFFIXNAME@@</suffix>
     93035"RTN","C0CCCD1",108,0)
     93036 ;;</name>
     93037"RTN","C0CCCD1",109,0)
     93038 ;;<administrativeGenderCode code="@@ACTORGENDER@@" codeSystem="2.16.840.1.113883.5.1"/>
     93039"RTN","C0CCCD1",110,0)
     93040 ;;<birthTime value="@@ACTORDATEOFBIRTH@@"/>
     93041"RTN","C0CCCD1",111,0)
     93042 ;;</patient>
     93043"RTN","C0CCCD1",112,0)
     93044 ;;<providerOrganization>
     93045"RTN","C0CCCD1",113,0)
     93046 ;;<id root="2.16.840.1.113883.19.5"/>
     93047"RTN","C0CCCD1",114,0)
     93048 ;;<name>@@ORGANIZATIONNAME@@</name>
     93049"RTN","C0CCCD1",115,0)
     93050 ;;</providerOrganization>
     93051"RTN","C0CCCD1",116,0)
     93052 ;;</patientRole>
     93053"RTN","C0CCCD1",117,0)
     93054 ;;</recordTarget>
     93055"RTN","C0CCCD1",118,0)
     93056 ;;<author>
     93057"RTN","C0CCCD1",119,0)
     93058 ;;<time value="20000407130000+0500"/>
     93059"RTN","C0CCCD1",120,0)
     93060 ;;<assignedAuthor>
     93061"RTN","C0CCCD1",121,0)
     93062 ;;<id root="20cf14fb-b65c-4c8c-a54d-b0cca834c18c"/>
     93063"RTN","C0CCCD1",122,0)
     93064 ;;<assignedPerson>
     93065"RTN","C0CCCD1",123,0)
     93066 ;;<name>
     93067"RTN","C0CCCD1",124,0)
     93068 ;;<prefix>@@ACTORNAMEPREFIX@@</prefix>
     93069"RTN","C0CCCD1",125,0)
     93070 ;;<given>@@ACTORGIVENNAME@@</given>
     93071"RTN","C0CCCD1",126,0)
     93072 ;;<family>@@ACTORFAMILYNAME@@</family>
     93073"RTN","C0CCCD1",127,0)
     93074 ;;</name>
     93075"RTN","C0CCCD1",128,0)
     93076 ;;</assignedPerson>
     93077"RTN","C0CCCD1",129,0)
     93078 ;;<representedOrganization>
     93079"RTN","C0CCCD1",130,0)
     93080 ;;<id root="2.16.840.1.113883.19.5"/>
     93081"RTN","C0CCCD1",131,0)
     93082 ;;<name>@@ORGANIZATIONNAME@@</name>
     93083"RTN","C0CCCD1",132,0)
     93084 ;;</representedOrganization>
     93085"RTN","C0CCCD1",133,0)
     93086 ;;</assignedAuthor>
     93087"RTN","C0CCCD1",134,0)
     93088 ;;</author>
     93089"RTN","C0CCCD1",135,0)
     93090 ;;<informant>
     93091"RTN","C0CCCD1",136,0)
     93092 ;;<assignedEntity>
     93093"RTN","C0CCCD1",137,0)
     93094 ;;<id nullFlavor="NI"/>
     93095"RTN","C0CCCD1",138,0)
     93096 ;;<representedOrganization>
     93097"RTN","C0CCCD1",139,0)
     93098 ;;<id root="2.16.840.1.113883.19.5"/>
     93099"RTN","C0CCCD1",140,0)
     93100 ;;<name>@@ORGANIZATIONNAME@@</name>
     93101"RTN","C0CCCD1",141,0)
     93102 ;;</representedOrganization>
     93103"RTN","C0CCCD1",142,0)
     93104 ;;</assignedEntity>
     93105"RTN","C0CCCD1",143,0)
     93106 ;;</informant>
     93107"RTN","C0CCCD1",144,0)
     93108 ;;<custodian>
     93109"RTN","C0CCCD1",145,0)
     93110 ;;<assignedCustodian>
     93111"RTN","C0CCCD1",146,0)
     93112 ;;<representedCustodianOrganization>
     93113"RTN","C0CCCD1",147,0)
     93114 ;;<id root="2.16.840.1.113883.19.5"/>
     93115"RTN","C0CCCD1",148,0)
     93116 ;;<name>@@ORGANIZATIONNAME@@</name>
     93117"RTN","C0CCCD1",149,0)
     93118 ;;</representedCustodianOrganization>
     93119"RTN","C0CCCD1",150,0)
     93120 ;;</assignedCustodian>
     93121"RTN","C0CCCD1",151,0)
     93122 ;;</custodian>
     93123"RTN","C0CCCD1",152,0)
     93124 ;;<legalAuthenticator>
     93125"RTN","C0CCCD1",153,0)
     93126 ;;<time value="20000407130000+0500"/>
     93127"RTN","C0CCCD1",154,0)
     93128 ;;<signatureCode code="S"/>
     93129"RTN","C0CCCD1",155,0)
     93130 ;;<assignedEntity>
     93131"RTN","C0CCCD1",156,0)
     93132 ;;<id nullFlavor="NI"/>
     93133"RTN","C0CCCD1",157,0)
     93134 ;;<representedOrganization>
     93135"RTN","C0CCCD1",158,0)
     93136 ;;<id root="2.16.840.1.113883.19.5"/>
     93137"RTN","C0CCCD1",159,0)
     93138 ;;<name>@@ORGANIZATIONNAME@@</name>
     93139"RTN","C0CCCD1",160,0)
     93140 ;;</representedOrganization>
     93141"RTN","C0CCCD1",161,0)
     93142 ;;</assignedEntity>
     93143"RTN","C0CCCD1",162,0)
     93144 ;;</legalAuthenticator>
     93145"RTN","C0CCCD1",163,0)
     93146 ;;<Actors>
     93147"RTN","C0CCCD1",164,0)
     93148 ;;<ACTOR-NOK>
     93149"RTN","C0CCCD1",165,0)
     93150 ;;<participant typeCode="IND">
     93151"RTN","C0CCCD1",166,0)
     93152 ;;<associatedEntity classCode="NOK">
     93153"RTN","C0CCCD1",167,0)
     93154 ;;<id root="4ac71514-6a10-4164-9715-f8d96af48e6d"/>
     93155"RTN","C0CCCD1",168,0)
     93156 ;;<code code="65656005" codeSystem="2.16.840.1.113883.6.96" displayName="Biiological mother"/>
     93157"RTN","C0CCCD1",169,0)
     93158 ;;<telecom value="tel:(999)555-1212"/>
     93159"RTN","C0CCCD1",170,0)
     93160 ;;<associatedPerson>
     93161"RTN","C0CCCD1",171,0)
     93162 ;;<name>
     93163"RTN","C0CCCD1",172,0)
     93164 ;;<given>Henrietta</given>
     93165"RTN","C0CCCD1",173,0)
     93166 ;;<family>Levin</family>
     93167"RTN","C0CCCD1",174,0)
     93168 ;;</name>
     93169"RTN","C0CCCD1",175,0)
     93170 ;;</associatedPerson>
     93171"RTN","C0CCCD1",176,0)
     93172 ;;</associatedEntity>
     93173"RTN","C0CCCD1",177,0)
     93174 ;;</participant>
     93175"RTN","C0CCCD1",178,0)
     93176 ;;</ACTOR-NOK>
     93177"RTN","C0CCCD1",179,0)
     93178 ;;</Actors>
     93179"RTN","C0CCCD1",180,0)
     93180 ;;<documentationOf>
     93181"RTN","C0CCCD1",181,0)
     93182 ;;<serviceEvent classCode="PCPR">
     93183"RTN","C0CCCD1",182,0)
     93184 ;;<effectiveTime>
     93185"RTN","C0CCCD1",183,0)
     93186 ;;<high value="@@DATETIME@@"/>
     93187"RTN","C0CCCD1",184,0)
     93188 ;;</effectiveTime>
     93189"RTN","C0CCCD1",185,0)
     93190 ;;<performer typeCode="PRF">
     93191"RTN","C0CCCD1",186,0)
     93192 ;;<functionCode code="PCP" codeSystem="2.16.840.1.113883.5.88"/>
     93193"RTN","C0CCCD1",187,0)
     93194 ;;<time>
     93195"RTN","C0CCCD1",188,0)
     93196 ;;<low value="1990"/>
     93197"RTN","C0CCCD1",189,0)
     93198 ;;<high value='20000407'/>
     93199"RTN","C0CCCD1",190,0)
     93200 ;;</time>
     93201"RTN","C0CCCD1",191,0)
     93202 ;;<assignedEntity>
     93203"RTN","C0CCCD1",192,0)
     93204 ;;<id root="20cf14fb-b65c-4c8c-a54d-b0cca834c18c"/>
     93205"RTN","C0CCCD1",193,0)
     93206 ;;<assignedPerson>
     93207"RTN","C0CCCD1",194,0)
     93208 ;;<name>
     93209"RTN","C0CCCD1",195,0)
     93210 ;;<prefix>@@ACTORPREFIXNAME@@</prefix>
     93211"RTN","C0CCCD1",196,0)
     93212 ;;<given>@@ACTORGIVENNAME@@</given>
     93213"RTN","C0CCCD1",197,0)
     93214 ;;<family>@@ACTORFAMILYNAME@@</family>
     93215"RTN","C0CCCD1",198,0)
     93216 ;;</name>
     93217"RTN","C0CCCD1",199,0)
     93218 ;;</assignedPerson>
     93219"RTN","C0CCCD1",200,0)
     93220 ;;<representedOrganization>
     93221"RTN","C0CCCD1",201,0)
     93222 ;;<id root="2.16.840.1.113883.19.5"/>
     93223"RTN","C0CCCD1",202,0)
     93224 ;;<name>@@ORGANIZATIONNAME@@</name>
     93225"RTN","C0CCCD1",203,0)
     93226 ;;</representedOrganization>
     93227"RTN","C0CCCD1",204,0)
     93228 ;;</assignedEntity>
     93229"RTN","C0CCCD1",205,0)
     93230 ;;</performer>
     93231"RTN","C0CCCD1",206,0)
     93232 ;;</serviceEvent>
     93233"RTN","C0CCCD1",207,0)
     93234 ;;</documentationOf>
     93235"RTN","C0CCCD1",208,0)
    9296893236 ;;<Body>
    92969 "RTN","C0CCCD1",69,0)
     93237"RTN","C0CCCD1",209,0)
     93238 ;;<PROBLEMS-HTML>
     93239"RTN","C0CCCD1",210,0)
     93240 ;;<text><table border="1" width="100%"><thead><tr><th>Condition</th><th>Effective Dates</th><th>Condition Status</th></tr></thead><tbody>
     93241"RTN","C0CCCD1",211,0)
     93242 ;;<tr><td>@@PROBLEMDESCRIPTION@@</td>
     93243"RTN","C0CCCD1",212,0)
     93244 ;;<td>@@PROBLEMDATEOFONSET@@</td>
     93245"RTN","C0CCCD1",213,0)
     93246 ;;<td>Active</td></tr>
     93247"RTN","C0CCCD1",214,0)
     93248 ;;</tbody></table></text>
     93249"RTN","C0CCCD1",215,0)
     93250 ;;</PROBLEMS-HTML>
     93251"RTN","C0CCCD1",216,0)
    9297093252 ;;<Problems>
    92971 "RTN","C0CCCD1",70,0)
    92972  ;;</Problems>
    92973 "RTN","C0CCCD1",71,0)
    92974  ;;<FamilyHistory>
    92975 "RTN","C0CCCD1",72,0)
    92976  ;;</FamilyHistory>
    92977 "RTN","C0CCCD1",73,0)
    92978  ;;<SocialHistory>
    92979 "RTN","C0CCCD1",74,0)
    92980  ;;</SocialHistory>
    92981 "RTN","C0CCCD1",75,0)
    92982  ;;<Alerts>
    92983 "RTN","C0CCCD1",76,0)
    92984  ;;</Alerts>
    92985 "RTN","C0CCCD1",77,0)
    92986  ;;<Medications>
    92987 "RTN","C0CCCD1",78,0)
    92988  ;;</Medications>
    92989 "RTN","C0CCCD1",79,0)
    92990  ;;<VitalSigns>
    92991 "RTN","C0CCCD1",80,0)
    92992  ;;</VitalSigns>
    92993 "RTN","C0CCCD1",81,0)
    92994  ;;<Results>
    92995 "RTN","C0CCCD1",82,0)
    92996  ;;</Results>
    92997 "RTN","C0CCCD1",83,0)
    92998  ;;</Body>
    92999 "RTN","C0CCCD1",84,0)
    93000  ;;</ContinuityOfCareRecord>
    93001 "RTN","C0CCCD1",85,0)
    93002  ;</MARKUP>
    93003 "RTN","C0CCCD1",86,0)
    93004  ;;<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
    93005 "RTN","C0CCCD1",87,0)
    93006  ;;</ClinicalDocument>
    93007 "RTN","C0CCCD1",88,0)
    93008  Q
    93009 "RTN","C0CCCD1",89,0)
    93010  ;
    93011 "RTN","C0CCCD1",90,0)
    93012  ;<TEMPLATE>
    93013 "RTN","C0CCCD1",91,0)
    93014  ;;<?xml version="1.0"?>
    93015 "RTN","C0CCCD1",92,0)
    93016  ;;<?xml-stylesheet type="text/xsl" href="CCD.xsl"?>
    93017 "RTN","C0CCCD1",93,0)
    93018  ;;<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
    93019 "RTN","C0CCCD1",94,0)
    93020  ;;<typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
    93021 "RTN","C0CCCD1",95,0)
    93022  ;;<templateId root="2.16.840.1.113883.10.20.1"/>
    93023 "RTN","C0CCCD1",96,0)
    93024  ;;<id root="db734647-fc99-424c-a864-7e3cda82e703"/>
    93025 "RTN","C0CCCD1",97,0)
    93026  ;;<code code="34133-9" codeSystem="2.16.840.1.113883.6.1" displayName="Summarization of episode note"/>
    93027 "RTN","C0CCCD1",98,0)
    93028  ;;<title>Continuity of Care Document</title>
    93029 "RTN","C0CCCD1",99,0)
    93030  ;;<effectiveTime value="20000407130000+0500"/>
    93031 "RTN","C0CCCD1",100,0)
    93032  ;;<confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25"/>
    93033 "RTN","C0CCCD1",101,0)
    93034  ;;<languageCode code="en-US"/>
    93035 "RTN","C0CCCD1",102,0)
    93036  ;;<recordTarget>
    93037 "RTN","C0CCCD1",103,0)
    93038  ;;<patientRole>
    93039 "RTN","C0CCCD1",104,0)
    93040  ;;<id extension="@@ACTORIEN@@" root="2.16.840.1.113883.19.5"/>
    93041 "RTN","C0CCCD1",105,0)
    93042  ;;<patient>
    93043 "RTN","C0CCCD1",106,0)
    93044  ;;<name>
    93045 "RTN","C0CCCD1",107,0)
    93046  ;;<given>@@ACTORGIVENNAME@@</given>
    93047 "RTN","C0CCCD1",108,0)
    93048  ;;<family>@@ACTORFAMILYNAME@@</family>
    93049 "RTN","C0CCCD1",109,0)
    93050  ;;<suffix>@@ACTORSUFFIXNAME@@</suffix>
    93051 "RTN","C0CCCD1",110,0)
    93052  ;;</name>
    93053 "RTN","C0CCCD1",111,0)
    93054  ;;<administrativeGenderCode code="@@ACTORGENDER@@" codeSystem="2.16.840.1.113883.5.1"/>
    93055 "RTN","C0CCCD1",112,0)
    93056  ;;<birthTime value="@@ACTORDATEOFBIRTH@@"/>
    93057 "RTN","C0CCCD1",113,0)
    93058  ;;</patient>
    93059 "RTN","C0CCCD1",114,0)
    93060  ;;<providerOrganization>
    93061 "RTN","C0CCCD1",115,0)
    93062  ;;<id root="2.16.840.1.113883.19.5"/>
    93063 "RTN","C0CCCD1",116,0)
    93064  ;;<name>@@ORGANIZATIONNAME@@</name>
    93065 "RTN","C0CCCD1",117,0)
    93066  ;;</providerOrganization>
    93067 "RTN","C0CCCD1",118,0)
    93068  ;;</patientRole>
    93069 "RTN","C0CCCD1",119,0)
    93070  ;;</recordTarget>
    93071 "RTN","C0CCCD1",120,0)
    93072  ;;<author>
    93073 "RTN","C0CCCD1",121,0)
    93074  ;;<time value="20000407130000+0500"/>
    93075 "RTN","C0CCCD1",122,0)
    93076  ;;<assignedAuthor>
    93077 "RTN","C0CCCD1",123,0)
    93078  ;;<id root="20cf14fb-b65c-4c8c-a54d-b0cca834c18c"/>
    93079 "RTN","C0CCCD1",124,0)
    93080  ;;<assignedPerson>
    93081 "RTN","C0CCCD1",125,0)
    93082  ;;<name>
    93083 "RTN","C0CCCD1",126,0)
    93084  ;;<prefix>@@ACTORNAMEPREFIX@@</prefix>
    93085 "RTN","C0CCCD1",127,0)
    93086  ;;<given>@@ACTORGIVENNAME@@</given>
    93087 "RTN","C0CCCD1",128,0)
    93088  ;;<family>@@ACTORFAMILYNAME@@</family>
    93089 "RTN","C0CCCD1",129,0)
    93090  ;;</name>
    93091 "RTN","C0CCCD1",130,0)
    93092  ;;</assignedPerson>
    93093 "RTN","C0CCCD1",131,0)
    93094  ;;<representedOrganization>
    93095 "RTN","C0CCCD1",132,0)
    93096  ;;<id root="2.16.840.1.113883.19.5"/>
    93097 "RTN","C0CCCD1",133,0)
    93098  ;;<name>@@ORGANIZATIONNAME@@</name>
    93099 "RTN","C0CCCD1",134,0)
    93100  ;;</representedOrganization>
    93101 "RTN","C0CCCD1",135,0)
    93102  ;;</assignedAuthor>
    93103 "RTN","C0CCCD1",136,0)
    93104  ;;</author>
    93105 "RTN","C0CCCD1",137,0)
    93106  ;;<informant>
    93107 "RTN","C0CCCD1",138,0)
    93108  ;;<assignedEntity>
    93109 "RTN","C0CCCD1",139,0)
    93110  ;;<id nullFlavor="NI"/>
    93111 "RTN","C0CCCD1",140,0)
    93112  ;;<representedOrganization>
    93113 "RTN","C0CCCD1",141,0)
    93114  ;;<id root="2.16.840.1.113883.19.5"/>
    93115 "RTN","C0CCCD1",142,0)
    93116  ;;<name>@@ORGANIZATIONNAME@@</name>
    93117 "RTN","C0CCCD1",143,0)
    93118  ;;</representedOrganization>
    93119 "RTN","C0CCCD1",144,0)
    93120  ;;</assignedEntity>
    93121 "RTN","C0CCCD1",145,0)
    93122  ;;</informant>
    93123 "RTN","C0CCCD1",146,0)
    93124  ;;<custodian>
    93125 "RTN","C0CCCD1",147,0)
    93126  ;;<assignedCustodian>
    93127 "RTN","C0CCCD1",148,0)
    93128  ;;<representedCustodianOrganization>
    93129 "RTN","C0CCCD1",149,0)
    93130  ;;<id root="2.16.840.1.113883.19.5"/>
    93131 "RTN","C0CCCD1",150,0)
    93132  ;;<name>@@ORGANIZATIONNAME@@</name>
    93133 "RTN","C0CCCD1",151,0)
    93134  ;;</representedCustodianOrganization>
    93135 "RTN","C0CCCD1",152,0)
    93136  ;;</assignedCustodian>
    93137 "RTN","C0CCCD1",153,0)
    93138  ;;</custodian>
    93139 "RTN","C0CCCD1",154,0)
    93140  ;;<legalAuthenticator>
    93141 "RTN","C0CCCD1",155,0)
    93142  ;;<time value="20000407130000+0500"/>
    93143 "RTN","C0CCCD1",156,0)
    93144  ;;<signatureCode code="S"/>
    93145 "RTN","C0CCCD1",157,0)
    93146  ;;<assignedEntity>
    93147 "RTN","C0CCCD1",158,0)
    93148  ;;<id nullFlavor="NI"/>
    93149 "RTN","C0CCCD1",159,0)
    93150  ;;<representedOrganization>
    93151 "RTN","C0CCCD1",160,0)
    93152  ;;<id root="2.16.840.1.113883.19.5"/>
    93153 "RTN","C0CCCD1",161,0)
    93154  ;;<name>@@ORGANIZATIONNAME@@</name>
    93155 "RTN","C0CCCD1",162,0)
    93156  ;;</representedOrganization>
    93157 "RTN","C0CCCD1",163,0)
    93158  ;;</assignedEntity>
    93159 "RTN","C0CCCD1",164,0)
    93160  ;;</legalAuthenticator>
    93161 "RTN","C0CCCD1",165,0)
    93162  ;;<Actors>
    93163 "RTN","C0CCCD1",166,0)
    93164  ;;<ACTOR-NOK>
    93165 "RTN","C0CCCD1",167,0)
    93166  ;;<participant typeCode="IND">
    93167 "RTN","C0CCCD1",168,0)
    93168  ;;<associatedEntity classCode="NOK">
    93169 "RTN","C0CCCD1",169,0)
    93170  ;;<id root="4ac71514-6a10-4164-9715-f8d96af48e6d"/>
    93171 "RTN","C0CCCD1",170,0)
    93172  ;;<code code="65656005" codeSystem="2.16.840.1.113883.6.96" displayName="Biiological mother"/>
    93173 "RTN","C0CCCD1",171,0)
    93174  ;;<telecom value="tel:(999)555-1212"/>
    93175 "RTN","C0CCCD1",172,0)
    93176  ;;<associatedPerson>
    93177 "RTN","C0CCCD1",173,0)
    93178  ;;<name>
    93179 "RTN","C0CCCD1",174,0)
    93180  ;;<given>Henrietta</given>
    93181 "RTN","C0CCCD1",175,0)