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

BGOPOST.m

Go to the documentation of this file.
BGOPOST ; IHS/BAO/TMD - BGO POST INIT ;29-May-2007 10:32;DKM
 ;;1.1;BGO COMPONENTS;**1,3**;Mar 20, 2007
 ;
 D REGNMSP^CIAURPC("BGO","CIAV VUECENTRIC")
 D PARAMS
 D MENUS
 D REFUSALS
 D FIXFCN("BI TODAY"),FIXFCN("BI NOW")
 D FIXPL
 D CLEANUP
 D XREF
 Q
 D REGMENU^BEHUTIL("BGOHF MAIN",,"HFA")
 D REGMENU^BEHUTIL("BGOIMM MAIN",,"IMM")
 D REGMENU^BEHUTIL("BGOPL MAIN",,"PLS")
 D REGMENU^BEHUTIL("BGOPOV MAIN",,"POV")
 D REGMENU^BEHUTIL("BGOPROC MAIN",,"PRC")
 D REGMENU^BEHUTIL("BGOPTED MAIN",,"EDU")
 D REGMENU^BEHUTIL("BGOPHHX MAIN",,"PHX")
 D REGMENU^BEHUTIL("BGOCC MAIN",,"CCX")
 Q:$$VERSION^XPDUTL("BEH UTILITIES")<1.2
 D REGMENU^BEHUTIL("BGO DISABLE VITALS EDITING",,"DVE","BEHOVM MAIN")
 Q
REFUSALS N IEN,FDA,CNT,X,Y
 D BMES^XPDUTL("Searching for missing Refusal Items...")
 S (CNT,IEN)=0
 F  S IEN=$O(^AUPNPREF(IEN)) Q:'IEN  S X=$G(^(IEN,0)) D
 .Q:$P(X,U,4)'=""!($P(X,U,5)="")
 .S Y=$$VAL^XBDIQ1($P(X,U,5),$P(X,U,6),$P($G(^AUTTREFT($P(X,U),0)),U,3))
 .S:$L(Y) FDA(9000022,IEN_",",.04)=$E(Y,1,80),CNT=CNT+1
 D BMES^XPDUTL("Missing Refusal Items Found: "_CNT)
 D:$D(FDA) FILE^DIE(,"FDA")
 Q
PARAMS Q:'$D(^BGOPARAM)
 N IEN,RET,FLG,X
 D BMES^XPDUTL("Migrating data from BGO PARAMETERS file...")
 S (IEN,FLG)=0
 F  S IEN=$O(^BGOPARAM(IEN)) Q:'IEN  D
 .S X=$P(^BGOPARAM(IEN,0),U,1,2),$P(X,U,3)="SYS"
 .D SETPARM^BGOUTL(.RET,X)
 .I RET D
 ..S FLG=1
 ..D BMES^XPDUTL("  Error migrating "_$P(X,U))
 .E  D BMES^XPDUTL("  "_$P(X,U)_" migrated")
 D SETPARM^BGOUTL(,"Caption-Facility^"_$S(^XMB("NETNAME")["DOMAIN.NAME":"IHS/Tribal &Facility",1:"&Facility")_"^SYS")
 D:'FLG DELFIL^CIAVINIT(90362.04)
 Q
FIXFCN(FCN) ;
 N FDA
 S FCN=$$FIND1^DIC(.5,,"X",FCN)
 Q:'FCN
 S FDA(.5,FCN_",",2)="X"
 D UPDATE^DIE(,"FDA")
 Q
FIXPL N LP1,LP2
 S LP1=0
 F  S LP1=$O(^BGOEDTPR(LP1)) Q:'LP1  D
 .N TMP,MGR,CNT
 .S (LP2,CNT)=0
 .M TMP=^BGOEDTPR(LP1,2)
 .K ^BGOEDTPR(LP1,2)
 .F  S LP2=$O(TMP(LP2)) Q:'LP2  S MGR=+$G(TMP(LP2,0)) D:MGR
 ..S ^BGOEDTPR(LP1,2,MGR,0)=MGR,^BGOEDTPR(LP1,2,"B",MGR,MGR)=""
 ..S CNT=CNT+1,^BGOEDTPR(LP1,2,0)="^90362.362P^"_MGR_U_CNT
 Q
XREF N DIK,DA
 D BMES^XPDUTL("Reindexing Files...")
 S DIK="^BGOCCPL(",DIK(1)=.02
 D ENALL^DIK
 S DIK="^AUTTEDT(",DIK(1)=1
 D ENALL^DIK
 Q
CLEANUP D RENENTRY^BEHUTIL(19930.2,"PVATLCALENDAR.PVCALENDAR.1","@")
 D RENENTRY^BEHUTIL(19930.2,"PVDATE2.PVDATE2.1","@")
 D RENENTRY^BEHUTIL(19930.2,"FILE:PVNUM.OCX","@")
 Q