source: ccr/trunk/p/GPLVITALS.m@ 36

Last change on this file since 36 was 36, checked in by Christopher Edwards, 16 years ago

switch proccessing of vitals and problems so CCR would validate
added date time for ccr
cleaned up template ccr (more to come)
more work done in vitals section

File size: 4.0 KB
Line 
1GPLVITALS ; CCDCCR/CJE - CCR/CCD PROCESSING FOR VITALS ; 07/03/08
2 ;;0.1;CCDCCR;;JUL 3,2008;
3EXTRACT(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@("VITALSIGNSDATAOBJECTID")="VITAL"_J ; UNIQUE OBJID FOR VITAL
21 . . I $P(VITPTMP,U,2)="HT" D
22 . . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
23 . . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^CCRUTIL($P(VITPTMP,U,4),"DT")
24 . . . W "CONVERTED DATE TIME: ",@VITVMAP@("VITALSIGNSEXACTDATETIME"),!
25 . . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="HEIGHT"
26 . . . ;S @VITVMAP@("VITALSIGNSSOURCEACTORID")=""
27 . . . S @VITVMAP@("VITALSIGNSTESTOBJECTID")="VITALTEST"_J
28 . . . S @VITVMAP@("VITALSIGNSTESTTYPETEXT")="OBSERVED"
29 . . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="HEIGHT"
30 . . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVALUE")=""
31 . . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODINGSYSTEM")=""
32 . . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVERSION")=""
33 . . . ;S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")=""
34 . . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P(VITPTMP,U,3)
35 . . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="in"
36 . . . ;S @VITVMAP@("HEIGHTWEIGHTSOURCE")=$P(VITPTMP,U,7)
37 . . E I $P(VITPTMP,U,2)="WT" D
38 . . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
39 . . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^CCRUTIL($P(VITPTMP,U,4),"DT")
40 . . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="WEIGHT"
41 . . . ;S @VITVMAP@("VITALSIGNSSOURCEACTORID")=""
42 . . . S @VITVMAP@("VITALSIGNSTESTOBJECTID")="VITALTEST"_J
43 . . . S @VITVMAP@("VITALSIGNSTESTTYPETEXT")="OBSERVED"
44 . . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="WEIGHT"
45 . . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVALUE")=""
46 . . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODINGSYSTEM")=""
47 . . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVERSION")=""
48 . . . ;S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")=""
49 . . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P(VITPTMP,U,3)
50 . . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="lbs"
51 . . E D
52 . . . ;W "IN VITAL: OTHER",!
53 . . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
54 . . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^CCRUTIL($P(VITPTMP,U,4),"DT")
55 . . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="OTHER VITAL"
56 . . . S @VITVMAP@("VITALSIGNSSOURCEACTORID")=""
57 . . . S @VITVMAP@("VITALSIGNSTESTOBJECTID")="VITALTEST"_J
58 . . . S @VITVMAP@("VITALSIGNSTESTTYPETEXT")="OBSERVED"
59 . . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="OTHER"
60 . . . S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVALUE")=""
61 . . . S @VITVMAP@("VITALSIGNSDESCRIPTIONCODINGSYSTEM")=""
62 . . . S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVERSION")=""
63 . . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")=""
64 . . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P(VITPTMP,U,3)
65 . . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="UNKNOWN"
66 . . . ;S @VITVMAP@("HEIGHTWEIGHTSOURCE")=$P(VITPTMP,U,7)
67 . . S VITARYTMP=$NA(@VITTARYTMP@(J))
68 . . K @VITARYTMP
69 . . D MAP^GPLXPATH(VITXML,VITVMAP,VITARYTMP)
70 . . I J=1 D ; FIRST ONE IS JUST A COPY
71 . . . ; W "FIRST ONE",!
72 . . . D CP^GPLXPATH(VITARYTMP,VITOUTXML)
73 . . . ; W "OUTXML ",OUTXML,!
74 . . I J>1 D ; AFTER THE FIRST, INSERT INNER XML
75 . . . D INSINNER^GPLXPATH(VITOUTXML,VITARYTMP)
76 ; ZWR ^TMP($J,"VITALS",*)
77 ; ZWR ^TMP($J,"VITALARYTMP",*) ; SHOW THE RESULTS
78 ; ZWR @OUTXML
79 N VITTMP,I
80 D MISSING^GPLXPATH(VITOUTXML,"VITTMP") ; SEARCH XML FOR MISSING VARS
81 I VITTMP(0)>0 D ; IF THERE ARE MISSING VARS - MARKED AS @@X@@
82 . W "VITALS MISSING ",!
83 . F I=1:1:VITTMP(0) W VITTMP(I),!
84 Q
85 ;
Note: See TracBrowser for help on using the repository browser.