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.
  1. BMCRCRV1 ; IHS/PHXAO/TMJ - PROCESS REFERRAL LIST ;
  1. ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
  1. ;
  1. ;
  1. ;
  1. START ;
  1. S (BMCBT,BMCBTH)=$H,BMCJOB=$J,BMCRCNT=0
  1. D PROCESS,END
  1. Q
  1. ;
  1. PROCESS ;
  1. S BMCREF="" F S BMCREF=$O(^BMCCOM("AC",BMCREF)) Q:BMCREF=""
  1. ;S BMCODAT=BMCSD_".9999" F S BMCODAT=$O(^BMCCOM("B",BMCODAT)) Q:BMCODAT=""!((BMCODAT\1)>BMCED) D R1
  1. I BMCREF="" S BMCET=$H Q D R1
  1. Q
  1. ;
  1. R1 ;
  1. ;S BMCCDT="" F S BMCCDT=$O(^BMCCOM("B",BMCODAT,BMCCDT)) Q:BMCCDT'=+BMCCDT S BMCRREC=^BMCCOM(BMCCDT,0) D PROC
  1. S BMCIEN="" F S BMCIEN=$O(^BMCCOM("AC",BMCREF,BMCIEN)) Q:BMCIEN'=+BMCIEN S BMCRREC=^BMCCOM(BMCIEN,0) D PROC
  1. Q
  1. END ;
  1. S BMCET=$H
  1. Q
  1. PROC ;
  1. S BMCCDT=$P(BMCRREC,U,1),DFN=$P(BMCRREC,U,2)
  1. S BMCODAT=BMCCDT Q:BMCODAT=""!(BMCODATE\1)>BMCED
  1. ;S BMCRREC=^BMCCOM(BMCCDT,0),DFN=$P(BMCRREC,U,2)
  1. Q:$P(^BMCREF(BMCREF,0),U,4)="N"
  1. S BMCDATE=$S($$AVDOS^BMCRLU(BMCCDT,"I")]"":$$AVDOS^BMCRLU(BMCCDT,"I"),1:"<none>")
  1. S ^XTMP("BMCRCRV",BMCJOB,BMCBTH,"DATA HITS",BMCDATE,$P(^DPT(DFN,0),U),BMCCDT)="",BMCRCNT=BMCRCNT+1
  1. Q