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

BMCRCRV1.m

Go to the documentation of this file.
BMCRCRV1 ; IHS/PHXAO/TMJ - PROCESS 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 BMCREF="" F  S BMCREF=$O(^BMCCOM("AC",BMCREF)) Q:BMCREF=""
 ;S BMCODAT=BMCSD_".9999" F  S BMCODAT=$O(^BMCCOM("B",BMCODAT)) Q:BMCODAT=""!((BMCODAT\1)>BMCED)  D R1
 I BMCREF="" S BMCET=$H Q  D R1
 Q
 ;
R1 ;
 ;S BMCCDT="" F  S BMCCDT=$O(^BMCCOM("B",BMCODAT,BMCCDT)) Q:BMCCDT'=+BMCCDT  S BMCRREC=^BMCCOM(BMCCDT,0) D PROC
 S BMCIEN="" F  S BMCIEN=$O(^BMCCOM("AC",BMCREF,BMCIEN)) Q:BMCIEN'=+BMCIEN  S BMCRREC=^BMCCOM(BMCIEN,0) D PROC
 Q
END ;
 S BMCET=$H
 Q
PROC ;
 S BMCCDT=$P(BMCRREC,U,1),DFN=$P(BMCRREC,U,2)
 S BMCODAT=BMCCDT Q:BMCODAT=""!(BMCODATE\1)>BMCED
 ;S BMCRREC=^BMCCOM(BMCCDT,0),DFN=$P(BMCRREC,U,2)
 Q:$P(^BMCREF(BMCREF,0),U,4)="N"
 S BMCDATE=$S($$AVDOS^BMCRLU(BMCCDT,"I")]"":$$AVDOS^BMCRLU(BMCCDT,"I"),1:"<none>")
 S ^XTMP("BMCRCRV",BMCJOB,BMCBTH,"DATA HITS",BMCDATE,$P(^DPT(DFN,0),U),BMCCDT)="",BMCRCNT=BMCRCNT+1
 Q