1 | GPLPROBS ; CCDCCR/GPL - CCR/CCD PROCESSING FOR PROBLEMS ; 6/6/08
|
---|
2 | ;;0.1;CCDCCR;nopatch;noreleasedate
|
---|
3 | ;
|
---|
4 | ; PROCESS THE PROBLEMS SECTION OF THE CCR
|
---|
5 | ;
|
---|
6 | EXTRACT(IPXML,DFN,OUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE
|
---|
7 | ;
|
---|
8 | ; INXML AND OUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED
|
---|
9 | ; INXML WILL CONTAIN ONLY THE PROBLEM SECTION OF THE OVERALL TEMPLATE
|
---|
10 | ; ONLY THE XML FOR ONE PROBLEM WILL BE PASSED. THIS ROUTINE WILL MAKE
|
---|
11 | ; COPIES AS NECESSARY TO REPRESENT MULTIPLE PROBLEMS
|
---|
12 | ; INSERT^GPLXPATH IS USED TO APPEND THE PROBLEMS TO THE OUTPUT
|
---|
13 | ;
|
---|
14 | N RPCRSLT,J,K,PTMP,X,VMAP,TBUF
|
---|
15 | D LIST^ORQQPL3(.RPCRSLT,DFN,"") ; CALL THE PROBLEM LIST RPC
|
---|
16 | I '$D(RPCRSLT(0)) W "ERROR CALLING LIST^ORQQPL3 ",! Q
|
---|
17 | ZWR RPCRSLT
|
---|
18 | S TVMAP=$NA(^TMP($J,"PROBVALS"))
|
---|
19 | S TARYTMP=$NA(^TMP($J,"PROBARYTMP"))
|
---|
20 | F J=1:1:RPCRSLT(0) D ; FOR EACH PROBLEM IN THE LIST
|
---|
21 | . S VMAP=$NA(@TVMAP@(J))
|
---|
22 | . K @VMAP
|
---|
23 | . I DEBUG W "VMAP= ",VMAP,!
|
---|
24 | . S PTMP=RPCRSLT(J) ; PULL OUT PROBLEM FROM RPC RETURN ARRAY
|
---|
25 | . S @VMAP@("PROBLEMOBJECTID")="PROBLEM"_J ; UNIQUE OBJID FOR PROBLEM
|
---|
26 | . S @VMAP@("PROBLEMIEN")=$P(PTMP,U,1)
|
---|
27 | . S @VMAP@("PROBLEMSTATUS")=$P(PTMP,U,2)
|
---|
28 | . S @VMAP@("PROBLEMDESCRIPTION")=$P(PTMP,U,3)
|
---|
29 | . S @VMAP@("PROBLEMCODEVALUE")=$P(PTMP,U,4)
|
---|
30 | . S @VMAP@("PROBLEMDATEOFONSET")=$P(PTMP,U,5)
|
---|
31 | . S @VMAP@("PROBLEMDATEMOD")=$P(PTMP,U,6)
|
---|
32 | . S @VMAP@("PROBLEMSC")=$P(PTMP,U,7)
|
---|
33 | . S @VMAP@("PROBLEMSE")=$P(PTMP,U,8)
|
---|
34 | . S @VMAP@("PROBLEMCONDITION")=$P(PTMP,U,9)
|
---|
35 | . S @VMAP@("PROBLEMLOC")=$P(PTMP,U,10)
|
---|
36 | . S @VMAP@("PROBLEMLOCTYPE")=$P(PTMP,U,11)
|
---|
37 | . S @VMAP@("PROBLEMPROVIDER")=$P(PTMP,U,12)
|
---|
38 | . S X=@VMAP@("PROBLEMPROVIDER") ; FORMAT Y;NAME Y IS IEN OF PROVIDER
|
---|
39 | . S @VMAP@("PROBLEMSOURCEACTORID")="ACTORPROVIDER_"_$P(X,";",1)
|
---|
40 | . S @VMAP@("PROBLEMSERVICE")=$P(PTMP,U,13)
|
---|
41 | . S @VMAP@("PROBLEMHASCMT")=$P(PTMP,U,14)
|
---|
42 | . S @VMAP@("PROBLEMDTREC")=$P(PTMP,U,15)
|
---|
43 | . S @VMAP@("PROBLEMINACT")=$P(PTMP,U,16)
|
---|
44 | . S ARYTMP=$NA(@TARYTMP@(J))
|
---|
45 | . ; W "ARYTMP= ",ARYTMP,!
|
---|
46 | . K @ARYTMP
|
---|
47 | . D MAP^GPLXPATH(IPXML,VMAP,ARYTMP) ;
|
---|
48 | . I J=1 D ; FIRST ONE IS JUST A COPY
|
---|
49 | . . ; W "FIRST ONE",!
|
---|
50 | . . D CP^GPLXPATH(ARYTMP,OUTXML)
|
---|
51 | . . ; W "OUTXML ",OUTXML,!
|
---|
52 | . I J>1 D ; AFTER THE FIRST, INSERT INNER XML
|
---|
53 | . . D INSINNER^GPLXPATH(OUTXML,ARYTMP)
|
---|
54 | ; ZWR ^TMP($J,"PROBVALS",*)
|
---|
55 | ; ZWR ^TMP($J,"PROBARYTMP",*) ; SHOW THE RESULTS
|
---|
56 | ; ZWR @OUTXML
|
---|
57 | ; $$HTML^DILF(
|
---|
58 | N PROBSTMP,I
|
---|
59 | D MISSING^GPLXPATH(ARYTMP,"PROBSTMP") ; SEARCH XML FOR MISSING VARS
|
---|
60 | I PROBSTMP(0)>0 D ; IF THERE ARE MISSING VARS - STRINGS MARKED AS @@X@@
|
---|
61 | . W "PROBLEMS Missing list: ",!
|
---|
62 | . F I=1:1:PROBSTMP(0) W PROBSTMP(I),!
|
---|
63 | Q
|
---|