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

AUT98P26.m

Go to the documentation of this file.
AUT98P26 ; IHS/OIT/FBD - AUT V98.1 PATCH 26 ENVIRONMENT CHECKS AND POST-INIT PROCESS;   
 ;;98.1;IHS DICTIONARIES (POINTERS);**25**;FEB 9,2011;Build 6
 ;
 ;
 ; The following line prevents the "Disable Options..." and "Move Routines..." questions from being asked during the install.
 I $G(XPDENV)=1 S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
 F X="XPO1","XPZ1","XPZ2","XPI1" S XPDDIQ(X)=0
 ;KERNEL
 I +$$VERSION^XPDUTL("XU")<8 D MES^XPDUTL($$CJ^XLFSTR("Version 8.0 of KERNEL is required.  Not installed",80)) D SORRY(2) I 1
 E  D MES^XPDUTL($$CJ^XLFSTR("Requires Kernel Version 8.0....Present.",80))
 ;FILEMAN
 I +$$VERSION^XPDUTL("DI")<22 D MES^XPDUTL($$CJ^XLFSTR("Version 22.0 of FILEMAN is required.  Not installed.",80)) D SORRY(2) I 1
 E  D MES^XPDUTL($$CJ^XLFSTR("Requires Fileman v22....Present.",80))
 ;AUT
 I $$VERSION^XPDUTL("AUT")'="98.1" D MES^XPDUTL($$CJ^XLFSTR("Version 98.1 of the IHS DICTIONARIES (POINTERS) is required.  Not installed",80)) D SORRY(2) I 1
 E  D MES^XPDUTL($$CJ^XLFSTR("Requires IHS DICTIONARIES (POINTERS) Version 98.1....Present.",80))
 ;AUT 98.1 PATCH 25
 I '$$INSTALLD("AUT*98.1*25") D SORRY(2)
 ;
 ;CHECK IF PROVIDER TYPES IN '3P PROVIDER TAXONOMY' FILE MATCH PROPER PROVIDER CLASS CODES
 D MES^XPDUTL($$CJ^XLFSTR("Valid provider classes required in 3P PROVIDER TAXONOMY file...",80))
 IF $$PTXSCAN D MES^XPDUTL($$CJ^XLFSTR("Invalid provider classes found in 3P PROVIDER TAXONOMY file.",80)) D SORRY(2) I 1
 E  D MES^XPDUTL($$CJ^XLFSTR("Provider classes in 3P PROVIDER TAXONOMY validate properly.",80))
 ;
 Q  ;END OF ENVIRONMENT CHECK
 ;
PRE ;PATCH 26 PRE-INIT CHECKS AND PROCESSES
 D MES^XPDUTL($$CJ^XLFSTR("Beginning AUT v98.1 patch 26 pre-init process.",80))
 ;
 ;
 D MES^XPDUTL($$CJ^XLFSTR("AUT v98.1 patch 26 pre-init process complete.",80))
 Q
 ;
