Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Info |  Source |  Entry Points
Print Page as PDF
Routine: SCRPMTA

Package: Scheduling

Routine: SCRPMTA


Information

SCRPMTA ;ALB/REW/PDR - Team Reassignment APIs:APPTTM ; AUG 1998

Source Information

Source file <SCRPMTA.m>

Entry Points

Name Comments DBIA/ICR reference
ACPTTM(DFN,SCTMTO,SCFIELDA,SCACT,FASIEN,SCERR) ;add a patient to a team (pt tmassgn - #404.42)
; input:
; DFN = pointer to PATIENT file (#2)
; SCTMTO = pointer to TEAM file (#404.51) "TO" Team
; SCFIELDA= array of additional fields to be added for 404.42
; SCACT = date to activate [default=DT]
; FASIEN = IEN of source team assignment
; SCERR = array NAME to store error messages.
; [ex. ^TMP("ORXX",$J)]
APTTMQ ;
PTTMACT(DFN,SCTMTO,SCDT,SCERR) ;what is patient/team assignment on a given date-time into the future? Return 404.42 ien or 0
OKDATA()
DISTMOK(DFN,TMIEN,SCACT,SCDUZ,SD) ; Discharge patient from Team Assignment
; DFN = pointer to patient
; TMIEN = Ptr to Team Assignment File 404.42 for Team being discharged
; SCAT = Discharge Date
; SCDUZ = DUZ of user making reassignment
; SD = text indicating "source" or "destination" team
DISCHPOS(DFN,TMASGN,SCAT,SCERR,SCTEC) ;Discharge positition assignments
; DFN = ptr to patient
; TMASGN = ptr to team assignment
; SCAT = discharge date
PREVDAY(DAY) ; GET PREVIOUS DAY
; DAY = DATE IN FILEMAN FORMAT
GETTMPAR(DFN,SCTMTO,SCDT,SCERR,SCTMPAR,SCPTTM) ; RETURN team parameters
; SCTMPAR is returned as:
; Piece Description
; 1 IEN of TEAM file entry
; 2 Name of team
; 3 IEN of file #404.42 (Pt Tm Assignment)
; 4 current effective date
; 5 current inactivate date (if any)
; 6 pointer to 403.47 (purpose)
; 7 Name of Purpose
; 8 Is this the pt's PC Team?
; 9 IEN of PC team assignment - added to record -PDR
GETPCTM(TMLIST) ; FIND THE PC TEAM FOR THIS PATIENT
FUASSN(SCDTPAR,SCDT) ; is there a future assignment?
FUDISCHG(SCTMPAR,SCDT) ;IS THERE A FUTURE DISCHARGE?
MOVPATOK(DFN,SCACT,SCTMTO,SCFIELDA,SCTMPAR,SCPTTM,SCDUZ) ; DID MOVE GO OK?
INVALMOV(DTMIEN,STMIEN,TMPAR) ; IS THIS A VALID REASSIGNMENT?
; can't have a pc team reassignment if patient has an existing PC team assignment
; and it is not
; 1: the src team (move from src to dest discharges src, result only 1 pc team) OR
; 2: the destination team (already existing assignment)
PCASSGN() ; IS THE REASSIGNMENT DESTINATION TO BE PC?
OTHPCTM(DTMIEN,STMIEN,TMPAR) ; IS THERE ALREADY PC TEAM ASSIGNMENT?
ACTIVDES(SCDTPAR,SCACT) ; IS THE DESTINATION ASSIGNMENT ACTIVE?
; SCDTPAR = Destination Team assignment parameter string
ERROR(TXT,ID,ERN) ; ERROR PROCESSOR
Info |  Source |  Entry Points