source: BMXNET_RPMS_dotNET_UTILITIES-BMX/trunk/m/BMXUTL2.m@ 1639

Last change on this file since 1639 was 1209, checked in by Sam Habiel, 13 years ago

BMXMON fix; updated all routines to v 2.31

File size: 933 bytes
RevLine 
[645]1BMXUTL2 ; IHS/OIT/HMW - UTIL: PATIENT INFO ;
[1209]2 ;;2.31;BMX;;Jul 25, 2011
[645]3 ;;Stolen from:* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
4 ;; UTILITY: PATIENT FUNCTIONS: CONTRAS, INPATIENT, HIDOSE.
5 ;
6NEXTAPPT(BMXDFN) ;EP
7 ;---> Return patient's next appointment from Scheduling Package.
8 ;---> Parameters:
9 ; 1 - BMXDFN (req) Patient's IEN (BMXDFN).
10 ;
11 Q:'$G(BMXDFN) ""
12 Q:'$D(^DPT(BMXDFN)) ""
13 ;
14 N BMXAPPT,BMXDT,BMXYES
15 S BMXDT=DT+.2400,BMXYES=0
16 F S BMXDT=$O(^DPT(BMXDFN,"S",BMXDT)) Q:'BMXDT!(BMXYES) D
17 .N BMXDATA,BMXOI,X
18 .S BMXDATA=$G(^DPT(BMXDFN,"S",BMXDT,0))
19 .Q:BMXDATA=""
20 .;
21 .;---> Quit if appointment is cancelled.
22 .Q:$P(BMXDATA,U,2)["C"
23 .;
24 .S X=0 F S X=$O(^SC(+BMXDATA,"S",BMXDT,1,X)) Q:'X D
25 ..Q:+$G(^SC(+BMXDATA,"S",BMXDT,1,X,0))'=BMXDFN
26 ..S BMXYES=BMXDT_U_+BMXDATA
27 ;
28 Q:'BMXYES ""
29 ;
30 S BMXAPPT=$$FMTE^XLFDT(+BMXYES,"1P")_" with "
31 S BMXAPPT=BMXAPPT_$P($G(^SC($P(BMXYES,U,2),0)),U)
32 Q BMXAPPT
Note: See TracBrowser for help on using the repository browser.