CIAVIP15 ;MSC/IND/PLS - EHR v1.1p15 Inits;08-Sep-2015 17:24;PLS
;;1.1;VUECENTRIC FRAMEWORK;;23-Oct-2006
;;Copyright 2000-2015, Medsphere Systems Corporation
;=================================================================
EC ;EP - Environment check
Q
PRE ;EP - Preinit
Q
POST ;EP - Postinit
N VER,FDA,PID,IEN,X,TYPE
D BMES^XPDUTL("Updating version numbers...")
F VER=0:1 S X=$P($T(VER+VER),";;",2) Q:'$L(X) D
.S PID=$$PRGID^CIAVMCFG($P(X,";"))
.S:PID FDA(19930.2,PID_",",2)=$P(X,";",2),FDA(19930.2,PID_",",7)=$P(X,";",3)
D:$D(FDA) FILE^DIE(,"FDA")
W !!!
;Update help file references
D UPDCHM
;Mark menu out of order
D OUT^XPDMENU("BEHORM TAXONOMY EDIT","Please use the PXRM TAXONOMY EDIT option.")
D OUT^XPDMENU("BEHORM TAXONOMY COPY","Please use the PXRM TAXONOMY COPY option.")
D OUT^XPDMENU("BEHORM TAXONOMY DIALOG","Please use the PXRM TAXONOMY DIALOG option.")
D OUT^XPDMENU("BEHORM TAXONOMY INQUIRY","Please use the PXRM TAXONOMY INQUIRY option.")
D OUT^XPDMENU("BEHORM TAXONOMY LIST","Please use the PXRM TAXONOMY LIST option.")
D OUT^XPDMENU("BEHORM TAXONOMY MANAGEMENT","Please use the PXRM TAXONOMY MANAGEMENT option.")
;Change friendly names of objects
D UPDOBJNM("BGOAMI.AMICONTROL","AMI Component")
D UPDOBJNM("BGOAMI.LAUNCHAMIBUTTON","AMI Component Button")
D UPDOBJNM("BEHSTROKE.STROKECONTROL","Stroke Tool")
D UPDOBJNM("BEHSTROKE.LAUNCHSTROKEBUTTON","Stroke Tool Button")
;Prompt to enable logins
I $L($$GETLOGIN^CIAVUTIL),$$ASK^CIAU("Do you want to enable EHR logins","Y") D
.D SDABORT^CIAVUTIL(,1),BMES^XPDUTL("Application logins have been enabled.")
Q
;Register RPCs to context
REGRPC ;EP-
I $$REGRPC^CIAURPC("MAGJ USER2","CIAV VUECENTRIC")
I $$REGRPC^CIAURPC("MAGG CPRS RAD EXAM","CIAV VUECENTRIC")
I $$REGRPC^CIAURPC("MAG3 CPRS TIU NOTE","CIAV VUECENTRIC")
Q
; Update the friendly name of an existing object
UPDOBJNM(OBJ,NAME) ;EP-
N PID,FDA
S PID=$$PRGID^CIAVMCFG(OBJ)
Q:'PID
S FDA(19930.2,PID_",",1)=NAME
D FILE^DIE(,"FDA")
Q
; Attach Event Protocols to Event Types
EVTPRTL(TYPE) ;
N EVTNM,PRT,EVT,FDA
S EVTNM="CIAV "_TYPE_" EVENT"
S EVT=$$EVENTIEN^CIANBEVT(TYPE)
Q:'EVT
S PRT=$$FIND1^DIC(101,,,EVTNM)
Q:'PRT
S FDA(19941.21,EVT_",",7)=PRT
D FILE^DIE(,"FDA")
Q
; Delete a USES item
DELUSES(PARENT,ITM) ;EP-
N PID,ITMIEN,FDA
S PID=$$PRGID^CIAVMCFG(PARENT)
I PID D
.S ITMIEN=$$FIND1^DIC(19930.221,","_PID_",","B",ITM)
.I ITMIEN D
..S FDA(19930.221,ITMIEN_","_PID_",",.01)="@"
..D FILE^DIE(,"FDA")
Q
;
UPDCHM ;EP-
N CHM,PID
F CHM=0:1 S X=$P($T(CHM+CHM),";;",2) Q:'$L(X) D
.S PID=$$PRGID^CIAVMCFG($P(X,";"))
.D AECHM(PID,$P(X,";",2,99))
W !!
Q
;
AECHM(PID,VAL) ;EP-
N LN,FN,IDX,TXT,ARY,CNT,IENS
S FN=$P(VAL,";"),CNT=0
S LN=0 F S LN=$O(^CIAVOBJ(19930.2,PID,6,LN)) Q:'LN D Q:$G(IDX)
.S TXT=^CIAVOBJ(19930.2,PID,6,LN,0)
.S ARY(LN,0)=TXT,CNT=CNT+1
.I $$UP^XLFSTR(TXT)[$$UP^XLFSTR($P(VAL,";")) S IDX=LN
I $G(IDX) D
.S ^CIAVOBJ(19930.2,PID,6,IDX,0)=VAL
E D
.S ARY($S('CNT:1,1:CNT+1),0)=VAL
.S IENS=PID_","
.S FDA(19930.2,IENS,10)="ARY"
.D FILE^DIE(,"FDA")
Q
; Rename .01 field of BEH Measurement file
BEHMSR(X,Y) ;
N IEN,FDA
S IEN=$O(^BEHOVM(90460.01,"B",X,0))
Q:'IEN
S FDA(90460.01,IEN_",",.01)=Y
D FILE^DIE(,"FDA")
Q
VER ;;BEHALLERGIES.ALLERGIES;4.2.5.1;8D715397DAB968E4452A00CF36889A7B
;;BEHRXGENERATORSERVICE.RXGENERATOR;1.0.5711.21573;902BAC82C3BFD3695C6598FEEF929EC1
;;BEHCIR.CIRCTRL;1.0.5681.17468;BD794C23F2907AAF99BFB18BF1CE9FB6
;;BEHCCDA.CCDACTRL;1.0.5729.29151;50A518608E153B88A854765BAEBDB448
;;
CHM ;;BEHALLERGIES.ALLERGIES;BEHAllergies.chm;2015.7.13.171904;DB692179FA69E9D43661B50CA926C595
;;BEHMEDS.MEDMANAGEMENT;BEHMeds.chm;2015.7.13.172056;F1E97FE4BDAAEC9ACC3D5144EB8A8090
;;BEHCCDA.CCDACTRL;BEHCCDA.CHM;2015.7.22.163820;1DA08C6490CED1369C95017C3ACBD9C0
;;
CIAVIP15 ;MSC/IND/PLS - EHR v1.1p15 Inits;08-Sep-2015 17:24;PLS
+1 ;;1.1;VUECENTRIC FRAMEWORK;;23-Oct-2006
+2 ;;Copyright 2000-2015, Medsphere Systems Corporation
+3 ;=================================================================
EC ;EP - Environment check
+1 QUIT
PRE ;EP - Preinit
+1 QUIT
POST ;EP - Postinit
+1 NEW VER,FDA,PID,IEN,X,TYPE
+2 DO BMES^XPDUTL("Updating version numbers...")
+3 FOR VER=0:1
SET X=$PIECE($TEXT(VER+VER),";;",2)
IF '$LENGTH(X)
QUIT
Begin DoDot:1
+4 SET PID=$$PRGID^CIAVMCFG($PIECE(X,";"))
+5 IF PID
SET FDA(19930.2,PID_",",2)=$PIECE(X,";",2)
SET FDA(19930.2,PID_",",7)=$PIECE(X,";",3)
End DoDot:1
+6 IF $DATA(FDA)
DO FILE^DIE(,"FDA")
+7 WRITE !!!
+8 ;Update help file references
+9 DO UPDCHM
+10 ;Mark menu out of order
+11 DO OUT^XPDMENU("BEHORM TAXONOMY EDIT","Please use the PXRM TAXONOMY EDIT option.")
+12 DO OUT^XPDMENU("BEHORM TAXONOMY COPY","Please use the PXRM TAXONOMY COPY option.")
+13 DO OUT^XPDMENU("BEHORM TAXONOMY DIALOG","Please use the PXRM TAXONOMY DIALOG option.")
+14 DO OUT^XPDMENU("BEHORM TAXONOMY INQUIRY","Please use the PXRM TAXONOMY INQUIRY option.")
+15 DO OUT^XPDMENU("BEHORM TAXONOMY LIST","Please use the PXRM TAXONOMY LIST option.")
+16 DO OUT^XPDMENU("BEHORM TAXONOMY MANAGEMENT","Please use the PXRM TAXONOMY MANAGEMENT option.")
+17 ;Change friendly names of objects
+18 DO UPDOBJNM("BGOAMI.AMICONTROL","AMI Component")
+19 DO UPDOBJNM("BGOAMI.LAUNCHAMIBUTTON","AMI Component Button")
+20 DO UPDOBJNM("BEHSTROKE.STROKECONTROL","Stroke Tool")
+21 DO UPDOBJNM("BEHSTROKE.LAUNCHSTROKEBUTTON","Stroke Tool Button")
+22 ;Prompt to enable logins
+23 IF $LENGTH($$GETLOGIN^CIAVUTIL)
IF $$ASK^CIAU("Do you want to enable EHR logins","Y")
Begin DoDot:1
+24 DO SDABORT^CIAVUTIL(,1)
DO BMES^XPDUTL("Application logins have been enabled.")
End DoDot:1
+25 QUIT
+26 ;Register RPCs to context
REGRPC ;EP-
+1 IF $$REGRPC^CIAURPC("MAGJ USER2","CIAV VUECENTRIC")
+2 IF $$REGRPC^CIAURPC("MAGG CPRS RAD EXAM","CIAV VUECENTRIC")
+3 IF $$REGRPC^CIAURPC("MAG3 CPRS TIU NOTE","CIAV VUECENTRIC")
+4 QUIT
+5 ; Update the friendly name of an existing object
UPDOBJNM(OBJ,NAME) ;EP-
+1 NEW PID,FDA
+2 SET PID=$$PRGID^CIAVMCFG(OBJ)
+3 IF 'PID
QUIT
+4 SET FDA(19930.2,PID_",",1)=NAME
+5 DO FILE^DIE(,"FDA")
+6 QUIT
+7 ; Attach Event Protocols to Event Types
EVTPRTL(TYPE) ;
+1 NEW EVTNM,PRT,EVT,FDA
+2 SET EVTNM="CIAV "_TYPE_" EVENT"
+3 SET EVT=$$EVENTIEN^CIANBEVT(TYPE)
+4 IF 'EVT
QUIT
+5 SET PRT=$$FIND1^DIC(101,,,EVTNM)
+6 IF 'PRT
QUIT
+7 SET FDA(19941.21,EVT_",",7)=PRT
+8 DO FILE^DIE(,"FDA")
+9 QUIT
+10 ; Delete a USES item
DELUSES(PARENT,ITM) ;EP-
+1 NEW PID,ITMIEN,FDA
+2 SET PID=$$PRGID^CIAVMCFG(PARENT)
+3 IF PID
Begin DoDot:1
+4 SET ITMIEN=$$FIND1^DIC(19930.221,","_PID_",","B",ITM)
+5 IF ITMIEN
Begin DoDot:2
+6 SET FDA(19930.221,ITMIEN_","_PID_",",.01)="@"
+7 DO FILE^DIE(,"FDA")
End DoDot:2
End DoDot:1
+8 QUIT
+9 ;
UPDCHM ;EP-
+1 NEW CHM,PID
+2 FOR CHM=0:1
SET X=$PIECE($TEXT(CHM+CHM),";;",2)
IF '$LENGTH(X)
QUIT
Begin DoDot:1
+3 SET PID=$$PRGID^CIAVMCFG($PIECE(X,";"))
+4 DO AECHM(PID,$PIECE(X,";",2,99))
End DoDot:1
+5 WRITE !!
+6 QUIT
+7 ;
AECHM(PID,VAL) ;EP-
+1 NEW LN,FN,IDX,TXT,ARY,CNT,IENS
+2 SET FN=$PIECE(VAL,";")
SET CNT=0
+3 SET LN=0
FOR
SET LN=$ORDER(^CIAVOBJ(19930.2,PID,6,LN))
IF 'LN
QUIT
Begin DoDot:1
+4 SET TXT=^CIAVOBJ(19930.2,PID,6,LN,0)
+5 SET ARY(LN,0)=TXT
SET CNT=CNT+1
+6 IF $$UP^XLFSTR(TXT)[$$UP^XLFSTR($PIECE(VAL,";"))
SET IDX=LN
End DoDot:1
IF $GET(IDX)
QUIT
+7 IF $GET(IDX)
Begin DoDot:1
+8 SET ^CIAVOBJ(19930.2,PID,6,IDX,0)=VAL
End DoDot:1
+9 IF '$TEST
Begin DoDot:1
+10 SET ARY($SELECT('CNT:1,1:CNT+1),0)=VAL
+11 SET IENS=PID_","
+12 SET FDA(19930.2,IENS,10)="ARY"
+13 DO FILE^DIE(,"FDA")
End DoDot:1
+14 QUIT
+15 ; Rename .01 field of BEH Measurement file
BEHMSR(X,Y) ;
+1 NEW IEN,FDA
+2 SET IEN=$ORDER(^BEHOVM(90460.01,"B",X,0))
+3 IF 'IEN
QUIT
+4 SET FDA(90460.01,IEN_",",.01)=Y
+5 DO FILE^DIE(,"FDA")
+6 QUIT
VER ;;BEHALLERGIES.ALLERGIES;4.2.5.1;8D715397DAB968E4452A00CF36889A7B
+1 ;;BEHRXGENERATORSERVICE.RXGENERATOR;1.0.5711.21573;902BAC82C3BFD3695C6598FEEF929EC1
+2 ;;BEHCIR.CIRCTRL;1.0.5681.17468;BD794C23F2907AAF99BFB18BF1CE9FB6
+3 ;;BEHCCDA.CCDACTRL;1.0.5729.29151;50A518608E153B88A854765BAEBDB448
+4 ;;
CHM ;;BEHALLERGIES.ALLERGIES;BEHAllergies.chm;2015.7.13.171904;DB692179FA69E9D43661B50CA926C595
+1 ;;BEHMEDS.MEDMANAGEMENT;BEHMeds.chm;2015.7.13.172056;F1E97FE4BDAAEC9ACC3D5144EB8A8090
+2 ;;BEHCCDA.CCDACTRL;BEHCCDA.CHM;2015.7.22.163820;1DA08C6490CED1369C95017C3ACBD9C0
+3 ;;