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

SCMCDD2.m

Go to the documentation of this file.
  1. SCMCDD2 ;ALB/REW - DD Calls used by PCMM ; 27 March 1996
  1. ;;5.3;Scheduling;**41,107,520**;AUG 13, 1993;Build 26
  1. ;1
  1. USEPCDEF(SCCL) ;how should pc practitioner be used for clinic
  1. ; return 2=always default 1=default if no provider listed 0 -never
  1. Q 2
  1. SETSCTM(SCTP,SCCL,SCTMNM) ;create 'TEAM' x-ref for Hospital Location File (#44)
  1. ; x=sccl, da=sctp sctmnm=name of team
  1. Q:'$G(SCTP)!('$G(SCCL))
  1. S SCTMNM=$G(SCTMNM,$P(^SCTM(404.51,+$P(^SCTM(404.57,SCTP,0),U,2),0),U))
  1. S:$L(SCTMNM) ^SC("TEAM",SCTMNM,+SCCL)=""
  1. Q
  1. ;
  1. KILLSCTM(SCTP,SCCL,SCTMNM) ;kill 'TEAM' x-ref for File #44 (if no other positions from team have this as associated clinic)
  1. ; x=sccl, da=sctp sctmnm=name of team
  1. N SCTM
  1. Q:'$G(SCTP)!('$G(SCCL))
  1. S SCTM=+$P(^SCTM(404.57,SCTP,0),U,2)
  1. S SCTMNM=$G(SCTMNM,$P(^SCTM(404.51,+SCTM,0),U))
  1. K:$L(SCTMNM)&('$$OKTMCL(SCTM,SCTP,SCCL)) ^SC("TEAM",SCTMNM,+SCCL)
  1. Q
  1. OKTMCL(SCTM,SCTP,SCCL) ;does team have another position with this clinic as an assoicated clinic?
  1. N SCXTP,SCOK
  1. S SCOK=0
  1. S SCXTP=0
  1. F S SCXTP=$O(^SCTM(404.57,"E",SCCL,SCXTP)) Q:('SCXTP)!(SCXTP=SCTP) D
  1. .I $P(^SCTM(404.57,SCXTP,0),U,2)'=SCTM Q
  1. .S SCOK=1
  1. Q SCOK
  1. STSCTMNM(SCTM,SCTMNM) ;if team name changes - set for 'TEAM' xrefs for file#44
  1. ; sctm=da sctmnm=x
  1. Q:'$G(SCTM)!(SCTMNM="")
  1. N SCTPNM,SCCL
  1. S SCTPNM=""
  1. F S SCTPNM=$O(^SCTM(404.57,"ATMPOS",SCTM,SCTPNM)) Q:SCTPNM="" D
  1. .S SCTP=$O(^SCTM(404.57,"ATMPOS",SCTM,SCTPNM,0)) ;note: name is unique
  1. .S SCCL=$P($G(^SCTM(404.57,+SCTP,0)),U,9)
  1. .D:SCCL SETSCTM(SCTP,SCCL,SCTMNM)
  1. Q
  1. KLSCTMNM(SCTM,SCTMNM) ;if team name changes - kill 'TEAM' xrefs for file #44
  1. ; sctm=da sctmnm=x
  1. Q:'$G(SCTM)!(SCTMNM="")
  1. N SCTPNM,SCCL
  1. S SCTPNM=""
  1. F S SCTPNM=$O(^SCTM(404.57,"ATMPOS",SCTM,SCTPNM)) Q:SCTPNM="" D
  1. .S SCTP=$O(^SCTM(404.57,"ATMPOS",SCTM,SCTPNM,0)) ;note: name is unique
  1. .S SCCL=$P($G(^SCTM(404.57,+SCTP,0)),U,9)
  1. .K:SCCL ^SC("TEAM",SCTMNM)
  1. Q