Changeset 1517


Ignore:
Timestamp:
Aug 16, 2012, 8:19:14 PM (12 years ago)
Author:
Sam Habiel
Message:

Updated C0QQRDA file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qrda/C0Q/trunk/p/C0QQRDA.m

    r1516 r1517  
    1 C0QQRDA ; GPL - Quality Reporting QRDA Processing ; 8/1/12 7:34am
    2         ;;1.0;C0Q;**4**;May 21, 2012;Build 28
     1C0QQRDA ; GPL - Quality Reporting QRDA Processing ; 8/1/12 4:24pm
     2        ;;1.0;QUALITY MEASURES;**4**;May 21, 2012;Build 28
    33        ;Copyright 2012 George Lilly.  Licensed under the terms of the GNU
    44        ;General Public License See attached copy of the License.
     
    2222        K @REF
    2323        D WORK(REF)
    24         D ZWRITE^C0QUTIL(REF)
    2524        D PRINTXML(REF)
    2625        QUIT
     
    5150        QUIT
    5251        ;
    53 PRINTXML(C0QREF)
    54         N C0QDFN,C0QMS,C0QM S (C0QDFN,C0QMS,C0QM)=""
    55         S L=0
    56         F  S C0QDFN=$O(@C0QREF@(C0QDFN)) Q:C0QDFN=""  D
    57         . D OT("QUALITY")
    58         . F  S C0QMS=$O(@C0QREF@(C0QDFN,C0QMS)) Q:C0QMS=""  D
    59         . . D OT("MEASURE_SET")
    60         . . D TAG("ID",C0QMS)
    61         . . D OT("MEASURES")
    62         . . F  S C0QM=$O(@C0QREF@(C0QDFN,C0QMS,C0QM)) Q:C0QM=""  D
    63         . . . D TAG("MEASURE",C0QM)
    64         . . D CT("MEASURES")
    65         . . D CT("MEASURE_SET")
    66         . D CT("QUALITY")
     52PRINTXML(C0QREF) ; Print the XML; Private EP
     53        N C0QDFN,C0QMS,C0QM S (C0QDFN,C0QMS,C0QM)="" ; DFN, Measure Set, Measure loopers
     54        F  S C0QDFN=$O(@C0QREF@(C0QDFN)) Q:C0QDFN=""  D  ; For each patient
     55        . W !!,$C(27),"[1;37;42m","Prosessing DFN ",C0QDFN,$C(27),"[0m",!  ; Print in Green.
     56        . ;
     57        . ;
     58        . ; CCR Generatation is next; protected against crashes.
     59        . ; ET set to new value then restored.
     60        . N C0QCCRXML ; CCR XML
     61        . N OLDTRAP S OLDTRAP=$ET
     62        . ; ET: Rollback to this level, write the error in red , clear it, then quit
     63        . N $ES,$ET
     64        . S $ET="Q:($ES)  W $C(27),""[1;37;41m"",$ZS,$C(27),""[0m"",! S $EC="""""
     65        . D CCRRPC^C0CCCR(.C0QCCRXML,C0QDFN) ; Run CCR RPC.
     66        . S $ET=OLDTRAP
     67        . ;
     68        . ;
     69        . ; Quality XML Section generated by hand next...
     70        . N C0QXML ; Generated Quality XML
     71        . D XMLSTORE(.C0QXML,$$OT("QUALITY")) ; Open Tag
     72        . F  S C0QMS=$O(@C0QREF@(C0QDFN,C0QMS)) Q:C0QMS=""  D  ; For each measure set
     73        . . D XMLSTORE(.C0QXML,$$OT("MEASURE_SET")) ; Open tag
     74        . . D XMLSTORE(.C0QXML,$$TAG("ID",C0QMS)) ; Write out set QRDA code
     75        . . D XMLSTORE(.C0QXML,$$OT("MEASURES")) ; Open tag
     76        . . F  S C0QM=$O(@C0QREF@(C0QDFN,C0QMS,C0QM)) Q:C0QM=""  D  ; for each measure
     77        . . . D XMLSTORE(.C0QXML,$$TAG("MEASURE",C0QM)) ; Write <measure> and qrda code
     78        . . D XMLSTORE(.C0QXML,$$CT("MEASURES")) ; Close tag
     79        . . D XMLSTORE(.C0QXML,$$CT("MEASURE_SET")) ; Close tag
     80        . D XMLSTORE(.C0QXML,$$CT("QUALITY")) ; Close tag
     81        . ;
     82        . ;
     83        . ; Insert XML under the root of the document XPATH
     84        . D INSERT^C0CXPATH($NA(C0QCCRXML),$NA(C0QXML),"//ContinuityOfCareRecord")
     85        . ;
     86        . ;
     87        . ; Get Kernel Default Directory
     88        . N DEFDIR S DEFDIR=$$DEFDIR^%ZISH()
     89        . ;
     90        . ;
     91        . ; Write out to a file.
     92        . N FN S FN="QRDA_CCR_DFN"_$$RJ^XLFSTR(C0QDFN,10,"0")_".XML" ; File Name
     93        . K C0QCCRXML(0) ; remove zero node
     94        . D EN^DDIOL($$OUTPUT^C0CXPATH($NA(C0QCCRXML(1)),FN,DEFDIR))
    6795        QUIT
    6896        ;
    69         ; Quick XML stuff
    70 OT(STR) D L1 W "<"_STR_">",! Q  ; Open Tag
    71 CT(STR) D L2 W "</"_STR_">",! Q  ; Close Tag
    72 TAG(NM,CONTENT) D WS W "<"_NM_">",CONTENT,"</"_NM_">",! Q  ; Write whole tag
     97        ; Quick XML stuff ; All Private
     98OT(STR) Q "<"_STR_">"  ; $$ Open Tag
     99CT(STR) Q "</"_STR_">"  ; $$ Close Tag
     100TAG(NM,CONTENT) Q "<"_NM_">"_CONTENT_"</"_NM_">"  ; $$ Whole tag
     101        ;
     102XMLSTORE(REF,STR) ; Priv Proc - Store XML
     103        ; REF -> Save Array. Pass by Reference.
     104        ; STR -> What to store. Pass by Value.
     105        ; Use like this: D XMLSTORE(.STORE,"<tag>")
     106        ; Output: STORE(1)="<tag>"
     107        N L ; Number Subscript to use
     108        S L=$O(REF(" "),-1) S L=L+1 ; Get last number and increment
     109        S REF(L)=STR,REF(0)=L ; Store string in numbered sub, store last number in 0 node (not used here)
     110        QUIT
     111 ;
     112 ; Following is for formatting printed XML. L passed in Symbol Table and starts at 0.
    73113L1 D WS S L=L+1 Q  ; Write space and increment
    74114L2 S L=L-1 D WS Q  ; Decrement and Write space
Note: See TracChangeset for help on using the changeset viewer.