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

AUPN9920.m

Go to the documentation of this file.
AUPN9920 ;IHS/OIT/FBD - AUPN 99.1 PATCH 20 ;
 ;;99.1;IHS DICTIONARIES (PATIENT);**20**;MAR 9, 1999
 ;
 ;
ENV ;ENVIROMENT CHECK
 I '$G(IOM) D HOME^%ZIS
 ;
 I '$G(DUZ) W !,"DUZ UNDEFINED OR 0." D SORRY(2) Q
 ;
 I '$L($G(DUZ(0))) W !,"DUZ(0) UNDEFINED OR NULL." D SORRY(2) Q
 ;
 S X=$P(^VA(200,DUZ,0),U)
 W !!,$$CJ^XLFSTR("Hello, "_$P(X,",",2)_" "_$P(X,","),IOM)
 W !!,$$CJ^XLFSTR("Checking Environment for "_$P($T(+2),";",4)_" V "_$P($T(+2),";",3)_" Patch "_$P($T(+2),";",5)_".",IOM)
 ;
 NEW IORVON,IORVOFF
 S X="IORVON;IORVOFF"
 D ENDR^%ZISS
 ;
 I $$VCHK("DI","22.0",2)
 I $$VCHK("XU","8.0",2)
 I $$VCHK("AUPN","99.1",2)
 ;
 I '$$INSTALLD("AUPN*99.1*19") D SORRY(2)
 I '$$INSTALLD("AUT*98.1*23") D SORRY(2)
 ;
 NEW DA,DIC
 S X="AUPN",DIC="^DIC(9.4,",DIC(0)="",D="C"
 D IX^DIC
 I Y<0,$D(^DIC(9.4,"C","AUPN")) D  Q
 . W !!,*7,*7,$$CJ^XLFSTR("You Have More Than One Entry In The",IOM),!,$$CJ^XLFSTR("PACKAGE File with an ""AUPN"" prefix.",IOM)
 . W !,$$CJ^XLFSTR(IORVON_"One entry needs to be deleted."_IORVOFF,IOM)
 . D SORRY(2)
 .Q
 ;
 I $G(XPDQUIT) W !,$$CJ^XLFSTR(IORVON_"FIX IT! Before Proceeding."_IORVOFF,IOM),!!,*7,*7,*7 Q
 ;
 I $G(XPDENV)=1 S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"),XPDDIQ("XPO1"),XPDDIQ("XPI1"))=0
 ;
 W !!,$$CJ^XLFSTR("ENVIRONMENT OK.",IOM)
 ;
 I '$$DIR^XBDIR("E","","","","","",1) D SORRY(3)
 Q  ;ENVIRONMENT CHECK EXIT
 ;
SORRY(X) ;
 KILL DIFQ
 I X=3 S XPDQUIT=2 Q
 S XPDQUIT=X
 W *7,!,$$CJ^XLFSTR("Sorry....FIX IT!",IOM)
 Q
 ;
 ; 
VCHK(AUPNPRE,AUPNVER,AUPNQUIT) ; Check versions needed.
 ;  
 NEW AUPNV
 S AUPNV=$$VERSION^XPDUTL(AUPNPRE)
 W !,$$CJ^XLFSTR("Need at least "_AUPNPRE_" v "_AUPNVER_"....."_AUPNPRE_" v "_AUPNV_" Present",IOM)
 I AUPNV<AUPNVER D SORRY(AUPNQUIT) Q 0
 Q 1
 ;
 ;
POST ;EP - APUN V99.1 PATCH 20 POST-INIT
 ;
