CRHD7 ; CAIRO/CLC - TEAM ROSTER ;4/22/08  12:53
 ;;1.0;CRHD;****;Jan 28, 2008;Build 19
 ;=================================================================
MGR(CRHDRTN,DUZ) ;check for the Manager key
 
CRHDKN,CRHDOUT
 
CRHDRTN=0
 
CRHDKN=$$FIND1^DIC(19.1,"","X","CRHD SHIFT CHG HANDOFF MGR","","","CRHDOUT")
 
GETS^DIQ(200,DUZ_",","51*","I","CRHDOUT")
 
CRHDKN>0 CRHDRTN=$D(CRHDOUT(200.051,+CRHDKN_","_DUZ_","))
 
Q
TEAMMEM(CRHDRTN,CRHDTM) ;
 
CRHDTMM,CRHDCT,CRHDOP,CRHDPG,CRHDX1,CRHDRM,CRHDEM
 
CRHDTT,CRHDSORT,CRHDTTCT,CRHDTIT,CRHDFG,CRHDUIF,CRHDX
 
CRHDCT=1
 
I $P(CRHDTM,"^",2)="USR" D
 
.CRHDTM=$$GET^XPAR("USR.`"_+CRHDTM,"ORLP DEFAULT TEAM",1,"I")
 
+CRHDTM D
 
.'$D(^OR(100.21,+CRHDTM,0)) CRHDRTN CRHDRTN="" Q
 
.CRHDTMM
 
.TEAMPROV^ORQPTQ1(.CRHDTMM,+CRHDTM)
 .
I $D(CRHDTMMD
 
..CRHDX1=0
 ..
F  S CRHDX1=$O(CRHDTMM(CRHDX1)) Q:'CRHDX1  D
 
...DISP^CRHDUD(.CRHDUIF,+CRHDTMM(CRHDX1))
 ...
I $D(CRHDUIFCRHDSORT($P(CRHDUIF,"^",2))=CRHDUIF
 
I $D(CRHDSORTD
 
.CRHDCT=0
 .
CRHDX=""
 
.F  S CRHDX=$O(CRHDSORT(CRHDX)) Q:CRHDX=""  D
 
..CRHDCT=CRHDCT+1
 ..
CRHDRTN(CRHDCT)=CRHDSORT(CRHDX)
 
Q
GETMPEXP(CRHDLST,CRHDUSR,CRHDDIV) ;get temp flds expiration time
 
CRHDLST
 
CRHDPARA,CRHDTITL,CRHDPP
 
CRHDPP=1,2,3,4 D
 
.GETONEP^CRHD4(.CRHDPARA,CRHDUSR,"TEMP_FLD_"_CRHDPP_"_TITLE",CRHDDIV)
 .
I $G(CRHDPARA(1))'=""  D
 
..CRHDTITL=$$UP^XLFSTR(CRHDPARA(1))
 ..
CRHDLST(CRHDTITL)=""
 
..CRHDPARA
 
..GETONEP^CRHD4(.CRHDPARA,CRHDUSR,"edt_TEMP_FLD_"_CRHDPP_"_EXPIRE",CRHDDIV)
 ..
I $G(CRHDPARA(1))'="" CRHDLST(CRHDTITL)=CRHDPARA(1)
 
Q
DELTMPTX(CRHDFLDA,DA) ;KILL TEXT FOR TEMP FLD DATA
 
DIE,DR
 
DIE="^CRHD(183.2,"_CRHDFLDA_",1,"
 
DA(1)=CRHDFLDA,DR=".01///@"
 
^DIE
 
Q