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

SCAPMC5.m

Go to the documentation of this file.
  1. SCAPMC5 ;ALB/REW - Team API's:TMAU ; JUL 3, 1995
  1. ;;5.3;Scheduling;**41**;AUG 13, 1993
  1. ;;1.0
  1. TMAU(SCAU,SCDATES,SCPURPA,SCLIST,SCERR) ; -- list of teams for autolink
  1. ; input:
  1. ; SCAU = variable pointer to TEAM AUTOLINK file (#404.56)
  1. ; e.g. 10866;VA(200 for the practitioner with duz=10866
  1. ; SCDATES("BEGIN") = begin date to search (inclusive)
  1. ; [default: TODAY]
  1. ; ("END") = end date to search (inclusive)
  1. ; [default: TODAY]
  1. ; ("INCL") = 1: only use teams who were active
  1. ; for entire date range
  1. ; 0: anytime in date range
  1. ; [default: 1]
  1. ; SCPURPA -array of pointers to team purpose file 403.47
  1. ; if none are defined - returns all teams
  1. ; if @SCPURPA@('exclude') is defined - exclude listed teams
  1. ; SCLIST -array name to store list
  1. ; [ex. ^TMP("SCTM",$J)]
  1. ;
  1. ; SCERR = array NAME to store error messages.
  1. ; [ex. ^TMP("ORXX",$J)]
  1. ;
  1. ; Output:
  1. ; SCLIST() = array of teams
  1. ; Format:
  1. ; Subscript: Sequential # from 1 to n
  1. ; Piece Description
  1. ; 1 IEN of TEAM file entry
  1. ; 2 Name of team
  1. ; 3 current effective date
  1. ; 4 current inactivate date (if any)
  1. ;
  1. ; SCERR() = Array of DIALOG file messages(errors) .
  1. ; Foramt:
  1. ; @SCERR@(0)= Number of errors, undefined if none
  1. ; Subscript: Sequential # from 1 to n
  1. ; Piece Description
  1. ; 1 IEN of DIALOG file
  1. ; Returned: 1 if ok, 0 if error
  1. ;
  1. ST N SCTM,SCTM0,SCPRP,SCTMAU
  1. N SCLSEQ,SCN,SCESEQ,SCPARM,SCP,SCBEGIN,SCEND,SCINCL,SCDTS
  1. G:'$$OKDATA PRACQ ;check/setup variables
  1. ;
  1. ; -- loop through autolink assignments
  1. S SCTM=0
  1. F S SCTM=$O(^SCTM(404.56,"AC",SCAU,SCTM)) Q:'SCTM D
  1. .S SCTM0=$G(^SCTM(404.51,SCTM,0))
  1. .Q:SCTM0=""
  1. .S SCPRP=$P(SCTM0,U,3)
  1. .Q:'$$OKARRAY^SCAPU1(.SCPURPA,SCPRP)
  1. .S ACTHIST=$$ACTHIST^SCAPMCU2(404.58,SCTM,SCDATES,.SCERR,"SCTMAU")
  1. .IF ACTHIST>0 D
  1. ..Q:$D(@SCLIST@("SCTM",SCTM,$P(ACTHIST,U,3)))
  1. ..S SCN=$G(@SCLIST@(0),0)+1
  1. ..S @SCLIST@(0)=SCN
  1. ..S @SCLIST@(SCN)=SCTM_U_$P(^SCTM(404.51,SCTM,0),U,1)_U_$P(ACTHIST,U,3,4)
  1. ..S @SCLIST@("SCTM",SCTM,$P(ACTHIST,U,3),SCN)=""
  1. PRACQ Q $G(@SCERR@(0))<1
  1. OKDATA() ;check/setup variables
  1. N SCOK
  1. S SCOK=1
  1. D INIT^SCAPMCU1(.SCOK) ; set default dates & error array (if undefined)
  1. IF '$D(^SCTM(404.56,"AC",SCAU)) D S SCOK=0
  1. . S SCPARM("AUTOLINK")=SCAU
  1. . D ERR^SCAPMCU1(SCESEQ,4045601,.SCPARM,"",.SCERR)
  1. ; -- is it a valid SCAU passed (Error # 4045601 in DIALOG file)
  1. Q SCOK