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

SCAPMR6.m

Go to the documentation of this file.
  1. SCAPMR6 ;ALB/REW/PDR - Team Reassignment APIs:APPTTM ; 5 Jul 1995
  1. ;;5.3;Scheduling;**148,157,1015**;AUG 13, 1993;Build 21
  1. ;
  1. ; --------------------------- MAIN -------------------------------------
  1. ACPTRATM(DFNA,SCTMTO,SCTMFRM,SCOTH,SCFIELDA,SCACT,SCERR,SCNEWTM,SCOLDTM,SCBADTM) ; list of patients RE-assigned to a team (404.42)
  1. ; input: as per ACPTTM (above with the following change:)
  1. ; DFNA = is the name of a patient array (e.g. $N(^TMP(SCJOB,"SC PATIENT LIST")))
  1. ; there is at least one scpt(dfn)="" defined
  1. ; SCTMTO = pointer to "TO" team file
  1. ; SCTMFRM = pointer to "FROM" team file - PDR 7/98
  1. ; SCOTH = array of other parameters e.g. SCOTH("SIZELIM")
  1. ; SCFIELDA = List of array of fields and values in 404.42
  1. ; SCACT = Date filed (NOW)
  1. ; SCERR = Name of error message var
  1. ; SCNEWTM = Subset of DFNA that was NEWLY assigned to Team [returned]
  1. ; SCOLDTM = Subset of DFNA that was already assigned -Team [returned]
  1. ; SCBADTP = Subset of DFNA that was NOT assigned to Team [returned]
  1. ; Note: The above three arrays return data in a user determined array
  1. ; output: Count of Patients:
  1. ; 1 2 3 4
  1. ; total assigned^newly assigned^assigned prior^not assigned
  1. N DFN,SCNEWCNT,SCOLDCNT,SCBADCNT,SCX,SCNOMAIL,SCERR,FASIEN
  1. S SCNOMAIL=1
  1. S (SCNEWCNT,SCOLDCNT,SCBADCNT)=0
  1. S DFN=0
  1. F S DFN=$O(@DFNA@(DFN)) Q:'DFN D
  1. . S FASIEN=@DFNA@(DFN) ; get the "FROM" team assignment
  1. . S SCX=$$ACPTTM^SCRPMTA(DFN,SCTMTO,.SCFIELDA,.SCACT,FASIEN,.SCERR)
  1. . ; SCX = ien of 404.42^new?
  1. . IF $P(SCX,U,2) D ;newly assigned to TO Team
  1. .. ;S ^TMP("PDR",$J,"NEW",DFN)=""
  1. .. S SCNEWCNT=SCNEWCNT+1
  1. .. S @SCNEWTM@(DFN)=+SCX ;scnewtm
  1. . IF $P(SCX,U,1)&('$P(SCX,U,2)) D ;already assigned to TO team
  1. .. ;S ^TMP("PDR",$J,"OLD",DFN)=""
  1. .. S SCOLDCNT=SCOLDCNT+1
  1. .. S @SCOLDTM@(DFN)=+SCX
  1. . IF 'SCX D ; Unable to reassign to new team, so don't discharge from old team
  1. .. ;S ^TMP("PDR",$J,"BAD",DFN)=""
  1. .. S @SCBADTM@(DFN)=$P(SCX,U,3)
  1. .. S SCBADCNT=SCBADCNT+1
  1. K SCNOMAIL
  1. ; Send out mail notices only if there are failures to reassign
  1. I SCBADCNT D MAILLST^SCMRTMM(SCTMTO,.SCADDFLD,DT,.SCBADTM) ; report only on unable to assign
  1. Q (SCNEWCNT+SCOLDCNT)_U_SCBADCNT
  1. ;