source: WorldVistAEHR/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVEE0.m@ 1306

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

initial load of WorldVistAEHR

File size: 5.3 KB
RevLine 
[613]1GMRVEE0 ;HIRMFO/RM,YH-ENTERED IN ERROR EDIT ;3/15/99 15:04
2 ;;4.0;Vitals/Measurements;**1,7,11**;Apr 25, 1997
3EN1 ; ENTRY FROM OPTION GMRV ERROR EDIT
4 S GMROUT=0 W ! S DIC="^DPT(",DIC(0)="AEMQ" D ^DIC K DIC S:+Y'>0 GMROUT=1 G Q:+Y'>0 S DFN=+Y
5EN2 ; ENTRY TO VITALS ENTERED IN ERROR IF DFN IS KNOWN.
6 Q:'$D(DFN) S GMROUT=0 K ^TMP($J)
7DATE S %DT(0)="-NOW",%DT("A")="Select DATE (TIME optional) of this error: ",%DT="AXET" D ^%DT K %DT I +Y'>0 S GMROUT=1 G Q
8 S GMRVDATE=+Y D DATACK I GMROUT W !,$C(7),"No data for this date" S GMROUT=0 G DATE
9EN3 ;ENTRY TO ERROR EDIT PROVIDED DFN AND DATE/TIME ARE GIVEN
10 S GMRX=$O(GMRARTY("D",0)) I GMRX>0 D CHSDT G:GMROUT Q D EN1^GMRVEE1
11 I GMRARTY W ! S DIC=120.51,DIC(0)="AQEM",DIC("A")="Select a VITAL type record, or press return to correct DATE/TIME, PATIENT or set INVALID for the record: ",DIC("S")="I $D(GMRARTY(+Y))" D ^DIC K DIC
12 S:$D(DUOUT)!$D(DTOUT) GMROUT=1 G:GMROUT Q
13 S GMRVITY=$S(+Y>0:+Y,1:"A")
14 I 'GMRARTY S GMRVITY=$O(GMRARTY(0))
15 D:GMRVITY'="A" WHTL
16 I '($D(GMRARTY)\10) W !?3,$C(7),"There is no data for this patient for this date/time" G Q
17 S GMRVDT=$O(GMRARTY("D",0)) S:GMRVITY="A"&'$O(GMRARTY(+$O(GMRARTY("")))) GMRVITY=$O(GMRARTY(""))
18 D RESLS^GMRVEE1
19Q K ^TMP($J),GMRAINP,GMRDA,GMRDAT,GMREDB,GMRFDT,GMRNM,GMRSDT,GMRTY,GMRVDATE,GMRVITY,GMRX,GMRDATE,GMRI,GMRSITE,GMRVIDT,GMRSTR,GMRVCH,GMRVIT,GMRVX,DR,DA,DIE,DFN,DIC,GMRARTY,GMRCHC,GMRDFN,GMRVDT,GMRVHLOC,GMRY,GMRZ,POP,GDATE,GSAVE,GDFN,GMRCNT
20 D KVAR^VADPT K GMRINF,GMRDATA,%T,%Y,D0,DI,DQ,VAERR,VAIP,GMRQUAL,GMRENTY,GFLAG,GMRZZ,GMRVARY
21 K GMROK,GDT I GMROUT K GMROUT Q
22 G EN1
23WHTL ; ELIMINATE ALL NON GMRVITY CHILDREN FROM GMRARTY
24 F GMRX=0:0 S GMRX=$O(GMRARTY(GMRX)) Q:GMRX'>0 I GMRX'=GMRVITY K GMRARTY(GMRX)
25 F GMRX=0:0 S GMRX=$O(GMRARTY("D",GMRX)) Q:GMRX'>0 I '$D(GMRARTY(GMRVITY,GMRX)) K GMRARTY("D",GMRX)
26 Q
27CHSDT ; CHOOSE A DATE FOR ALL VITAL TYPES, OR DROP THRU FROM SINGLE VITAL TYPE
28 S (GMRCNT,GMRNM)=0 K ^TMP($J,"GMRC") W !,"CHOOSE FROM: ",!
29 S GFLAG="" F GMRX=0:0 S GMRX=$O(GMRARTY("D",GMRX)) Q:GMRX'>0!GMROUT!(GFLAG["^") S GMRNM=GMRNM+1,^TMP($J,"GMRC",GMRNM)=GMRX,GMRCNT=GMRCNT+1 W !,?2,GMRNM_" " S Y=GMRX D DT^DIQ D PRTCHS I GMRCNT=3 D
30 . W !," Return to continue or enter ^ to stop listing: " R GFLAG:DTIME S:'$T GMROUT=1 S GMRCNT=0
31 . Q
32CHNUM Q:GMROUT W !!,"Select VITAL/MEASUREMENT from the above list: " R GMRX:DTIME I '$T!(GMRX="^") S GMROUT=1 Q
33 I GMRX="" S GMROUT=1 Q
34 I '$D(^TMP($J,"GMRC",GMRX)) W !,$C(7),?3,"ANSWER WITH "_$S(GMRNM>0:"A NUMBER BETWEEN 1 AND "_GMRNM,1:"THE NUMBER 1") G CHNUM:GMRX'?1"?".E,CHSDT
35SDA S GMRVDT=^TMP($J,"GMRC",GMRX) F GMRX=0:0 S GMRX=$O(GMRARTY(GMRX)) Q:GMRX'>0 F GMRY=0:0 S GMRY=$O(GMRARTY(GMRX,GMRY)) Q:GMRY'>0 I GMRY'=GMRVDT K GMRARTY(GMRX,GMRY),GMRARTY("D",GMRY)
36 Q
37PRTCHS ; PRINT CHOICES FOR DATE/TIME DEFINED BY GMRX
38 F GMRY=0:0 S GMRY=$O(GMRARTY(GMRY)) Q:GMRY'>0 I $D(GMRARTY(GMRY,GMRX)) S GMRDA=GMRARTY(GMRY,GMRX) D PRTLN
39 Q
40PRTLN ; PRINT DATA FOR VITAL RECORD DEFINED BY GMRDA
41 S GMRDAT=$S($D(^GMR(120.5,GMRDA,0)):^(0),1:"") Q:GMRDAT=""
42 K GMRVX S GMRVX=$S($D(^GMRD(120.51,GMRY,0)):$P(^(0),"^",2),1:""),GMRVX(0)=$P(GMRDAT,"^",8) D:GMRVX(0)>0 EN1^GMRVSAS0
43 S GMRZZ="",GMRZZ(1)="" I $P($G(^GMR(120.5,GMRDA,5,0)),"^",4)>0 K GMRVARY S GMRVARY="" D CHAR^GMRVCHAR(GMRDA,.GMRVARY,GMRY) S GMRZZ=$$WRITECH^GMRVCHAR(GMRDA,.GMRVARY,9) S:GMRZZ'=""&(GMRVX'="PO2") GMRZZ=" ("_GMRZZ_")"
44 I GMRVX="T",GMRVX(0)>0 S GMRVX(0)=GMRVX(0)_" F ("_$J(GMRVX(0)-32*5/9,0,1)_" C)"
45 I GMRVX="HT",GMRVX(0)>0 S GMRVX(0)=$S(GMRVX(0)\12:GMRVX(0)\12_" ft ",1:"")_$S(GMRVX(0)#12:GMRVX(0)#12_" in",1:"")_" ("_$J(GMRVX(0)*2.54,0,2)_" cm)"
46 I GMRVX="WT",GMRVX(0)>0 S GMRVX(0)=GMRVX(0)_" lb ("_$J(GMRVX(0)/2.2,0,2)_" kg)"
47 I GMRVX="PN" D
48 . I GMRVX(0)=0 S GMRVX(0)=GMRVX(0)_" No pain" Q
49 . I GMRVX(0)=99 S GMRVX(0)=GMRVX(0)_" Unable to respond" Q
50 . I GMRVX(0)=10 S GMRVX(0)=GMRVX(0)_" Worst imaginable pain" Q
51 I GMRVX="CG",GMRVX(0)>0 S GMRVX(0)=GMRVX(0)_" in ("_$J(+GMRVX(0)/.3937,0,2)_" cm)"
52 I GMRVX="CVP",GMRVX(0)>0 S GMRVX(0)=GMRVX(0)_" cmH2O ("_$J(GMRVX(0)/1.36,0,1)_" mmHg)"
53 I GMRVX="PO2",GMRVX(0)>0 D
54 .N GMRVPO S GMRVPO=$P(GMRDAT,"^",10)
55 .S GMRVX(0)="Pulse oximetry "_GMRVX(0)_"%"_$S(GMRVPO'="":" with supplemental O2 "_$S(GMRVPO["l/min":$P(GMRVPO," l/min")_"L/min",1:"")_$S(GMRVPO["l/min":$P(GMRVPO," l/min",2),1:GMRVPO),1:"")
56 .Q
57 I GMRVX="P" D
58 . I GMRZZ'="",GMRVX(0)=1 S:$F(GMRZZ,"DORSALIS PEDIS")>0 GMRVX(1)=""
59 . I GMRZZ'="",GMRVX(0)=0 S:$F(GMRZZ,"DORSALIS PEDIS")>0 GMRVX(1)=1
60 . Q
61 W !,?5,$S(GMRVX="PN":"Pain",1:GMRVX),": ",GMRVX(0),$S('$D(GMRVX(1)):" ",'GMRVX(1):" ",1:"*")
62 W:GMRVX="PO2" !,?10,"via " W GMRZZ
63 Q
64DATACK ; CHECK TO SEE IF DATA FOR THIS PATIENT FOR THIS DATE. IF THERE IS
65 ; SET UP AN ARRAY GMRARTY WITH GMRARTY=$S(0:ONE TYPE ONLY,1:MORE
66 ; THAN ONE TYPE) AND GMRARTY(TYPE IEN)=120.5 ENTRY
67 K GMRARTY S X1=GMRVDATE,X2=1 D C^%DTC S GMRVDT(0)=$P(X,".",1)
68 F GMRVITY=0:0 S GMRVITY=$O(^GMR(120.5,"AA",DFN,GMRVITY)) Q:GMRVITY'>0 D CNLP
69 I '$D(GMRARTY) S GMROUT=1
70 Q
71CNLP ;
72 F GMRVDT=(9999999-GMRVDT(0)):0 S GMRVDT=$O(^GMR(120.5,"AA",DFN,GMRVITY,GMRVDT)) Q:$P(9999999-GMRVDT,".")'[$P(GMRVDATE,".")!(GMRVDT'>0) D:$S('$P(GMRVDATE,".",2):1,1:GMRVDATE=(9999999-GMRVDT)) STARTY
73 Q
74STARTY ; SET GMRARTY ARRAY
75 F GMRDA=0:0 S GMRDA=$O(^GMR(120.5,"AA",DFN,GMRVITY,GMRVDT,GMRDA)) Q:GMRDA'>0 I '$D(^GMR(120.5,GMRDA,2)) S GMRARTY=$S($D(GMRARTY):1,1:0),GMRARTY(GMRVITY,9999999-GMRVDT)=GMRDA,GMRARTY("D",9999999-GMRVDT)="" Q
76 Q
Note: See TracBrowser for help on using the repository browser.