Fixed double XML escaping/encoding and let MAP^C0CXPATH handle it.

This commit is contained in:
cje 2009-11-05 19:53:27 +00:00
parent bb6d3ad368
commit b6c5c14f75
1 changed files with 16 additions and 12 deletions

View File

@ -1,4 +1,4 @@
C0CALABS ; CCDCCR/GPL - CCR/CCD PROCESSING FOR LAB RESULTS ; 10/01/08
C0CALABS ; CCDCCR/GPL - CCR/CCD PROCESSING FOR LAB RESULTS ; 10/01/08
;;1.0;C0C;;May 19, 2009;
;Copyright 2008,2009 George Lilly, University of Minnesota.
;Licensed under the terms of the GNU General Public License.
@ -18,7 +18,7 @@ C0CALABS ; CCDCCR/GPL - CCR/CCD PROCESSING FOR LAB RESULTS ; 10/01/08
;with this program; if not, write to the Free Software Foundation, Inc.,
;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
;
MAP(MIXML,DFN,MOXML) ;TO MAKE THIS COMPATIBLE WITH OLD CALLING FOR EXTRACT
MAP(MIXML,DFN,MOXML) ;TO MAKE THIS COMPATIBLE WITH OLD CALLING FOR EXTRACT
; ASSUMES THAT EXTRACT HAS BEEN RUN AND THE VARIABLES STORED IN MIVAR
; MIXML,MIVAR, AND MOXML ARE PASSED BY NAME
; MIXML IS THE TEMPLATE TO USE
@ -36,7 +36,7 @@ MAP(MIXML,DFN,MOXML) ;TO MAKE THIS COMPATIBLE WITH OLD CALLING FOR EXTRACT
M @C0CO=C0COXML ; COPY RESULTS TO OUTPUT
Q
;
RPCMAP(RTN,DFN,RMIVAR,RMIXML) ; RPC ENTRY POINT FOR MAPPING RESULTS
RPCMAP(RTN,DFN,RMIVAR,RMIXML) ; RPC ENTRY POINT FOR MAPPING RESULTS
; RTN IS PASSED BY REFERENCE
;N C0CT0,C0CT,C0CV ; CCR TEMPLATE, RESULTS SUBTEMPLATE, VARIABLES
;N C0CRT,C0CTT ; TEST REQUEST TEMPLATE, TEST RESULT TEMPLATE
@ -113,7 +113,7 @@ RPCMAP(RTN,DFN,RMIVAR,RMIXML) ; RPC ENTRY POINT FOR MAPPING RESULTS
K @C0CRBASE ; CLEAR OUT TEMPORARY STURCTURE
Q
;
EXTRACT(ILXML,DFN,OLXML) ; EXTRACT LABS INTO THE C0CLVAR GLOBAL
EXTRACT(ILXML,DFN,OLXML) ; EXTRACT LABS INTO THE C0CLVAR GLOBAL
;
; LABXML AND LABOUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED
;
@ -134,7 +134,7 @@ EXTRACT(ILXML,DFN,OLXML) ; EXTRACT LABS INTO THE C0CLVAR GLOBAL
I $D(OLXML) S @OLXML@(0)=0 ; EXTRACT DOES NOT PRODUCE XML... SEE MAP^C0CLABS
Q
;
GHL7 ; GET HL7 MESSAGE FOR LABS FOR THIS PATIENT
GHL7 ; GET HL7 MESSAGE FOR LABS FOR THIS PATIENT
; N C0CPTID,C0CSPC,C0CSDT,C0CEDT,C0CR
; SET UP FOR LAB API CALL
S C0CPTID=$$SSN^C0CDPT(DFN) ; GET THE SSN FOR THIS PATIENT
@ -154,7 +154,7 @@ GHL7 ; GET HL7 MESSAGE FOR LABS FOR THIS PATIENT
S C0CR=$$LAB^C0CLA7Q(C0CPTID,C0CSDT,C0CEDT,C0CSPC,C0CSPC) ; CALL LAB LOOKUP
Q
;
LIST ; LIST THE HL7 MESSAGE; ALSO, EXTRACT THE RESULT VARIABLES TO C0CLB
LIST ; LIST THE HL7 MESSAGE; ALSO, EXTRACT THE RESULT VARIABLES TO C0CLB
;
; N C0CI,C0CJ,C0COBT,C0CHB,C0CVAR
I '$D(C0CLB) S C0CLB=$NA(^TMP("C0CCCR",$J,"RESULTS")) ; BASE GLB FOR LABS VARS
@ -204,9 +204,13 @@ LIST ; LIST THE HL7 MESSAGE; ALSO, EXTRACT THE RESULT VARIABLES TO C0CLB
. . . S XV("RESULTTESTCODINGSYSTEM")=C0CVAR("C3") ; PRIMARY DISPLAY NAME
. . . S XV("RESULTTESTDESCRIPTIONTEXT")=C0CVAR("C2") ; USE PRIMARY TEXT
. . N C0CZG S C0CZG=XV("RESULTTESTNORMALDESCTEXT") ;
. . S XV("RESULTTESTNORMALDESCTEXT")=$$SYMENC^MXMLUTL(C0CZG) ;ESCAPE
. . ; mod to remove local XML escaping rely upon MAP^C0CXPATH
. . ;S XV("RESULTTESTNORMALDESCTEXT")=$$SYMENC^MXMLUTL(C0CZG) ;ESCAPE
. . S XV("RESULTTESTNORMALDESCTEXT")=C0CZG
. . S C0CZG=XV("RESULTTESTVALUE")
. . S XV("RESULTTESTVALUE")=$$SYMENC^MXMLUTL(C0CZG) ;ESCAPE
. . ; mod to remove local XML escaping rely upon MAP^C0CXPATH
. . ;S XV("RESULTTESTVALUE")=$$SYMENC^MXMLUTL(C0CZG) ;ESCAPE
. . S XV("RESULTTESTVALUE")=C0CZG
. I C0CTYP="OBX" D ; PROCESS TEST RESULTS
. . I C0CLOBX=0 D ; FIRST TEST RESULT FOR THIS SECTION
. . . S C0CLB2=$NA(@C0CLB@(C0CLI,"M","TEST")) ; INDENT FOR TEST RESULTS
@ -228,7 +232,7 @@ LIST ; LIST THE HL7 MESSAGE; ALSO, EXTRACT THE RESULT VARIABLES TO C0CLB
;K ^TMP("C0CRIM","VARS",DFN,"RESULTS")
;M ^TMP("C0CRIM","VARS",DFN,"RESULTS")=@C0CLB
Q
LTYP(OSEG,OTYP,OVARA,OC0CQT) ;
LTYP(OSEG,OTYP,OVARA,OC0CQT) ;
S OTAB=$NA(@C0CTAB@(OTYP)) ; TABLE FOR SEGMENT TYPE
I '$D(OC0CQT) S C0CQT=0 ; NOT C0CQT IS DEFAULT
E S C0CQT=OC0CQT ; ACCEPT C0CQT FLAG
@ -245,10 +249,10 @@ LTYP(OSEG,OTYP,OVARA,OC0CQT) ;
. . I 'C0CQT D ; PRINT OUTPUT IF C0CQT IS FALSE
. . . I OV'="" W OI_": "_$P(@OTAB@(OI),"^",3),": ",OVAR,": ",OV,!
Q
LOBX ;
LOBX ;
Q
;
OUT(DFN) ; WRITE OUT A CCR THAT HAS JUST BEEN PROCESSED (FOR TESTING)
OUT(DFN) ; WRITE OUT A CCR THAT HAS JUST BEEN PROCESSED (FOR TESTING)
N GA,GF,GD
S GA=$NA(^TMP("C0CCCR",$J,DFN,"CCR",1))
S GF="RPMS_CCR_"_DFN_"_"_DT_".xml"
@ -256,7 +260,7 @@ OUT(DFN) ; WRITE OUT A CCR THAT HAS JUST BEEN PROCESSED (FOR TESTING)
W $$OUTPUT^C0CXPATH(GA,GF,GD)
Q
;
SETTBL ;
SETTBL ;
K X ; CLEAR X
S X("PID","PID1")="1^00104^Set ID - Patient ID"
S X("PID","PID2")="2^00105^Patient ID (External ID)"