Added "GPLCCR" to ^TMP globals for SAC compliance

This commit is contained in:
george 2008-07-07 05:30:04 +00:00
parent 541198530f
commit 07dbe235b3
5 changed files with 41 additions and 20 deletions

View File

@ -10,11 +10,11 @@ EXPORT ; EXPORT ENTRY POINT FOR CCR
S DFN=$P(Y,U,1) ; SET THE PATIENT
N CCRGLO
D CCRRPC(.CCRGLO,DFN,"CCR","","","")
S OARY=$NA(^TMP($J,DFN,"CCR",1))
S OARY=$NA(^TMP("GPLCCR",$J,DFN,"CCR",1))
S ONAM="PAT_"_DFN_"_CCR_V1.xml"
S ODIR="/home/glilly/CCROUT"
;S ODIR="/home/cedwards/"
;S ODIR="/opt/wv/p/"
;S ODIR="/opt/wv/p/"
D OUTPUT^GPLXPATH(OARY,ONAM,ODIR)
Q
;
@ -30,11 +30,11 @@ CCRRPC(CCRGRTN,DFN,CCRPART,TIME1,TIME2,HDRARY) ;RPC ENTRY POINT FOR CCR OUTPUT
; "TO" VARIABLES
; IF NULL WILL DEFAULT TO "FROM" DUZ AND "TO" DFN
S DEBUG=0
S TGLOBAL=$NA(^TMP($J,"TEMPLATE")) ; GLOBAL FOR STORING TEMPLATE
S CCRGLO=$NA(^TMP($J,DFN,"CCR")) ; GLOBAL FOR BUILDING THE CCR
S ACTGLO=$NA(^TMP($J,DFN,"ACTORS")) ; GLOBAL FOR ALL ACTORS
S TGLOBAL=$NA(^TMP("GPLCCR",$J,"TEMPLATE")) ; GLOBAL FOR STORING TEMPLATE
S CCRGLO=$NA(^TMP("GPLCCR",$J,DFN,"CCR")) ; GLOBAL FOR BUILDING THE CCR
S ACTGLO=$NA(^TMP("GPLCCR",$J,DFN,"ACTORS")) ; GLOBAL FOR ALL ACTORS
; TO GET PART OF THE CCR RETURNED, PASS CCRPART="PROBLEMS" ETC
S CCRGRTN=$NA(^TMP($J,DFN,CCRPART)) ; RTN GLO NM OF PART OR ALL
S CCRGRTN=$NA(^TMP("GPLCCR",$J,DFN,CCRPART)) ; RTN GLO NM OF PART OR ALL
D LOAD^GPLCCR0(TGLOBAL) ; LOAD THE CCR TEMPLATE
D CP^GPLXPATH(TGLOBAL,CCRGLO) ; COPY THE TEMPLATE TO CCR GLOBAL
;
@ -47,8 +47,8 @@ CCRRPC(CCRGRTN,DFN,CCRPART,TIME1,TIME2,HDRARY) ;RPC ENTRY POINT FOR CCR OUTPUT
;
D HDRMAP(CCRGLO,DFN,HDRARY) ; MAP HEADER VARIABLES
;
K ^TMP($J,"CCRSTEP") ; KILL GLOBAL PRIOR TO ADDING TO IT
S CCRXTAB="^TMP($J,""CCRSTEP"")" ; GLOBAL TO STORE CCR STEPS
K ^TMP("GPLCCR",$J,"CCRSTEP") ; KILL GLOBAL PRIOR TO ADDING TO IT
S CCRXTAB=$NA(^TMP("GPLCCR",$J,"CCRSTEP")) ; GLOBAL TO STORE CCR STEPS
D INITSTPS(CCRXTAB) ; INITIALIZED CCR PROCESSING STEPS
N I,XI,TAG,RTN,CALL,XPATH,IXML,OXML,INXML,CCRBLD
F I=1:1:@CCRXTAB@(0) D ; PROCESS THE CCR BODY SECTIONS
@ -74,13 +74,13 @@ CCRRPC(CCRGRTN,DFN,CCRPART,TIME1,TIME2,HDRARY) ;RPC ENTRY POINT FOR CCR OUTPUT
;
INITSTPS(TAB) ; INITIALIZE CCR PROCESSING STEPS
; TAB IS PASSED BY NAME
; W "TAB= ",TAB,!
D PUSH^GPLXPATH(TAB,"EXTRACT;GPLPROBS;//ContinuityOfCareRecord/Body/Problems;^TMP($J,DFN,""PROBLEMS"")")
D PUSH^GPLXPATH(TAB,"EXTRACT;GPLVITALS;//ContinuityOfCareRecord/Body/VitalSigns;^TMP($J,DFN,""VITALS"")")
W "TAB= ",TAB,!
D PUSH^GPLXPATH(TAB,"EXTRACT;GPLPROBS;//ContinuityOfCareRecord/Body/Problems;^TMP(""GPLCCR"",$J,DFN,""PROBLEMS"")")
D PUSH^GPLXPATH(TAB,"EXTRACT;GPLVITALS;//ContinuityOfCareRecord/Body/VitalSigns;^TMP(""GPLCCR"",$J,DFN,""VITALS"")")
Q
;
HDRMAP(CXML,DFN,IHDR) ; MAP HEADER VARIABLES: FROM, TO ECT
N VMAP S VMAP=$NA(^TMP($J,DFN,"HEADER"))
N VMAP S VMAP=$NA(^TMP("GPLCCR",$J,DFN,"HEADER"))
; K @VMAP
S @VMAP@("DATETIME")=$$FMDTOUTC^CCRUTIL($$FMTHL7^XLFDT($$NOW^XLFDT),"DT")
I IHDR="" D ; HEADER ARRAY IS NOT PROVIDED, USE DEFAULTS

