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

SCAPMC12.m

Go to the documentation of this file.
  1. SCAPMC12 ;ALB/REW - Team API's: TPPR ; 2/10/00 8:14am
  1. ;;5.3;Scheduling;**41,204,1015**;AUG 13, 1993;Build 21
  1. ;;1.0
  1. TPPR(SC200,SCDATES,SCPURPA,SCROLEA,SCLIST,SCERR) ; -- positions 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. ; SCROLEA - array of pointers to standard position file 403.46
  1. ; if none are defined - returns all positions
  1. ; if @SCROLEA@('exclude') is defined - exclude listed roles
  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 positions (includes SCTP xref)
  1. ; Format:
  1. ; Subscript: Sequential # from 1 to n
  1. ; Piece Description
  1. ; 1 IEN of TEAM POSITION File (#404.57)
  1. ; 2 Name of Position
  1. ; 3 IEN of Team #404.51
  1. ; 4 IEN of file #404.59 (Tm Pos History)
  1. ; 5 current effective date
  1. ; 6 current inactivate date (if any)
  1. ; 7 pointer to 403.46 (role)
  1. ; 8 Name of Standard Role
  1. ; 9 pointer to User Class (#8930)
  1. ; 10 Name of User Class
  1. ; Subscript: "SCTP",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 SCTPA,SCTPA,SCTPA0,SCTP,SCR,SCACTHIS,SCTM,SCTPPR,SCPTA
  1. N SCLSEQ,SCN,SCESEQ,SCPARM,SCBEGIN,SCEND,SCINCL,SCDTS
  1. ; -- initialize control variables
  1. G:'$$OKDATA PRACQ
  1. ; -- loop through position assignment history
  1. S SCTPA=0
  1. F S SCTPA=$O(^SCTM(404.52,"C",SC200,SCTPA)) Q:'SCTPA D
  1. .S SCTPA0=$G(^SCTM(404.52,SCTPA,0))
  1. .S SCTP=+$P(SCTPA0,U,1)
  1. .Q:'SCTP
  1. .S SCTM=+$P($G(^SCTM(404.57,SCTP,0)),U,2)
  1. .Q:'SCTM
  1. .S SCACTHIS=$$ACTHIST^SCAPMCU2(404.52,SCTP,SCDATES,SCERR,"SCTPPR")
  1. .Q:'SCACTHIS
  1. .;
  1. .;djb/bp Next line fixes NOIS NOP-0499-11252 & ISA-0899-12551
  1. .Q:$P(SCACTHIS,"^",2)'=SCTPA
  1. .;
  1. .S SCP=+$P($G(^SCTM(404.51,+SCTM,0)),U,3)
  1. .Q:'$$OKARRAY^SCAPU1(.SCPURPA,.SCP)
  1. .S SCPTA=0
  1. .S SCR=+$P($G(^SCTM(404.57,SCTP,0)),U,3)
  1. .Q:'$$OKARRAY^SCAPU1(.SCROLEA,.SCR)
  1. .D BLD^SCAPMC24(.SCLIST,SCTM,SCTP,SCACTHIS,SCR)
  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. ;
  1. Q SCOK
  1. ;