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

PXRMP19I.m

Go to the documentation of this file.
PXRMP19I ; BP/AGP/WAT - PXRM*2.0*19 INSTALL ROUTINE. ;02/27/17  13:27
 ;;2.0;CLINICAL REMINDERS;**19**;Feb 04, 2005;Build 187
 Q
 ;2053 UPDATE^DIE | 3217 $$FIND1^DIC | 2056 $$GET1^DIQ | 10103 $$FMADD^XLFDT| 10067 DES^XMA21 | 5249 ^TIU(8925.1
 ;5247 ^GMT(142 | 10141 ^XPDUTL | 4440 PROD^XUPROD | 2541 KSP^XUPARAM | 1131 ^XMB("NETNAME") | 10067 DES^XMA21 | 2172 XPDID
 ;
PRE ;
 N INC
 I $D(^XTMP("PXRM CCHT_HT")) S INC=(+$O(^XTMP("PXRM CCHT_HT",1000000000),-1)+1)
 E  S INC=1
 S ^XTMP("PXRM CCHT_HT",0)=$$FMADD^XLFDT(DT,90)_"^"_DT_"^"_"CONTAINS ANY ITEMS RENAMED BY PXRM*2.0*19"
 N P47I
 S P47I=$$PATCH^XPDUTL("PXRM*2.0*47")
 I 'P47I D
 . D OPTION^PXRMUTIL("DISABLE")
 . D PROTOCOL^PXRMUTIL("DISABLE")
 I P47I D
 . D OPTIONS^PXRMUTIL("DISABLE","INSTALL OF PXRM*2.0*19")
 . D PROTCOLS^PXRMUTIL("DISABLE","INSTALL OF PXRM*2.0*19")
 D HFACTOR^PXRMP19B
 D EDTOPICS
 D INSTUB
 D DELEXE^PXRMEXSI("EXARRAY","PXRMP19E")
 Q
 ;
POST ;
 K:$D(^XTMP("PXRM19RECIPS")) ^XTMP("PXRM19RECIPS")
 N XPDIDTOT,PXRMNUM,PXRMPOST,OUTPUT
 N XMDUZ,XMDF,XMMG,X,XMOUT,XMY,DIR,NXT
 S XPDIDTOT=6,PXRMNUM=1,PXRMPOST=1
 S OUTPUT(1)="The post-install will generate a single MailMan message:"
 S OUTPUT(2)="LOCAL CCHT HFs NOT USED IN NAT'L HT CLIN REMINDER CONTENT"
 S OUTPUT(3)="The installer is strongly encouraged to include the site's local Clinical"
 S OUTPUT(4)="Reminders support/configuration personnel/mail group as recipients."
 ;Enable options and protocols
 N P47I
 S P47I=$$PATCH^XPDUTL("PXRM*2.0*47")
 I 'P47I D
 . D OPTION^PXRMUTIL("ENABLE")
 . D PROTOCOL^PXRMUTIL("ENABLE")
 I P47I D
 . D OPTIONS^PXRMUTIL("ENABLE","INSTALL OF PXRM*2.0*19")
 . D PROTCOLS^PXRMUTIL("ENABLE","INSTALL OF PXRM*2.0*19")
 D BMES^XPDUTL("Preparing to install Reminder Exchange entry VA-HT PROJECT.")
 D MES^XPDUTL("This is a very large entry that installs numerous components.")
 D MES^XPDUTL("Installation of this entry will take 10-15 minutes.")
 D SMEXINS^PXRMEXSI("EXARRAY","PXRMP19E")
 D UPDATE
 D BMES^XPDUTL(.OUTPUT)
 S XMDUZ=DUZ
 D DES^XMA21
 I $D(XMY)>9 D
 .S ^XTMP("PXRM19RECIPS",0)=$$FMADD^XLFDT(DT,31)_U_DT_U_"RECIPIENTS OF PXRM*2.0*19 POST INSTALL MESSAGES"
 .M ^XTMP("PXRM19RECIPS")=XMY
 D QUEUE^PXRMP19A("post-install message","MAIN^PXRMP19A","PXRM*2.0*19 HT MAILMAM REPORT",.PXRMNUM)
 D ORWPCE^PXRMP19A(.PXRMNUM)
 D TIURMDLG^PXRMP19A(.PXRMNUM)
 D SETTIU
 D SENDIM
 Q
 ;
UPDATE ;update progress bar during post-install
 I $G(PXRMPOST)=1 D UPDATE^XPDID(PXRMNUM) S PXRMNUM=PXRMNUM+1
 Q
 ;
SETTIU ;set tiu obj class owner
 ;;HT CAREGIVER
 ;;HT CATEGORY OF CARE
 ;;HT EMERGENCY PRIORITY RATING
 ;;HT ENROLLMENT START DATE
 ;;HT MED RECON
 ;;HT NIC/CCM RATING LAST
 ;;HT REMINDERS DUE
 ;;ADMISSIONS PAST YR
 ;;GEC BASIC ADLS (LAST)
 ;;GEC IADLS (LAST)
 ;;OUTPT APPTS PAST YR
 ;;NEXT OF KIN
 ;;EOF
 D MES^XPDUTL("Setting Data Fields for TIU-HS Objects")
 N FDA,FDAIEN,ERRMSG,MSG,OBJIEN,HSI,HSTYPE,NAME,OWNER,PXRMERR
 S HSI=""
 S OWNER=$$LU(8930,"CLINICAL COORDINATOR")
 S FDAIEN="?1"
 F HSI=1:1 S HSTYPE=$P($T(SETTIU+HSI),";",3) Q:HSTYPE="EOF"  D
 .N FDA
 .S NAME=$P($T(SETTIU+HSI),";;",2)
 .S OBJIEN=$$LU(8925.1,NAME)
 .I $G(OBJIEN)=0 D BMES^XPDUTL(NAME_" not found in TIU DOCUMENT DEFINITION file") Q
 .I $G(OBJIEN)="" S ERRMSG="Error during lookup.  The error returned was:" D ERR(ERRMSG,.PXRMERR) Q
 .Q:$P(^TIU(8925.1,$G(OBJIEN),0),U,4)'="O"
 .S FDA(8925.1,OBJIEN_",",.06)=$G(OWNER)
 .S FDA(8925.1,OBJIEN_",",.13)="YES"
 .S FDA(8925.1,OBJIEN_",",99)=$H
 .D UPDATE^DIE("","FDA","","MSG")
 .I $D(MSG("DIERR")) S ERRMSG="Error setting data..." D ERR(ERRMSG,.MSG) Q
 D BMES^XPDUTL("Setting Data Fields Complete")
 D UPDATE
 Q
 ;
ERR(ERRMSG,MSG) ; error
 I $D(MSG) D  Q
 .D BMES^XPDUTL($G(ERRMSG))
 .S MSG="" F  S MSG=$O(MSG("DIERR",1,"TEXT",MSG)) Q:MSG=""  W MSG("DIERR",1,"TEXT",MSG),!
 Q
 ;
LU(FILE,NAME) ; DBS lookup
 Q $$FIND1^DIC(FILE,"","X",NAME,,,"PXRMERR")
 ;
SENDIM ;Send install message.
 N FROM,NODE,PARAM,SYSTEM,SUBJECT,TO,VALUE
 S NODE="PXRM*2.0*19"
 K ^TMP(NODE,$J)
 S FROM="PXRM*2.0*19 Install@"_^XMB("NETNAME")
 S SYSTEM=$$KSP^XUPARAM("WHERE")
 I $$PROD^XUPROD(1) S TO("G.CLINICAL REMINDERS SUPPORT@DOMAIN.EXT")=""
 E  D
 . N MGIEN,MGROUP
 . S MGIEN=$G(^PXRM(800,1,"MGFE"))
 . S MGROUP=$S(MGIEN'="":"G."_$$GET1^DIQ(3.8,MGIEN,.01),1:DUZ)
 . S TO(MGROUP)=""
 S SUBJECT="Install of PXRM*2.0*19"
 S ^TMP(NODE,$J,1,0)="PXRM*2.0*19 has been installed."
 S ^TMP(NODE,$J,2,0)="System is "_SYSTEM
 D SEND^PXRMMSG(NODE,SUBJECT,.TO,FROM)
 D UPDATE
 Q
 ;
EDTOPICS ;
 ;if low IEN at pilot site; rename to VA- to avoid two entries at low IENs with different names
 N LIST,PXNAT,PXRMINST,FILENUM,NAME,DA,MSG,NEWNAME
 D EDLIST(.LIST)
 S PXNAT=1
 S FILENUM="" F  S FILENUM=$O(LIST(FILENUM)) Q:FILENUM=""  D
 .S NAME="" F  S NAME=$O(LIST(FILENUM,NAME)) Q:NAME=""  D
 ..S DA=$$FIND1^DIC(FILENUM,"","BX",NAME,"","","MSG") Q:DA=0  ;don't proceed if item not found.
 ..I $D(MSG("DIERR")) D  Q
 ...D BMES^XPDUTL("Error during lookup of "_NAME)
 ...S MSG="" F  S MSG=$O(MSG("DIERR",1,"TEXT",MSG)) Q:MSG=""  W MSG("DIERR",1,"TEXT",MSG),!
 ..Q:DA'<100000  ;if the IEN is high/local, leave entry as is and pilot site will have to manually delete/repoint to new VA- nat'l entry
 ..I NAME="CARE COORDINATION HOME TELEHEALTH (CCHT)" S NEWNAME="VA-HOME TELEHEALTH (HT)" D RENAME^PXRMUTIL(FILENUM,NAME,NEWNAME) Q
 ..S NEWNAME="VA-"_NAME D RENAME^PXRMUTIL(FILENUM,NAME,NEWNAME)
 ..S ^XTMP("PXRM CCHT_HT",INC,0)=FILENUM_"^"_NAME_"^"_NEWNAME,INC=INC+1
 Q
 ;
EDLIST(LIST) ;list of ed topics
 S LIST(9999999.09,"CARE COORDINATION HOME TELEHEALTH (CCHT)")=""
 S LIST(9999999.09,"HOME TELEHEALTH-DISEASE MGMT/PATIENT SELF-MGMT")=""
 S LIST(9999999.09,"HOME TELEHEALTH-IN HOME MONITORING")=""
 S LIST(9999999.09,"HOME TELEHEALTH-CAREGIVER EDUCATION/SUPPORT")=""
 S LIST(9999999.09,"HOME TELEHEALTH-MEDICATION MANAGEMENT")=""
 Q
 ;
INSTUB ;stubs for non-remote types
 ;;VA-ADMISSIONS PAST YR
 ;;VA-GEC IADLS
 ;;VA-GEC BASIC ADLS
 ;;VA-HT BASIC ADLS
 ;;VA-HT CAREGIVER
 ;;VA-HT CATEGORY OF CARE LAST
 ;;VA-HT EMERGENCY LEVELS LAST
 ;;VA-HT ENROLLMENT START
 ;;VA-HT IADLS
 ;;VA-HT MED RECON
 ;;VA-HT NIC/CCM RATING LAST
 ;;VA-HT REMINDERS DUE
 ;;VA-NEXT OF KIN
 ;;VA-OUTPT APPTS PAST YR
 ;;EOF
 N DA,DIE,DR,IEN,LIEN,NAME
 N HSTYPE,HSI
 N FDA,MSG,HSIEN
 S HSI=""
 S DIE="^GMT(142,"
 F HSI=1:1 S HSTYPE=$P($T(INSTUB+HSI),";",3) Q:HSTYPE="EOF"  D
 .;if type already exists, quit out for this type
 .Q:$D(^GMT(142,"B",HSTYPE))>0
 .S IEN=0 F  S IEN=$O(^GMT(142,IEN)) D  Q:IEN'>0!(IEN=5000001)
 ..I IEN<5000000 S LIEN=IEN
 .I LIEN<5000000 D
 ..S DA=LIEN
 ..Q:DA=5000000
 ..S DA=DA+1
 ..I '$D(^GMT(142,DA)) D
 ...S FDA(1,142,"+1,",.01)=HSTYPE
 ...S HSIEN(1)=DA
 ...D UPDATE^DIE("S","FDA(1)","HSIEN","MSG")
 Q
 ;