BQILYUTL ;PRXM/HC/ALA-Layout Template Utilities ; 04 Jun 2007 4:03 PM
;;2.3;ICARE MANAGEMENT SYSTEM;;Apr 18, 2012;Build 59
;
DEF(OWNR,TYPE) ;EP - Get the IEN of the default layout template
; Input
; TYPE - Type of default
; OWNR - User
;
NEW IEN,MIEN
S IEN=0,MIEN=""
F S IEN=$O(^BQICARE(OWNR,15,"C",TYPE,IEN)) Q:'IEN D
. I $P(^BQICARE(OWNR,15,IEN,0),U,3)'="Y" Q
. S MIEN=IEN
Q MIEN
;
TPN(OWNR,TEMPL) ;EP - Get the IEN of the template
I $G(TEMPL)="" Q ""
;
NEW DIC,X,Y
S DIC="^BQICARE("_OWNR_",15,",DIC(0)="X"
S X=TEMPL
D ^DIC
I Y=-1 Q ""
Q:+Y +Y
Q ""
BQILYUTL ;PRXM/HC/ALA-Layout Template Utilities ; 04 Jun 2007 4:03 PM
+1 ;;2.3;ICARE MANAGEMENT SYSTEM;;Apr 18, 2012;Build 59
+2 ;
DEF(OWNR,TYPE) ;EP - Get the IEN of the default layout template
+1 ; Input
+2 ; TYPE - Type of default
+3 ; OWNR - User
+4 ;
+5 NEW IEN,MIEN
+6 SET IEN=0
SET MIEN=""
+7 FOR
SET IEN=$ORDER(^BQICARE(OWNR,15,"C",TYPE,IEN))
IF 'IEN
QUIT
Begin DoDot:1
+8 IF $PIECE(^BQICARE(OWNR,15,IEN,0),U,3)'="Y"
QUIT
+9 SET MIEN=IEN
End DoDot:1
+10 QUIT MIEN
+11 ;
TPN(OWNR,TEMPL) ;EP - Get the IEN of the template
+1 IF $GET(TEMPL)=""
QUIT ""
+2 ;
+3 NEW DIC,X,Y
+4 SET DIC="^BQICARE("_OWNR_",15,"
SET DIC(0)="X"
+5 SET X=TEMPL
+6 DO ^DIC
+7 IF Y=-1
QUIT ""
+8 IF +Y
QUIT +Y
+9 QUIT ""