Changeset 1517
- Timestamp:
- Aug 16, 2012, 8:19:14 PM (12 years ago)
- 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:34am2 ;;1.0; C0Q;**4**;May 21, 2012;Build 281 C0QQRDA ; GPL - Quality Reporting QRDA Processing ; 8/1/12 4:24pm 2 ;;1.0;QUALITY MEASURES;**4**;May 21, 2012;Build 28 3 3 ;Copyright 2012 George Lilly. Licensed under the terms of the GNU 4 4 ;General Public License See attached copy of the License. … … 22 22 K @REF 23 23 D WORK(REF) 24 D ZWRITE^C0QUTIL(REF)25 24 D PRINTXML(REF) 26 25 QUIT … … 51 50 QUIT 52 51 ; 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") 52 PRINTXML(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)) 67 95 QUIT 68 96 ; 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 98 OT(STR) Q "<"_STR_">" ; $$ Open Tag 99 CT(STR) Q "</"_STR_">" ; $$ Close Tag 100 TAG(NM,CONTENT) Q "<"_NM_">"_CONTENT_"</"_NM_">" ; $$ Whole tag 101 ; 102 XMLSTORE(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. 73 113 L1 D WS S L=L+1 Q ; Write space and increment 74 114 L2 S L=L-1 D WS Q ; Decrement and Write space
Note:
See TracChangeset
for help on using the changeset viewer.