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

CIAVIN11.m

Go to the documentation of this file.
CIAVIN11 ;MSC/IND/DKM - EHR v1.1 Inits;04-May-2006 08:19;DKM
 ;;1.1;VUECENTRIC FRAMEWORK;;Sep 30, 2005
 ;;Copyright 2000-2006, Medsphere Systems Corporation
 ;=================================================================
EC ;EP - Environment check
 Q
PRE ;EP - Preinit
 D BMES^XPDUTL("Updating EHR Parameters...")
 D CVTPARS("CIA"),CVTPARS("BEH")
 Q
POST ;EP - Postinit
 W !!!
 I $L($$GETLOGIN^CIAVUTIL),$$ASK^CIAU("Do you want to enable VueCentric logins","Y") D
 .D SDABORT^CIAVUTIL(,1),BMES^XPDUTL("Application logins have been enabled.")
 D:$L($T(^BEHUTIL)) REGMENU^BEHUTIL("CIAV MANAGER",,"FRM")
 Q
 ; Convert parameters by namespace
CVTPARS(NMSP) ;EP
 N PARNM,LEN
 S PARNM=NMSP,LEN=$L(NMSP)
 F  S PARNM=$O(^XTV(8989.51,"B",PARNM)) Q:$E(PARNM,1,LEN)'=NMSP  D
 .D BMES^XPDUTL("Updating parameter "_PARNM_"...  "_$$CVTPAR(PARNM))
 Q
 ; Convert PKG entity type to SYS entity type
CVTPAR(PARNM) ;EP
 N PARAM,PKGIEN,PKGPRI,PKGVAL,PKGVP,SYSIEN,SYSPRI,SYSVP,SYSVAL,FDA
 S PARAM=$S(PARNM=+PARNM:PARNM,1:$$FIND1^DIC(8989.51,,"X",PARNM))
 Q:'PARAM!'$D(^XTV(8989.51,PARAM,0)) "Parameter "_PARNM_" not found."
 S PKGIEN=+$O(^XTV(8989.51,PARAM,30,"AG","DIC(9.4,",0))
 S PKGPRI=-$G(^XTV(8989.51,PARAM,30,PKGIEN,0))
 Q:'PKGIEN "Nothing to change."
 S SYSIEN=+$O(^XTV(8989.51,PARAM,30,"AG","DIC(4.2,",0))
 S SYSPRI=-$G(^XTV(8989.51,PARAM,30,SYSIEN,0))
 S SYSVP=$$GETVP(PARAM,"SYS"),PKGVP=$$GETVP(PARAM,"PKG")
 Q:'$L(PKGVP) "Cannot determine package."
 S PKGVAL=$O(^XTV(8989.5,"AC",PARAM,PKGVP,""))'=""
 S SYSVAL=$O(^XTV(8989.5,"AC",PARAM,SYSVP,""))'=""
 S FDA=1
 I SYSIEN,'SYSVAL D
 .S FDA(FDA,8989.513,SYSIEN_","_PARAM_",",.01)="@",SYSIEN=0
 S FDA=FDA+1
 I SYSVAL,PKGVAL D
 .N DELVP,DELIEN,IEN
 .I PKGPRI>SYSPRI S DELIEN=SYSIEN,DELVP=SYSVP,SYSIEN=0,SYSVAL=0
 .E  S DELIEN=PKGIEN,DELVP=PKGVP,PKGIEN=0,PKGVAL=0
 .D CHGENT(DELIEN,DELVP,"@","@")
 S FDA=FDA+1
 I SYSVAL,'PKGVAL D
 .S:PKGIEN FDA(FDA,8989.513,PKGIEN_","_PARAM_",",.01)="@",PKGIEN=0
 S FDA=FDA+1
 I 'SYSIEN,PKGIEN D
 .D CHGENT(PKGIEN,PKGVP,4.2,SYSVP)
 .S SYSIEN=PKGIEN,SYSVAL=PKGVAL,(PKGIEN,PKGVAL)=0
 I $D(FDA) D
 .N ERR,LVL
 .F LVL=0:0 S LVL=$O(FDA(LVL)) Q:'LVL  D
 ..D UPDATE^DIE(,$NA(FDA(LVL)),,"ERR")
 ..ZW ERR
 Q "OK"
GETVP(PAR,ENT) ;
 D ENTDFLT^XPAR1(.ENT)
 Q ENT
CHGENT(ENTIEN,ENTVP,ENTVAL,PARVAL) ;
 N INST,IEN
 S INST=""
 S FDA(FDA,8989.513,ENTIEN_","_PARAM_",",$S(ENTVAL="@":.01,1:.02))=ENTVAL
 F  S INST=$O(^XTV(8989.5,"AC",PARAM,ENTVP,INST)) Q:'$L(INST)  D
 .F IEN=0:0 S IEN=$O(^XTV(8989.5,"AC",PARAM,ENTVP,INST,IEN)) Q:'IEN  D
 ..S FDA(FDA+.1,8989.5,IEN_",",.01)=PARVAL
 Q