source: FOIAVistA/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVED0.m@ 1470

Last change on this file since 1470 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 4.6 KB
Line 
1GMRVED0 ;HIRMFO/RM,YH,FT-VITAL SIGNS EDIT SHORT FORM ;6/13/01 15:44
2 ;;4.0;Vitals/Measurements;**7,9,13**;Apr 25, 1997
3 ;
4 ; This routine uses the following IAs:
5 ; #1380 ^DG(405.4 (controlled)
6 ; #10035 ^DPT("CN" (supported)
7 ; #10039 ^DIC(42 (supported)
8 ; #10040 ^SC( (supported)
9 ; #10061 ^VADPT APIs (supported)
10 ;
11EN2 ; DETERMINE VITALS SITE
12 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)
13 I '($D(GMRVIDT)#2) S GMRVIDT(0)=1 D DATE^GMRVED0 I GMROUT K GMROUT Q
14 S GMROUT=0,GMRVWLOC=1,GDT(1)=GMRVIDT D WARDPAT G:GMROUT Q
15A2 ;
16 I $G(GMRSTR)="" D
17 . 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:"")
18 . 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:"")
19 I GMRENTY=18 S GMRSTR="PN"
20 Q:GMRSTR=""
21A3 ;
22 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
23 I "Aa"[GMREDB D EN1^GMRVED2,EN2^GMRVED2 G Q
24 I "Ss"[GMREDB D EN3^GMRVED6,EN1^GMRVED2,EN2^GMRVED2 G Q
25 Q
26EN3 ; CALL IF DFN TO EDIT SINGLE PATIENT VITALS WHERE
27 ; INPUT : DFN= PT FILE PTR.
28 ; GMRSTR=STRING OF VITALS TO EDIT
29 ; where T=Temp, P=Pulse, R=Resp, B=BP,H=Ht., W=Wt.
30 ; GMRVHLOC=HOSP. LOCATION (PTR TO FILE 44)
31 ; GMRVIDT=DATE/TIME VITALS TAKEN
32 ; OUPTUT : GMRVIEN(GMRVTY)=120.5 ENTRY^GMRVREAD^GMRVSITE
33 ; where GMRVTY is the vital type see codes above
34 ; GMRVREAD = READING FOR THIS VITAL TYPE
35 ; GMRVSITE = PTR TO GMR VITALS SITE FILE
36 ; GMROUT WILL BE 1 IF ABNORMAL EXIT, ELSE 0
37 Q:'$D(DFN)!'$D(GMRSTR)!'$D(GMRVIDT)
38 S GMROUT=0,GMRTMP=1 I GMROUT S GMROUT=$S(GMROUT=2:0,1:1) G Q3
39 S GMREDB="P1" D A3
40 Q:$D(GNUROP)
41Q3 D Q1 K GMREDB,GMRENTY,GMRTMP Q
42DATE ; CALL TO SET GMRVIDT (WHEN THE VITALS WERE TAKEN)
43 ; ALSO RETURNS GMROUT=1 IF TIMEOUT OR UPARROW OUT.
44 S X=U,%DT("A")="ENTER DATE (TIME Required) VITALS WERE TAKEN: ",%DT="XAPETR" D ^%DT K %DT
45 I Y<0!(X=U) S GMROUT=$S(X=U:1,1:2) Q
46 D NOW^%DTC I Y>% W !,?3,$C(7),"Cannot enter future dates" G DATE
47 I Y<$$FMADD^XLFDT(DT,-365) W !,?3,$C(7),"Sorry, you cannot enter a date more than 1 year old." G DATE
48 S GMRVIDT=Y K POP
49 Q
50Q ;
51 G:$D(GMRTMP) Q1
52 K GMRVIDT
53 K ^TMP($J),DFN,GMREDB,GMRENTY,GMROUT,GMRSTR,GMRVHLOC
54Q1 ;
55 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
56 D KVAR^VADPT K VA,DIPGM,GMROV,GMRP,GMRTYPE,GMRQUAL,GCT,GDA,GDATA,GLAST,GTYPE,GMRDT0
57 Q
58WARDPAT ; SELECT EDIT BY 1. UNIT, 2. SELECTED ROOMS ON UNIT, 3. PATIENT
59 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
60 I "Aa"[GMREDB!("Ss"[GMREDB)!("P1p"[GMREDB) G WP1
61 I GMREDB?1"?".E S XQH="GMRV WARD/PAT SEL" D EN^XQH K XQH G WARDPAT
62 W !,$C(7),?5,"INVALID ENTRY ??" G WARDPAT
63WP1 ;
64 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
65 D PATDAT
66 Q
67WARDSEL ; SELECT SEARCH WARD
68 S DIC="^DIC(42,",DIC(0)="AEQMZ",DIC("S")="I '$$INACT42^GMRVUT2(+Y)"
69 D ^DIC K DIC I X=U!(+Y'>0) S GMROUT=1 Q
70 S GMRWARD=+Y,GMRWARD(1)=$P(Y(0),U),DFN=$O(^DPT("CN",GMRWARD(1),0))
71 I DFN="" W !,*7,"**** NO PATIENTS REGISTERED ON UNIT ",$P(^DIC(42,GMRWARD,0),U)," ****" S GMROUT=1 Q
72 S GMRVHLOC=$S($D(^DIC(42,GMRWARD,44)):$P(^(44),U),1:"")
73 Q
74PATDAT ;
75 S DIC(0)="AEQMZ",DIC="^DPT(" D ^DIC K DIC S DFN=+Y
76 I DFN'>0 S GMROUT=1 Q
77 D INP^VADPT S GMRWARD(1)=$P(VAIN(4),U,2),GMRWARD=$P(VAIN(4),U) D KVAR^VADPT K VA
78 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
79 Q:'GMRVWLOC
80 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
81 I +Y'>0 W !,"Hospital location is required",! S GMROUT=1 Q
82 S GMRVHLOC=+Y Q
83MULTIVM 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
84 D DATE I 'GMROUT S GMRDT0=GMRVIDT D EN2^GMRVED3 G MULTIVM
85 S GMROUT=0 Q
Note: See TracBrowser for help on using the repository browser.