Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BPC7OGMU

BPC7OGMU.m

Go to the documentation of this file.
  1. BPC7OGMU ; IHS/OIT/MJL - Interim report rpc memo utility 6/6/97 16:15 ;
  1. ;;1.5;BPC;;MAY 26, 2005
  1. ;;
  1. ;;5.2;LAB SERVICE;**187**;Sep 27, 1994
  1. ;
  1. NEWOLD(Y,DFN) ; from ORWLRR
  1. N LRDFN
  1. D DEMO^BPC7OGU(DFN,.LRDFN)
  1. S Y=$$NEWEST(LRDFN)_U_$$OLDEST(LRDFN)
  1. Q
  1. ;
  1. NEWEST(LRDFN) ;
  1. N IDT,FIRSTCH,FIRSTMI
  1. S (FIRSTCH,FIRSTMI)=""
  1. S IDT=0 F S IDT=$O(^LR(LRDFN,"CH",IDT)) Q:IDT<1 I $P($G(^(IDT,0)),U,3) S FIRSTCH=9999999-IDT Q
  1. S IDT=0 F S IDT=$O(^LR(LRDFN,"MI",IDT)) Q:IDT<1 I $P($G(^(IDT,0)),U,1) S FIRSTMI=9999999-IDT Q
  1. I FIRSTCH>FIRSTMI Q FIRSTCH
  1. I FIRSTCH'>FIRSTMI Q FIRSTMI
  1. Q ""
  1. ;
  1. OLDEST(LRDFN) ;
  1. N IDT,FIRSTCH,FIRSTMI
  1. S (FIRSTCH,FIRSTMI)=""
  1. S IDT="" F S IDT=$O(^LR(LRDFN,"CH",IDT),-1) Q:IDT="" I $P($G(^(IDT,0)),U,3) S FIRSTCH=9999999-IDT Q
  1. S IDT="" F S IDT=$O(^LR(LRDFN,"MI",IDT),-1) Q:IDT="" I $P($G(^(IDT,0)),U,1) S FIRSTMI=9999999-IDT Q
  1. I FIRSTMI="" Q FIRSTCH
  1. I FIRSTCH="" Q FIRSTMI
  1. I FIRSTCH<FIRSTMI Q FIRSTCH
  1. I FIRSTCH'<FIRSTMI Q FIRSTMI
  1. Q ""