MHV1P5 ;WAS/GPM - My HealtheVet Install Utility Routine ; [4/29/08 11:49pm]
;;1.0;My HealtheVet;**5**;Aug 23, 2005;Build 24
;;Per VHA Directive 2004-038, this routine should not be modified.
;
; Integration Agreements:
; 10141 : BMES^XPDUTL
; : MES^XPDUTL
;
ENV ;
Q
;
PRE ; Pre-init routine
; Turn on MHV Application Logging, add a log entry for the start
; of the patch install.
D LOGON
D LOG^MHVUL2(XPDNM,"PRE-INIT","S","TRACE")
Q
;
POST ; Post-init routine
N ERR
D LOG^MHVUL2(XPDNM,"POST-INIT BEGIN","S","TRACE")
;
D BMES^XPDUTL(" Creating SECURE MESSAGING clinic")
I '$$CLINIC(.ERR) D
. I ERR="ENTRY EXISTS" D Q
. . D BMES^XPDUTL(" *** SECURE MESSAGING clinic exists")
. . D MES^XPDUTL(" This may be because this patch has already been installed.")
. . D MES^XPDUTL(" If this is the first installation of this patch,")
. . D MES^XPDUTL(" Please log a remedy ticket.")
. . Q
. D BMES^XPDUTL(" *** Error creating SECURE MESSAGING clinic")
. D MES^XPDUTL(" Please log a remedy ticket.")
. Q
;
D QRYSETUP
;
D LOG^MHVUL2(XPDNM,"POST-INIT END","S","TRACE")
D LOGOFF
D RESET^MHVUL2
Q
;
LOGON ; Turn on MHV application logging
N UPDATE,SUCCESS
D BMES^XPDUTL(" Turning on MHV Application Logging")
S UPDATE("STATE")=1
S UPDATE("DELETE")=$$HTFM^XLFDT($H+60)
S UPDATE("LEVEL")="DEBUG"
D LOGSET^MHVUL1(.SUCCESS,.UPDATE)
Q
;
LOGOFF ; Turn off MHV application logging
N SUCCESS
D BMES^XPDUTL(" Turning off MHV Application Logging")
D LOGOFF^MHVUL1(.SUCCESS)
Q
;
CLINIC(ERR) ; Set up HOSPITAL LOCATION entry (file #44)
N CIEN,TIEN,IENS,FDA
D LOG^MHVUL2("CREATE SM CLINIC","BEGIN","S","TRACE")
K ERR
S ERR=""
;
S CIEN=$$FIND1^DIC(44,"","X","SECURE MESSAGING","B","","ERR")
I CIEN D Q 0
. S ERR="ENTRY EXISTS"
. D LOG^MHVUL2("CREATE SM CLINIC FAILED",ERR,"S","ERROR")
. Q
I $G(ERR("DIERR")) D Q 0
. S ERR=$G(ERR("DIERR",1))_"^"_$G(ERR("DIERR",1,"TEXT",1))
. D LOG^MHVUL2("CREATE SM CLINIC FAILED",ERR,"S","ERROR")
. Q
;
S TIEN=$$FIND1^DIC(40.9,"","X","OTHER LOCATION","B","","ERR")
I 'TIEN D Q 0
. I '$G(ERR("DIERR")) S ERR("DIERR",1,"TEXT",1)="NOT FOUND"
. S ERR=$G(ERR("DIERR",1))_"^"_$G(ERR("DIERR",1,"TEXT",1))
. D LOG^MHVUL2("CREATE SM CLINIC FAILED",ERR,"S","ERROR")
. Q
;
S IENS="+1,"
S FDA(44,IENS,.01)="SECURE MESSAGING"
S FDA(44,IENS,1)="SM" ;ABBREVIATION
S FDA(44,IENS,2)="Z" ;TYPE - other location
S FDA(44,IENS,2.1)=TIEN ;TYPE EXTENSION
S FDA(44,IENS,3)=+$$SITE^VASITE ;INSTITUTION
S FDA(44,IENS,10)="Secure Messaging System" ; PHYSICAL LOCATION
S FDA(44,IENS,2502)="Y" ;NON-COUNT CLINIC?
S FDA(44,IENS,2504)="N" ;CLINIC MEETS AT FACILITY?
D UPDATE^DIE("","FDA","","ERR")
I $G(ERR("DIERR")) D Q 0
. S ERR=$G(ERR("DIERR",1))_"^"_$G(ERR("DIERR",1,"TEXT",1))
. D LOG^MHVUL2("CREATE SM CLINIC FAILED",ERR,"S","ERROR")
. Q
;
D LOG^MHVUL2("CREATE SM CLINIC","SUCCESS","S","TRACE")
Q 1
;
QRYSETUP ; Setup for demographics query
; Setup MHV REQUEST TYPE and MHV RESPONSE MAP
;
N FIELDS,ERR
S ERR=""
S FIELDS("REQUEST TYPE")="SM-DEMOGRAPHICS"
S FIELDS("NUMBER")=25
S FIELDS("BLOCK")=1
S FIELDS("REALTIME")=1
S FIELDS("DATATYPE")="SMDemographics"
S FIELDS("EXECUTE")="EXTRACT~MHVXDEMS"
S FIELDS("DESCRIPTION",1)="QRY^A19 query for patient demographics."
S FIELDS("DESCRIPTION",2)="Specify patient by ICN, DFN, or SSN."
S FIELDS("DESCRIPTION",3)="Developed for Secure Messaging."
D LOG^MHVUL2("UPDATE REQUEST TYPE",.FIELDS,"M","DEBUG")
D UPDREQ^MHVU2(.FIELDS,1,.ERR)
I ERR'="" D
. D LOG^MHVUL2("UPDATE FAILED",ERR,"S","ERROR")
. D BMES^XPDUTL(" *** An Error occurred during installation.")
. D MES^XPDUTL(" Please log a remedy ticket.")
. Q
;
K FIELDS
S ERR=""
S FIELDS("SUBSCRIBER")="MHVSM QRY-A19 Subscriber"
S FIELDS("PROTOCOL")="MHVSM ADR-A19 Event Driver"
S FIELDS("BUILDER")="ADRA19~MHV7B8"
S FIELDS("SEGMENT")="PID"
D LOG^MHVUL2("UPDATE RESPONSE MAP",.FIELDS,"M","DEBUG")
D UPDMAP^MHVU2(.FIELDS,1,.ERR)
I ERR'="" D
. D LOG^MHVUL2("UPDATE FAILED",ERR,"S","ERROR")
. D BMES^XPDUTL(" *** An Error occurred during installation.")
. D MES^XPDUTL(" Please log a remedy ticket.")
. Q
;
S ERR=""
D LOG^MHVUL2("ENABLE","SM-DEMOGRAPHICS","S","TRACE")
D TOGGLE^MHVU2("SM-DEMOGRAPHICS","ENABLE",.ERR)
I ERR'="" D
. D LOG^MHVUL2("ENABLE FAILED",ERR,"S","ERROR")
. D BMES^XPDUTL(" *** An Error occurred during installation.")
. D MES^XPDUTL(" Please log a remedy ticket.")
. Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMHV1P5 4719 printed Nov 22, 2024@17:25:36 Page 2
MHV1P5 ;WAS/GPM - My HealtheVet Install Utility Routine ; [4/29/08 11:49pm]
+1 ;;1.0;My HealtheVet;**5**;Aug 23, 2005;Build 24
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 ; Integration Agreements:
+5 ; 10141 : BMES^XPDUTL
+6 ; : MES^XPDUTL
+7 ;
ENV ;
+1 QUIT
+2 ;
PRE ; Pre-init routine
+1 ; Turn on MHV Application Logging, add a log entry for the start
+2 ; of the patch install.
+3 DO LOGON
+4 DO LOG^MHVUL2(XPDNM,"PRE-INIT","S","TRACE")
+5 QUIT
+6 ;
POST ; Post-init routine
+1 NEW ERR
+2 DO LOG^MHVUL2(XPDNM,"POST-INIT BEGIN","S","TRACE")
+3 ;
+4 DO BMES^XPDUTL(" Creating SECURE MESSAGING clinic")
+5 IF '$$CLINIC(.ERR)
Begin DoDot:1
+6 IF ERR="ENTRY EXISTS"
Begin DoDot:2
+7 DO BMES^XPDUTL(" *** SECURE MESSAGING clinic exists")
+8 DO MES^XPDUTL(" This may be because this patch has already been installed.")
+9 DO MES^XPDUTL(" If this is the first installation of this patch,")
+10 DO MES^XPDUTL(" Please log a remedy ticket.")
+11 QUIT
End DoDot:2
QUIT
+12 DO BMES^XPDUTL(" *** Error creating SECURE MESSAGING clinic")
+13 DO MES^XPDUTL(" Please log a remedy ticket.")
+14 QUIT
End DoDot:1
+15 ;
+16 DO QRYSETUP
+17 ;
+18 DO LOG^MHVUL2(XPDNM,"POST-INIT END","S","TRACE")
+19 DO LOGOFF
+20 DO RESET^MHVUL2
+21 QUIT
+22 ;
LOGON ; Turn on MHV application logging
+1 NEW UPDATE,SUCCESS
+2 DO BMES^XPDUTL(" Turning on MHV Application Logging")
+3 SET UPDATE("STATE")=1
+4 SET UPDATE("DELETE")=$$HTFM^XLFDT($HOROLOG+60)
+5 SET UPDATE("LEVEL")="DEBUG"
+6 DO LOGSET^MHVUL1(.SUCCESS,.UPDATE)
+7 QUIT
+8 ;
LOGOFF ; Turn off MHV application logging
+1 NEW SUCCESS
+2 DO BMES^XPDUTL(" Turning off MHV Application Logging")
+3 DO LOGOFF^MHVUL1(.SUCCESS)
+4 QUIT
+5 ;
CLINIC(ERR) ; Set up HOSPITAL LOCATION entry (file #44)
+1 NEW CIEN,TIEN,IENS,FDA
+2 DO LOG^MHVUL2("CREATE SM CLINIC","BEGIN","S","TRACE")
+3 KILL ERR
+4 SET ERR=""
+5 ;
+6 SET CIEN=$$FIND1^DIC(44,"","X","SECURE MESSAGING","B","","ERR")
+7 IF CIEN
Begin DoDot:1
+8 SET ERR="ENTRY EXISTS"
+9 DO LOG^MHVUL2("CREATE SM CLINIC FAILED",ERR,"S","ERROR")
+10 QUIT
End DoDot:1
QUIT 0
+11 IF $GET(ERR("DIERR"))
Begin DoDot:1
+12 SET ERR=$GET(ERR("DIERR",1))_"^"_$GET(ERR("DIERR",1,"TEXT",1))
+13 DO LOG^MHVUL2("CREATE SM CLINIC FAILED",ERR,"S","ERROR")
+14 QUIT
End DoDot:1
QUIT 0
+15 ;
+16 SET TIEN=$$FIND1^DIC(40.9,"","X","OTHER LOCATION","B","","ERR")
+17 IF 'TIEN
Begin DoDot:1
+18 IF '$GET(ERR("DIERR"))
SET ERR("DIERR",1,"TEXT",1)="NOT FOUND"
+19 SET ERR=$GET(ERR("DIERR",1))_"^"_$GET(ERR("DIERR",1,"TEXT",1))
+20 DO LOG^MHVUL2("CREATE SM CLINIC FAILED",ERR,"S","ERROR")
+21 QUIT
End DoDot:1
QUIT 0
+22 ;
+23 SET IENS="+1,"
+24 SET FDA(44,IENS,.01)="SECURE MESSAGING"
+25 ;ABBREVIATION
SET FDA(44,IENS,1)="SM"
+26 ;TYPE - other location
SET FDA(44,IENS,2)="Z"
+27 ;TYPE EXTENSION
SET FDA(44,IENS,2.1)=TIEN
+28 ;INSTITUTION
SET FDA(44,IENS,3)=+$$SITE^VASITE
+29 ; PHYSICAL LOCATION
SET FDA(44,IENS,10)="Secure Messaging System"
+30 ;NON-COUNT CLINIC?
SET FDA(44,IENS,2502)="Y"
+31 ;CLINIC MEETS AT FACILITY?
SET FDA(44,IENS,2504)="N"
+32 DO UPDATE^DIE("","FDA","","ERR")
+33 IF $GET(ERR("DIERR"))
Begin DoDot:1
+34 SET ERR=$GET(ERR("DIERR",1))_"^"_$GET(ERR("DIERR",1,"TEXT",1))
+35 DO LOG^MHVUL2("CREATE SM CLINIC FAILED",ERR,"S","ERROR")
+36 QUIT
End DoDot:1
QUIT 0
+37 ;
+38 DO LOG^MHVUL2("CREATE SM CLINIC","SUCCESS","S","TRACE")
+39 QUIT 1
+40 ;
QRYSETUP ; Setup for demographics query
+1 ; Setup MHV REQUEST TYPE and MHV RESPONSE MAP
+2 ;
+3 NEW FIELDS,ERR
+4 SET ERR=""
+5 SET FIELDS("REQUEST TYPE")="SM-DEMOGRAPHICS"
+6 SET FIELDS("NUMBER")=25
+7 SET FIELDS("BLOCK")=1
+8 SET FIELDS("REALTIME")=1
+9 SET FIELDS("DATATYPE")="SMDemographics"
+10 SET FIELDS("EXECUTE")="EXTRACT~MHVXDEMS"
+11 SET FIELDS("DESCRIPTION",1)="QRY^A19 query for patient demographics."
+12 SET FIELDS("DESCRIPTION",2)="Specify patient by ICN, DFN, or SSN."
+13 SET FIELDS("DESCRIPTION",3)="Developed for Secure Messaging."
+14 DO LOG^MHVUL2("UPDATE REQUEST TYPE",.FIELDS,"M","DEBUG")
+15 DO UPDREQ^MHVU2(.FIELDS,1,.ERR)
+16 IF ERR'=""
Begin DoDot:1
+17 DO LOG^MHVUL2("UPDATE FAILED",ERR,"S","ERROR")
+18 DO BMES^XPDUTL(" *** An Error occurred during installation.")
+19 DO MES^XPDUTL(" Please log a remedy ticket.")
+20 QUIT
End DoDot:1
+21 ;
+22 KILL FIELDS
+23 SET ERR=""
+24 SET FIELDS("SUBSCRIBER")="MHVSM QRY-A19 Subscriber"
+25 SET FIELDS("PROTOCOL")="MHVSM ADR-A19 Event Driver"
+26 SET FIELDS("BUILDER")="ADRA19~MHV7B8"
+27 SET FIELDS("SEGMENT")="PID"
+28 DO LOG^MHVUL2("UPDATE RESPONSE MAP",.FIELDS,"M","DEBUG")
+29 DO UPDMAP^MHVU2(.FIELDS,1,.ERR)
+30 IF ERR'=""
Begin DoDot:1
+31 DO LOG^MHVUL2("UPDATE FAILED",ERR,"S","ERROR")
+32 DO BMES^XPDUTL(" *** An Error occurred during installation.")
+33 DO MES^XPDUTL(" Please log a remedy ticket.")
+34 QUIT
End DoDot:1
+35 ;
+36 SET ERR=""
+37 DO LOG^MHVUL2("ENABLE","SM-DEMOGRAPHICS","S","TRACE")
+38 DO TOGGLE^MHVU2("SM-DEMOGRAPHICS","ENABLE",.ERR)
+39 IF ERR'=""
Begin DoDot:1
+40 DO LOG^MHVUL2("ENABLE FAILED",ERR,"S","ERROR")
+41 DO BMES^XPDUTL(" *** An Error occurred during installation.")
+42 DO MES^XPDUTL(" Please log a remedy ticket.")
+43 QUIT
End DoDot:1
+44 ;