PTXSCAN() ;PRE-SCAN OF PROVIDER TYPES SPECIFIED IN '3P PROVIDER TAXONOMY' FILE
 ;RETURN VALUE: 1 IF INVALID CODES DETECTED, 0 (ZERO) IF CLEAN
 N FLAG,PTXIEN,PRVCODE,PIECE,SPEC,MSG
 S FLAG=0  ;IF FLAG PASSES THROUGH SCAN UNAFFECTED, SCAN IS CLEAN
 S PTXIEN=0
 F  S PTXIEN=$O(^ABMPTAX(PTXIEN)) Q:'+PTXIEN  D  ;
 .F PIECE=2,4,5 D  ;NODE PIECES FOR PROVIDER CLASS (#.02), PROVIDER CLASS 2 (#.04) AND PROVIDER CLASS 3 (#.05) FIELDS
 ..S PRVCODE=$P(^ABMPTAX(PTXIEN,0),U,PIECE) Q:PRVCODE=""
 ..I '+$O(^DIC(7,"D",PRVCODE,"")) D  ;NO CORRESPONDING CODE FOUND IN 'D' XREF OF PROVIDER CLASS FILE, SO CODE IS INVALID
 ...S FLAG=1
 ...S SPEC=$S(PIECE=4:" 2",PIECE=5:" 3",1:"")
 ...S MSG="Record IEN "_PTXIEN_": invalid code "_PRVCODE_" found in PROVIDER CLASS"_SPEC_" field."
 ...D MES^XPDUTL($$CJ^XLFSTR(MSG,80))
 Q FLAG
 ;
POST ;PATCH 26 POST-INIT PROCESSES
 D MES^XPDUTL($$CJ^XLFSTR("Beginning AUT v98.1 patch 26 post-init process.",80))
 ;
 D MTPOP  ;POPULATE 'EDUCATION TOPICS' FILE'S NEW 'MAJOR TOPIC PTR' FIELD
 D ITPOP  ;POPULATE 'INSURER' FILE'S NEW 'INSURER TYPE' FIELD
 D PTXUP  ;UPDATE 'PROVIDER TAXONOMY' FILE - 
 ;
 D MES^XPDUTL($$CJ^XLFSTR("AUT v98.1 patch 26 post-init process complete.",80))
 Q
 ;
MTPOP  ;EDUCATION MAJOR TOPICS FIELD POPULATION
 D MES^XPDUTL($$CJ^XLFSTR("Populating EDUCATION TOPICS file / MAJOR TOPICS PTR field...",80))
 D CVTALL^AUTEMTP
 D MES^XPDUTL($$CJ^XLFSTR("EDUCATION TOPICS / MAJOR TOPICS PTR field population complete.",80))
 Q
 ;
ITPOP ;INSURER / INSURER TYPE FIELD POPULATION
 D MES^XPDUTL($$CJ^XLFSTR("Populating INSURER file / INSURER TYPE field...",80))
 D CVTALL^AUTCVIT
 D MES^XPDUTL($$CJ^XLFSTR("INSURER / INSURER TYPE field population complete.",80))
 Q
 ;
PTXUP ;UPDATE 'PROVIDER TAXONOMY' WITH INFORMATION FROM '3P PROVIDER TAXONOMY'
 ;PROVIDER TAXONOMY ENTRIES WHICH MATCH TO 3P TAXONOMY ENTRIES ARE UPDATED WITH
 ;CORRESPONDING PROVIDER CLASS INFORMATION.  
 N P3TXIEN,PTXIEN,NUCC,PERC,PRVC1,PRVC2,PRVC3,DA,DIE,DR
 S PTXIEN=0
 F  S PTXIEN=$O(^AUTTPTAX(PTXIEN)) Q:'+PTXIEN  D  ;SCANNING PROVIDER TAXONOMY
 .S NUCC=$P(^AUTTPTAX(PTXIEN,1),U,1)
 .S P3TXIEN=$O(^ABMPTAX("B",NUCC,"")) Q:P3TXIEN=""  ;CORRESPONDING 3P PROVIDER TAXONOMY ENTRY
 .S PERC=$P(^ABMPTAX(P3TXIEN,0),U,3)  ;PERSON CLASS
 .S PRVC1=$P(^ABMPTAX(P3TXIEN,0),U,2) S:PRVC1'="" PRVC1=+$O(^DIC(7,"D",PRVC1,""))  ;PROVIDER CLASS
 .S PRVC2=$P(^ABMPTAX(P3TXIEN,0),U,4) S:PRVC2'="" PRVC2=+$O(^DIC(7,"D",PRVC2,""))  ;PROVIDER CLASS 2
 .S PRVC3=$P(^ABMPTAX(P3TXIEN,0),U,5) S:PRVC3'="" PRVC3=+$O(^DIC(7,"D",PRVC3,""))  ;PROVIDER CLASS 3
 .K DA,DIE,DR S DR=""
 .S DIE="^AUTTPTAX(",DA=PTXIEN
 .I +PERC S DR="3///`"_PERC
 .I +PRVC1 S:+$L(DR) DR=DR_";" S DR=DR_"4.1///`"_PRVC1
 .I +PRVC2 S:+$L(DR) DR=DR_";" S DR=DR_"4.2///`"_PRVC2
 .I +PRVC3 S:+$L(DR) DR=DR_";" S DR=DR_"4.3///`"_PRVC3
 .Q:DR=""  ;SKIP EDIT IF NOTHING TO TRANSFER
 .D ^DIE K DA,DIE,DR
 ;
AUSC ;POST-UPDATE CLEANUP
 K DIK
 K ^AUTTPTAX("AUSC")  ;FLUSH POTENTIALLY CORRUPTED CROSS-REFERENCES
 S DIK="^AUTTPTAX("   ;IN PROVIDER TAXONOMY FILE
 S DIK(1)="3^AUSC"    ;OF "PERSON CLASS" FIELD'S "AUSC" XREF
 D ENALL^DIK          ;THEN REBUILD "AUSC" XREF FOR ALL XREFS
 Q
 ;
INSTALLD(AUTSTAL) ;EP - Determine if patch AUTSTAL was installed, where
 ; AUTSTAL is the name of the INSTALL.  E.g "AG*6.0*11".
 ;
 NEW AUTY,DIC,X,Y
 S X=$P(AUTSTAL,"*",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(AUTSTAL,"*",2)
 D ^DIC
 I Y<1 D IMES Q 0
 S DIC=DIC_+Y_",""PAH"",",X=$P(AUTSTAL,"*",3)
 D ^DIC
 S AUTY=Y
 D IMES
 Q $S(AUTY<1:0,1:1)
IMES ;
 D MES^XPDUTL($$CJ^XLFSTR("Patch """_AUTSTAL_""" is"_$S(Y<1:" *NOT*",1:"")_" installed.",IOM))
 Q
SORRY(X) ;
 KILL DIFQ
 I X=3 S XPDQUIT=2 Q
 S XPDQUIT=X
 W *7,!,$$CJ^XLFSTR("Sorry....FIX IT!",IOM)
 Q