source: WorldVistAEHR/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVUT0.m@ 632

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

initial load of WorldVistAEHR

File size: 4.7 KB
Line 
1GMRVUT0 ;HIRMFO/RM,YH,FT-INPUT TRANSFORMS FOR VITAL TYPES ;7/5/01 16:17
2 ;;4.0;Vitals/Measurements;**1,13**;Apr 25, 1997
3EN2 ; CALLED FROM INPUT TRANSFORM OF RATE AND QUALITY SUBFIELDS OF SITE
4 ; FIELD OF THE VITAL MEASUREMENT (#120.5) FILE - GMRFLD IS SET BEFORE
5 ; ENTRY, BUT KILLED WITHIN THE ROUTINE
6 S GMRTYP=$S($D(^GMR(120.5,DA,0)):$P(^(0),U,3),1:"") G K:GMRTYP'>0
7 G K:GMRTYP'>0,Q2:$P(^GMRD(120.51,GMRTYP,0),U,$S(GMRFLD=1:4,GMRFLD=2:5,1:3))
8K D EN^DDIOL($C(7)_"CANNOT EDIT THIS FIELD FOR THIS TYPE OF MEASUREMENT","","!?5") K X
9Q2 K GMRTYP,GMRFLD Q
10EN3 ; INPUT TRANSFORM FOR HEIGHT RATES
11 N GMR
12 S GMR=$P(X,+X,2,10) I GMR="" S X=0 Q
13 I $E(GMR)="C"!($E(GMR)="c")&("CMCmcMcm"[GMR) S X=$J(.3937*(+X),0,2) Q
14 I $E(GMR)="I"!($E(GMR)="i")!($E(GMR)="""") S X=+X Q
15 I $E(GMR)="F"!($E(GMR)="f")!($E(GMR)="'") D FTIN Q
16 S X=0
17 Q
18FTIN ;
19 N GMRF,GMRIN,GMRXX,GMRYY
20 S GMRF=$E(GMR),GMR=$E(GMR,2,$L(GMR)) F GMRXX=1:0 S GMRYY=$E(GMR) Q:GMRYY?1N!(GMRYY="") S GMRF=GMRF_GMRYY,GMR=$E(GMR,2,$L(GMR))
21 I "FTFtfTft'"'[GMRF Q
22 S GMRIN=$P(GMR,+GMR,2) I "INIniNin""''"'[GMRIN!(GMRIN="'") Q
23 S X=+X*12+(+GMR)
24 Q
25EN1 ; ENTRY TO GATHER PATIENTS VITAL/MEASURMENT DATA
26 ; INPUT VARIABLES:
27 ;
28 ; DFN = Entry number of patient in Patient file.
29 ; GMRVSTR = types of vital/measurments desired. Use the abbreviations
30 ; found in the Vital Type (120.51) file. For multiple
31 ; vitals, use the ; as a delimiter.
32 ; GMRVSTR(0) = GMRVSTDT^GMRVENDT^GMRVOCC^GMRVSORD
33 ; where GMRVSTDT = The start date/time that the utility will
34 ; use in obtaining patient data. (OPTIONAL)
35 ; GMRVENDT = The end date/time that the utility will use
36 ; to stop the search. (OPTIONAL)
37 ; GMRVOCC = The number of occurrences of the data that
38 ; is desired by the search. (OPTIONAL)
39 ; GMRVSORD = The sort order desired in output, see OUTPUT
40 ; VARIABLES section. (REQUIRED)
41 ; GMRVSTR("LT") = ^TYP1^[TYP2^...] (OPTIONAL)
42 ; THIS VARIABLE IS AN ^ DELIMITED LIST OF HOSPITAL LOCATION
43 ; TYPES TO EXTRACT MEASUREMENT DATA FOR. E.G., ^C^M^, WILL
44 ; EXTRACT DATA FOR ONLY THOSE MEASUREMENTS TAKEN ON CLINICS
45 ; OR MODULES.
46 ;
47 ; OUTPUT VARIABLES:
48 ;
49 ; The utility will create an array with the desired information. The
50 ; array structure will be as follows if '$P(GMRVSTR,"^",4):
51 ; ^UTILITY($J,"GMRVD",GMRVTYP,GMRVRDT,GMRVIEN)=GMRVDATA
52 ; or if $P(GMRVSTR,"^",4) then the following will be returned:
53 ; ^UTILITY($J,"GMRVD",GMRVRDT,GMRVTYP,GMRVIEN)=GMRVDATA
54 ; where GMRVRDT = Reverse FileMan date/time.
55 ; 9999999-Date/time vital/measurement was taken.
56 ; GMRVTYP = The abbreviation used in the GMRVSTR string for the
57 ; type of vital/measurment taken.
58 ; GMRVIEN = Entry number in file Vital/Measurement (120.5) file.
59 ; GMRVDATA = $P(^GMR(120.5,GMRVIEN,0),"^",1,9) will be the patient data as
60 ; currently defined in the DD for file 120.5.
61 ; $P(GMRVDATA,"^",10) = the first qualifier
62 ; $P(GMRVDATA,"^",11) = the second qualifier
63 ; $P(GMRVDATA,"^",12)= "*" for abnormal measurement, otherwise = ""
64 ; $P(GMRVDATA,"^",13)= values in centigrade for T; KG for WT;
65 ; in centimeter for HT and Circumference/Girth;
66 ; in mmHg for CVP.
67 ; $P(GMRVDATA,"^",14)= Body Mass Index.
68 ; $P(GMRVDATA,"^",15)= L/Min of supplemental O2.
69 ; $P(GMRVDATA,"^",16)= % of supplemental O2.
70 ; $P(GMRVDATA,"^",17)= all qualifiers.
71 ; The variable GMRVSTR will be killed.
72 Q:'$D(GMRVSTR(0))!'($D(GMRVSTR)#2)!'($D(DFN)#2) Q:DFN'>0
73 S GMRSAVE=GMRVSTR,GMRSAVE(0)=GMRVSTR(0) S GMRVSTR="HT" D EN6^GMRVUTL S GMRVSTR=GMRSAVE,GMRVSTR(0)=GMRSAVE(0) S GMRHT=(+$P(X,"^",8)*2.54)/100
74 I $G(GMRVSTR("LT"))="" S GMRVSTR("LT")=""
75 F GMRVSTR(1)=1:1:$L(GMRVSTR,";") S GMRVSTR("T")=$P(GMRVSTR,";",GMRVSTR(1)) I $L(GMRVSTR("T")) S GMRVSTR("B")=$S($P(GMRVSTR(0),"^",2):9999999-$P(GMRVSTR(0),"^",2)-.0000001,1:0),GMRVSTR("E")=9999999-$P(GMRVSTR(0),"^"),GMRVSTR("O")=0 D GETD
76 K GMRINF,GG,GMRSAVE,GMRHT,GMRVARY,GMRVSTR,GMRSITE,GMRQUAL,GMRVX,GMRZTY,GDATA Q
77GETD ; LOOP THRU AA XREF AND GET PT DATA.
78 S GMRVSTR("TDA")=$O(^GMRD(120.51,"C",GMRVSTR("T"),0)) Q:'GMRVSTR("TDA")
79 I GMRVSTR("T")="BP"!(GMRVSTR("T")="P") D BP^GMRVUT2 Q
80 F GMRVSTR("R")=GMRVSTR("B"):0 S GMRVSTR("R")=$O(^GMR(120.5,"AA",DFN,GMRVSTR("TDA"),GMRVSTR("R"))) Q:GMRVSTR("R")>GMRVSTR("E")!(GMRVSTR("R")'>0) D GETD1 Q:GMRVSTR("TMO")
81 Q
82GETD1 ;
83 S GMRVSTR("TMO")=0
84 F GMRVSTR("IEN")=0:0 S GMRVSTR("IEN")=$O(^GMR(120.5,"AA",DFN,GMRVSTR("TDA"),GMRVSTR("R"),GMRVSTR("IEN"))) Q:GMRVSTR("IEN")'>0 I '$P($G(^GMR(120.5,+GMRVSTR("IEN"),2)),"^") D SETU2^GMRVUT2 Q:GMRVSTR("TMO")
85 Q
Note: See TracBrowser for help on using the repository browser.