Added dynamic units for vital signs (uses what is returned in RPC)

This commit is contained in:
cje 2009-11-05 19:52:39 +00:00
parent 743ea960db
commit bb6d3ad368
1 changed files with 14 additions and 14 deletions

View File

@ -1,4 +1,4 @@
C0CVITAL ; CCDCCR/CJE/GPL - CCR/CCD PROCESSING FOR VITALS ; 07/16/08 C0CVITAL ; CCDCCR/CJE/GPL - CCR/CCD PROCESSING FOR VITALS ; 07/16/08
;;1.0;C0C;;May 19, 2009; ;;1.0;C0C;;May 19, 2009;
;Copyright 2008,2009 George Lilly, University of Minnesota and others. ;Copyright 2008,2009 George Lilly, University of Minnesota and others.
;Licensed under the terms of the GNU General Public License. ;Licensed under the terms of the GNU General Public License.
@ -21,7 +21,7 @@ C0CVITAL ; CCDCCR/CJE/GPL - CCR/CCD PROCESSING FOR VITALS ; 07/16/08
W "NO ENTRY FROM TOP",! W "NO ENTRY FROM TOP",!
Q Q
; ;
EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT VITALS INTO PROVIDED XML TEMPLATE EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT VITALS INTO PROVIDED XML TEMPLATE
; ;
; VITXML AND OUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED ; VITXML AND OUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED
; IVITXML CONTAINS ONLY THE VITALS SECTION OF THE OVERALL TEMPLATE ; IVITXML CONTAINS ONLY THE VITALS SECTION OF THE OVERALL TEMPLATE
@ -38,7 +38,7 @@ EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT VITALS INTO PROVIDED XML TEMPLATE
;E D VITVISTA ;E D VITVISTA
Q Q
; ;
VITVISTA ; EXTRACT VITALS FROM VISTA INTO PROVIDED XML TEMPLATE VITVISTA ; EXTRACT VITALS FROM VISTA INTO PROVIDED XML TEMPLATE
D VITALS^ORQQVI(.VITRSLT,DFN,C0CSDT,C0CEDT) D VITALS^ORQQVI(.VITRSLT,DFN,C0CSDT,C0CEDT)
;D VITALS^ORQQVI(.VITRSLT,DFN,C0CVSTRT,C0CVLMT) ; GPL LET GMR HANDLE THE DATES ;D VITALS^ORQQVI(.VITRSLT,DFN,C0CVSTRT,C0CVLMT) ; GPL LET GMR HANDLE THE DATES
I '$D(VITRSLT(1)) S @VITOUTXML@(0)=0 Q ; RETURN NOT FOUND AND QUIT I '$D(VITRSLT(1)) S @VITOUTXML@(0)=0 Q ; RETURN NOT FOUND AND QUIT
@ -198,7 +198,7 @@ VITVISTA ; EXTRACT VITALS FROM VISTA INTO PROVIDED XML TEMPLATE
. F I=1:1:VITTMP(0) W VITTMP(I),! . F I=1:1:VITTMP(0) W VITTMP(I),!
Q Q
; ;
VITRPMS ; EXTRACT VITALS FROM RPMS INTO PROVIDED XML TEMPLATE VITRPMS ; EXTRACT VITALS FROM RPMS INTO PROVIDED XML TEMPLATE
; RPMS VITAL RPC ONLY RETURNS LATEST VITAL IN SPECIFIED DATE RANGE NOT ALL VITALS IN DATE RANGE ; RPMS VITAL RPC ONLY RETURNS LATEST VITAL IN SPECIFIED DATE RANGE NOT ALL VITALS IN DATE RANGE
; WE NEED TO SETUP THE VARIABLES THE INTERNAL CALL NEEDS TO BYPASS A HARD CODE OF ONE VITAL FOR DATE RANGE ; WE NEED TO SETUP THE VARIABLES THE INTERNAL CALL NEEDS TO BYPASS A HARD CODE OF ONE VITAL FOR DATE RANGE
N END,START,DATA N END,START,DATA
@ -240,7 +240,7 @@ VITRPMS ; EXTRACT VITALS FROM RPMS INTO PROVIDED XML TEMPLATE
. . . S @VITVMAP@("VITALSIGNSCODEVERSION")="" . . . S @VITVMAP@("VITALSIGNSCODEVERSION")=""
. . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")="ACTORPROVIDER_"_$P($G(^AUPNVMSR($P(VITPTMP,U,1),12)),U,4) . . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")="ACTORPROVIDER_"_$P($G(^AUPNVMSR($P(VITPTMP,U,1),12)),U,4)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P($P(VITPTMP,U,5)," ",1) . . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P($P(VITPTMP,U,5)," ",1)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="in" . . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")=$P($P(VITPTMP,U,5)," ",2)
. . E I $P(VITPTMP,U,3)="WT" D . . E I $P(VITPTMP,U,3)="WT" D
. . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED" . . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^C0CUTIL($P(VITPTMP,U,4),"DT") . . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^C0CUTIL($P(VITPTMP,U,4),"DT")
@ -254,7 +254,7 @@ VITRPMS ; EXTRACT VITALS FROM RPMS INTO PROVIDED XML TEMPLATE
. . . S @VITVMAP@("VITALSIGNSCODEVERSION")="" . . . S @VITVMAP@("VITALSIGNSCODEVERSION")=""
. . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")="ACTORPROVIDER_"_$P($G(^AUPNVMSR($P(VITPTMP,U,1),12)),U,4) . . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")="ACTORPROVIDER_"_$P($G(^AUPNVMSR($P(VITPTMP,U,1),12)),U,4)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P($P(VITPTMP,U,5)," ",1) . . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P($P(VITPTMP,U,5)," ",1)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="lbs" . . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")=$P($P(VITPTMP,U,5)," ",2)
. . E I $P(VITPTMP,U,3)="BP" D . . E I $P(VITPTMP,U,3)="BP" D
. . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED" . . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^C0CUTIL($P(VITPTMP,U,4),"DT") . . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^C0CUTIL($P(VITPTMP,U,4),"DT")
@ -268,7 +268,7 @@ VITRPMS ; EXTRACT VITALS FROM RPMS INTO PROVIDED XML TEMPLATE
. . . S @VITVMAP@("VITALSIGNSCODEVERSION")="" . . . S @VITVMAP@("VITALSIGNSCODEVERSION")=""
. . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")="ACTORPROVIDER_"_$P($G(^AUPNVMSR($P(VITPTMP,U,1),12)),U,4) . . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")="ACTORPROVIDER_"_$P($G(^AUPNVMSR($P(VITPTMP,U,1),12)),U,4)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P($P(VITPTMP,U,5)," ",1) . . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P($P(VITPTMP,U,5)," ",1)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="" . . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")=$P($P(VITPTMP,U,5)," ",2)
. . E I $P(VITPTMP,U,3)="TMP" D . . E I $P(VITPTMP,U,3)="TMP" D
. . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED" . . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^C0CUTIL($P(VITPTMP,U,4),"DT") . . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^C0CUTIL($P(VITPTMP,U,4),"DT")
@ -282,7 +282,7 @@ VITRPMS ; EXTRACT VITALS FROM RPMS INTO PROVIDED XML TEMPLATE
. . . S @VITVMAP@("VITALSIGNSCODEVERSION")="" . . . S @VITVMAP@("VITALSIGNSCODEVERSION")=""
. . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")="ACTORPROVIDER_"_$P($G(^AUPNVMSR($P(VITPTMP,U,1),12)),U,4) . . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")="ACTORPROVIDER_"_$P($G(^AUPNVMSR($P(VITPTMP,U,1),12)),U,4)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P($P(VITPTMP,U,5)," ",1) . . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P($P(VITPTMP,U,5)," ",1)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="F" . . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")=$P($P(VITPTMP,U,5)," ",2)
. . E I $P(VITPTMP,U,3)="RS" D . . E I $P(VITPTMP,U,3)="RS" D
. . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED" . . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^C0CUTIL($P(VITPTMP,U,4),"DT") . . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^C0CUTIL($P(VITPTMP,U,4),"DT")
@ -296,7 +296,7 @@ VITRPMS ; EXTRACT VITALS FROM RPMS INTO PROVIDED XML TEMPLATE
. . . S @VITVMAP@("VITALSIGNSCODEVERSION")="" . . . S @VITVMAP@("VITALSIGNSCODEVERSION")=""
. . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")="ACTORPROVIDER_"_$P($G(^AUPNVMSR($P(VITPTMP,U,1),12)),U,4) . . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")="ACTORPROVIDER_"_$P($G(^AUPNVMSR($P(VITPTMP,U,1),12)),U,4)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P($P(VITPTMP,U,5)," ",1) . . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P($P(VITPTMP,U,5)," ",1)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="" . . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")=$P($P(VITPTMP,U,5)," ",2)
. . E I $P(VITPTMP,U,3)="PU" D . . E I $P(VITPTMP,U,3)="PU" D
. . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED" . . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^C0CUTIL($P(VITPTMP,U,4),"DT") . . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^C0CUTIL($P(VITPTMP,U,4),"DT")
@ -310,7 +310,7 @@ VITRPMS ; EXTRACT VITALS FROM RPMS INTO PROVIDED XML TEMPLATE
. . . S @VITVMAP@("VITALSIGNSCODEVERSION")="" . . . S @VITVMAP@("VITALSIGNSCODEVERSION")=""
. . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")="ACTORPROVIDER_"_$P($G(^AUPNVMSR($P(VITPTMP,U,1),12)),U,4) . . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")="ACTORPROVIDER_"_$P($G(^AUPNVMSR($P(VITPTMP,U,1),12)),U,4)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P($P(VITPTMP,U,5)," ",1) . . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P($P(VITPTMP,U,5)," ",1)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="" . . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")=$P($P(VITPTMP,U,5)," ",2)
. . E I $P(VITPTMP,U,3)="PA" D . . E I $P(VITPTMP,U,3)="PA" D
. . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED" . . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^C0CUTIL($P(VITPTMP,U,4),"DT") . . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^C0CUTIL($P(VITPTMP,U,4),"DT")
@ -324,7 +324,7 @@ VITRPMS ; EXTRACT VITALS FROM RPMS INTO PROVIDED XML TEMPLATE
. . . S @VITVMAP@("VITALSIGNSCODEVERSION")="" . . . S @VITVMAP@("VITALSIGNSCODEVERSION")=""
. . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")="ACTORPROVIDER_"_$P($G(^AUPNVMSR($P(VITPTMP,U,1),12)),U,4) . . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")="ACTORPROVIDER_"_$P($G(^AUPNVMSR($P(VITPTMP,U,1),12)),U,4)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P($P(VITPTMP,U,5)," ",1) . . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P($P(VITPTMP,U,5)," ",1)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="" . . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")=$P($P(VITPTMP,U,5)," ",2)
. . E D . . E D
. . . ;W "IN VITAL: OTHER",! . . . ;W "IN VITAL: OTHER",!
. . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED" . . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
@ -360,7 +360,7 @@ VITRPMS ; EXTRACT VITALS FROM RPMS INTO PROVIDED XML TEMPLATE
K ^TMP("CIAVMRPC",$J) K ^TMP("CIAVMRPC",$J)
Q Q
; ;
VITDRPMS(VDT) ; RUN DATE SORTING ALGORITHM FOR RPMS VITDRPMS(VDT) ; RUN DATE SORTING ALGORITHM FOR RPMS
; VDT IS PASSED BY REFERENCE AND WILL CONTAIN THE ARRAY ; VDT IS PASSED BY REFERENCE AND WILL CONTAIN THE ARRAY
; OF DATES IN THE VITALS RESULTS ; OF DATES IN THE VITALS RESULTS
N VDTI,VDTJ,VTDCNT N VDTI,VDTJ,VTDCNT
@ -373,7 +373,7 @@ VITDRPMS(VDT) ; RUN DATE SORTING ALGORITHM FOR RPMS
S VDT(0)=VTDCNT S VDT(0)=VTDCNT
Q Q
; ;
VITDVISTA(VDT) ; RUN DATE SORTING ALGORITHM FOR VISTA VITDVISTA(VDT) ; RUN DATE SORTING ALGORITHM FOR VISTA
; VDT IS PASSED BY REFERENCE AND WILL CONTAIN THE ARRAY ; VDT IS PASSED BY REFERENCE AND WILL CONTAIN THE ARRAY
; OF DATES IN THE VITALS RESULTS ; OF DATES IN THE VITALS RESULTS
N VDTI,VDTJ,VTDCNT N VDTI,VDTJ,VTDCNT