GMVDCRPC ;HOIFO/DAD-VITALS COMPONENT: RPCs ;8/24/99 08:28
;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
;
; This routine uses the following IAs:
; <None>
;
EN1(RESULT,GMVFMT,GMVITTYP) ;
; RPC: GMVDC GET VITAL CATEGORIES
; Get list of the categories
; Input:
; GMVFMT = Format of returned data (Optional)
; 1 - IENs (default), 2 - Abbreviations, 3 - Full Names
; GMVITTYP = A pointer to GMRV Vital Type file (#120.51) (Optional)
; Output:
; RESULT() = CategoryIEN ^ CategoryName ^
; VitalTypeIEN ^ DefaultQualifier
N GMVCNT,GMVD0,GMVD1,GMVDATA,GMVDEFQ
S GMVCNT=0
S GMVFMT=$S("^1^2^3^"[(U_$G(GMVFMT)_U):GMVFMT,1:1)
I $G(GMVITTYP)="" D
. S GMVITTYP=0
. F S GMVITTYP=$O(^GMRD(120.53,"C",GMVITTYP)) Q:GMVITTYP'>0 D EN1A
. Q
E D
. S GMVITTYP=$$VITIEN^GMVDCUTL(GMVITTYP)
. D EN1A
. Q
S RESULT(0)="OK"
Q
EN1A S GMVD0=0
F S GMVD0=$O(^GMRD(120.53,"C",GMVITTYP,GMVD0)) Q:GMVD0'>0 D
. S GMVD1=0
. F S GMVD1=$O(^GMRD(120.53,"C",GMVITTYP,GMVD0,GMVD1)) Q:GMVD1'>0 D
.. S GMVDATA=$P($G(^GMRD(120.53,GMVD0,0)),U)
.. I GMVDATA]"" D
... S GMVITTYP(0)=$G(^GMRD(120.51,+GMVITTYP,0))
... S GMVITTYP(1)=GMVITTYP,GMVITTYP(2)=$P(GMVITTYP(0),U,2)
... S GMVITTYP(3)=$P(GMVITTYP(0),U)
... S GMVDEFQ=$P($G(^GMRD(120.53,GMVD0,1,GMVD1,0)),U,7)
... S GMVDEFQ(0)=$G(^GMRD(120.52,+GMVDEFQ,0))
... S GMVDEFQ(1)=GMVDEFQ,GMVDEFQ(2)=$P(GMVDEFQ(0),U,2)
... S GMVDEFQ(3)=$P(GMVDEFQ(0),U)
... S GMVCNT=GMVCNT+1
... S RESULT(GMVCNT)=GMVD0_U_GMVDATA_U_GMVITTYP(GMVFMT)_U_GMVDEFQ(GMVFMT)
... Q
.. Q
. Q
Q
;
EN2(RESULT) ;
; RPC: GMVDC GET VITAL ERROR REASONS
; Get list of the entered in error reasons
; Input:
; None
; Output:
; RESULT() = ErrorReasonInternal ^ ErrorReasonExternal
N GMVD0,GMVDATA
S GMVDATA=$$GET1^DID(120.506,.01,"","POINTER")
F GMVD0=1:1 S GMVDATA(0)=$P(GMVDATA,";",GMVD0) Q:GMVDATA(0)="" D
. S RESULT(GMVD0)=$TR(GMVDATA(0),":","^")
. Q
S RESULT(0)="OK"
Q
;
EN3(RESULT,GMVFMT,GMVITTYP,GMVITCAT) ;
; RPC: GMVDC GET VITAL QUALIFIERS
; Get list of the qualifiers
; Input:
; GMVFMT = Format of returned data (Optional)
; 1 - IENs (default), 2 - Abbreviations, 3 - Full Names
; GMVITTYP = A pointer to GMRV Vital Type file (#120.51) (Optional)
; GMVITCAT = A pointer to GMRV Vital Category file (#120.53) (Optional)
; Output:
; RESULT() = QualifierIEN ^ QualifierName ^ QualifierSynonym ^
; VitalTypeIEN ^ CategoryIEN
N GMVCATD0,GMVCNT,GMVD0,GMVD1,GMVDATA
S GMVCNT=0
S GMVFMT=$S("^1^2^3^"[(U_$G(GMVFMT)_U):GMVFMT,1:1)
S GMVITCAT=$$CATIEN^GMVDCUTL($G(GMVITCAT))
I $G(GMVITTYP)="" D
. S GMVITTYP=0
. F S GMVITTYP=$O(^GMRD(120.52,"C",GMVITTYP)) Q:GMVITTYP'>0 D EN3A
. Q
E D
. S GMVITTYP=$$VITIEN^GMVDCUTL(GMVITTYP)
. D EN3A
. Q
S RESULT(0)="OK"
Q
EN3A S GMVD0=0
F S GMVD0=$O(^GMRD(120.52,"C",GMVITTYP,GMVD0)) Q:GMVD0'>0 D
. S GMVD1=0
. F S GMVD1=$O(^GMRD(120.52,"C",GMVITTYP,GMVD0,GMVD1)) Q:GMVD1'>0 D
.. S GMVCATD0=$P($G(^GMRD(120.52,GMVD0,1,GMVD1,0)),U,2)
.. I $G(GMVITCAT)>0,GMVITCAT'=GMVCATD0 Q
.. S GMVDATA=$G(^GMRD(120.52,GMVD0,0))
.. I GMVDATA]"" D
... S GMVITTYP(0)=$G(^GMRD(120.51,+GMVITTYP,0))
... S GMVITTYP(1)=GMVITTYP,GMVITTYP(2)=$P(GMVITTYP(0),U,2)
... S GMVITTYP(3)=$P(GMVITTYP(0),U)
... S GMVITCAT(0)=$G(^GMRD(120.53,+GMVCATD0,0))
... S GMVITCAT(1)=GMVCATD0,(GMVITCAT(2),GMVITCAT(3))=$P(GMVITCAT(0),U)
... S GMVCNT=GMVCNT+1
... S RESULT(GMVCNT)=GMVD0_U_$P(GMVDATA,U)_U_$P(GMVDATA,U,2)_U_GMVITTYP(GMVFMT)_U_GMVITCAT(GMVFMT)
... Q
.. Q
. Q
Q
;
EN4(RESULT) ;
; RPC: GMVDC GET VITAL TYPES
; Get list of the vital types
; Input:
; None
; Output:
; RESULT() = VitalTypeIEN ^ VitalTypeName ^
; VitalTypeAbbr ^ VitalTypePCE_Abbreviation
N GMVD0,GMVDATA
S GMVD0=0
F S GMVD0=$O(^GMRD(120.51,GMVD0)) Q:GMVD0'>0 D
. S GMVDATA=$G(^GMRD(120.51,GMVD0,0))
. I GMVDATA]"" S RESULT(GMVD0)=GMVD0_U_$P(GMVDATA,U)_U_$P(GMVDATA,U,2)_U_$P(GMVDATA,U,7)
. Q
S RESULT(0)="OK"
Q
;
EN5(RESULT,GMVDFN,GMVFMT,GMVABR,GMVMSYS) ;
; RPC: GMVDC GET LATEST VITALS
; Returns the latest vitals for a selected patient
; Input:
; GMVDFN = A pointer to the Patient file (#2) (Required)
; GMVFMT = Format of returned data (Optional)
; 1 - IENs (default), 2 - Abbreviations, 3 - Full Names
; GMVABR = Abbreviations of vital types to return (Optional)
; "^T^P^R^PO2^BP^HT^WT^CVP^CG^PN^" (Default)
; "~ALL~" to return all vital types
; GMVMSYS = Measurement system (Optional)
; M = Metric, C - US Customary (Default)
; Output:
; RESULT() = VitalMeasurementIEN ^ DateTimeTaken ^ PatientDFN ^
; VitalType ^ DateTimeEntered ^ HospitalLocation ^
; EnteredBy ^ Measurement ^ EnteredInError ^
; EnteredInErrorBy ^
; Qualifier1 ; Qualifier2 ; ... ^
; EnteredInErrorReason1 ; EnteredInErrorReason2 ; ... ^
D EN1^GMVDCEXT("^TMP(""GMV"",$J)",GMVDFN,$G(GMVFMT),$G(GMVABR),0,"","",$G(GMVMSYS),0)
S RESULT=$NA(^TMP("GMV",$J))
Q
;
EN6(RESULT,GMVDFN,GMVFMT,GMVABR,GMVBEG,GMVEND,GMVMSYS,GMVEE) ;
; RPC: GMVDC GET VITALS
; Returns vitals for a selected patient and date/time range
; Input:
; GMVDFN = A pointer to the Patient file (#2) (Required)
; GMVFMT = Format of returned data (Optional)
; 1 - IENs (default), 2 - Abbreviations, 3 - Full Names
; GMVABR = Abbreviations of vital types to return (Optional)
; "^T^P^R^PO2^BP^HT^WT^CVP^CG^PN^" (Default)
; "~ALL~" to return all vital types
; GMVBEG = Beginning date for all vitals (Not used for GMVALL = 0)
; GMVEND = Ending date for all vitals (Not used for GMVALL = 0)
; GMVMSYS = Measurement system (Optional)
; M = Metric, C - US Customary (Default)
; GMVEE = Include entered in error records (Optional)
; (0 - No (Default), 1 - Yes)
;
; Output:
; RESULT() = VitalMeasurementIEN ^ DateTimeTaken ^ PatientDFN ^
; VitalType ^ DateTimeEntered ^ HospitalLocation ^
; EnteredBy ^ Measurement ^ EnteredInError ^
; EnteredInErrorBy ^
; Qualifier1 ; Qualifier2 ; ... ^
; EnteredInErrorReason1 ; EnteredInErrorReason2 ; ... ^
D EN1^GMVDCEXT("^TMP(""GMV"",$J)",GMVDFN,$G(GMVFMT),$G(GMVABR),1,$G(GMVBEG),$G(GMVEND),$G(GMVMSYS),$G(GMVEE))
S RESULT=$NA(^TMP("GMV",$J))
Q
;
EN7(RESULT,GMVITTYP) ;
; RPC: GMVDC GET VITALS HELP
; Get help text for a selected vital type
; Input:
; GMVITTYP = A pointer to GMRV Vital Type file (#120.51) (Optional)
; Output:
; RESULT() = Help text
S GMVITTYP=$$VITIEN^GMVDCUTL(GMVITTYP)
S GMVITTYP=$P($G(^GMRD(120.51,+GMVITTYP,0)),U,2)
I GMVITTYP]"" D
. D HELP^GMVDCHLP(.RESULT,GMVITTYP)
. S RESULT(0)="OK"
. I $O(RESULT(0))'>0 S RESULT(1)="No help text available."
. Q
E D
. S RESULT(0)="ERROR"
. S RESULT(1)="ERROR: Missing or invalid Vital Type parameter"
. Q
Q
;
EN8(RESULT,GMVPARAM) ;
; RPC: GMVDC SAVE VITALS
; Saves vitals data
N GMVDFN,GMVDTDUN,GMVDTENT,GMVENTBY,GMVERRBY,GMVHOSPL,GMVMSYS K RESULT
S RESULT(0)="OK"
S GMVDATA="^TMP(""GMV"",$J)"
D FMTPARAM^GMVDCUTL(.GMVPARAM,GMVDATA)
D EN1^GMVDCVAL(.RESULT,GMVDATA)
I $G(RESULT(0))="OK" D EN1^GMVDCSAV(.RESULT,GMVDATA)
K RESULT(-1)
Q
;
EN9(RESULT,GMVPARAM) ;
; RPC: GMVDC VALIDATE VITALS
; Validates vitals data
N GMVDFN,GMVDTDUN,GMVDTENT,GMVENTBY,GMVERRBY,GMVHOSPL,GMVMSYS K RESULT
S RESULT(0)="OK"
S GMVDATA="^TMP(""GMV"",$J)"
D FMTPARAM^GMVDCUTL(.GMVPARAM,GMVDATA)
D EN1^GMVDCVAL(.RESULT,GMVDATA)
K RESULT(-1)
Q
;
EN10(RESULT,GMVMSYS) ;
; RPC: GMVDC GET ABNORMAL RANGES
; Returns the abnormal ranges for the vital types
; Input:
; GMVMSYS = Measurement system (Optional)
; M = Metric, C - US Customary (Default)
; Output:
; RESULT(1) = TEMP-HIGH ^ TEMP-LOW ^ PULSE-HIGH ^ PULSE-LOW ^
; RESP-HIGH ^ RESP-LOW ^ SYSTOLIC-HIGH ^ DIASTOLIC-HIGH ^
; SYSTOLIC-LOW ^ DIASTOLIC-LOW ^ CVP-HIGH ^ CVP-LOW ^
; O2SAT-LOW
N GMVABBR,GMVALUE,GMVPIECE K RESULT
S GMVMSYS=$$MEASYS^GMVDCUTL($G(GMVMSYS))
S RESULT(0)="OK"
S RESULT(1)=$P($G(^GMRD(120.57,1,1)),U,1,13)
F GMVPIECE=1,2,11,12 D
. S GMVABBR=$P("T^T^^^^^^^^^CVP^CVP",U,GMVPIECE)
. S GMVALUE=$P(RESULT(1),U,GMVPIECE)
. S GMVALUE=$$CNV^GMVDCCNV(GMVALUE,GMVMSYS,"G",GMVABBR)
. S $P(RESULT(1),U,GMVPIECE)=GMVALUE
. Q
Q
GMVDCRPC ;HOIFO/DAD-VITALS COMPONENT: RPCs ;8/24/99 08:28
+1 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
+2 ;
+3 ; This routine uses the following IAs:
+4 ; <None>
+5 ;
EN1(RESULT,GMVFMT,GMVITTYP) ;
+1 ; RPC: GMVDC GET VITAL CATEGORIES
+2 ; Get list of the categories
+3 ; Input:
+4 ; GMVFMT = Format of returned data (Optional)
+5 ; 1 - IENs (default), 2 - Abbreviations, 3 - Full Names
+6 ; GMVITTYP = A pointer to GMRV Vital Type file (#120.51) (Optional)
+7 ; Output:
+8 ; RESULT() = CategoryIEN ^ CategoryName ^
+9 ; VitalTypeIEN ^ DefaultQualifier
+10 NEW GMVCNT,GMVD0,GMVD1,GMVDATA,GMVDEFQ
+11 SET GMVCNT=0
+12 SET GMVFMT=$SELECT("^1^2^3^"[(U_$GET(GMVFMT)_U):GMVFMT,1:1)
+13 IF $GET(GMVITTYP)=""
Begin DoDot:1
+14 SET GMVITTYP=0
+15 FOR
SET GMVITTYP=$ORDER(^GMRD(120.53,"C",GMVITTYP))
IF GMVITTYP'>0
QUIT
DO EN1A
+16 QUIT
End DoDot:1
+17 IF '$TEST
Begin DoDot:1
+18 SET GMVITTYP=$$VITIEN^GMVDCUTL(GMVITTYP)
+19 DO EN1A
+20 QUIT
End DoDot:1
+21 SET RESULT(0)="OK"
+22 QUIT
EN1A SET GMVD0=0
+1 FOR
SET GMVD0=$ORDER(^GMRD(120.53,"C",GMVITTYP,GMVD0))
IF GMVD0'>0
QUIT
Begin DoDot:1
+2 SET GMVD1=0
+3 FOR
SET GMVD1=$ORDER(^GMRD(120.53,"C",GMVITTYP,GMVD0,GMVD1))
IF GMVD1'>0
QUIT
Begin DoDot:2
+4 SET GMVDATA=$PIECE($GET(^GMRD(120.53,GMVD0,0)),U)
+5 IF GMVDATA]""
Begin DoDot:3
+6 SET GMVITTYP(0)=$GET(^GMRD(120.51,+GMVITTYP,0))
+7 SET GMVITTYP(1)=GMVITTYP
SET GMVITTYP(2)=$PIECE(GMVITTYP(0),U,2)
+8 SET GMVITTYP(3)=$PIECE(GMVITTYP(0),U)
+9 SET GMVDEFQ=$PIECE($GET(^GMRD(120.53,GMVD0,1,GMVD1,0)),U,7)
+10 SET GMVDEFQ(0)=$GET(^GMRD(120.52,+GMVDEFQ,0))
+11 SET GMVDEFQ(1)=GMVDEFQ
SET GMVDEFQ(2)=$PIECE(GMVDEFQ(0),U,2)
+12 SET GMVDEFQ(3)=$PIECE(GMVDEFQ(0),U)
+13 SET GMVCNT=GMVCNT+1
+14 SET RESULT(GMVCNT)=GMVD0_U_GMVDATA_U_GMVITTYP(GMVFMT)_U_GMVDEFQ(GMVFMT)
+15 QUIT
End DoDot:3
+16 QUIT
End DoDot:2
+17 QUIT
End DoDot:1
+18 QUIT
+19 ;
EN2(RESULT) ;
+1 ; RPC: GMVDC GET VITAL ERROR REASONS
+2 ; Get list of the entered in error reasons
+3 ; Input:
+4 ; None
+5 ; Output:
+6 ; RESULT() = ErrorReasonInternal ^ ErrorReasonExternal
+7 NEW GMVD0,GMVDATA
+8 SET GMVDATA=$$GET1^DID(120.506,.01,"","POINTER")
+9 FOR GMVD0=1:1
SET GMVDATA(0)=$PIECE(GMVDATA,";",GMVD0)
IF GMVDATA(0)=""
QUIT
Begin DoDot:1
+10 SET RESULT(GMVD0)=$TRANSLATE(GMVDATA(0),":","^")
+11 QUIT
End DoDot:1
+12 SET RESULT(0)="OK"
+13 QUIT
+14 ;
EN3(RESULT,GMVFMT,GMVITTYP,GMVITCAT) ;
+1 ; RPC: GMVDC GET VITAL QUALIFIERS
+2 ; Get list of the qualifiers
+3 ; Input:
+4 ; GMVFMT = Format of returned data (Optional)
+5 ; 1 - IENs (default), 2 - Abbreviations, 3 - Full Names
+6 ; GMVITTYP = A pointer to GMRV Vital Type file (#120.51) (Optional)
+7 ; GMVITCAT = A pointer to GMRV Vital Category file (#120.53) (Optional)
+8 ; Output:
+9 ; RESULT() = QualifierIEN ^ QualifierName ^ QualifierSynonym ^
+10 ; VitalTypeIEN ^ CategoryIEN
+11 NEW GMVCATD0,GMVCNT,GMVD0,GMVD1,GMVDATA
+12 SET GMVCNT=0
+13 SET GMVFMT=$SELECT("^1^2^3^"[(U_$GET(GMVFMT)_U):GMVFMT,1:1)
+14 SET GMVITCAT=$$CATIEN^GMVDCUTL($GET(GMVITCAT))
+15 IF $GET(GMVITTYP)=""
Begin DoDot:1
+16 SET GMVITTYP=0
+17 FOR
SET GMVITTYP=$ORDER(^GMRD(120.52,"C",GMVITTYP))
IF GMVITTYP'>0
QUIT
DO EN3A
+18 QUIT
End DoDot:1
+19 IF '$TEST
Begin DoDot:1
+20 SET GMVITTYP=$$VITIEN^GMVDCUTL(GMVITTYP)
+21 DO EN3A
+22 QUIT
End DoDot:1
+23 SET RESULT(0)="OK"
+24 QUIT
EN3A SET GMVD0=0
+1 FOR
SET GMVD0=$ORDER(^GMRD(120.52,"C",GMVITTYP,GMVD0))
IF GMVD0'>0
QUIT
Begin DoDot:1
+2 SET GMVD1=0
+3 FOR
SET GMVD1=$ORDER(^GMRD(120.52,"C",GMVITTYP,GMVD0,GMVD1))
IF GMVD1'>0
QUIT
Begin DoDot:2
+4 SET GMVCATD0=$PIECE($GET(^GMRD(120.52,GMVD0,1,GMVD1,0)),U,2)
+5 IF $GET(GMVITCAT)>0
IF GMVITCAT'=GMVCATD0
QUIT
+6 SET GMVDATA=$GET(^GMRD(120.52,GMVD0,0))
+7 IF GMVDATA]""
Begin DoDot:3
+8 SET GMVITTYP(0)=$GET(^GMRD(120.51,+GMVITTYP,0))
+9 SET GMVITTYP(1)=GMVITTYP
SET GMVITTYP(2)=$PIECE(GMVITTYP(0),U,2)
+10 SET GMVITTYP(3)=$PIECE(GMVITTYP(0),U)
+11 SET GMVITCAT(0)=$GET(^GMRD(120.53,+GMVCATD0,0))
+12 SET GMVITCAT(1)=GMVCATD0
SET (GMVITCAT(2),GMVITCAT(3))=$PIECE(GMVITCAT(0),U)
+13 SET GMVCNT=GMVCNT+1
+14 SET RESULT(GMVCNT)=GMVD0_U_$PIECE(GMVDATA,U)_U_$PIECE(GMVDATA,U,2)_U_GMVITTYP(GMVFMT)_U_GMVITCAT(GMVFMT)
+15 QUIT
End DoDot:3
+16 QUIT
End DoDot:2
+17 QUIT
End DoDot:1
+18 QUIT
+19 ;
EN4(RESULT) ;
+1 ; RPC: GMVDC GET VITAL TYPES
+2 ; Get list of the vital types
+3 ; Input:
+4 ; None
+5 ; Output:
+6 ; RESULT() = VitalTypeIEN ^ VitalTypeName ^
+7 ; VitalTypeAbbr ^ VitalTypePCE_Abbreviation
+8 NEW GMVD0,GMVDATA
+9 SET GMVD0=0
+10 FOR
SET GMVD0=$ORDER(^GMRD(120.51,GMVD0))
IF GMVD0'>0
QUIT
Begin DoDot:1
+11 SET GMVDATA=$GET(^GMRD(120.51,GMVD0,0))
+12 IF GMVDATA]""
SET RESULT(GMVD0)=GMVD0_U_$PIECE(GMVDATA,U)_U_$PIECE(GMVDATA,U,2)_U_$PIECE(GMVDATA,U,7)
+13 QUIT
End DoDot:1
+14 SET RESULT(0)="OK"
+15 QUIT
+16 ;
EN5(RESULT,GMVDFN,GMVFMT,GMVABR,GMVMSYS) ;
+1 ; RPC: GMVDC GET LATEST VITALS
+2 ; Returns the latest vitals for a selected patient
+3 ; Input:
+4 ; GMVDFN = A pointer to the Patient file (#2) (Required)
+5 ; GMVFMT = Format of returned data (Optional)
+6 ; 1 - IENs (default), 2 - Abbreviations, 3 - Full Names
+7 ; GMVABR = Abbreviations of vital types to return (Optional)
+8 ; "^T^P^R^PO2^BP^HT^WT^CVP^CG^PN^" (Default)
+9 ; "~ALL~" to return all vital types
+10 ; GMVMSYS = Measurement system (Optional)
+11 ; M = Metric, C - US Customary (Default)
+12 ; Output:
+13 ; RESULT() = VitalMeasurementIEN ^ DateTimeTaken ^ PatientDFN ^
+14 ; VitalType ^ DateTimeEntered ^ HospitalLocation ^
+15 ; EnteredBy ^ Measurement ^ EnteredInError ^
+16 ; EnteredInErrorBy ^
+17 ; Qualifier1 ; Qualifier2 ; ... ^
+18 ; EnteredInErrorReason1 ; EnteredInErrorReason2 ; ... ^
+19 DO EN1^GMVDCEXT("^TMP(""GMV"",$J)",GMVDFN,$GET(GMVFMT),$GET(GMVABR),0,"","",$GET(GMVMSYS),0)
+20 SET RESULT=$NAME(^TMP("GMV",$JOB))
+21 QUIT
+22 ;
EN6(RESULT,GMVDFN,GMVFMT,GMVABR,GMVBEG,GMVEND,GMVMSYS,GMVEE) ;
+1 ; RPC: GMVDC GET VITALS
+2 ; Returns vitals for a selected patient and date/time range
+3 ; Input:
+4 ; GMVDFN = A pointer to the Patient file (#2) (Required)
+5 ; GMVFMT = Format of returned data (Optional)
+6 ; 1 - IENs (default), 2 - Abbreviations, 3 - Full Names
+7 ; GMVABR = Abbreviations of vital types to return (Optional)
+8 ; "^T^P^R^PO2^BP^HT^WT^CVP^CG^PN^" (Default)
+9 ; "~ALL~" to return all vital types
+10 ; GMVBEG = Beginning date for all vitals (Not used for GMVALL = 0)
+11 ; GMVEND = Ending date for all vitals (Not used for GMVALL = 0)
+12 ; GMVMSYS = Measurement system (Optional)
+13 ; M = Metric, C - US Customary (Default)
+14 ; GMVEE = Include entered in error records (Optional)
+15 ; (0 - No (Default), 1 - Yes)
+16 ;
+17 ; Output:
+18 ; RESULT() = VitalMeasurementIEN ^ DateTimeTaken ^ PatientDFN ^
+19 ; VitalType ^ DateTimeEntered ^ HospitalLocation ^
+20 ; EnteredBy ^ Measurement ^ EnteredInError ^
+21 ; EnteredInErrorBy ^
+22 ; Qualifier1 ; Qualifier2 ; ... ^
+23 ; EnteredInErrorReason1 ; EnteredInErrorReason2 ; ... ^
+24 DO EN1^GMVDCEXT("^TMP(""GMV"",$J)",GMVDFN,$GET(GMVFMT),$GET(GMVABR),1,$GET(GMVBEG),$GET(GMVEND),$GET(GMVMSYS),$GET(GMVEE))
+25 SET RESULT=$NAME(^TMP("GMV",$JOB))
+26 QUIT
+27 ;
EN7(RESULT,GMVITTYP) ;
+1 ; RPC: GMVDC GET VITALS HELP
+2 ; Get help text for a selected vital type
+3 ; Input:
+4 ; GMVITTYP = A pointer to GMRV Vital Type file (#120.51) (Optional)
+5 ; Output:
+6 ; RESULT() = Help text
+7 SET GMVITTYP=$$VITIEN^GMVDCUTL(GMVITTYP)
+8 SET GMVITTYP=$PIECE($GET(^GMRD(120.51,+GMVITTYP,0)),U,2)
+9 IF GMVITTYP]""
Begin DoDot:1
+10 DO HELP^GMVDCHLP(.RESULT,GMVITTYP)
+11 SET RESULT(0)="OK"
+12 IF $ORDER(RESULT(0))'>0
SET RESULT(1)="No help text available."
+13 QUIT
End DoDot:1
+14 IF '$TEST
Begin DoDot:1
+15 SET RESULT(0)="ERROR"
+16 SET RESULT(1)="ERROR: Missing or invalid Vital Type parameter"
+17 QUIT
End DoDot:1
+18 QUIT
+19 ;
EN8(RESULT,GMVPARAM) ;
+1 ; RPC: GMVDC SAVE VITALS
+2 ; Saves vitals data
+3 NEW GMVDFN,GMVDTDUN,GMVDTENT,GMVENTBY,GMVERRBY,GMVHOSPL,GMVMSYS
KILL RESULT
+4 SET RESULT(0)="OK"
+5 SET GMVDATA="^TMP(""GMV"",$J)"
+6 DO FMTPARAM^GMVDCUTL(.GMVPARAM,GMVDATA)
+7 DO EN1^GMVDCVAL(.RESULT,GMVDATA)
+8 IF $GET(RESULT(0))="OK"
DO EN1^GMVDCSAV(.RESULT,GMVDATA)
+9 KILL RESULT(-1)
+10 QUIT
+11 ;
EN9(RESULT,GMVPARAM) ;
+1 ; RPC: GMVDC VALIDATE VITALS
+2 ; Validates vitals data
+3 NEW GMVDFN,GMVDTDUN,GMVDTENT,GMVENTBY,GMVERRBY,GMVHOSPL,GMVMSYS
KILL RESULT
+4 SET RESULT(0)="OK"
+5 SET GMVDATA="^TMP(""GMV"",$J)"
+6 DO FMTPARAM^GMVDCUTL(.GMVPARAM,GMVDATA)
+7 DO EN1^GMVDCVAL(.RESULT,GMVDATA)
+8 KILL RESULT(-1)
+9 QUIT
+10 ;
EN10(RESULT,GMVMSYS) ;
+1 ; RPC: GMVDC GET ABNORMAL RANGES
+2 ; Returns the abnormal ranges for the vital types
+3 ; Input:
+4 ; GMVMSYS = Measurement system (Optional)
+5 ; M = Metric, C - US Customary (Default)
+6 ; Output:
+7 ; RESULT(1) = TEMP-HIGH ^ TEMP-LOW ^ PULSE-HIGH ^ PULSE-LOW ^
+8 ; RESP-HIGH ^ RESP-LOW ^ SYSTOLIC-HIGH ^ DIASTOLIC-HIGH ^
+9 ; SYSTOLIC-LOW ^ DIASTOLIC-LOW ^ CVP-HIGH ^ CVP-LOW ^
+10 ; O2SAT-LOW
+11 NEW GMVABBR,GMVALUE,GMVPIECE
KILL RESULT
+12 SET GMVMSYS=$$MEASYS^GMVDCUTL($GET(GMVMSYS))
+13 SET RESULT(0)="OK"
+14 SET RESULT(1)=$PIECE($GET(^GMRD(120.57,1,1)),U,1,13)
+15 FOR GMVPIECE=1,2,11,12
Begin DoDot:1
+16 SET GMVABBR=$PIECE("T^T^^^^^^^^^CVP^CVP",U,GMVPIECE)
+17 SET GMVALUE=$PIECE(RESULT(1),U,GMVPIECE)
+18 SET GMVALUE=$$CNV^GMVDCCNV(GMVALUE,GMVMSYS,"G",GMVABBR)
+19 SET $PIECE(RESULT(1),U,GMVPIECE)=GMVALUE
+20 QUIT
End DoDot:1
+21 QUIT