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

SCAPMC1.m

Go to the documentation of this file.
  1. SCAPMC1 ;ALB/REW - Team API's: PRTM ; JUN 26, 1995
  1. ;;5.3;Scheduling;**41**;AUG 13, 1993
  1. ;;1.0
  1. PRTM(SCTEAM,SCDATES,SCUSRA,SCROLEA,SCLIST,SCERR) ; -- practitioners for team
  1. ; input:
  1. ; SCTEAM = ien of TEAM [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 pracitioners who were on
  1. ; team for entire date range
  1. ; 0: anytime in date range
  1. ; [default: 1]
  1. ; SCUSRA = array of usr classes to use/exclude
  1. ; if $d(@scusra@('exclude')) -> list to exclude
  1. ; SCROLEA = array of roles to use/exclude
  1. ; SCERR = array NAME to store error messages.
  1. ; [ex. ^TMP("ORXX",$J
  1. ; Output:
  1. ; SCLIST() = array of practitioners
  1. ; Format:
  1. ; Subscript: Sequential # from 1 to n
  1. ; Piece Description
  1. ; 1 IEN of NEW PERSON file entry (#200)
  1. ; 2 Name of person
  1. ; 3 IEN of TEAM POSITION file (#404.57)
  1. ; 4 Name of Position
  1. ; 5 IEN OF USR CLASS(#8930) of POSITION (#404.57)
  1. ; 6 USR Class Name
  1. ; 7 IEN of STANDARD POSITION (#403.46)
  1. ; 8 Standard Role (Position) Name
  1. ; 9 Activation Date for 404.52 (not 404.59!)
  1. ; 10 Inactivation Date for 404.52
  1. ; 11 IEN of Position Ass History (404.52)
  1. ; 12 IEN of Preceptor Position
  1. ; 13 Name of Preceptor Position
  1. ;
  1. ; SCERR() = Array of DIALOG file messages(errors) .
  1. ; @SCERR(0)= Number of error(s), UNDEFINED if no errors
  1. ; Foramt:
  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. ; -- initialize control variables
  1. ;
  1. ST N SCPOSNM,SCTP,SCPOS0,SCOK,SCND,SCU,SCR,SCPRTM
  1. N SCLSEQ,SCN,SCESEQ,SCPARM,SCP,SCBEGIN,SCEND,SCINCL,SCDTS
  1. G:'$$OKDATA PRACQ ; setup/check variables
  1. ; -- loop through team positions
  1. S SCTP=0
  1. F S SCTP=$O(^SCTM(404.57,"C",SCTEAM,SCTP)) Q:'SCTP D
  1. .S SCND=$G(^SCTM(404.57,SCTP,0))
  1. .S SCU=$P(SCND,U,13)
  1. .Q:'$$OKUSRCL^SCAPU1(.SCUSRA,.SCU)
  1. .S SCR=$P(SCND,U,3)
  1. .Q:'$$OKARRAY^SCAPU1(.SCROLEA,.SCR)
  1. .Q:'$$ACTHIST^SCAPMCU2(404.52,SCTP,SCDATES,.SCERR,"SCPRTM")
  1. .Q:'$$PRTP^SCAPMC8(SCTP,SCDATES,.SCLIST,.SCERR)
  1. PRACQ Q $G(@SCERR@(0))<1
  1. OKDATA() ; setup/check variables - return 1 if ok; 0 if error
  1. N SCOK
  1. S SCOK=1
  1. D INIT^SCAPMCU1(.SCOK) ; default dates & error array if undefined
  1. IF '$D(^SCTM(404.51,+$G(SCTEAM),0)) D S SCOK=0
  1. . S SCPARM("TEAM")=$G(SCTEAM,"Undefined")
  1. . D ERR^SCAPMCU1(.SCESEQ,4045101,.SCPARM,"",.SCERR)
  1. Q SCOK