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

BMCRR91.m

Go to the documentation of this file.
BMCRR91 ; IHS/PHXAO/TMJ - PROCESS REFERRAL LIST ;   
 ;;4.0;REFERRED CARE INFO SYSTEM;**9**;JAN 09, 2006;Build 101
 ;IHS/ITSC/FCJ ADDED DATE RANGE SORT
 ;
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 BMCREF="" F  S BMCREF=$O(^BMCREF("B",BMCODAT,BMCREF)) Q:BMCREF'=+BMCREF  S BMCRREC=^BMCREF(BMCREF,0) D PROC
 Q
 ;
END ;
 S BMCET=$H
 Q
PROC ;
 S BMCRREC=^BMCREF(BMCREF,0),DFN=$P(BMCRREC,U,3)
 Q:$P(BMCRREC,U,4)="N"
 ;Q:$P(BMCRREC,U,15)'="A"   ;BMC*4.0*9 IHS.OIT.FCJ
 Q:($P(BMCRREC,U,15)="C1")!($P(BMCRREC,U,15)="X")  ;QUIT IF NOT ACTIVE OR APPROVED ;BMC*4.0*9 IHS.OIT.FCJ
 ;get sort value
 S BMCSORT=""
 D @BMCSTYPE
 S:BMCSORT="" BMCSORT="??"
 S ^XTMP("BMCRR9",BMCJOB,BMCBTH,"DATA HITS",BMCSORT,BMCREF)="",BMCRCNT=BMCRCNT+1
 Q
B ;sort by begin date
 S BMCSORT=$$AVDOS^BMCRLU(BMCREF,"I")
 S:BMCSORT="" BMCSORT="??"
 Q
I ;sort by date initiated
 S BMCSORT=$P(BMCRREC,U)
 Q