1 | GPLVITALS ; CCDCCR/GPL - CCR/CCD PROCESSING FOR VITALS ; 6/6/08
|
---|
2 | ;;0.1;CCDCCR;nopatch;noreleasedate
|
---|
3 | EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE
|
---|
4 | ;
|
---|
5 | ; VITXML AND OUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED
|
---|
6 | ; IVITXML WILL CONTAIN ONLY THE VITALS SECTION OF THE OVERALL TEMPLATE
|
---|
7 | ;
|
---|
8 | N VITRSLT,J,K,VITPTMP,X,VITVMAP,TBUF
|
---|
9 | D VITALS^ORQQVI(.VITRSLT,DFN,"","")
|
---|
10 | I '$D(VITRSLT(1)) W "ERROR RUNNINIG VITALS RPC",! Q
|
---|
11 | ;ZWR RPCRSLT
|
---|
12 | S VITTVMAP=$NA(^TMP($J,"VITALS"))
|
---|
13 | S VITTARYTMP=$NA(^TMP($J,"VITALARYTMP"))
|
---|
14 | F J=1:1:VITRSLT(1) D ; FOR EACH VITAL IN THE LIST
|
---|
15 | . I $D(VITRSLT(J)) D
|
---|
16 | . . S VITVMAP=$NA(@VITTVMAP@(J))
|
---|
17 | . . K @VITVMAP
|
---|
18 | . . I DEBUG W "VMAP= ",VMAP,!
|
---|
19 | . . S VITPTMP=VITRSLT(J) ; PULL OUT VITAL FROM RPC RETURN ARRAY
|
---|
20 | . . S @VITVMAP@("DATAOBJECTID")="VITAL"_J ; UNIQUE OBJID FOR VITAL
|
---|
21 | . . I $P(VITPTMP,U,2)="HT" D
|
---|
22 | . . . S @VITVMAP@("HEIGHTWEIGHTDATATIME")=$P(VITPTMP,U,4)
|
---|
23 | . . . S @VITVMAP@("HEIGHTWEIGHTSOURCE")=$P(VITPTMP,U,7)
|
---|
24 | . . . S @VITVMAP@("HEIGHTSOURCEID")=$P(VITPTMP,U,1)
|
---|
25 | . . . S @VITVMAP@("HEIGHTINCHES")=$P(VITPTMP,U,3)
|
---|
26 | . . I $P(VITPTMP,U,2)="WT" D
|
---|
27 | . . . S @VITVMAP@("WEIGHTSOURCEID")=$P(VITPTMP,U,1)
|
---|
28 | . . . S @VITVMAP@("WEIGHTLBS")=$P(VITPTMP,U,3)
|
---|
29 | . . S VITARYTMP=$NA(@VITTARYTMP@(J))
|
---|
30 | . . K @VITARYTMP
|
---|
31 | . . D MAP^GPLXPATH(VITXML,VITVMAP,VITARYTMP)
|
---|
32 | . . I J=1 D ; FIRST ONE IS JUST A COPY
|
---|
33 | . . . ; W "FIRST ONE",!
|
---|
34 | . . . D CP^GPLXPATH(VITARYTMP,VITOUTXML)
|
---|
35 | . . . ; W "OUTXML ",OUTXML,!
|
---|
36 | . . I J>1 D ; AFTER THE FIRST, INSERT INNER XML
|
---|
37 | . . . D INSINNER^GPLXPATH(VITOUTXML,VITARYTMP)
|
---|
38 | ;ZWR ^TMP($J,"VITALS",*)
|
---|
39 | ;ZWR ^TMP($J,"VITALARYTMP",*) ; SHOW THE RESULTS
|
---|
40 | ; W "OUT OF FOR LOOP.",!
|
---|
41 | ;ZWR
|
---|
42 | ; ZWR @OUTXML
|
---|
43 | ; $$HTML^DILF(
|
---|
44 | N VITTMP,I
|
---|
45 | D MISSING^GPLXPATH(VITXML,"VITTMP") ; SEARCH XML FOR MISSING VARS
|
---|
46 | I VITTMP(0)>0 D ; IF THERE ARE MISSING VARS - MARKED AS @@X@@
|
---|
47 | . W "VITALS MISSING ",!
|
---|
48 | . F I=1:1:VITTMP(0) W VITTMP(I),!
|
---|
49 | Q
|
---|