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

SCAPMC9.m

Go to the documentation of this file.
  1. SCAPMC9 ;ALB/REW - Team API's:PRCL ; JUN 26, 1995
  1. ;;5.3;Scheduling;**41,112,520**;AUG 13, 1993;Build 26
  1. ;;1.0
  1. PRCL(SC44,SCDATES,SCPOSA,SCUSRA,SCROLEA,SCLIST,SCERR) ;-- list of practitioners for clinic
  1. ; input:
  1. ; SC44 = ien of CLINIC <FILE#44> [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. ; SCPOSA= array of positions to include reverse with scposa('exclude')
  1. ; SCUSRA= array of usr classes included reverse with scusra('exclude')
  1. ; SCROLEA= array of roles included reverse with SCROLEA('exclude')
  1. ; SCERR = array NAME to store error messages.
  1. ; [ex. ^TMP("ORXX",$J)]
  1. ;
  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. ; @sclist@('scpr',sc200,sctp,scact,scn)=""
  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. ;
  1. ST N SCPOSNM,SCTP,SCPOS0,SCOK,SCND,SCU,SCR,SCPRCL
  1. N SCLSEQ,SCN,SCESEQ,SCPARM,SCP,SCBEGIN,SCEND,SCINCL,SCDTS
  1. ; -- initialize control variables
  1. G:'$$OKDATA PRACQ ; check/setup variables
  1. ; -- loop through team positions
  1. S SCTP=0
  1. F S SCTP=$O(^SCTM(404.57,"E",SC44,SCTP)) Q:SCTP="" D
  1. .Q:'$$OKARRAY^SCAPU1(.SCPOSA,SCTP)
  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. .IF 'SCTP D Q
  1. ..S SCPARM("Position")=$G(SCTP,"Undefined")
  1. ..D ERR^SCAPMCU1(.SCESEQ,4045101,.SCPARM,"",SCERR)
  1. .ELSE D
  1. ..S SCX=$$ACTHIST^SCAPMCU2(404.52,SCTP,SCDATES,.SCERR,"SCPRCL")
  1. ..S:SCX X=$$PRTP^SCAPMC8(SCTP,SCDATES,.SCLIST,.SCERR)
  1. PRACQ Q $G(@SCERR@(0))<1
  1. OKDATA() ;check/setup variables - return 1 if ok/ 0 if error
  1. N SCOK
  1. S SCOK=1
  1. D INIT^SCAPMCU1(.SCOK) ; set default dates & error array (if undefined)
  1. ;
  1. IF '$D(^SC(+$G(SC44),0)) D S SCOK=0
  1. . S SCPARM("CLINIC")=$G(SC44,"Undefined")
  1. . D ERR^SCAPMCU1(.SCESEQ,4045101,.SCPARM,"",.SCERR)
  1. Q SCOK