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

SCMCPR1.m

Go to the documentation of this file.
  1. SCMCPR1 ;ALB/SCK - API FILE FOR STAFF ASSIGNMENTS ; 9/14/05 12:10pm
  1. ;;5.3;Scheduling;**41,45,264,297,1015**;AUG 13, 1993;Build 21
  1. ;;1.0
  1. Q
  1. ;
  1. URSLKUP(SCDAT,SCUSR,SCVAL,SCREEN,SCINST,SCPC) ;
  1. ; Does a lookup in the USR #8930.3 file based on the user class match passed in
  1. ;
  1. ; Input
  1. ; SCUSR User class to use for lookup
  1. ; SCVAL Partial User name to lookup on
  1. ;
  1. ; Returns an array of matches found, or an error array.
  1. ; Format for array:
  1. ; SCDATA(1)=[Data]
  1. ; SCDATA(x)=IEN^New Users Name^Title
  1. ;
  1. ; Format for Error:
  1. ; SCDATA(1)=[Errors]
  1. ; SCDATA(x)=" message "
  1. ;
  1. N SCI,N,SCRTN,SCTMP,SCTITLE,SCIEN,SCN,SCUERR
  1. ;
  1. I SCUSR']""&(SCINST=1) D G USRQ
  1. . S N=0
  1. . D SETF("[Errors]")
  1. . D SETF("No User Class Defined")
  1. ;
  1. IF $L(SCVAL)<3&(SCINST=0) D G USRQ
  1. . S N=0
  1. .D SETF("[Errors]")
  1. .D SETF("Insufficient characters to match")
  1. ;
  1. S N=0
  1. IF SCINST=1 D
  1. . D LIST^DIC(200,"",".01;8;28","","","",SCVAL,"","IF $$ISA^USRLM(Y,SCUSR,.SCUERR)","","")
  1. ;
  1. IF SCINST=0 D
  1. .D LIST^DIC(200,"",".01;8;28","","","",SCVAL,"",SCREEN,"","")
  1. ;
  1. S N=0
  1. D SETF("[Data]")
  1. S I="" F S I=$O(^TMP("DILIST",$J,1,I)) Q:'I D
  1. . S SCTMP=^TMP("DILIST",$J,2,I)_U
  1. . I $G(SCPC) I $O(^SD(403.46,+SCPC,2,0)) N PC S PC=0 D Q:'PC ;Put back for provider by role
  1. .. N CODE S CODE=$$GET^XUA4A72(+SCTMP) D Q:PC
  1. ... I $D(^SD(403.46,+SCPC,2,+CODE)) S PC=1
  1. . S:SCINST SCTMP=SCTMP_$$CLNAME^USRLM(+SCUSR)
  1. . S SCTMP=SCTMP_U_U_U_U_^TMP("DILIST",$J,1,I)
  1. . S SCTMP=SCTMP_U_^TMP("DILIST",$J,"ID",I,8)
  1. . S SCTMP=SCTMP_U_^TMP("DILIST",$J,"ID",I,28)
  1. . D SETF(SCTMP)
  1. ;
  1. K ^TMP("DILIST",$J)
  1. USRQ Q
  1. ;
  1. SETF(X) ;
  1. S N=N+1
  1. S SCDAT(N)=X
  1. Q
  1. ;
  1. ;
  1. TEST(CHK) ;
  1. N SC,SCCHECK
  1. K SCK
  1. IF CHK=1 D
  1. . S DIC="^USR(8930,",DIC("A")="Enter User Class: ",DIC(0)="AEMZ"
  1. . D ^DIC
  1. . W !,Y,!
  1. . R "Lookup: ",X:60
  1. . Q:'$G(Y)>0
  1. . D URSLKUP(.SCK,$P(Y,U),X,"",CHK)
  1. ;
  1. IF CHK=0 D
  1. . R "Name: ",X:60
  1. . D URSLKUP(.SCK,"",X,"",CHK)
  1. ;
  1. ;;;W ! ZW SCK
  1. TESTQ Q