View File

@ -15,8 +15,8 @@ EXTRACT(IPXML,DFN,OUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE
D LIST^ORQQPL3(.RPCRSLT,DFN,"") ; CALL THE PROBLEM LIST RPC
I '$D(RPCRSLT(0)) W "ERROR CALLING LIST^ORQQPL3 ",! Q
ZWR RPCRSLT
S TVMAP=$NA(^TMP($J,"PROBVALS"))
S TARYTMP=$NA(^TMP($J,"PROBARYTMP"))
S TVMAP=$NA(^TMP("GPLCCR",$J,"PROBVALS"))
S TARYTMP=$NA(^TMP("GPLCCR",$J,"PROBARYTMP"))
F J=1:1:RPCRSLT(0) D ; FOR EACH PROBLEM IN THE LIST
. S VMAP=$NA(@TVMAP@(J))
. K @VMAP
@ -51,8 +51,8 @@ EXTRACT(IPXML,DFN,OUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE
. . ; W "OUTXML ",OUTXML,!
. I J>1 D ; AFTER THE FIRST, INSERT INNER XML
. . D INSINNER^GPLXPATH(OUTXML,ARYTMP)
; ZWR ^TMP($J,"PROBVALS",*)
; ZWR ^TMP($J,"PROBARYTMP",*) ; SHOW THE RESULTS
; ZWR ^TMP("GPLCCR",$J,"PROBVALS",*)
; ZWR ^TMP("GPLCCR",$J,"PROBARYTMP",*) ; SHOW THE RESULTS
; ZWR @OUTXML
; $$HTML^DILF(
N PROBSTMP,I

View File

@ -38,7 +38,6 @@ ZLOAD(ZARY,ROUTINE) ; load tests into ZARY which is passed by reference
N SECTION S SECTION="[anonymous]" ; test case section
;
N NUM F NUM=1:1 S LINE=$T(+NUM^@ROUTINE) Q:LINE="" D
. W NUM," ",LINE,!
. I LINE?." "1";;><TEST>".E S INTEST=1 ; entering test section
. I LINE?." "1";;><TEMPLATE>".E S INTEST=1 ; entering TEMPLATE section
. I LINE?." "1";;></TEST>".E S INTEST=0 ; leaving test section

View File

@ -9,10 +9,10 @@ EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMP
D VITALS^ORQQVI(.VITRSLT,DFN,"","")
I '$D(VITRSLT(1)) W "ERROR RUNNINIG VITALS RPC",! Q
; ZWR RPCRSLT
S VITTVMAP=$NA(^TMP($J,"VITALS"))
S VITTARYTMP=$NA(^TMP($J,"VITALARYTMP"))
S VITTVMAP=$NA(^TMP("GPLCCR",$J,"VITALS"))
S VITTARYTMP=$NA(^TMP("GPLCCR",$J,"VITALARYTMP"))
F J=1:1:VITRSLT(1) D ; FOR EACH VITAL IN THE LIST
. I $D(VITRSLT(J)) D
. I $D(VITRSLT(J)) D
. . S VITVMAP=$NA(@VITTVMAP@(J))
. . K @VITVMAP
. . I DEBUG W "VMAP= ",VMAP,!

View File

@ -330,6 +330,28 @@ MAP(IXML,INARY,OXML) ; SUBSTITUTE @@X@@ VARS IN IXML WITH VALUES IN INARY
W "MAPPED",!
Q
;
TRIM(THEXML) ; TAKES OUT ALL NULL ELEMENTS
; THEXML IS PASSED BY NAME
N I,J,TMPXML,DEL
F I=1:1:@THEXML@(0) D ; LOOP THROUGH ENTIRE ARRAY
. I @THEXML@(I)'["><" D PUSH("TMPXML",@THEXML@(I))
D INDEX("TMPXML") ; MAKE AN XPATH INDEX
S I="" S I=$O(TMPXML(I))
F K=0:0 D Q:I="" ; NOW LOOK FOR EMPTY SECTIONS
. I I["//" D ;
. . W I,TMPXML(I),!
. . S J=$P(TMPXML(I),"^",1)
. . I J+1=$P(TMPXML(I),"^",2) D ;
. . . W I,!
. . . S DEL(J)=""
. . . S DEL(J+1)=""
. S I=$O(TMPXML(I))
F I=1:1:TMPXML(0) D ;
. I '$D(DEL(I))
. D PUSH("TMPXML2",TMPXML(I))
D CP("TMPXML2",THEXML)
Q
;
PARY(GLO) ;PRINT AN ARRAY
N I
F I=1:1:@GLO@(0) W @GLO@(I),!