GMRVED0 ;HIRMFO/RM,YH,FT-VITAL SIGNS EDIT SHORT FORM ;6/13/01 15:44
;;4.0;Vitals/Measurements;**7,9,13**;Apr 25, 1997
;
; This routine uses the following IAs:
; #1380 ^DG(405.4 (controlled)
; #10035 ^DPT("CN" (supported)
; #10039 ^DIC(42 (supported)
; #10040 ^SC( (supported)
; #10061 ^VADPT APIs (supported)
;
EN2 ; DETERMINE VITALS SITE
Q:GMRENTY<1!(GMRENTY>21) K GMRTMP S GMROUT=0,GMRVIDT(0)=0 I $D(GMRVDBA) S GMRVIDT=$P(GMRVDBA,U,2),GMROUT=$P(GMRVDBA,U)
I '($D(GMRVIDT)#2) S GMRVIDT(0)=1 D DATE^GMRVED0 I GMROUT K GMROUT Q
S GMROUT=0,GMRVWLOC=1,GDT(1)=GMRVIDT D WARDPAT G:GMROUT Q
A2 ;
I $G(GMRSTR)="" D
. S GMRSTR=$S(GMRENTY=1:"T;P;R;PN;",GMRENTY=2:"T;P;R;BP;PN;",GMRENTY=3:"T;P;R;BP;HT;WT;PN;",1:"")
. I GMRSTR="" S GMRSTR=$S(GMRENTY=4:"T;P;R;BP;WT;PN;",GMRENTY=5:"T;P;R;BP;",GMRENTY=6:"BP;P;",GMRENTY=7:"P;",GMRENTY=8:"WT;",GMRENTY=19:"CG;",GMRENTY=20:"PO2;",GMRENTY=21:"CVP;",1:"")
I GMRENTY=18 S GMRSTR="PN"
Q:GMRSTR=""
A3 ;
I "P1p"[GMREDB S GDT=GMRVIDT D EN1^GMRVADM G:GMROUT Q S GMRDT0=GMRVIDT D EN2^GMRVED3 G:GMROUT!(GMREDB="P1") Q D MULTIVM W !! S GMRVIDT=GDT(1) D PATDAT G Q:GMROUT,A3
I "Aa"[GMREDB D EN1^GMRVED2,EN2^GMRVED2 G Q
I "Ss"[GMREDB D EN3^GMRVED6,EN1^GMRVED2,EN2^GMRVED2 G Q
Q
EN3 ; CALL IF DFN TO EDIT SINGLE PATIENT VITALS WHERE
; INPUT : DFN= PT FILE PTR.
; GMRSTR=STRING OF VITALS TO EDIT
; where T=Temp, P=Pulse, R=Resp, B=BP,H=Ht., W=Wt.
; GMRVHLOC=HOSP. LOCATION (PTR TO FILE 44)
; GMRVIDT=DATE/TIME VITALS TAKEN
; OUPTUT : GMRVIEN(GMRVTY)=120.5 ENTRY^GMRVREAD^GMRVSITE
; where GMRVTY is the vital type see codes above
; GMRVREAD = READING FOR THIS VITAL TYPE
; GMRVSITE = PTR TO GMR VITALS SITE FILE
; GMROUT WILL BE 1 IF ABNORMAL EXIT, ELSE 0
Q:'$D(DFN)!'$D(GMRSTR)!'$D(GMRVIDT)
S GMROUT=0,GMRTMP=1 I GMROUT S GMROUT=$S(GMROUT=2:0,1:1) G Q3
S GMREDB="P1" D A3
Q:$D(GNUROP)
Q3 D Q1 K GMREDB,GMRENTY,GMRTMP Q
DATE ; CALL TO SET GMRVIDT (WHEN THE VITALS WERE TAKEN)
; ALSO RETURNS GMROUT=1 IF TIMEOUT OR UPARROW OUT.
S X=U,%DT("A")="ENTER DATE (TIME Required) VITALS WERE TAKEN: ",%DT="XAPETR" D ^%DT K %DT
I Y<0!(X=U) S GMROUT=$S(X=U:1,1:2) Q
D NOW^%DTC I Y>% W !,?3,$C(7),"Cannot enter future dates" G DATE
I Y<$$FMADD^XLFDT(DT,-365) W !,?3,$C(7),"Sorry, you cannot enter a date more than 1 year old." G DATE
S GMRVIDT=Y K POP
Q
Q ;
G:$D(GMRTMP) Q1
K GMRVIDT
K ^TMP($J),DFN,GMREDB,GMRENTY,GMROUT,GMRSTR,GMRVHLOC
Q1 ;
K %,%T,%DT,%H,DA,DIE,DIC,DQ,DR,GMRDAT,GMRDATE,GMRHELP,GMRI,GMRINPTR,GMRLEN,GMRMSL,GMRNAM,GMRPRMT,GMRRET,GMRRMBD,GMRRMST,GMRROOM,GMRS,GMRSCR,GMRSITE,GMRTO,GMRTY,GMRVIT,GMRVITY,GMRVWLOC,GMRWARD,GMRX,GMRVX,GMRY,POP,GDT,GENTR,GMROK,GMRTMP
D KVAR^VADPT K VA,DIPGM,GMROV,GMRP,GMRTYPE,GMRQUAL,GCT,GDA,GDATA,GLAST,GTYPE,GMRDT0
Q
WARDPAT ; SELECT EDIT BY 1. UNIT, 2. SELECTED ROOMS ON UNIT, 3. PATIENT
W !,"Vitals by (A)ll patients on a unit, (S)elected Rooms on unit, or (P)atient? " R GMREDB:DTIME S:'$T GMREDB=U I U[GMREDB S GMROUT=1 Q
I "Aa"[GMREDB!("Ss"[GMREDB)!("P1p"[GMREDB) G WP1
I GMREDB?1"?".E S XQH="GMRV WARD/PAT SEL" D EN^XQH K XQH G WARDPAT
W !,$C(7),?5,"INVALID ENTRY ??" G WARDPAT
WP1 ;
I "Aa"[GMREDB!("Ss"[GMREDB) D WARDSEL Q:GMROUT Q:"Ss"'[GMREDB!("Ss"[GMREDB&$D(^DG(405.4,"W",GMRWARD))) S XQH="GMRV NO ROOM" D EN^XQH K XQH G WARDPAT
D PATDAT
Q
WARDSEL ; SELECT SEARCH WARD
S DIC="^DIC(42,",DIC(0)="AEQMZ",DIC("S")="I '$$INACT42^GMRVUT2(+Y)"
D ^DIC K DIC I X=U!(+Y'>0) S GMROUT=1 Q
S GMRWARD=+Y,GMRWARD(1)=$P(Y(0),U),DFN=$O(^DPT("CN",GMRWARD(1),0))
I DFN="" W !,*7,"**** NO PATIENTS REGISTERED ON UNIT ",$P(^DIC(42,GMRWARD,0),U)," ****" S GMROUT=1 Q
S GMRVHLOC=$S($D(^DIC(42,GMRWARD,44)):$P(^(44),U),1:"")
Q
PATDAT ;
S DIC(0)="AEQMZ",DIC="^DPT(" D ^DIC K DIC S DFN=+Y
I DFN'>0 S GMROUT=1 Q
D INP^VADPT S GMRWARD(1)=$P(VAIN(4),U,2),GMRWARD=$P(VAIN(4),U) D KVAR^VADPT K VA
I ('$D(GMRWARD)!(GMRWARD'>0)),"P1p"[GMREDB,$D(GMRVIDT) S GENTR=2,GDT=GMRVIDT D ADM^GMRVADM Q:GMROUT S:GMRWARD=0 GMROUT=1 Q:GMROUT
Q:'GMRVWLOC
S DIC("A")="Select Hospital Location: ",DIC("B")=$S('$D(^DIC(42,+GMRWARD,44)):"",$D(^SC(+$P(^DIC(42,+GMRWARD,44),U),0)):$P(^(0),U),1:""),DIC=44,DIC(0)="AEMQ",DIC("S")="I $P(^(0),U,3)'=""Z""" D ^DIC K DIC
I +Y'>0 W !,"Hospital location is required",! S GMROUT=1 Q
S GMRVHLOC=+Y Q
MULTIVM Q:GMROUT W !!,"Do you want to enter other V/M data for this patient" S %=2 D YN^DICN W:%=0 !!,"Select YES if you want to enter another V/M record at a different",!,"date/time for the same patient.",! G:%=0 MULTIVM Q:%'=1
D DATE I 'GMROUT S GMRDT0=GMRVIDT D EN2^GMRVED3 G MULTIVM
S GMROUT=0 Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRVED0 4798 printed Dec 13, 2024@01:56:12 Page 2
GMRVED0 ;HIRMFO/RM,YH,FT-VITAL SIGNS EDIT SHORT FORM ;6/13/01 15:44
+1 ;;4.0;Vitals/Measurements;**7,9,13**;Apr 25, 1997
+2 ;
+3 ; This routine uses the following IAs:
+4 ; #1380 ^DG(405.4 (controlled)
+5 ; #10035 ^DPT("CN" (supported)
+6 ; #10039 ^DIC(42 (supported)
+7 ; #10040 ^SC( (supported)
+8 ; #10061 ^VADPT APIs (supported)
+9 ;
EN2 ; DETERMINE VITALS SITE
+1 if GMRENTY<1!(GMRENTY>21)
QUIT
KILL GMRTMP
SET GMROUT=0
SET GMRVIDT(0)=0
IF $DATA(GMRVDBA)
SET GMRVIDT=$PIECE(GMRVDBA,U,2)
SET GMROUT=$PIECE(GMRVDBA,U)
+2 IF '($DATA(GMRVIDT)#2)
SET GMRVIDT(0)=1
DO DATE^GMRVED0
IF GMROUT
KILL GMROUT
QUIT
+3 SET GMROUT=0
SET GMRVWLOC=1
SET GDT(1)=GMRVIDT
DO WARDPAT
if GMROUT
GOTO Q
A2 ;
+1 IF $GET(GMRSTR)=""
Begin DoDot:1
+2 SET GMRSTR=$SELECT(GMRENTY=1:"T;P;R;PN;",GMRENTY=2:"T;P;R;BP;PN;",GMRENTY=3:"T;P;R;BP;HT;WT;PN;",1:"")
+3 IF GMRSTR=""
SET GMRSTR=$SELECT(GMRENTY=4:"T;P;R;BP;WT;PN;",GMRENTY=5:"T;P;R;BP;",GMRENTY=6:"BP;P;",GMRENTY=7:"P;",GMRENTY=8:"WT;",GMRENTY=19:"CG;",GMRENTY=20:"PO2;",GMRENTY=21:"CVP;",1:"")
End DoDot:1
+4 IF GMRENTY=18
SET GMRSTR="PN"
+5 if GMRSTR=""
QUIT
A3 ;
+1 IF "P1p"[GMREDB
SET GDT=GMRVIDT
DO EN1^GMRVADM
if GMROUT
GOTO Q
SET GMRDT0=GMRVIDT
DO EN2^GMRVED3
if GMROUT!(GMREDB="P1")
GOTO Q
DO MULTIVM
WRITE !!
SET GMRVIDT=GDT(1)
DO PATDAT
if GMROUT
GOTO Q
GOTO A3
+2 IF "Aa"[GMREDB
DO EN1^GMRVED2
DO EN2^GMRVED2
GOTO Q
+3 IF "Ss"[GMREDB
DO EN3^GMRVED6
DO EN1^GMRVED2
DO EN2^GMRVED2
GOTO Q
+4 QUIT
EN3 ; CALL IF DFN TO EDIT SINGLE PATIENT VITALS WHERE
+1 ; INPUT : DFN= PT FILE PTR.
+2 ; GMRSTR=STRING OF VITALS TO EDIT
+3 ; where T=Temp, P=Pulse, R=Resp, B=BP,H=Ht., W=Wt.
+4 ; GMRVHLOC=HOSP. LOCATION (PTR TO FILE 44)
+5 ; GMRVIDT=DATE/TIME VITALS TAKEN
+6 ; OUPTUT : GMRVIEN(GMRVTY)=120.5 ENTRY^GMRVREAD^GMRVSITE
+7 ; where GMRVTY is the vital type see codes above
+8 ; GMRVREAD = READING FOR THIS VITAL TYPE
+9 ; GMRVSITE = PTR TO GMR VITALS SITE FILE
+10 ; GMROUT WILL BE 1 IF ABNORMAL EXIT, ELSE 0
+11 if '$DATA(DFN)!'$DATA(GMRSTR)!'$DATA(GMRVIDT)
QUIT
+12 SET GMROUT=0
SET GMRTMP=1
IF GMROUT
SET GMROUT=$SELECT(GMROUT=2:0,1:1)
GOTO Q3
+13 SET GMREDB="P1"
DO A3
+14 if $DATA(GNUROP)
QUIT
Q3 DO Q1
KILL GMREDB,GMRENTY,GMRTMP
QUIT
DATE ; CALL TO SET GMRVIDT (WHEN THE VITALS WERE TAKEN)
+1 ; ALSO RETURNS GMROUT=1 IF TIMEOUT OR UPARROW OUT.
+2 SET X=U
SET %DT("A")="ENTER DATE (TIME Required) VITALS WERE TAKEN: "
SET %DT="XAPETR"
DO ^%DT
KILL %DT
+3 IF Y<0!(X=U)
SET GMROUT=$SELECT(X=U:1,1:2)
QUIT
+4 DO NOW^%DTC
IF Y>%
WRITE !,?3,$CHAR(7),"Cannot enter future dates"
GOTO DATE
+5 IF Y<$$FMADD^XLFDT(DT,-365)
WRITE !,?3,$CHAR(7),"Sorry, you cannot enter a date more than 1 year old."
GOTO DATE
+6 SET GMRVIDT=Y
KILL POP
+7 QUIT
Q ;
+1 if $DATA(GMRTMP)
GOTO Q1
+2 KILL GMRVIDT
+3 KILL ^TMP($JOB),DFN,GMREDB,GMRENTY,GMROUT,GMRSTR,GMRVHLOC
Q1 ;
+1 KILL %,%T,%DT,%H,DA,DIE,DIC,DQ,DR,GMRDAT,GMRDATE,GMRHELP,GMRI,GMRINPTR,GMRLEN,GMRMSL,GMRNAM,GMRPRMT,GMRRET,GMRRMBD,GMRRMST,GMRROOM,GMRS,GMRSCR,GMRSITE,GMRTO,GMRTY,GMRVIT,GMRVITY,GMRVWLOC,GMRWARD,GMRX,GMRVX,GMRY,POP,GDT,GENTR,GMROK,GMRTMP
+2 DO KVAR^VADPT
KILL VA,DIPGM,GMROV,GMRP,GMRTYPE,GMRQUAL,GCT,GDA,GDATA,GLAST,GTYPE,GMRDT0
+3 QUIT
WARDPAT ; SELECT EDIT BY 1. UNIT, 2. SELECTED ROOMS ON UNIT, 3. PATIENT
+1 WRITE !,"Vitals by (A)ll patients on a unit, (S)elected Rooms on unit, or (P)atient? "
READ GMREDB:DTIME
if '$TEST
SET GMREDB=U
IF U[GMREDB
SET GMROUT=1
QUIT
+2 IF "Aa"[GMREDB!("Ss"[GMREDB)!("P1p"[GMREDB)
GOTO WP1
+3 IF GMREDB?1"?".E
SET XQH="GMRV WARD/PAT SEL"
DO EN^XQH
KILL XQH
GOTO WARDPAT
+4 WRITE !,$CHAR(7),?5,"INVALID ENTRY ??"
GOTO WARDPAT
WP1 ;
+1 IF "Aa"[GMREDB!("Ss"[GMREDB)
DO WARDSEL
if GMROUT
QUIT
if "Ss"'[GMREDB!("Ss"[GMREDB&$DATA(^DG(405.4,"W",GMRWARD)))
QUIT
SET XQH="GMRV NO ROOM"
DO EN^XQH
KILL XQH
GOTO WARDPAT
+2 DO PATDAT
+3 QUIT
WARDSEL ; SELECT SEARCH WARD
+1 SET DIC="^DIC(42,"
SET DIC(0)="AEQMZ"
SET DIC("S")="I '$$INACT42^GMRVUT2(+Y)"
+2 DO ^DIC
KILL DIC
IF X=U!(+Y'>0)
SET GMROUT=1
QUIT
+3 SET GMRWARD=+Y
SET GMRWARD(1)=$PIECE(Y(0),U)
SET DFN=$ORDER(^DPT("CN",GMRWARD(1),0))
+4 IF DFN=""
WRITE !,*7,"**** NO PATIENTS REGISTERED ON UNIT ",$PIECE(^DIC(42,GMRWARD,0),U)," ****"
SET GMROUT=1
QUIT
+5 SET GMRVHLOC=$SELECT($DATA(^DIC(42,GMRWARD,44)):$PIECE(^(44),U),1:"")
+6 QUIT
PATDAT ;
+1 SET DIC(0)="AEQMZ"
SET DIC="^DPT("
DO ^DIC
KILL DIC
SET DFN=+Y
+2 IF DFN'>0
SET GMROUT=1
QUIT
+3 DO INP^VADPT
SET GMRWARD(1)=$PIECE(VAIN(4),U,2)
SET GMRWARD=$PIECE(VAIN(4),U)
DO KVAR^VADPT
KILL VA
+4 IF ('$DATA(GMRWARD)!(GMRWARD'>0))
IF "P1p"[GMREDB
IF $DATA(GMRVIDT)
SET GENTR=2
SET GDT=GMRVIDT
DO ADM^GMRVADM
if GMROUT
QUIT
if GMRWARD=0
SET GMROUT=1
if GMROUT
QUIT
+5 if 'GMRVWLOC
QUIT
+6 SET DIC("A")="Select Hospital Location: "
SET DIC("B")=$SELECT('$DATA(^DIC(42,+GMRWARD,44)):"",$DATA(^SC(+$PIECE(^DIC(42,+GMRWARD,44),U),0)):$PIECE(^(0),U),1:"")
SET DIC=44
SET DIC(0)="AEMQ"
SET DIC("S")="I $P(^(0),U,3)'=""Z"""
DO ^DIC
KILL DIC
+7 IF +Y'>0
WRITE !,"Hospital location is required",!
SET GMROUT=1
QUIT
+8 SET GMRVHLOC=+Y
QUIT
MULTIVM if GMROUT
QUIT
WRITE !!,"Do you want to enter other V/M data for this patient"
SET %=2
DO YN^DICN
if %=0
WRITE !!,"Select YES if you want to enter another V/M record at a different",!,"date/time for the same patient.",!
if %=0
GOTO MULTIVM
if %'=1
QUIT
+1 DO DATE
IF 'GMROUT
SET GMRDT0=GMRVIDT
DO EN2^GMRVED3
GOTO MULTIVM
+2 SET GMROUT=0
QUIT