Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: NURCVED0

NURCVED0.m

Go to the documentation of this file.
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