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

SCAPMC10.m

Go to the documentation of this file.
  1. SCAPMC10 ;ALB/REW - Team API's: PRPT ; JUN 26, 1995
  1. ;;5.3;Scheduling;**41,1015**;AUG 13, 1993;Build 21
  1. ;;1.0
  1. PRPT(DFN,SCDATES,SCPOSA,SCUSRA,SCROLEA,SCPURPA,SCLIST,SCERR,SCYESCL) ; -- practs for patient (No support for scyescl)
  1. ; input:
  1. ; DFN = ien of PATIENT <FILE#2> [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 usr classes included reverse with scusra('exclude')
  1. ;SCPURPA - array of pointers to team purpose file 403.47
  1. ; if none definded - retruns all teams
  1. ; if @scpurpa@('exclude') is defined - exclude listed teams
  1. ; SCERR = array NAME to store error messages.
  1. ; [ex. ^TMP("ORXX",$J)]
  1. ; SCYESCL=Boolean indicator to include patients' enrollments in
  1. ; clinics - [0:strong recommendation/default=NO,1=YES] **NOT SUPPORTED **
  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. ;
  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 SCTP,SCPOS0,SCOK,SCTEAMS,INDX,SCPRACTS,SCND,SCU,SCR,SCPOSIT,SCX,SCTP,SC44
  1. N SCLSEQ,SCN,SCESEQ,SCPARM,SCP,SCBEGIN,SCEND,SCINCL,SCDTS
  1. N SCENROLL,SCPOSIT,PT,ENR
  1. G:'$$OKDATA PRPTQ ; check/setup variables
  1. ; put list of patient's positions in SCPOSIT()
  1. IF '$$TPPT^SCAPMC23(DFN,.SCDATES,.SCPOSA,.SCUSA,.SCPURPA,.SCROLEA,.SCYESCL,"SCPOSIT",.SCERR) G PRPTQ
  1. F INDX=1:1:$G(SCPOSIT(0)) S SCX=$G(SCPOSIT(INDX)) D
  1. .IF 'SCX D Q
  1. ..S SCPARM("Position Xref")=$G(SCX)
  1. ..D ERR^SCAPMCU1(.SCESEQ,,SCPARM,"",.SCERR)
  1. .S SCTP=$P(SCX,U,1)
  1. .S PT("BEGIN")=$S(SCBEGIN>$P(SCX,U,5):SCBEGIN,1:$P(SCX,U,5))
  1. .S PT("END")=$S('$P(SCX,U,6):SCEND,(SCEND<$P(SCX,U,6)):SCEND,1:$P(SCX,U,6))
  1. .S PT("INCL")=SCINCL
  1. .;go thru each pt team position assignment
  1. .Q:'$$PRTP^SCAPMC8(SCTP,"PT",.SCLIST,.SCERR)
  1. PRPTQ Q $G(@SCERR@(0))<1
  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. IF '$D(^DPT(+$G(DFN),0)) D S SCOK=0
  1. . S SCPARM("PATIENT")=$G(DFN,"Undefined")
  1. . D ERR^SCAPMCU1(.SCESEQ,4045101,.SCPARM,"",.SCERR)
  1. S SCPOSA=$G(SCPOSA,"")
  1. S SCUSRA=$G(SCUSRA,"")
  1. Q SCOK