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

BSDU3.m

Go to the documentation of this file.
  1. BSDU3 ; IHS/ANMC/LJF - TEAM INFO UTILITIES ;
  1. ;;5.3;PIMS;;APR 26, 2002
  1. ;
  1. PROV(TEAM,DATES,LIST) ;EP; returns array in LIST of providers tied to team
  1. ;Only called if PCMM is used!!!!!!!!!!!!!
  1. ; TEAM=team ien
  1. ; DATES("BEGIN")=earliest date for provider on team
  1. ; DATES("END")=lastest date for provider
  1. ; DATES("INCL")=1 to get only those on team throughout date range
  1. ; =0 to get those on team sometime during date range
  1. N OKAY,XLIST,YLIST,POS,PRV,PLIST
  1. S LIST="^TMP(""SCRP"",$J,""LIST"")"
  1. K XLIST,@LIST
  1. ;
  1. ; find positions for team
  1. S OKAY=$$TPTM^SCAPMC(TEAM,.DATES,"","","XLIST","ERROR")
  1. ;
  1. ; loop thru positions to find providers
  1. S POS=0 F S POS=$O(XLIST("SCTP",TEAM,POS)) Q:'POS D
  1. . S POS0=$G(^SCTM(404.57,POS,0)) Q:'$L(POS0)
  1. . ;
  1. . ; find providers for position during date range
  1. . K YLIST S OKAY=$$PRTP^SCAPMC(POS,.SCDT,"YLIST","ERROR",1,0)
  1. . ;
  1. . ; loop thru providers found
  1. . S PRV=0 F S PRV=$O(YLIST(PRV)) Q:'PRV D
  1. .. S @LIST@(0)=$G(@LIST@(0))+1
  1. .. S @LIST@(@LIST@(0))=YLIST(PRV)
  1. ;
  1. Q LIST
  1. ;
  1. CLINICS(PROV,LIST) ;EP; returns array of clinics for this provider
  1. ; PROV=provider ien; LIST returns as array
  1. NEW X
  1. S X=0 F S X=$O(^SC("AIHSDPR",PROV,X)) Q:'X D
  1. . S Y=$O(^SC("AIHSDPR",PROV,X,0)) Q:'Y ;quit if bad xref
  1. . Q:$G(^SC("AIHSDPR",PROV,X,Y))'=1 ;quit if not default provider
  1. . S LIST(X)=""
  1. Q