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

BADEECP1.m

Go to the documentation of this file.
  1. BADEECP1 ;IHS/MSC/MGH - BADE ENVIRONMENT CHECK ROUTINE ;28-Jun-2010 16:21;MGH
  1. ;;1.0;DENTAL/EDR INTERFACE;**1**;AUG 22, 2011
  1. ;
  1. ENV ;EP
  1. N IN,PATCH,INSTDA,STAT
  1. ;Check for the installation of the EHR
  1. S IN="IHS PCC SUITE 2.0",INSTDA=""
  1. I '$D(^XPD(9.7,"B",IN)) D Q
  1. .D MES("You must first install the IHS PCC SUITE 2.0 before this patch",2)
  1. S INSTDA=$O(^XPD(9.7,"B",IN,INSTDA),-1)
  1. S STAT=+$P($G(^XPD(9.7,INSTDA,0)),U,9)
  1. I STAT'=3 D Q
  1. .D MES("IHS PCC SUITE 2.0 must be completely installed before installing this patch",2)
  1. S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
  1. ;Check for the installation of the EDR
  1. S IN="DENTAL/EDR INTERFACE 1.0",INSTDA=""
  1. I '$D(^XPD(9.7,"B",IN)) D Q
  1. .D MES("You must first install the DENTAL/EDR INTERFACE 1.0 before this patch",2)
  1. S INSTDA=$O(^XPD(9.7,"B",IN,INSTDA),-1)
  1. S STAT=+$P($G(^XPD(9.7,INSTDA,0)),U,9)
  1. I STAT'=3 D Q
  1. .D MES("DENTAL/EDR INTERFACE 1.0 must be completely installed before installing this patch",2)
  1. S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
  1. Q
  1. ;
  1. MES(TXT,QUIT) ;EP
  1. D BMES^XPDUTL(" "_$G(TXT))
  1. S:$G(QUIT) XPDABORT=QUIT
  1. Q
  1. ;
  1. PRE ;EP - Pre-init
  1. Q
  1. RENXPAR(OLD,NEW) ; Rename parameter
  1. N IEN,FDA,FIL
  1. S FIL=8989.51
  1. Q:$$FIND1^DIC(FIL,"","X",NEW) ; New name already exists
  1. S IEN=$$FIND1^DIC(FIL,"","X",OLD)
  1. Q:'IEN ; Old name doesn't exist
  1. S FDA(FIL,IEN_",",.01)=NEW
  1. D FILE^DIE("E","FDA")
  1. Q
  1. POST ;EP
  1. N XMRG
  1. D EN^XPAR("SYS","BADE EDR PAUSE MRG LOAD",,"Y")
  1. D EN^XPAR("SYS","BADE EDR MRG DFN",,"")
  1. D EN^XPAR("SYS","BADE EDR MRG LOAD TSK",,"")
  1. D EN^XPAR("SYS","BADE EDR MRG TOTAL",,0)
  1. D EN^XPAR("SYS","BADE EDR MRG PTS ERRORS",,"")
  1. D EN^XPAR("SYS","BADE EDR MRG ERRORS",,0)
  1. ;CLEAN OUT OUT OF ORDER MESSAGES
  1. S MENU(1)="BADE EDR UPLOAD ALL MERGED PTS"
  1. S MENU(2)="BADE EDR PAUSE MRG LOAD"
  1. S MENU(3)="BADE EDR RESTART MRG UPLOAD"
  1. F I=1:1:3 D
  1. .N DA,DIE,DR
  1. .S MSG=""
  1. .S DA=$O(^DIC(19,"B",MENU(I),""))
  1. .I DA'="" D
  1. ..S DIE="^DIC(19,",DR="2///@"
  1. ..D ^DIE
  1. ;
  1. ;Check and see if patient merge has been installed yet
  1. S XMRG=$$VERSION^XPDUTL("BPM")
  1. ;Check and see if patient merge patch 1 has been installed yet
  1. I 'XMRG D COMPLETE^BADEMRG("NO BPM") D BMES^XPDUTL(" Patient Merge not Installed") ;SAIC/FJE DISPALY RESULTS
  1. D CKPATCH
  1. D BMES^XPDUTL(" Post Initialization Completed") ;SAIC/FJE DISPLAY RESULTS
  1. Q
  1. ; Register a protocol to an extended action protocol
  1. ; Input: P-Parent protocol
  1. ; C-Child protocol
  1. ; SEQ-Sequence Number
  1. REGPROT(P,C,SEQ,ERR) ;EP
  1. N IENARY,PIEN,AIEN,FDA
  1. D
  1. .I '$L(P)!('$L(C)) S ERR="Missing input parameter" Q
  1. .S IENARY(1)=$$FIND1^DIC(101,"","",P)
  1. .S AIEN=$$FIND1^DIC(101,"","",C)
  1. .I 'IENARY(1)!'AIEN S ERR="Unknown protocol name" Q
  1. .S FDA(101.01,"?+2,"_IENARY(1)_",",.01)=AIEN
  1. .S FDA(101.01,"?+2,"_IENARY(1)_",",3)=SEQ
  1. .D UPDATE^DIE("S","FDA","IENARY","ERR")
  1. ;Q:$Q $G(ERR)=""
  1. Q
  1. ; Return IEN to Clinic Stop Code file for given stop code
  1. GETSC(SC) ;EP
  1. N RES
  1. S RES=$$FIND1^DIC(40.7,,,SC,"C")
  1. Q +RES
  1. ; Return first IEN to Hospital Location file for given stop code ien
  1. GETHLOC(SIEN) ;EP
  1. N RES
  1. Q:'$G(SIEN) 0
  1. S RES=$O(^SC("ASTOP",SIEN,0))
  1. Q +RES
  1. CKPATCH ;Only add protocol if BPM patch 1 is installed
  1. S PATCH="BPM*1.0*1"
  1. I $$PATCH^XPDUTL(PATCH) D REGPROT("BPM MERGE PATIENT ADT-A40","BADE MERGE PATIENT ADT-A40",967) D BMES^XPDUTL(" BADE Merge Protocol added") ;SAIC/FJE DISPALY RESULTS
  1. I '$$PATCH^XPDUTL(PATCH) D BMES^XPDUTL(" BADE Merge Protocol Not Created") ;SAIC/FJE DISPALY RESULTS
  1. Q