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

BMCRR81.m

Go to the documentation of this file.
BMCRR81 ; IHS/PHXAO/TMJ - PROCESS REFERRAL LIST ;  
 ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
 ;IHS/ITSC/FCJ ADDED TEST FOR SR
 ;
 ;
START ;
 S (BMCBT,BMCBTH)=$H,BMCJOB=$J,BMCRCNT=0
 D PROCESS,END
 Q
 ;
PROCESS ;
V ; Run by visit date
 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
 ;
END ;
 S BMCET=$H
 Q
R1 ;
 S BMCREF="" F  S BMCREF=$O(^BMCREF("B",BMCODAT,BMCREF)) Q:BMCREF'=+BMCREF  S BMCRREC=^BMCREF(BMCREF,0),DFN=$P(BMCRREC,U,3) D PROCR
 Q
PROCR ;
 Q:$P(BMCRREC,U,4)="N"
 Q:$P(BMCRREC,U,15)="X"
 Q:$P($G(^BMCREF(BMCREF,1)),U)'=""  ;QUIT IF SR
 I '$D(^BMCDX("AD",BMCREF)) Q  ;no icd codes/cpt codes
 S (BMCX,BMCFOUN)=0 F  S BMCX=$O(^BMCDX("AD",BMCREF,BMCX)) Q:BMCX'=+BMCX!(BMCFOUN)  S BMCFOUN=$$TXC^ATXTXCHK(+^BMCDX(BMCX,0),BMCHCTAX)
 Q:'BMCFOUN
 S ^XTMP("BMCRR8",BMCJOB,BMCBTH,"DATA HITS",$P(^DPT(DFN,0),U),DFN,BMCREF)=""
 Q