Enabled Vitals processing in GPLCCR.m
Fixed bug where if you ran EXPORT^GPLCCR more than once body tags would still get added (added K ^TMP($J,"CCRSTEP") before setting it by INITSTPS) Added code to start processing Vitals for selected patient Cleaned up some of the template CCR so information in CCR would be correct
This commit is contained in:
parent
a26fb0b883
commit
f6fe8898bf
|
@ -13,6 +13,7 @@ EXPORT ; EXPORT ENTRY POINT FOR CCR
|
|||
S OARY=$NA(^TMP($J,DFN,"CCR",1))
|
||||
S ONAM="PAT_"_DFN_"_CCR_V1.xml"
|
||||
S ODIR="/home/glilly/CCROUT"
|
||||
;S ODIR="/home/cedwards/"
|
||||
D OUTPUT^GPLXPATH(OARY,ONAM,ODIR)
|
||||
Q
|
||||
;
|
||||
|
@ -25,7 +26,7 @@ CCRRPC(CCRGRTN,DFN,CCRPART,TIME1,TIME2,HDRARY) ; RPC ENTRY POINT FOR CCR OUTPUT
|
|||
; TIME2 IS ENDING TIME TO INCLUDE TIME IS FILEMAN TIME - NULL MEANS NOW
|
||||
; HDRARY IS THE HEADER ARRAY DEFINING THE "FROM" AND "TO" VARIABLES
|
||||
; IF NULL WILL DEFAULT TO "FROM" DUZ AND "TO" DFN
|
||||
S DEBUG=1
|
||||
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
|
||||
|
@ -43,6 +44,7 @@ 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 PROCESSING STEPS
|
||||
D INITSTPS(CCRXTAB) ; INITIALIZED CCR PROCESSING STEPS
|
||||
N I,XI,TAG,RTN,CALL,XPATH,IXML,OXML,INXML,CCRBLD
|
||||
|
@ -67,7 +69,7 @@ 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;GPLVITALS;//ContinuityOfCareRecord/Body/VitalSigns;^TMP($J,DFN,""VITALS"")")
|
||||
D PUSH^GPLXPATH(TAB,"EXTRACT;GPLVITALS;//ContinuityOfCareRecord/Body/VitalSigns;^TMP($J,DFN,""VITALS"")")
|
||||
D PUSH^GPLXPATH(TAB,"EXTRACT;GPLPROBS;//ContinuityOfCareRecord/Body/Problems;^TMP($J,DFN,""PROBLEMS"")")
|
||||
Q
|
||||
;
|
||||
|
@ -99,7 +101,7 @@ ACTLST(AXML,ACTRTN) ; RETURN THE ACTOR LIST FOR THE XML IN AXML
|
|||
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,!
|
||||
. . ;W "<ActorID>=>",J,!
|
||||
. . S K(J)="" ; HASHING ACTOR TO GET RID OF DUPLICATES
|
||||
S I="" ; GOING TO $O THROUGH THE HASH
|
||||
F J=0:0 D Q:$O(K(I))=""
|
||||
|
|
28
p/GPLCCR0.m
28
p/GPLCCR0.m
|
@ -369,23 +369,23 @@ LOAD(ARY) ; LOAD A CCR TEMPLATE INTO ARY PASSED BY NAME
|
|||
;;</Medications>
|
||||
;;<VitalSigns>
|
||||
;;<Result>
|
||||
;;<CCRDataObjectID>@@DATAOBJECTID@@BB0009</CCRDataObjectID>
|
||||
;;<CCRDataObjectID>@@DATAOBJECTID@@</CCRDataObjectID>
|
||||
;;<DateTime>
|
||||
;;<Type>
|
||||
;;<Text>Assessment Time</Text>
|
||||
;;</Type>
|
||||
;;<ExactDateTime>@@HEIGHTWEIGHTDATATIME@@2008-03-18</ExactDateTime>
|
||||
;;<ExactDateTime>@@HEIGHTWEIGHTDATATIME@@</ExactDateTime>
|
||||
;;</DateTime>
|
||||
;;<Description>
|
||||
;;<Text>Height & Weight</Text>
|
||||
;;</Description>
|
||||
;;<Source>
|
||||
;;<Actor>
|
||||
;;<ActorID>@@HEIGHTWEIGHTSOURCE@@AA0001</ActorID>
|
||||
;;<ActorID>@@HEIGHTWEIGHTSOURCE@@</ActorID>
|
||||
;;</Actor>
|
||||
;;</Source>
|
||||
;;<Test>
|
||||
;;<CCRDataObjectID>@@DATAOBJECTID@@BB0010</CCRDataObjectID>
|
||||
;;<CCRDataObjectID>@@DATAOBJECTID@@</CCRDataObjectID>
|
||||
;;<Type>
|
||||
;;<Text>Observation</Text>
|
||||
;;</Type>
|
||||
|
@ -399,18 +399,18 @@ LOAD(ARY) ; LOAD A CCR TEMPLATE INTO ARY PASSED BY NAME
|
|||
;;</Description>
|
||||
;;<Source>
|
||||
;;<Actor>
|
||||
;;<ActorID>@@HEIGHTSOURCEID@@AA0002</ActorID>
|
||||
;;<ActorID>@@HEIGHTSOURCEID@@</ActorID>
|
||||
;;</Actor>
|
||||
;;</Source>
|
||||
;;<TestResult>
|
||||
;;<Value>@@HEIGHTINCHES@@68</Value>
|
||||
;;<Value>@@HEIGHTINCHES@@</Value>
|
||||
;;<Units>
|
||||
;;<Unit>in</Unit>
|
||||
;;</Units>
|
||||
;;</TestResult>
|
||||
;;</Test>
|
||||
;;<Test>
|
||||
;;<CCRDataObjectID>@@DATAOBJECTID@@BB0011</CCRDataObjectID>
|
||||
;;<CCRDataObjectID>@@DATAOBJECTID@@</CCRDataObjectID>
|
||||
;;<Type>
|
||||
;;<Text>Observation</Text>
|
||||
;;</Type>
|
||||
|
@ -424,11 +424,11 @@ LOAD(ARY) ; LOAD A CCR TEMPLATE INTO ARY PASSED BY NAME
|
|||
;;</Description>
|
||||
;;<Source>
|
||||
;;<Actor>
|
||||
;;<ActorID>@@WEIGHTSOURCEID@@AA0002</ActorID>
|
||||
;;<ActorID>@@WEIGHTSOURCEID@@</ActorID>
|
||||
;;</Actor>
|
||||
;;</Source>
|
||||
;;<TestResult>
|
||||
;;<Value>@@WEIGHTLBS@@180</Value>
|
||||
;;<Value>@@WEIGHTLBS@@</Value>
|
||||
;;<Units>
|
||||
;;<Unit>lb</Unit>
|
||||
;;</Units>
|
||||
|
@ -436,17 +436,17 @@ LOAD(ARY) ; LOAD A CCR TEMPLATE INTO ARY PASSED BY NAME
|
|||
;;</Test>
|
||||
;;</Result>
|
||||
;;<Result>
|
||||
;;<CCRDataObjectID>@@DATAOBJECTID@@BB0012</CCRDataObjectID>
|
||||
;;<CCRDataObjectID>@@DATAOBJECTID@@</CCRDataObjectID>
|
||||
;;<Description>
|
||||
;;<Text>Blood Type</Text>
|
||||
;;</Description>
|
||||
;;<Source>
|
||||
;;<Actor>
|
||||
;;<ActorID>@@BLOODTYPESOURCEID@@AA0001</ActorID>
|
||||
;;<ActorID>@@BLOODTYPESOURCEID@@</ActorID>
|
||||
;;</Actor>
|
||||
;;</Source>
|
||||
;;<Test>
|
||||
;;<CCRDataObjectID>@@DATAOBJECTID@@BB0013</CCRDataObjectID>
|
||||
;;<CCRDataObjectID>@@DATAOBJECTID@@</CCRDataObjectID>
|
||||
;;<Type>
|
||||
;;<Text>Result</Text>
|
||||
;;</Type>
|
||||
|
@ -460,11 +460,11 @@ LOAD(ARY) ; LOAD A CCR TEMPLATE INTO ARY PASSED BY NAME
|
|||
;;</Description>
|
||||
;;<Source>
|
||||
;;<Actor>
|
||||
;;<ActorID>@@BLOODTYPESOURCEID2@@AA0002</ActorID>
|
||||
;;<ActorID>@@BLOODTYPESOURCEID2@@</ActorID>
|
||||
;;</Actor>
|
||||
;;</Source>
|
||||
;;<TestResult>
|
||||
;;<Value>@@BLOODTYPERESULT@@A+</Value>
|
||||
;;<Value>@@BLOODTYPERESULT@@</Value>
|
||||
;;</TestResult>
|
||||
;;</Test>
|
||||
;;</Result>
|
||||
|
|
|
@ -1,15 +1,49 @@
|
|||
GPLVITALS ; CCDCCR/GPL - CCR/CCD PROCESSING FOR VITALS ; 6/6/08
|
||||
;;0.1;CCDCCR;nopatch;noreleasedate
|
||||
EXTRACT(VITXML,DFN,OUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE
|
||||
EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE
|
||||
;
|
||||
; VITXML AND OUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED
|
||||
; IVITXML WILL CONTAIN ONLY THE VITALS SECTION OF THE OVERALL TEMPLATE
|
||||
;
|
||||
N VITALSTMP,I
|
||||
S VITALSTMP="^TMP($J,""MISSINGVITALS"")"
|
||||
; ZWR @VITXML
|
||||
D MISSING^GPLXPATH(VITXML,VITALSTMP) ; SEARCH XML FOR MISSING VARS
|
||||
I @VITALSTMP@(0)>0 D ; IF THERE ARE MISSING VARS - MARKED AS @@X@@
|
||||
N VITRSLT,J,K,VITPTMP,X,VITVMAP,TBUF
|
||||
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"))
|
||||
F J=1:1:VITRSLT(1) D ; FOR EACH VITAL IN THE LIST
|
||||
. I $D(VITRSLT(J)) D
|
||||
. . S VITVMAP=$NA(@VITTVMAP@(J))
|
||||
. . K @VITVMAP
|
||||
. . I DEBUG W "VMAP= ",VMAP,!
|
||||
. . S VITPTMP=VITRSLT(J) ; PULL OUT VITAL FROM RPC RETURN ARRAY
|
||||
. . S @VITVMAP@("DATAOBJECTID")="VITAL"_J ; UNIQUE OBJID FOR VITAL
|
||||
. . I $P(VITPTMP,U,2)="HT" D
|
||||
. . . S @VITVMAP@("HEIGHTWEIGHTDATATIME")=$P(VITPTMP,U,4)
|
||||
. . . S @VITVMAP@("HEIGHTWEIGHTSOURCE")=$P(VITPTMP,U,7)
|
||||
. . . S @VITVMAP@("HEIGHTSOURCEID")=$P(VITPTMP,U,1)
|
||||
. . . S @VITVMAP@("HEIGHTINCHES")=$P(VITPTMP,U,3)
|
||||
. . I $P(VITPTMP,U,2)="WT" D
|
||||
. . . S @VITVMAP@("WEIGHTSOURCEID")=$P(VITPTMP,U,1)
|
||||
. . . S @VITVMAP@("WEIGHTLBS")=$P(VITPTMP,U,3)
|
||||
. . S VITARYTMP=$NA(@VITTARYTMP@(J))
|
||||
. . K @VITARYTMP
|
||||
. . D MAP^GPLXPATH(VITXML,VITVMAP,VITARYTMP)
|
||||
. . I J=1 D ; FIRST ONE IS JUST A COPY
|
||||
. . . ; W "FIRST ONE",!
|
||||
. . . D CP^GPLXPATH(VITARYTMP,VITOUTXML)
|
||||
. . . ; W "OUTXML ",OUTXML,!
|
||||
. . I J>1 D ; AFTER THE FIRST, INSERT INNER XML
|
||||
. . . D INSINNER^GPLXPATH(VITOUTXML,VITARYTMP)
|
||||
;ZWR ^TMP($J,"VITALS",*)
|
||||
;ZWR ^TMP($J,"VITALARYTMP",*) ; SHOW THE RESULTS
|
||||
; W "OUT OF FOR LOOP.",!
|
||||
;ZWR
|
||||
; ZWR @OUTXML
|
||||
; $$HTML^DILF(
|
||||
N VITTMP,I
|
||||
D MISSING^GPLXPATH(VITXML,"VITTMP") ; SEARCH XML FOR MISSING VARS
|
||||
I VITTMP(0)>0 D ; IF THERE ARE MISSING VARS - MARKED AS @@X@@
|
||||
. W "VITALS MISSING ",!
|
||||
. F I=1:1:@VITALSTMP@(0) W @VITALSTMP@(I),!
|
||||
. F I=1:1:VITTMP(0) W VITTMP(I),!
|
||||
Q
|
Loading…
Reference in New Issue