NURCVED0 ;HIRMFO/YH,MD,RM,FT-VITAL SIGNS EDIT SHORT FORM ;6/22/01 10:28
;;4.0;NURSING SERVICE;**36**;Apr 25, 1997
;
; This routine uses the following IAs:
; #1914 ^GMRVALL0 API (private)
; #1440 ^GMRVED0 APIs (private)
; #1441 ^GMRVEE0 APIs (private)
; #10039 ^DIC(42 (supported)
; #10061 ^VADPT API (supported)
;
EN1 ;CALL TO EDIT PATIENT VITALS
;ENTRY POINT FOR OPTION NURCPE-VIT-EDIT
;OUTPUT VARIABLES: DFN = PT. FILE POINTER
; GMRSTR = STRING OF WHICH VITALS TO EDIT
; GMRVHLOC = PTS HOSPITAL LOCATION(PTR TO FILE 44)
S GMROUT=0,GNUROP=1,NURQUIT=$P(NURSDBA,"^"),GMRVIDT=$P(NURSDBA,"^",2)
; EN3^GMRVED0 IS CALLED TO EDIT SINGLE PATIENT VITALS
S (NURQUIT,NURQUIT(1))=0
I GMRENTY=9 D LIST^GMRVALL0 G:GMROUT Q
D WARDPAT^NURCVUT0 G:NURQUIT!(NUREDB["S"&'$D(NRMBD)) Q D SETUTIL I '$D(^TMP($J)) W:"Ss"[NUREDB !,"*** NO PATIENTS REGISTERED IN THESE ROOMS",! G Q
S NURRM="" F NN=0:0 S NURRM=$O(^TMP($J,NURRM)) Q:NURRM=""!NURQUIT S NBED="" F NN=0:0 S NBED=$O(^TMP($J,NURRM,NBED)) Q:NBED=""!NURQUIT S NURNAM="" F NN=0:0 S NURNAM=$O(^TMP($J,NURRM,NBED,NURNAM)) Q:NURNAM=""!NURQUIT D EDTPT
G Q
EDTPT ;
F DFN=0:0 S DFN=$O(^TMP($J,NURRM,NBED,NURNAM,DFN)) Q:DFN'>0!NURQUIT D:"Pp"'[NUREDB ASKOK Q:NURQUIT I 'NURQUIT(1) S GMRVHLOC=$S($D(^(DFN)):^(DFN),1:"") D I "Pp"[NUREDB D:'GMROUT MULTIVM S NURQUIT=1 Q
. S NURENTY=GMRENTY,NURSTR=GMRSTR D EN3^GMRVED0 S GMRENTY=NURENTY,GMRSTR=NURSTR
. Q
Q
ASKOK ; LOOPING THROUGH NAMES
S (GMROUT,NURQUIT(1))=0 W !,NURNAM,?$X+10,$S(NURRM=" BLANK":" ",1:NURRM)_"-"_$S(NBED=" BLANK":" ",1:NBED_" ") S %=1 D YN^DICN I %=1!(%=-1) S:%=-1 NURQUIT=1 Q
I '% W $C(7),!,?4,"ANSWER 'YES' or 'NO'" G ASKOK
ASL W !,"Do you wish to stop looping through names?" S %=1 D YN^DICN W ! I %=1!(%=-1) S NURQUIT=1 Q
I '% W $C(7),!,?4,"ANSWER 'YES' or 'NO'" G ASL
S NURQUIT(1)=1
Q
SETUTIL ; SET ARRAY OF PATIENTS
K ^TMP($J) I "Pp"[NUREDB S NURWARD=$S($D(^NURSF(214,DFN,0)):$P(^(0),"^",3),1:"") D SETWLO D WRDST
I "SsUu"[NUREDB D SETWLO F DFN=0:0 S DFN=$O(^NURSF(214,"AF","A",NURWARD,DFN)) Q:DFN'>0 D WRDST
Q
WRDST ; SET UTILITY FOR PATIENTS ON WARD
W:$E(IOST)="C" "." D 1^VADPT
Q:"Ss"[NUREDB&($S(VAIN(5)="":1,1:'$D(NRMBD($P($P(VAIN(5),"^"),"-",1,2)))))!(VADM(1)="")
S NURHLO="" I +VAIN(4) S NURHLO=$S($D(^DIC(42,+VAIN(4),44)):^(44),1:"")
I +NURWLO,'NURHLO S NURHLO=$S($D(^DIC(42,$P(NURWLO,"^",2),44)):^(44),1:"")
I 'NURHLO S NURHLO=$S($D(^NURSF(211.4,+NURWARD,0)):$P(^(0),"^"),1:"")
S ^TMP($J,$S($P($P(VAIN(5),"^"),"-")'="":$P($P(VAIN(5),"^"),"-"),1:" BLANK"),$S($P($P(VAIN(5),"^"),"-",2)'="":$P($P(VAIN(5),"^"),"-",2),1:" BLANK"),VADM(1),DFN)=NURHLO
Q
SETWLO ; SET 42 FILE ENTRY FOR NURSWARD, NURWLO=$S(1:ONLY ONE 42 ENTRY,
; 0: MORE THAN ONE 42 ENTRY OR NO ENTRY)_"^"_(42 ENTRY)
; AND THE NURHLO ARRAY AS THE HOSPITAL LOCATIONS ASSOCIATED WITH 211.4
S Y=0,NURWLO="0^" F X=0:0 S X=$O(^NURSF(211.4,NURWARD,3,X)) Q:X'>0 S Z=$S($D(^NURSF(211.4,NURWARD,3,X,0)):+^(0),1:"") I Z>0 S Y=Y+1 S:Y=1 NURWLO="1^"_Z S:$S('$D(^DIC(42,Z,44)):0,1:+^(44)) NURHLO(+^(44))=""
S:Y>1 $P(NURWLO,"^")=0
Q
DATE ; CALL TO SET AND GMRVIDT (WHEN THE VITALS WERE TAKEN)
; ALSO RETURNS NURQUIT=1 IF TIMEOUT OR UPARROW OUT.
S X="^",%DT("A")="ENTER DATE (TIME Required) VITALS WERE TAKEN: ",%DT="XAPETR",%DT(0)="-NOW" D ^%DT K %DT
I Y<0!(X="^") S NURQUIT=1 Q
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
Q
Q ;
D Q^GMRVED0 K NURX,NURP,GNUROP,NAME,NURHLO,NURRM,NURWLO,NBED,NN,NPWARD,NURQUIT,NROOM,NUREDB,NURNAM,NURWARD,GMROUT,GMRVIEN,GMRVIDT,GMRTYPE,GMRP,Z,GMROK,GDT,%,C,GMROV,I,J,K,W,Y,Z,NURENTY,NURSTR
Q
EN2 ;EDIT A VITAL/MEASUREMENT ENTERED IN ERROR
;ENTRY POINT FOR OPTION NURCPE-VIT-ERROR
S NACT=0,DIC(0)="EQM",NASK=1 D EN5^NURSCUTL G Q5:DFN'>0 D EN2^GMRVEE0
Q5 K NACT,DIC,NASK,DFN
Q
MULTIVM 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 Q:NURQUIT S NURENTY=GMRENTY D EN3^GMRVED0 S GMRENTY=NURENTY G:'GMROUT MULTIVM Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HNURCVED0 4253 printed Oct 16, 2024@18:21:43 Page 2
NURCVED0 ;HIRMFO/YH,MD,RM,FT-VITAL SIGNS EDIT SHORT FORM ;6/22/01 10:28
+1 ;;4.0;NURSING SERVICE;**36**;Apr 25, 1997
+2 ;
+3 ; This routine uses the following IAs:
+4 ; #1914 ^GMRVALL0 API (private)
+5 ; #1440 ^GMRVED0 APIs (private)
+6 ; #1441 ^GMRVEE0 APIs (private)
+7 ; #10039 ^DIC(42 (supported)
+8 ; #10061 ^VADPT API (supported)
+9 ;
EN1 ;CALL TO EDIT PATIENT VITALS
+1 ;ENTRY POINT FOR OPTION NURCPE-VIT-EDIT
+2 ;OUTPUT VARIABLES: DFN = PT. FILE POINTER
+3 ; GMRSTR = STRING OF WHICH VITALS TO EDIT
+4 ; GMRVHLOC = PTS HOSPITAL LOCATION(PTR TO FILE 44)
+5 SET GMROUT=0
SET GNUROP=1
SET NURQUIT=$PIECE(NURSDBA,"^")
SET GMRVIDT=$PIECE(NURSDBA,"^",2)
+6 ; EN3^GMRVED0 IS CALLED TO EDIT SINGLE PATIENT VITALS
+7 SET (NURQUIT,NURQUIT(1))=0
+8 IF GMRENTY=9
DO LIST^GMRVALL0
if GMROUT
GOTO Q
+9 DO WARDPAT^NURCVUT0
if NURQUIT!(NUREDB["S"&'$DATA(NRMBD))
GOTO Q
DO SETUTIL
IF '$DATA(^TMP($JOB))
if "Ss"[NUREDB
WRITE !,"*** NO PATIENTS REGISTERED IN THESE ROOMS",!
GOTO Q
+10 SET NURRM=""
FOR NN=0:0
SET NURRM=$ORDER(^TMP($JOB,NURRM))
if NURRM=""!NURQUIT
QUIT
SET NBED=""
FOR NN=0:0
SET NBED=$ORDER(^TMP($JOB,NURRM,NBED))
if NBED=""!NURQUIT
QUIT
SET NURNAM=""
FOR NN=0:0
SET NURNAM=$ORDER(^TMP($JOB,NURRM,NBED,NURNAM))
if NURNAM=""!NURQUIT
QUIT
DO EDTPT
+11 GOTO Q
EDTPT ;
+1 FOR DFN=0:0
SET DFN=$ORDER(^TMP($JOB,NURRM,NBED,NURNAM,DFN))
if DFN'>0!NURQUIT
QUIT
if "Pp"'[NUREDB
DO ASKOK
if NURQUIT
QUIT
IF 'NURQUIT(1)
SET GMRVHLOC=$SELECT($DATA(^(DFN)):^(DFN),1:"")
Begin DoDot:1
+2 SET NURENTY=GMRENTY
SET NURSTR=GMRSTR
DO EN3^GMRVED0
SET GMRENTY=NURENTY
SET GMRSTR=NURSTR
+3 QUIT
End DoDot:1
IF "Pp"[NUREDB
if 'GMROUT
DO MULTIVM
SET NURQUIT=1
QUIT
+4 QUIT
ASKOK ; LOOPING THROUGH NAMES
+1 SET (GMROUT,NURQUIT(1))=0
WRITE !,NURNAM,?$X+10,$SELECT(NURRM=" BLANK":" ",1:NURRM)_"-"_$SELECT(NBED=" BLANK":" ",1:NBED_" ")
SET %=1
DO YN^DICN
IF %=1!(%=-1)
if %=-1
SET NURQUIT=1
QUIT
+2 IF '%
WRITE $CHAR(7),!,?4,"ANSWER 'YES' or 'NO'"
GOTO ASKOK
ASL WRITE !,"Do you wish to stop looping through names?"
SET %=1
DO YN^DICN
WRITE !
IF %=1!(%=-1)
SET NURQUIT=1
QUIT
+1 IF '%
WRITE $CHAR(7),!,?4,"ANSWER 'YES' or 'NO'"
GOTO ASL
+2 SET NURQUIT(1)=1
+3 QUIT
SETUTIL ; SET ARRAY OF PATIENTS
+1 KILL ^TMP($JOB)
IF "Pp"[NUREDB
SET NURWARD=$SELECT($DATA(^NURSF(214,DFN,0)):$PIECE(^(0),"^",3),1:"")
DO SETWLO
DO WRDST
+2 IF "SsUu"[NUREDB
DO SETWLO
FOR DFN=0:0
SET DFN=$ORDER(^NURSF(214,"AF","A",NURWARD,DFN))
if DFN'>0
QUIT
DO WRDST
+3 QUIT
WRDST ; SET UTILITY FOR PATIENTS ON WARD
+1 if $EXTRACT(IOST)="C"
WRITE "."
DO 1^VADPT
+2 if "Ss"[NUREDB&($SELECT(VAIN(5)=""
QUIT
+3 SET NURHLO=""
IF +VAIN(4)
SET NURHLO=$SELECT($DATA(^DIC(42,+VAIN(4),44)):^(44),1:"")
+4 IF +NURWLO
IF 'NURHLO
SET NURHLO=$SELECT($DATA(^DIC(42,$PIECE(NURWLO,"^",2),44)):^(44),1:"")
+5 IF 'NURHLO
SET NURHLO=$SELECT($DATA(^NURSF(211.4,+NURWARD,0)):$PIECE(^(0),"^"),1:"")
+6 SET ^TMP($JOB,$SELECT($PIECE($PIECE(VAIN(5),"^"),"-")'="":$PIECE($PIECE(VAIN(5),"^"),"-"),1:" BLANK"),$SELECT($PIECE($PIECE(VAIN(5),"^"),"-",2)'="":$PIECE($PIECE(VAIN(5),"^"),"-",2),1:" BLANK"),VADM(1),DFN)=NURHLO
+7 QUIT
SETWLO ; SET 42 FILE ENTRY FOR NURSWARD, NURWLO=$S(1:ONLY ONE 42 ENTRY,
+1 ; 0: MORE THAN ONE 42 ENTRY OR NO ENTRY)_"^"_(42 ENTRY)
+2 ; AND THE NURHLO ARRAY AS THE HOSPITAL LOCATIONS ASSOCIATED WITH 211.4
+3 SET Y=0
SET NURWLO="0^"
FOR X=0:0
SET X=$ORDER(^NURSF(211.4,NURWARD,3,X))
if X'>0
QUIT
SET Z=$SELECT($DATA(^NURSF(211.4,NURWARD,3,X,0)):+^(0),1:"")
IF Z>0
SET Y=Y+1
if Y=1
SET NURWLO="1^"_Z
if $SELECT('$DATA(^DIC(42,Z,44))
SET NURHLO(+^(44))=""
+4 if Y>1
SET $PIECE(NURWLO,"^")=0
+5 QUIT
DATE ; CALL TO SET AND GMRVIDT (WHEN THE VITALS WERE TAKEN)
+1 ; ALSO RETURNS NURQUIT=1 IF TIMEOUT OR UPARROW OUT.
+2 SET X="^"
SET %DT("A")="ENTER DATE (TIME Required) VITALS WERE TAKEN: "
SET %DT="XAPETR"
SET %DT(0)="-NOW"
DO ^%DT
KILL %DT
+3 IF Y<0!(X="^")
SET NURQUIT=1
QUIT
+4 IF Y<$$FMADD^XLFDT(DT,-365)
WRITE !,?3,$CHAR(7),"Sorry, you cannot enter a date more than 1 year old."
GOTO DATE
+5 SET GMRVIDT=Y
+6 QUIT
Q ;
+1 DO Q^GMRVED0
KILL NURX,NURP,GNUROP,NAME,NURHLO,NURRM,NURWLO,NBED,NN,NPWARD,NURQUIT,NROOM,NUREDB,NURNAM,NURWARD,GMROUT,GMRVIEN,GMRVIDT,GMRTYPE,GMRP,Z,GMROK,GDT,%,C,GMROV,I,J,K,W,Y,Z,NURENTY,NURSTR
+2 QUIT
EN2 ;EDIT A VITAL/MEASUREMENT ENTERED IN ERROR
+1 ;ENTRY POINT FOR OPTION NURCPE-VIT-ERROR
+2 SET NACT=0
SET DIC(0)="EQM"
SET NASK=1
DO EN5^NURSCUTL
if DFN'>0
GOTO Q5
DO EN2^GMRVEE0
Q5 KILL NACT,DIC,NASK,DFN
+1 QUIT
MULTIVM 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 NURQUIT
QUIT
SET NURENTY=GMRENTY
DO EN3^GMRVED0
SET GMRENTY=NURENTY
if 'GMROUT
GOTO MULTIVM
QUIT