XREF ;BUILD NEW CROSS-REFERENCES
 ;
 ;PATIENT FILE (9000001), DATE OF LAST UPDATE (.16), ADLU XREF
 ;
 D BMES^XPDUTL("Creating new PATIENT file cross-reference...")
 K ^AUPNPAT("ADLU")
 K DIK
 S DIK(1)=".16^ADLU",DIK="^AUPNPAT("
 D ENALL^DIK
 D MES^XPDUTL("Complete.")
 ;
 ;MEDICARE ELIGIBLE FILE (9000003), DATE OF LAST UPDATE (.07), ADLU XREF
 ;
 D BMES^XPDUTL("Creating new MEDICARE ELIGIBLE file cross-reference...")
 K ^AUPNMCR("ADLU")
 K DIK
 S DIK(1)=".07^ADLU",DIK="^AUPNMCR("
 D ENALL^DIK
 D MES^XPDUTL("Complete.")
 ;
 ;MEDICAID ELIGIBLE FILE (9000004), DATE OF LAST UPDATE (.08), ADLU XREF
 ;
 D BMES^XPDUTL("Creating new MEDICAID ELIGIBLE file cross-reference...")
 K ^AUPNMCD("ADLU")
 K DIK
 S DIK(1)=".08^ADLU",DIK="^AUPNMCD("
 D ENALL^DIK
 D MES^XPDUTL("Complete.")
 ;
 ;RAILROAD ELIGIBLE FILE (9000005), DATE OF LAST UPDATE (.07), ADLU XREF
 ;
 D BMES^XPDUTL("Creating new MEDICARE ELIGIBLE file cross-reference...")
 K ^AUPNMCR("ADLU")
 K DIK
 S DIK(1)=".07^ADLU",DIK="^AUPNMCR("
 D ENALL^DIK
 D MES^XPDUTL("Complete.")
 ;
 ;PRIVATE INSURANCE ELIGIBLE FILE (9000003)/INSURER SUBFIELD (1101), VERIFIED COVERAGE DATE (.09), AVCD XREF
 ;
 D BMES^XPDUTL("Creating new PRIVATE INSURANCE ELIGIBLE file cross-reference...")
 K ^AUPNPRVT("AVCD")
 S AUPNPIEN=0  ;PRIVATE INSURANCE ELIGIBLE IEN
 F  S AUPNPIEN=$O(^AUPNPRVT(AUPNPIEN))  Q:+AUPNPIEN'=AUPNPIEN  D
 .K DA,DIK
 .S DA(1)=AUPNPIEN
 .S DIK="^AUPNPRVT("_AUPNPIEN_",11,"
 .S DIK(1)=".09^AVCD"
 .D ENALL^DIK
 D MES^XPDUTL("Complete.")
 ;
 ;VISIT FILE (9000010), DATE LAST MODIFIED (.13), ADLM XREF
 ;
 D BMES^XPDUTL("Creating new VISIT file cross-reference...")
 K ^AUPNVSIT("ADLM")
 K DIK
 S DIK(1)=".13^ADLM",DIK="^AUPNVSIT("
 D ENALL^DIK
 D MES^XPDUTL("Complete.")
 ;
 ;PROBLEM FILE (9000011), DATE LAST MODIFIED (.03), ADLM XREF
 ;
 D BMES^XPDUTL("Creating new PROBLEM file cross-reference...")
 K ^AUPNPROB("ADLM")
 K DIK
 S DIK(1)=".03^ADLM",DIK="^AUPNPROB("
 D ENALL^DIK
 D MES^XPDUTL("Complete.")
 ;
 ;PATIENT REFUSALS FOR SERVICE/NMI FILE (9000022), DATE LAST MODIFIED (.08), ADLM XREF
 ;
 D BMES^XPDUTL("Creating new PATIENT REFUSALS FOR SERVICE/NMI file cross-reference...")
 K ^AUPNPREF("ADLM")
 K DIK
 S DIK(1)=".08^ADLM",DIK="^AUPNPREF("
 D ENALL^DIK
 D MES^XPDUTL("Complete.")
 ;
 ;
 ;
 D BMES^XPDUTL("Delivering AUPN*99.1*20 install message to select users...")
 NEW DIFROM,XMSUB,XMDUZ,XMTEXT,XMY
 KILL ^TMP("AUPN9920",$J)
 S ^TMP("AUPN9920",$J,1)=" --- AUPN v 99.1, Patch 20, has been installed into this uci ---"
 S %=0
 F  S %=$O(^XTMP("XPDI",XPDA,"BLD",XPDBLD,1,%)) Q:'%   S ^TMP("AUPN9920",$J,(%+1))=" "_^(%,0)
 S XMSUB=$P($P($T(+1),";",2)," ",3,99),XMDUZ=$S($G(DUZ):DUZ,1:.5),XMTEXT="^TMP(""AUPN9920"",$J,",XMY(1)="",XMY(DUZ)=""
 F %="AGZMENU","APCDZMENU","XUMGR","XUPROG","XUPROGMODE" D SINGLE(%)
 D ^XMD
 KILL ^TMP("AUPN9920",$J)
 Q
 ;
SINGLE(K) ; Get holders of a single key K.
 NEW Y
 S Y=0
 Q:'$D(^XUSEC(K))
 F  S Y=$O(^XUSEC(K,Y)) Q:'Y  S XMY(Y)=""
 Q
 ;
INSTALLD(AUPNSTAL) ;EP - Determine if patch AUPNSTAL was installed, where
 ; AUPNSTAL is the name of the INSTALL.  E.g "AG*6.0*11".
 ;
 NEW AUPNY,DIC,X,Y
 S X=$P(AUPNSTAL,"*",1)
 S DIC="^DIC(9.4,",DIC(0)="FM",D="C"
 D IX^DIC
 I Y<1 D IMES Q 0
 S DIC=DIC_+Y_",22,",X=$P(AUPNSTAL,"*",2)
 D ^DIC
 I Y<1 D IMES Q 0
 S DIC=DIC_+Y_",""PAH"",",X=$P(AUPNSTAL,"*",3)
 D ^DIC
 S AUPNY=Y
 D IMES
 Q $S(AUPNY<1:0,1:1)
IMES ;
 D MES^XPDUTL($$CJ^XLFSTR("Patch """_AUPNSTAL_""" is"_$S(Y<1:" *NOT*",1:"")_" installed.",IOM))
 Q
 ;