source: WorldVistAEHR/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMUTL.m@ 846

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

initial load of WorldVistAEHR

File size: 1.6 KB
Line 
1PXRMUTL ;EHR/DAOU/JLG - Utility Functions ;11/5/06 20:28
2 ;;2.0;CLINICAL REMINDERS;**7**;Feb 04, 2005;Build 14
3 ; Copyright (C) 2007 WorldVistA
4 ;
5 ; This program is free software; you can redistribute it and/or modify
6 ; it under the terms of the GNU General Public License as published by
7 ; the Free Software Foundation; either version 2 of the License, or
8 ; (at your option) any later version.
9 ;
10 ; This program is distributed in the hope that it will be useful,
11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ; GNU General Public License for more details.
14 ;
15 ; You should have received a copy of the GNU General Public License
16 ; along with this program; if not, write to the Free Software
17 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 ;'Modified' MAS Patient Look-up Check Cross-References June 1987
19 ;
20FNAME(DFN) ;Patient First name
21 N FULNAME,FIRSTN
22 S FULNAME=$$NAME^TIULO(DFN)
23 S FIRSTN=$P($P(FULNAME,",",2)," ",1)
24 I FIRSTN="" S FIRSTN="UNKNOWN"
25 Q FIRSTN
26 ;
27BMI(DFN) ;Patient body mass index
28 N PTWT,PTHT,BMI
29 S PTWT=$$WEIGHT^TIULO(DFN)
30 S PTHT=$$HEIGHT^TIULO(DFN)
31 I PTWT,PTHT D
32 .S BMI=703*(PTWT/(PTHT**2))+.5\1
33 E S BMI="UNK"
34 Q BMI
35 ;
36PATID(DFN) ;Patient id (either SSN or HRN)
37 ;At this stage it returns SSN if it exits. Will probably need to
38 ;be modified to return HRN even if SSN exists.
39 N PATID
40 S PATID=$$SSN^TIULO(DFN)
41 I PATID["SSN" D
42 .S PATID=$$HRN^AUPNPAT3(DFN,DUZ(2))
43 .I PATID,$L(PATID)<7 S PATID="HRN-"_PATID Q
44 .S PATID="UNKNOWN"
45 Q PATID
Note: See TracBrowser for help on using the repository browser.