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

SCAPMC16.m

Go to the documentation of this file.
  1. SCAPMC16 ;ALB/CMM - TEAM/CLINIC APIs ;03/19/96
  1. ;;5.3;Scheduling;**41**;AUG 13, 1993
  1. ;
  1. TMCL(SCCLN,SCDATES,SCLIST,SCERR) ; -- list of teams for a clinic
  1. ; input:
  1. ; SCCLN = ien of HOSPITAL LOCATION <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 patients who were assigned to
  1. ; team for entire date range
  1. ; 0: anytime in date range
  1. ; [default: 1]
  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 #404.51
  1. ; 2 Team Name
  1. ; Subscript: "SCTP",SCTM,IEN =""
  1. ;
  1. ; SCERR() = Array of errors
  1. ; @SCERR@(0) = number of errors, undefined if none
  1. ; Format:
  1. ; Subscript: Sequential # from 1 to n
  1. ; Piece Description
  1. ; 1 error description
  1. ; Returned: 1 if ok, 0 if error
  1. ;
  1. ST ;
  1. N OKAY,NODE,ENT,PCLIST,ERR2,CNT,TIEN
  1. I '$D(SCCLN)!('$D(SCLIST)) S @SCERR@(0)="undefined variables" Q 0
  1. I '$D(SCERR) Q 0
  1. ;
  1. S PCLIST="PCLST",ERR2="ERROR2"
  1. S OKAY=$$TPCL^SCAPMC30(SCCLN,.SCDATES,"","","","",.PCLIST,.ERR2)
  1. ; ^ positions for a clinic SCCLN
  1. I 'OKAY S @SCERR@(0)="error in TPCL^SCAPMC30 call"
  1. Q:'OKAY 0
  1. ;
  1. S (CNT,ENT)=0
  1. F S ENT=$O(@PCLIST@(ENT)) Q:ENT=""!(ENT'?.N) D
  1. .S NODE=$G(@PCLIST@(ENT))
  1. .S TIEN=+$P(NODE,"^",3) ;team ien
  1. .I $D(@SCLIST@("SCTP",TIEN)) Q
  1. .;unique entries only
  1. .S CNT=CNT+1
  1. .S @SCLIST@(CNT)=TIEN ;team ien
  1. .S @SCLIST@("SCTP",TIEN,CNT)=""
  1. .S $P(@SCLIST@(CNT),"^",2)=$P($G(^SCTM(404.51,TIEN,0)),"^") ;team name
  1. S @SCLIST@(0)=CNT
  1. Q 1