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

SCMCGU.m

Go to the documentation of this file.
  1. SCMCGU ;ALB/JLU;General PCMM utilities;7/1/99 ; 3/29/00 12:34pm
  1. ;;5.3;Scheduling;**195,177,212**;AUG 13, 1993
  1. ;
  1. NEWPERSN(IEN,ARY) ;This function takes an internal value/DUZ of the
  1. ;person you wish info on and performs a silent FM call to retrieve
  1. ;the data. DBIA #10060
  1. ;
  1. ;INPUTS
  1. ; IEN - the internal entry number of the user you want in
  1. ; VA(200. (REQUIRED)
  1. ; ARY - the closed array reference the data is to be returned in.
  1. ; This must be a clean array. This API will not issue any
  1. ; kills with this structure.(OPTIONAL)
  1. ; If no array is entered ^TMP("PCMM_PERSON",$J,IEN) will be used.
  1. ;
  1. ;OUTPUTS
  1. ; ARY(IEN)=Piece Structure below
  1. ; 1 - User Name (EXTERNAL)
  1. ; 2 - Office Phone number
  1. ; 3 - Room
  1. ; 4 - Service/Section (EXTERNAL)
  1. ; 5 - Voice Pager number
  1. ; 6 - Social Security number
  1. ;
  1. ;If successful 1 is return as the results of the function.
  1. ;If not successfull 0^reason is returned.
  1. ;
  1. N STOP
  1. S STOP=0
  1. D PARCHK G:STOP MNQ
  1. D GETDATA
  1. MNQ Q $S(STOP=0:1,1:0_U_$P(STOP,U,2))
  1. ;
  1. PARCHK ;Checks the parameters that are passed in.
  1. ;
  1. I '+$G(IEN) S STOP="1^Bad pointer value to file 200"
  1. I $G(ARY)']"" S ARY="^TMP(""PCMM_PERSON"",$J)"
  1. Q
  1. ;
  1. GETDATA ;Make the FM calls and formats the return array.
  1. ;
  1. N BLDERR
  1. K ^TMP("SCMC_BLD_PERSON",$J)
  1. D GETS^DIQ(200,IEN,".01;.132;.137;.141;29;9","EI","^TMP(""SCMC_BLD_PERSON"","_$J_")","BLDERR")
  1. ;only reporting the first one
  1. I $D(BLDERR) S STOP=1_U_BLDERR("DIERR",1,"TEXT",1) Q
  1. S $P(@ARY@(IEN),U,1)=^TMP("SCMC_BLD_PERSON",$J,200,IEN_",",.01,"E")
  1. S $P(@ARY@(IEN),U,2)=^TMP("SCMC_BLD_PERSON",$J,200,IEN_",",.132,"E")
  1. S $P(@ARY@(IEN),U,3)=^TMP("SCMC_BLD_PERSON",$J,200,IEN_",",.141,"E")
  1. S $P(@ARY@(IEN),U,4)=^TMP("SCMC_BLD_PERSON",$J,200,IEN_",",29,"E")
  1. S $P(@ARY@(IEN),U,5)=^TMP("SCMC_BLD_PERSON",$J,200,IEN_",",.137,"E")
  1. S $P(@ARY@(IEN),U,6)=^TMP("SCMC_BLD_PERSON",$J,200,IEN_",",9,"E")
  1. K ^TMP("SCMC_BLD_PERSON",$J)
  1. Q
  1. ;
  1. PDAT(SCPATCH,SCERROR) ;
  1. ; alb/rpm Patch 212
  1. ; This function is used to retrieve the PATCH install date when
  1. ; passed the PATCH name. The PATCH install date is found in the
  1. ; subfile #9.4901 field #.02.
  1. ;
  1. ; DBIA:#10048 indicates that Package(#9.4) file is open for read
  1. ; only with FM.
  1. ;
  1. ; Input:
  1. ; SCPATCH - Patch designation (i.e. SD*5.3*177)
  1. ; SCERROR (optional) - Variable stores user named variable
  1. ; to return error text. Passing ""
  1. ; is treated the same as no parameter.
  1. ;
  1. ; Output:
  1. ; Function value - Date patch installed on success, otherwise 0
  1. ; on failure.
  1. ; SCERROR - Variable stores error text explaining function
  1. ; failure. Only output if user passes second
  1. ; parameter to function and an error occurs.
  1. ;
  1. ; Validate input
  1. I $L(SCPATCH,"*")'=3 D Q 0
  1. . S:$G(SCERROR)]"" @SCERROR="Invalid input parameter"
  1. ; Verify patch is loaded
  1. I '$$PATCH^XPDUTL(SCPATCH) D Q 0
  1. . S:$G(SCERROR)]"" @SCERROR="Patch "_SCPATCH_" not loaded"
  1. ; Initialize locals
  1. NEW SCDATE,SCFILE,SCI,SCERR,SCIEN,SCPAT
  1. ; Search for Patch designation in #9.4 and subfiles (#9.49, #9.4901)
  1. S SCIEN=""
  1. F SCI=1:1:3 D Q:$D(SCERR)!'SCIEN(SCI)
  1. . S SCFILE=$S(SCI=1:9.4,SCI=2:9.49,1:9.4901)
  1. . S SCPAT=$P(SCPATCH,"*",SCI)
  1. . S SCIEN(SCI)=$$FIND1^DIC(SCFILE,SCIEN,"MX",SCPAT,"","","SCERR")
  1. . ; Check for alternate form of patch name (i.e. "176 SEQ #158")
  1. . I SCI=3,'SCIEN(SCI) S SCPAT=SCPAT_" SEQ" D
  1. . . S SCIEN(SCI)=$$FIND1^DIC(SCFILE,SCIEN,"M",SCPAT,"","","SCERR")
  1. . Q:$D(SCERR)!'SCIEN(SCI)
  1. . S SCIEN=$S(SCI<3:",",1:"")_SCIEN(SCI)_$S(SCI=1:",",1:"")_SCIEN
  1. ; Check for search errors
  1. I 'SCIEN(SCI) S:$G(SCERROR)]"" @SCERROR="Search failed" Q 0
  1. I $D(SCERR) S:$G(SCERROR)]"" @SCERROR=$G(SCERR("DIERR",1,"TEXT",1)) Q 0
  1. ;
  1. ; Retrieve date
  1. S SCDATE=$$GET1^DIQ(SCFILE,SCIEN,.02,"I","","SCERR")
  1. I $D(SCERR) S:$G(SCERROR)]"" @SCERROR=$G(SCERR("DIERR",1,"TEXT",1)) Q 0
  1. ;
  1. D CLEAN^DILF
  1. Q SCDATE