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

SCAPMC13.m

Go to the documentation of this file.
  1. SCAPMC13 ;ALB/REW - Team API's: TMPR ; JUN 30, 1995 [10/22/98 2:10pm]
  1. ;;5.3;Scheduling;**41,157**;AUG 13, 1993
  1. ;
  1. TMPR(SC200,SCDATES,SCPURPA,SCLIST,SCERR) ; -- list of teams for a pract
  1. ; input:
  1. ; SC200 = ien of NEW PERSON file(#200) [required]
  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 patients who were assigned to
  1. ; team 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("SCPT",$J)]
  1. ;
  1. ; SCERR = array NAME to store error messages.
  1. ; [ex. ^TMP("ORXX",$J)]
  1. ;
  1. ; Output:
  1. ; SCLIST() = array of teams (includes SCTM xref)
  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 IEN of file #404.52 (Pos Assign History)
  1. ; 4 current effective date
  1. ; 5 current inactivate date (if any)
  1. ; 6 pointer to 403.47 (purpose)
  1. ; 7 Name of Purpose
  1. ; Subscript: "SCTM",SCTM,IEN =""
  1. ;
  1. ; SCERR() = Array of DIALOG file messages(errors) .
  1. ; @SCERR@(0) = number of errors, undefined if none
  1. ; Format:
  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. ;
  1. ST N SCTM,SCPTA,SCPTA0,SCTP,SCTMPR
  1. N SCLSEQ,SCN,SCESEQ,SCPARM,SCP,SCBEGIN,SCEND,SCINCL,SCDTS
  1. ; -- initialize control variables
  1. G:'$$OKDATA PRACQ
  1. ; -- loop through position assignments (404.52) for pract
  1. S SCTPA=0
  1. F S SCTPA=$O(^SCTM(404.52,"C",SC200,SCTPA)) Q:'SCTPA D
  1. .S SCTP=$P($G(^SCTM(404.52,SCTPA,0)),U,1)
  1. .Q:'SCTP
  1. .S SCTM=$P($G(^SCTM(404.57,+$G(SCTP),0)),U,2)
  1. .Q:'SCTM
  1. .;;bp/djb Fix error due to bad pointers in TEAM field of
  1. .;; TEAM POSITION file
  1. .;;new code begin
  1. .Q:'$D(^SCTM(404.51,SCTM,0))
  1. .;;new code end
  1. .S SCP=$P(^SCTM(404.51,SCTM,0),U,3)
  1. .;;bp/djb Fix error due to calling rtn not initializing SCPURPA in
  1. .;; parameter list. Change line to pass SCPURPA by reference.
  1. .;;changed code begin
  1. .Q:'$$OKARRAY^SCAPU1(.SCPURPA,SCP)
  1. .;;changed code end
  1. .S ACTHIST=$$ACTHIST^SCAPMCU2(404.52,SCTP,SCDATES,.SCERR,"SCTMPR")
  1. .Q:'ACTHIST
  1. .D BLDTM^SCAPMC4(SCTM,SCDATES,ACTHIST,.SCLIST,.SCERR)
  1. PRACQ Q $G(@SCERR@(0))<1
  1. ;
  1. OKDATA() ;setup/check variables
  1. N SCOK
  1. S SCOK=1
  1. D INIT^SCAPMCU1(.SCOK) ; set default dates & error array (if undefined)
  1. IF '$D(^VA(200,+$G(SC200),0)) D S SCOK=0
  1. . S SCPARM("PRACTITIONER")=$G(SC200,"Undefined")
  1. . D ERR^SCAPMCU1(.SCESEQ,4045101,.SCPARM,"",.SCERR)
  1. Q SCOK
  1. ;