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

SCUTBK4.m

Go to the documentation of this file.
  1. SCUTBK4 ;ALB/JLU;BROKER UTILITIES
  1. ;;5.3;Scheduling;**148,157,1015**;AUG 13, 1993;Build 21
  1. ACTPOS(RESULTS,SCARY) ;
  1. ;
  1. ;This broker entry point returns an array of active positions for a
  1. ;patient on a specific team.
  1. ;
  1. ;INPUTS SCARY - Contains the following subscripted elements
  1. ; DFN - DFN of the patient.
  1. ; BEGIN - The beginning date range.
  1. ; END - The ending date range.
  1. ; TEAM - The team associated with the patient.
  1. ;
  1. ;OUTPUTS RESULTS - The array of active positions. The following
  1. ; is a description of the piece structure.
  1. ; PIECE - Description
  1. ; 1 IEN of TEAM POSITION FILE(#404.57)
  1. ; 2 NAME of Position
  1. ; 3 Current effective date
  1. ; 4 Pointer to role (403.46)
  1. ; 5 Name of Standard role
  1. ; 6 Pointer to User Class
  1. ; 7 Name of User Class
  1. ; 8 IEN of 404.43
  1. ;
  1. N SCOK,SCDT,SCDFN,SCTEAM,SCPOS,LP,CNT,SCERR
  1. ;
  1. D CHK^SCUTBK
  1. D TMP^SCUTBK
  1. ;
  1. D PARSE(.SCARY) ;parse array for inputs
  1. K ^TMP($J,"ACTLST")
  1. ;gets a list o positions for this patient
  1. S SCOK=$$TPPT^SCAPMC(SCDFN,.SCDT,"","","","","","SCPOS","SCBKERR")
  1. I 'SCOK G EXIT
  1. S CNT=1
  1. ;
  1. ;loop through positions only getting the ones associated with the team
  1. ;and that are active.
  1. ;
  1. F LP=0:0 S LP=$O(SCPOS(LP)) Q:'LP DO
  1. .I $P(SCPOS(LP),U,3)'=SCTEAM Q
  1. .I $P(SCPOS(LP),U,6)]"" Q
  1. .S ^TMP($J,"ACTLST",CNT)=$P(SCPOS(LP),U,1)_U_$P(SCPOS(LP),U,2)_U_$P(SCPOS(LP),U,5)_U_$P(SCPOS(LP),U,7)_U_$P(SCPOS(LP),U,8)_U_$P(SCPOS(LP),U,9)_U_$P(SCPOS(LP),U,10)_U_$P(SCPOS(LP),U,4)
  1. .S CNT=CNT+1
  1. .Q
  1. ;
  1. EXIT S RESULTS=$NA(^TMP($J,"ACTLST"))
  1. Q
  1. ;
  1. PARSE(ARY) ;parses the input parameters from the broker.
  1. ;
  1. S SCDFN=$G(ARY("DFN"))
  1. S SCDT("BEGIN")=$G(ARY("BEGIN"))
  1. S SCDT("END")=$G(ARY("END"))
  1. S SCTEAM=$G(ARY("TEAM"))
  1. Q
  1. ;
  1. PARIEN(RESULT) ;returns the ien for 404.91
  1. ;used by SCMC GET PARAMETER IEN (rpc)
  1. ;
  1. N RES
  1. S RES=$O(^SD(404.91,0))
  1. S RESULT=$S(RES="":0,1:+RES)
  1. Q