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

BPCRC2.m

Go to the documentation of this file.
BPCRC2 ; IHS/OIT/MJL - REFERRED CARE GUI RPC ROUTINES ;
 ;;1.5;BPC;;MAY 26, 2005
 ;
RCISPARM(BPCRES,BPCSITE) ;EP CALL FROM REMOTE PROC: BPC GETRCISITEPARAM
 ;
EN2 ;
 S XWBWRAP=1,BPCSITE=$G(BPCSITE)
 I BPCSITE="" S BPCRES(1)=-1,BPCRES(2)="No Site ID Received!" D KILL Q
 S BPCX=$G(^BMCPARM(BPCSITE,0))
 I BPCX="" S BPCRES(1)=-1,BPCRES(2)="No RCIS Site Parameter Data Available!" D KILL Q
 S BPCRES(1)=1,BPCRES(2)=BPCX
 D KILL
 Q
SCATLIST(BPCRES,BPCX,BPCMAX,BPCMORE,BPCPARAM) ;EP CALL FROM REMOTE PROC: BPC GETLOCALSERVICECAT
 ;
 S BPCGUI=1
EN1 ;
 S U="^",XWBWRAP=1,BPCCTR=0,BPCSUB=$J,BPCC="",BPCMORE=$G(BPCMORE),BPCGUI=$G(BPCGUI),BPCMAX=$G(BPCMAX),BPCX=$G(BPCX),BPCPARAM=$G(BPCPARAM),BPCLEN=$L(BPCX)
 S BPCRES="^BPCRES("_BPCSUB_")",BPCN=""
 S:'BPCMAX BPCMAX=$S(BPCGUI:50,1:1E10)
 K ^BPCRES(BPCSUB)
 I BPCX'="" I $D(^BMCLCAT("C",BPCX)) S BPCFLG=0 D GETSCAT I BPCFLG D KILL Q
 S:BPCX'="" BPCN=$O(^BMCLCAT("B",BPCX),-1)
 I BPCMORE'="" D MORESCAT,KILL Q
 D GETSCAT1,KILL
 Q
GETSCAT ;
 S BPCIEN="" F  S BPCIEN=$O(^BMCLCAT("C",BPCX,BPCIEN)) Q:BPCIEN=""  S BPCN=$P($G(^BMCLCAT(BPCIEN,0)),U,1) D SETSCAT
 S ^BPCRES(BPCSUB,0)=BPCCTR
 S:BPCCTR BPCFLG=1
 Q
GETSCAT1 ;
 S BPCFLAG=0 F  S BPCN=$O(^BMCLCAT("B",BPCN)) Q:BPCN=""  D GETSCAT2 Q:BPCFLAG
 S ^BPCRES(BPCSUB,0)=BPCCTR
 Q
GETSCAT2 ;
 I BPCX'="",$E(BPCN,1,BPCLEN)'=BPCX S BPCFLAG=1 Q
 S BPCIEN="" F  S BPCIEN=$O(^BMCLCAT("B",BPCN,BPCIEN)) Q:BPCIEN=""  D SETSCAT Q:BPCFLAG
 Q
SETSCAT ;
 I BPCCTR=BPCMAX D SETMORE S BPCFLAG=1 Q
 S BPCCTR=BPCCTR+1,^BPCRES(BPCSUB,BPCCTR)=BPCN_U_BPCIEN
 Q
MORESCAT ;
 S BPCFLAG=0,BPCN=$P(BPCMORE,"|",1),BPCIEN=$P(BPCMORE,"|",2) D SETSCAT Q:BPCFLAG
 F  S BPCIEN=$O(^BMCLCAT("B",BPCN,BPCIEN)) Q:BPCIEN=""  D SETSCAT Q:BPCFLAG
 Q:BPCFLAG
 D GETSCAT1
 Q
 ;
VNDLIST(BPCRES,BPCX,BPCMAX,BPCMORE,BPCPARAM) ;EP CALL FROM REMOTE PROC: BPC GETVENDORS
 ;
 S BPCGUI=1
EN ;
 S U="^",XWBWRAP=1,BPCCTR=0,BPCSUB=$J,BPCC="",BPCMORE=$G(BPCMORE),BPCGUI=$G(BPCGUI),BPCMAX=$G(BPCMAX),BPCX=$G(BPCX),BPCPARAM=$G(BPCPARAM),BPCLEN=$L(BPCX)
 S BPCRES="^BPCRES("_BPCSUB_")",BPCN=""
 S:'BPCMAX BPCMAX=$S(BPCGUI:50,1:1E10)
 K ^BPCRES(BPCSUB)
 I BPCX'="" I $D(^AUTTVNDR("C",BPCX)) S BPCFLG=0 D GETVNDR I BPCFLG D KILL Q
 S:BPCX'="" BPCN=$O(^AUTTVNDR("B",BPCX),-1)
 I BPCMORE'="" D MORE,KILL Q
 D GETVNDR1,KILL
 Q
G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