source: FOIAVistA/trunk/r/GEN_MED_OTHER-GMV/GMVUTL8.m@ 1765

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

initial load of FOIAVistA 6/30/08 version

File size: 3.7 KB
Line 
1GMVUTL8 ;HIOFO/DS,FT-RPC API TO RETURN ALL VITALS/CATEGORIES/QUALIFIERS ;3/31/05 13:34
2 ;;5.0;GEN. MED. REC. - VITALS;**1,3**;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; #2263 - ^XPAR calls (Supported)
6 ; #3227 - ^NURAPI calls (private)
7 ;
8 ; This routine supports the following IAs:
9 ; #4653 - QUALIFRS & SUPO2 entry points (private)
10 ; #4420 - GMV DLL VERSION is called at DLL (private)
11 ; #4354 - GMV GET CATEGORY IEN is called at CATEGORY (private)
12 ; #4357 - GMV GET VITAL TYPE IEN is called at TYPE (private)
13 ;
14APTLIST(ARRAY,LOC) ; Returns a list of active patients for a nursing
15 ; location in the array specified. [RPC entry point]
16 ; input: LOC - (Required) NURS LOCATION file (#211.4) ien
17 ; input: ARRAY - (Required) Name of the array to return entries in
18 ; output: ARRAY - Subscripted by sequential number with DFN in first
19 ; piece and patient name in second piece.
20 ; example: ARRAY(#)=DFN^patient name^SSN^DOB^SEX AND AGE
21 ; ^ATTENDING^VETERAN^INTERNAL DATE/TIME DECEASED
22 ; ^EXTERNAL DATE/TIME DECEASED
23 ;
24 I $G(LOC)="" S ARRAY(1)=-1
25 N DFN,GMVARRAY,GMVCNT,GMVPAT,PATNAME
26 D APTLIST^NURAPI(LOC,.GMVARRAY)
27 I $G(GMVARRAY(1))'>0 S ARRAY(1)=-1 Q
28 S GMVCNT=0
29 F S GMVCNT=$O(GMVARRAY(GMVCNT)) Q:'GMVCNT D
30 .S DFN=$P(GMVARRAY(GMVCNT),U,1)
31 .Q:'DFN
32 .S PATNAME=$P(GMVARRAY(GMVCNT),U,2)
33 .D PTINFO^GMVUTL3(.GMVPAT,DFN)
34 .S ARRAY(GMVCNT)=DFN_U_PATNAME_U_GMVPAT
35 .Q
36 Q
37TYPE(RESULT,GMVTYPE) ;GMV GET VITAL TYPE IEN [RPC entry point]
38 ; Input:
39 ; RESULT = variable name to hold result
40 ; GMVTYPE = Name of Vital Type (from FILE 120.51) (e.g., WEIGHT)
41 ; Output: Returns the IEN if GMVTYPE exists in FILE 120.51
42 ; else returns -1
43 ;
44 I GMVTYPE="" S RESULT=-1 Q
45 S RESULT=+$O(^GMRD(120.51,"B",GMVTYPE,0))
46 Q
47CATEGORY(RESULT,GMVCAT) ;GMV GET CATEGORY IEN [RPC entry point]
48 ; Input
49 ; RESULT = variable name to hold result
50 ; GMVCAT = Name of Category (from FILE 120.53) (e.g., METHOD)
51 ; Output: Returns the IEN if GMVTYPE exists in FILE 120.53
52 ; else returns -1
53 I GMVCAT="" S RESULT=-1 Q
54 S RESULT=+$O(^GMRD(120.53,"B",GMVCAT,0))
55 Q
56QUALIFER(RESULT,GMVQUAL) ;Return IEN of Qualifier name
57 ; Input:
58 ; RESULT = variable name to hold result
59 ; GMVQUAL = Name of Qualifier (from FILE 120.52) (e.g., ORAL)
60 ; Output: Returns the IEN if GMVQUAL exists in FILE 120.52
61 ; else returns -1
62 ;
63 I GMVQUAL="" S RESULT=-1 Q
64 S RESULT=+$O(^GMRD(120.52,"B",GMVQUAL,0))
65 Q
66VITALIEN() ;Returns the Vital Type IENS in a list separated by commas.
67 ; ex: ",8,9,21,20,5,3,22,1,2,19,"
68 ;
69 N GMVABB,GMVIEN,GMVLIST
70 S GMVLIST=""
71 F GMVABB="BP","T","R","P","HT","WT","CVP","CG","PO2","PN" D
72 .S GMVIEN=$O(^GMRD(120.51,"C",GMVABB,0))
73 .Q:'GMVIEN
74 .S GMVLIST=GMVLIST_","_GMVIEN
75 .Q
76 I $L(GMVLIST)'="," S GMVLIST=GMVLIST_","
77 Q GMVLIST
78 ;
79QUALIFRS(VIEN) ;Function to return vitals qualifiers text
80 ; VIEN is the FILE 120.5 IEN
81 ; Returns the qualifiers in a string of text
82 ; e.g., Actual,Standing
83 ;
84 N QUALS,VQIEN,QNAME
85 S QUALS=""
86 I 'VIEN Q QUALS
87 S VQIEN=0
88 F S VQIEN=$O(^GMR(120.5,VIEN,5,"B",VQIEN)) Q:'VQIEN D
89 .S QNAME=$P($G(^GMRD(120.52,+VQIEN,0)),U,1)
90 .I QNAME]"" S QUALS=QUALS_QNAME_","
91 .Q
92 I $L(QUALS)>0 S QUALS=$E(QUALS,1,$L(QUALS)-1)
93 Q QUALS
94SUPO2(VIEN) ;Function to return the Supplemental O2 value
95 ; VIEN is the FILE 120.5 IEN
96 ; Returns the Supplemental O2 value (#1.4)
97 ; e.g., 2.0 l/min 90%
98 ;
99 S VIEN=+$G(VIEN)
100 Q $P($G(^GMR(120.5,VIEN,0)),U,10)
101 ;
102DLL(RESULT,GMVX) ; Entry for [GMV DLL VERSION] RPC. Returns DLL version check
103 ; RESULT = variable name to return check
104 ; GMVX = dll name and version date/time
105 ; Returns yes or no
106 S RESULT=$$GET^XPAR("SYS","GMV DLL VERSION",GMVX,"E")
107 S:RESULT="" RESULT="NO"
108 Q
109 ;
Note: See TracBrowser for help on using the repository browser.