source: WorldVistAEHR/trunk/r/VISTA_OFFICE_EHR-VEPE/VEPEUTL.m@ 834

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

initial load of WorldVistAEHR

File size: 761 bytes
Line 
1VEPEUTL ;EHR/DAOU/JLG - Utility Functions ; 2/7/05 9:40pm
2 ;;1.0;t1;EHR VO UTILITIES;;Build 1
3 ;
4FNAME(DFN) ;Patient First name
5 N FULNAME,FIRSTN
6 S FULNAME=$$NAME^TIULO(DFN)
7 S FIRSTN=$P($P(FULNAME,",",2)," ",1)
8 I FIRSTN="" S FIRSTN="UNKNOWN"
9 Q FIRSTN
10 ;
11BMI(DFN) ;Patient body mass index
12 N PTWT,PTHT,BMI
13 S PTWT=$$WEIGHT^TIULO(DFN)
14 S PTHT=$$HEIGHT^TIULO(DFN)
15 I PTWT,PTHT D
16 .S BMI=703*(PTWT/(PTHT**2))+.5\1
17 E S BMI="UNK"
18 Q BMI
19 ;
20PATID(DFN) ;Patient id (either SSN or HRN)
21 ;At this stage it returns SSN if it exits. Will probably need to
22 ;be modified to return HRN even if SSN exists.
23 N PATID
24 S PATID=$$SSN^TIULO(DFN)
25 I PATID["SSN" D
26 .S PATID=$$HRN^AUPNPAT3(DFN,DUZ(2))
27 .I PATID,$L(PATID)<7 S PATID="HRN-"_PATID Q
28 .S PATID="UNKNOWN"
29 Q PATID
Note: See TracBrowser for help on using the repository browser.