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

BMCOUTR1.m

Go to the documentation of this file.
BMCOUTR1 ; IHS/PHXAO/TMJ - PROCESS OUTSIDE REFERRAL LIST ;    
 ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
 ;
 ;
START ;
 S (BMCBT,BMCBTH)=$H,BMCJOB=$J,BMCRCNT=0
 D PROCESS,END
 Q
 ;
PROCESS ;
 S BMCODAT=$O(^BMCREF("B",BMCSD)) I BMCODAT="" S BMCET=$H Q
 S BMCODAT=BMCSD_".9999" F  S BMCODAT=$O(^BMCREF("B",BMCODAT)) Q:BMCODAT=""!((BMCODAT\1)>BMCED)  D R1
 Q
 ;
R1 ;
 S BMCRDT="" F  S BMCRDT=$O(^BMCREF("B",BMCODAT,BMCRDT)) Q:BMCRDT'=+BMCRDT  S BMCRREC=^BMCREF(BMCRDT,0) D PROC
 Q
END ;
 S BMCET=$H
 Q
PROC ;
 Q:'$D(^BMCREF(BMCRDT,0))
 S BMCRREC=^BMCREF(BMCRDT,0),DFN=$P(BMCRREC,U,3),BMCDATE=$P(BMCRREC,U,1)
 ;
 S BMCREF=$P(BMCRREC,U,2)
 S BMCREQP=$P($G(BMCRREC),U,6) ;IHS REQUESTING PROVIDER
 Q:BMCREQP'=""  ;Quit if a Req Provider Exists
 Q:$P(^BMCREF(BMCRDT,0),U,4)="N"
 Q:$P(^BMCREF(BMCRDT,0),U,5)'=BMCFAC
 S ^XTMP("BMCOUTRP",BMCJOB,BMCBTH,"DATA HITS",BMCDATE,$P(^DPT(DFN,0),U),BMCRDT)="",BMCRCNT=BMCRCNT+1
 Q