CIAVIP11 ;MSC/IND/PLS - EHR v1.1p11 Inits;14-Apr-2013 11:59;DKM
;;1.1;VUECENTRIC FRAMEWORK;;23-Oct-2006
;;Copyright 2000-2012, 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 !!!
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.")
D UPDCHM
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
;
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(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 ;;BEHORDERS.ORDERENTRY;27.1.0.5;A9C50FD2D4A15C1ACC9B74AF591D467C
;;BEHOPTIONS.OPTIONS;1.1.3.4;2792F5AEF7857B6E4A226903946FDCF5
;;VCQUICKNOTE.QUICKNOTE;1.1.3.3;2B3F220C050242905A1798097F31B5DA
;;BEHCOMMUNITYINFO.COMMUNITYINFO;1.1.0.63;70809FC22D09F548D1F2B983DC2EC078
;;BEHINFOBTNSVC.INFOBTNSVC;1.1.0.12;B7F85E0CF3C373F731FD881537F3C473
;;BEHVITALS.VITALDISPLAY;5.0.4.8;01555E8EE26B3512EFB1C55CA3CDC0CD
;;BEHPHARMED.PHARMED;1.0.2.2;4B8CEA693160D24EB2F0F8E791D576A9
;;BEHRXGENERATORSERVICE.RXGENERATOR;1.0.0.80;E3162BC71F6D5BBDDB0D7352046E7C22
;;BEHREMINDERSVIEW.REMINDERSVIEW;4.2.4.1;68E946EE3985D3AB685B86E0D038E0A2
;;BEHESIGREVIEW.REVIEW;20.1.2.5;23E9021E2FC30E2E6BEFAA203DE61432
;;BEHESIGSERVICE.ESIGSERVICE;20.1.3.18;BCDFADB96FCFB9384F968B4F40DEE404
;;BEHQOWIZARD.QOWIZARD;1.1.4.21;7C8AE5E57AC5BC26555598005A67DDA4
;;INDIANHEALTHSERVICE.BEH.IBH.SUICIDE.CONTROLS.CTLSUICIDE_FORM;1.1.4300.2;F6849E21244EBBF9F84F557AE23569D8
;;
CHM ;;BEHMEDLIST.MEDLIST;BEHMedList.chm;2012.10.29.215058;72C8EC7337BD69A9D284EEE59066F74E
;;BEHALLERGIES.ALLERGIES;BEHAllergies.chm;2012.10.24.155448;49EFC4DBBE8205C58E3E3689AB499273
;;BEHCONSULTS.CONSULTS;BEHConsults.chm;2012.10.4.160054;8EC0A6EDC13EFB7B63949B6E567F8F71
;;BEHCRISES.CRISES;BEHCrises.chm;2012.10.4.185004;861E9CBEED95DF9CA9F2071FA1DC0A40
;;BEHDCSUMM.DCSUMM;BEHDCSumm.chm;2012.8.2.175800;A29D4FAB537E129FF8E9206BBAFF2879
;;BEHENCOUNTERINFO.ENCOUNTERINFO;BEHEncounterInfo.chm;2012.10.30.202908;477DB472D586FF8BFA59CCAA3294B2B8
;;BEHLABORDERS.LABORDERS;BEHLabOrders.chm;2012.10.11.125714;84492C04C475006B8490607CC569A94B
;;BEHNOTIFICATIONS.NOTIFICATIONS;BEHNotifications.chm;2012.10.16.193300;FFFFBEF96BFF2A35C9075A144F4A13B0
;;BEHPATIENTID.PATIENTID;BEHPatientID.chm;2012.8.3.183300;29BE120BA3919494C91DFE3D44FA0814
;;BEHPROBLEMLIST.PROBLEMLIST;BEHProblemList.chm;2012.10.31.160410;D8E6F21DCF75BDB76E244F638196BD8C
;;BEHMEDS.MEDMANAGEMENT;BEHMeds.chm;2012.10.29.181542;E3E30BB0CE1A796557597AFFD798F28A
;;BEHLAB.LABVIEW;BEHLab.chm;2012.8.10.180500;0F6BF48B7F7FA5FBC40068F11A8BBF4A
;;CSS_PATIENT.PATIENT;CSSPatient.chm;2012.8.17.132800;8006B186338962D3C903CEC2F864D21C
;;BEHNOTES.PROGRESSNOTES;BEHNotes.chm;2012.10.25.141030;BC557DBDA27694075FFC01615072B066
;;BEHVISITS.VISITS;BEHVisits.chm;2012.10.4.155432;9A0233B409799928C27D84DA435892E1
;;BEHREMINDERS.REMINDERS;BEHReminders.chm;2012.10.18.131922;AFEEA09F88DCA09C26C445E0473D769F
;;BEHREPORTS.REPORTS;BEHReports.chm;2012.10.25.190120;D1E50B5A2717E698514C63D7BA48C517
;;BEHPHARMED.PHARMED;BEHPharmEd.chm;2012.8.24.183516;257E5DF919E6D3953A7C6AB1C76E86DA
;;BEHREMINDERSVIEW.REMINDERSVIEW;BEHRemindersView.chm;2012.8.28.153600;9B3CFAEEDF196552C1418AA41C1E82E9
;;BEHVITALS.VITALDISPLAY;BEHVitals.chm;2012.8.28.194700;FE7BBBA024F78191F7F8053A051B287B
;;BEHORDERS.ORDERENTRY;BEHOrders.chm;2012.10.24.151004;B9FC01A02F5244EB4301BE71B302A616
;;VCQUICKNOTE.QUICKNOTE;vcQuickNote.chm;2012.9.6.163852;F568208DF803F2991A9A16C0093B5310
;;INDIANHEALTHSERVICE.BEH.POCLAB.BEHLABPOC;Lab_POC_Data_Entry.chm;2012.9.10.171300;F07331F5B9E8F6C69166D3A095FD822F
;;BEHLAB.LABVIEW;BEHLab.chm;2012.9.10.205400;D51962ACDFFD26D9C3EDFA58C56636D2
;;
CIAVIP11 ;MSC/IND/PLS - EHR v1.1p11 Inits;14-Apr-2013 11:59;DKM
+1 ;;1.1;VUECENTRIC FRAMEWORK;;23-Oct-2006
+2 ;;Copyright 2000-2012, 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 IF $LENGTH($$GETLOGIN^CIAVUTIL)
IF $$ASK^CIAU("Do you want to enable EHR logins","Y")
Begin DoDot:1
+9 DO SDABORT^CIAVUTIL(,1)
DO BMES^XPDUTL("Application logins have been enabled.")
End DoDot:1
+10 DO UPDCHM
+11 QUIT
+12 ; 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 ;
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(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 ;;BEHORDERS.ORDERENTRY;27.1.0.5;A9C50FD2D4A15C1ACC9B74AF591D467C
+1 ;;BEHOPTIONS.OPTIONS;1.1.3.4;2792F5AEF7857B6E4A226903946FDCF5
+2 ;;VCQUICKNOTE.QUICKNOTE;1.1.3.3;2B3F220C050242905A1798097F31B5DA
+3 ;;BEHCOMMUNITYINFO.COMMUNITYINFO;1.1.0.63;70809FC22D09F548D1F2B983DC2EC078
+4 ;;BEHINFOBTNSVC.INFOBTNSVC;1.1.0.12;B7F85E0CF3C373F731FD881537F3C473
+5 ;;BEHVITALS.VITALDISPLAY;5.0.4.8;01555E8EE26B3512EFB1C55CA3CDC0CD
+6 ;;BEHPHARMED.PHARMED;1.0.2.2;4B8CEA693160D24EB2F0F8E791D576A9
+7 ;;BEHRXGENERATORSERVICE.RXGENERATOR;1.0.0.80;E3162BC71F6D5BBDDB0D7352046E7C22
+8 ;;BEHREMINDERSVIEW.REMINDERSVIEW;4.2.4.1;68E946EE3985D3AB685B86E0D038E0A2
+9 ;;BEHESIGREVIEW.REVIEW;20.1.2.5;23E9021E2FC30E2E6BEFAA203DE61432
+10 ;;BEHESIGSERVICE.ESIGSERVICE;20.1.3.18;BCDFADB96FCFB9384F968B4F40DEE404
+11 ;;BEHQOWIZARD.QOWIZARD;1.1.4.21;7C8AE5E57AC5BC26555598005A67DDA4
+12 ;;INDIANHEALTHSERVICE.BEH.IBH.SUICIDE.CONTROLS.CTLSUICIDE_FORM;1.1.4300.2;F6849E21244EBBF9F84F557AE23569D8
+13 ;;
CHM ;;BEHMEDLIST.MEDLIST;BEHMedList.chm;2012.10.29.215058;72C8EC7337BD69A9D284EEE59066F74E
+1 ;;BEHALLERGIES.ALLERGIES;BEHAllergies.chm;2012.10.24.155448;49EFC4DBBE8205C58E3E3689AB499273
+2 ;;BEHCONSULTS.CONSULTS;BEHConsults.chm;2012.10.4.160054;8EC0A6EDC13EFB7B63949B6E567F8F71
+3 ;;BEHCRISES.CRISES;BEHCrises.chm;2012.10.4.185004;861E9CBEED95DF9CA9F2071FA1DC0A40
+4 ;;BEHDCSUMM.DCSUMM;BEHDCSumm.chm;2012.8.2.175800;A29D4FAB537E129FF8E9206BBAFF2879
+5 ;;BEHENCOUNTERINFO.ENCOUNTERINFO;BEHEncounterInfo.chm;2012.10.30.202908;477DB472D586FF8BFA59CCAA3294B2B8
+6 ;;BEHLABORDERS.LABORDERS;BEHLabOrders.chm;2012.10.11.125714;84492C04C475006B8490607CC569A94B
+7 ;;BEHNOTIFICATIONS.NOTIFICATIONS;BEHNotifications.chm;2012.10.16.193300;FFFFBEF96BFF2A35C9075A144F4A13B0
+8 ;;BEHPATIENTID.PATIENTID;BEHPatientID.chm;2012.8.3.183300;29BE120BA3919494C91DFE3D44FA0814
+9 ;;BEHPROBLEMLIST.PROBLEMLIST;BEHProblemList.chm;2012.10.31.160410;D8E6F21DCF75BDB76E244F638196BD8C
+10 ;;BEHMEDS.MEDMANAGEMENT;BEHMeds.chm;2012.10.29.181542;E3E30BB0CE1A796557597AFFD798F28A
+11 ;;BEHLAB.LABVIEW;BEHLab.chm;2012.8.10.180500;0F6BF48B7F7FA5FBC40068F11A8BBF4A
+12 ;;CSS_PATIENT.PATIENT;CSSPatient.chm;2012.8.17.132800;8006B186338962D3C903CEC2F864D21C
+13 ;;BEHNOTES.PROGRESSNOTES;BEHNotes.chm;2012.10.25.141030;BC557DBDA27694075FFC01615072B066
+14 ;;BEHVISITS.VISITS;BEHVisits.chm;2012.10.4.155432;9A0233B409799928C27D84DA435892E1
+15 ;;BEHREMINDERS.REMINDERS;BEHReminders.chm;2012.10.18.131922;AFEEA09F88DCA09C26C445E0473D769F
+16 ;;BEHREPORTS.REPORTS;BEHReports.chm;2012.10.25.190120;D1E50B5A2717E698514C63D7BA48C517
+17 ;;BEHPHARMED.PHARMED;BEHPharmEd.chm;2012.8.24.183516;257E5DF919E6D3953A7C6AB1C76E86DA
+18 ;;BEHREMINDERSVIEW.REMINDERSVIEW;BEHRemindersView.chm;2012.8.28.153600;9B3CFAEEDF196552C1418AA41C1E82E9
+19 ;;BEHVITALS.VITALDISPLAY;BEHVitals.chm;2012.8.28.194700;FE7BBBA024F78191F7F8053A051B287B
+20 ;;BEHORDERS.ORDERENTRY;BEHOrders.chm;2012.10.24.151004;B9FC01A02F5244EB4301BE71B302A616
+21 ;;VCQUICKNOTE.QUICKNOTE;vcQuickNote.chm;2012.9.6.163852;F568208DF803F2991A9A16C0093B5310
+22 ;;INDIANHEALTHSERVICE.BEH.POCLAB.BEHLABPOC;Lab_POC_Data_Entry.chm;2012.9.10.171300;F07331F5B9E8F6C69166D3A095FD822F
+23 ;;BEHLAB.LABVIEW;BEHLab.chm;2012.9.10.205400;D51962ACDFFD26D9C3EDFA58C56636D2
+24 ;;