Derive Actor list ^TMP($J,DFN,"ACTORS",*)

This commit is contained in:
george 2008-07-01 17:12:30 +00:00
parent bc021d0a95
commit cbee619c02
1 changed files with 33 additions and 2 deletions

View File

@ -20,6 +20,7 @@ CCRRPC(CCRGRTN,DFN,CCRPART) ; RPC ENTRY POINT FOR CCR OUTPUT
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 IN CCR
; 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 OF CCR
D LOAD^GPLCCR0(TGLOBAL) ; LOAD THE CCR TEMPLATE
@ -30,8 +31,9 @@ CCRRPC(CCRGRTN,DFN,CCRPART) ; RPC ENTRY POINT FOR CCR OUTPUT
D REPLACE^GPLXPATH(CCRGLO,"","//ContinuityOfCareRecord/Body")
D REPLACE^GPLXPATH(CCRGLO,"","//ContinuityOfCareRecord/Actors")
D REPLACE^GPLXPATH(CCRGLO,"","//ContinuityOfCareRecord/Signatures")
F I=1:1:@CCRGLO@(0) W @CCRGLO@(I),!
I DEBUG F I=1:1:@CCRGLO@(0) W @CCRGLO@(I),!
;
D CCRHDR(CCRGLO,DFN) ; MAP HEADER VARIABLES
S CCRXTAB="^TMP($J,""CCRSTEP"")" ; GLOBAL TO STORE CCR PROCESSING STEPS
D INITSTPS(CCRXTAB) ; INITIALIZED CCR PROCESSING STEPS
N I,XI,TAG,RTN,CALL,XPATH,IXML,OXML,INXML,CCRBLD
@ -50,6 +52,7 @@ CCRRPC(CCRGRTN,DFN,CCRPART) ; RPC ENTRY POINT FOR CCR OUTPUT
. ; NOW INSERT THE RESULTS IN THE CCR BUFFER
. D INSERT^GPLXPATH(CCRGLO,OXML,"//ContinuityOfCareRecord/Body")
. I DEBUG F GPLI=1:1:@OXML@(0) W @OXML@(GPLI),!
. D ACTLST^GPLCCR(CCRGLO,ACTGLO)
Q
;
INITSTPS(TAB) ; INITIALIZE CCR PROCESSING STEPS
@ -59,10 +62,34 @@ INITSTPS(TAB) ; INITIALIZE CCR PROCESSING STEPS
D PUSH^GPLXPATH(TAB,"EXTRACT;GPLPROBS;//ContinuityOfCareRecord/Body/Problems;^TMP($J,DFN,""PROBLEMS"")")
Q
;
CCRHDR(CXML,DFN) ; MAP HEADER VARIABLES: FROM, TO ECT
N VMAP S VMAP=$NA(^TMP($J,DFN,"HEADER"))
; K @VMAP
S @VMAP@("ACTORPATIENT")="ACTORPATIENT_"_DFN
S @VMAP@("ACTORFROM")="ACTORPROVIDER_"_DUZ ; FROM DUZ - ???
S @VMAP@("ACTORFROM2")="ACTORPROVIDER_"_DUZ ; NEED A BETTER WAY
S @VMAP@("ACTORTO")="ACTORPATIENT_"_DFN ; FOR TEST PURPOSES,
; THIS IS THE USE CASE FOR THE PHR WHERE "TO" IS THE PATIENT
N CTMP
D MAP^GPLXPATH(CXML,VMAP,"CTMP")
D CP^GPLXPATH("CTMP",CXML)
Q
;
ACTLST(AXML,ACTRTN) ; RETURN THE ACTOR LIST FOR THE XML IN AXML
; AXML AND ACTRTN ARE PASSED BY NAME
N I,J,K
K @ACTRTN ; CLEAR RETURN ARRAY
F I=1:1:@AXML@(0) D ; SCAN ALL LINES
. I @AXML@(I)?.E1"<ActorID>".E D ; THERE IS AN ACTOR ON THIS LINE
. . S J=$P($P(@AXML@(I),"<ActorID>",2),"</ActorID>",1)
. . W "<ActorID>=>",J,!
. . D PUSH^GPLXPATH(ACTRTN,J)
Q
;
TEST ; RUN ALL THE TEST CASES
;D TESTALL^GPLUNIT("GPLCCR")
D ZTEST^GPLCCR("PROBLEMS")
W "TESTING TESTING 123",!
W "TESTING RETURNED FROM PROBLMES",!
D ZTEST^GPLCCR("CCR")
Q
;
@ -87,4 +114,8 @@ TLIST ; LIST THE TESTS
;;>>>K GPL S GPL=""
;;>>>D CCRRPC^GPLCCR(.GPL,"2","CCR")
;;>>?@GPL@(@GPL@(0))="</ContinutiyOfCareRecord>"
;;><ACTLST>
;;>>>N TCCR
;;>>>D CCRRPC^GPLCCR(.TCCR,"2","CCR")
;;>>>D ACTLST^GPLCCR("TCCR","ACTTEST")
;;></TEST>