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

AG6P17A.m

Go to the documentation of this file.
  1. AG6P17A ;IHS/ASDST/GTH - Patient Registration 6.0 Patch 17 CONT. ; [ 04/08/2003 8:49 AM ]
  1. ;;7.0;IHS PATIENT REGISTRATION;;MAR 28, 2003
  1. ;
  1. ; IHS/SET/GTH AG*6*17 10/11/2002
  1. ;
  1. PRE ;EP - From KIDS.
  1. Q
  1. ;
  1. POST ;EP - From KIDS.
  1. ;
  1. D BMES^XPDUTL("Beginning post-install routine (POST^AG6P17)."),TS
  1. ;
  1. I '$$INSTALLD^AG6P17("AG*6.0*14") D TS,IP14
  1. ;
  1. I '$$INSTALLD^AG6P17("AG*6.0*15") D TS,IP15
  1. ;
  1. I $$INSTALLD^AG6P17("AG*6.0*17") D
  1. . D ^AGSETPRT
  1. . D TS,BMES^XPDUTL("Delivering AG*7.0 install message to select users...")
  1. . D MAIL
  1. . D BMES^XPDUTL("Post-install routine is complete."),TS
  1. ;
  1. Q:$$INSTALLD^AG6P17("AG*6.0*17")
  1. ;
  1. D TS,OPTRES("AGMENU")
  1. ;
  1. D TS,UPLG
  1. ;
  1. D TS,CMS
  1. ;
  1. D TS,P17^AG6P17B
  1. ;
  1. D TS,INDXC^AG6P17B
  1. ;
  1. D TS,COVIT^AG6P17B
  1. ;
  1. D TS,AGTX^AG6P17B
  1. ;
  1. D TS,DELR^AG6P17B
  1. ;
  1. D TS,EV^AG6P17B
  1. ;
  1. D TS,BMES^XPDUTL("Delivering AG*7.0 install message to select users...")
  1. D MAIL
  1. ;
  1. D DELOPT
  1. ;
  1. D ^AGSETPRT
  1. ;
  1. D BMES^XPDUTL("Post-install routine is complete."),TS
  1. Q
  1. ;
  1. MAIL ; Send install mail message.
  1. NEW DIFROM,XMSUB,XMDUZ,XMTEXT,XMY
  1. KILL ^TMP("AG6P17MS",$J)
  1. S ^TMP("AG6P17MS",$J,1)=" --- AG v 7.0, has been installed into this uci ---"
  1. S %=0
  1. F S %=$O(^XTMP("XPDI",XPDA,"BLD",XPDBLD,1,%)) Q:'% S ^TMP("AG6P17MS",$J,(%+1))=" "_^(%,0)
  1. S XMSUB=$P($P($T(+1),";",2)," ",3,99),XMDUZ=$S($G(DUZ):DUZ,1:.5),XMTEXT="^TMP(""AG6P17MS"",$J,",XMY(1)="",XMY(DUZ)=""
  1. F %="AGZMENU","XUMGR","XUPROG","XUPROGMODE" D SINGLE(%)
  1. D ^XMD
  1. KILL ^TMP("AG6P17MS",$J)
  1. Q
  1. ;
  1. DELOPT ; Delete OPTION "AG DDPS HRN DEL"
  1. S RECNO=0
  1. F S RECNO=$O(^DIC(19,"B","AG DDPS HRN DEL",RECNO)) Q:'RECNO D
  1. . S DIK="^DIC(19,",DA=RECNO D ^DIK
  1. Q
  1. ;
  1. SINGLE(K) ;EP - Get holders of a single key K.
  1. NEW Y
  1. S Y=0
  1. Q:'$D(^XUSEC(K))
  1. F S Y=$O(^XUSEC(K,Y)) Q:'Y S XMY(Y)=""
  1. Q
  1. ;
  1. ;
  1. INDEXAI ; REINDEX AI XREF PREVIOUS COMMUNITY
  1. ;
  1. ; Thanks to Toni Jarland for the original routine. Aug 17 2001.
  1. ;
  1. ;This runs the AI X-Ref Re-Index of the Previous Communty Multiple
  1. ;$Order through each AUPNPAT Global Entry & Re-Index AI X-Ref
  1. ;The AI X-Ref calls Routine AUPNPCTR which $O thru the Previous
  1. ;Community Multiple & resets the Last Previous Community Entry
  1. ;to fields #1117 Current Community Mulitple & #1118 Current Community
  1. ;Text Value. This will clean up missing Community Pointers used
  1. ;in the Patient Registration Re-export
  1. ;
  1. I $P($T(+2^AUPNPCTR),";",5)'="**6**" D Q
  1. . D BMES^XPDUTL("AUPN PATCH 6 IS NOT INSTALLED.")
  1. . D BMES^XPDUTL("THE AI X-REF RE-FIRE WILL BE IN VAIN.")
  1. . D BMES^XPDUTL("INSTALL AUPN 99.1 PATCH 6 AND RUN INDEXAI^AG6P17.")
  1. .Q
  1. NEW AGB,AGE
  1. S AGB=$$NOW^XLFDT
  1. D BMES^XPDUTL("Begin Re-Indexing AI Cross Reference of PATIENT File, "_$$FMTE^XLFDT(AGB))
  1. W:'$D(ZTQUEUED) !,"Estimated % complete:",!
  1. NEW AGP3,DA,DIK
  1. S DA(1)=0,DIK(1)=".03^AI",AGP3=$P(^AUPNPAT(0),U,3)
  1. F S DA(1)=$O(^AUPNPAT(DA(1))) Q:'DA(1) D
  1. . S DIK="^AUPNPAT("_DA(1)_",51,"
  1. . D ENALL^DIK
  1. . I '(DA(1)#100),'$D(ZTQUEUED) W " | ",$J(DA(1)/AGP3*100,0,0),"%"
  1. .Q
  1. ;
  1. S AGE=$$NOW^XLFDT
  1. D BMES^XPDUTL("End of Re-Indexing AI Cross Reference of PATIENT File, "_$$FMTE^XLFDT(AGE))
  1. D BMES^XPDUTL($$FMDIFF^XLFDT(AGE,AGB,2)_" seconds")
  1. Q
  1. ;
  1. OPTRES(AGM) ;
  1. D BMES^XPDUTL("Restoring '"_AGM_"' option to PRE-install configuration...")
  1. NEW AG,AGI
  1. I '$D(^XTMP("AG6P17",6.17,"OPTSAV",AGM)) D BMES^XPDUTL("FAILED. Option '"_AGM_"' was not previously saved.") Q
  1. S AG=0
  1. F S AG=$O(^XTMP("AG6P17",6.17,"OPTSAV",AGM,AG)) Q:'AG S AGI=^(AG) I '$$ADD^XPDMENU(AGM,$P(AGI,U,1),$P(AGI,U,2),$P(AGI,U,3)) D BMES^XPDUTL("....FAILED to re-atch "_$P(AGI,U,1)_" to "_AGM_".")
  1. Q
  1. ;
  1. IP14 ; Items from patch 14.
  1. D BMES^XPDUTL("Patch 14 was not installed. Performing P14 items...")
  1. ;
  1. D INDEXAI
  1. ;
  1. D BMES^XPDUTL("Q'ing Name check report...")
  1. S ZTRTN="START^AGEDNAME",ZTIO="",ZTDESC=$P($P($T(+1^AGEDNAME),";",2)," ",3,99),ZTDTH=$H
  1. D ^%ZTLOAD
  1. I $D(ZTSK) D MES^XPDUTL("Que'd to task "_ZTSK_".") I 1
  1. E D BMES^XPDUTL("Que of Name check report *FAILED*.")
  1. ;
  1. D BMES^XPDUTL("Attaching ""AG REP NAME CHECK"" option to menu ""REGISTRATION REPORTS"".")
  1. I $$ADD^XPDMENU("AGREPORTS","AG REP NAME CHECK","STD",25) D BMES^XPDUTL("....successfully atch'd....allocating Security Keys...") D I 1
  1. . NEW AG,DA,DIC,DINUM
  1. . S AG=0,AG("RPT")=$O(^DIC(19.1,"B","AGZREPORTS",0)),AG("STD")=$O(^DIC(19.1,"B","AGZNAMECHECK",0))
  1. . Q:'AG("RPT")!'AG("STD")
  1. . S DIC(0)="NMQ",DIC("P")="200.051PA"
  1. . F S AG=$O(^XUSEC("AGZREPORTS",AG)) Q:'AG D
  1. .. Q:$D(^VA(200,AG,51,AG("STD")))
  1. .. S DIC="^VA(200,AG,51,",DA(1)=AG,(DINUM,X)=AG("STD")
  1. .. D FILE^DICN
  1. ..Q
  1. .Q
  1. E D BMES^XPDUTL("....Attachment *FAILED*.")
  1. ;
  1. D BMES^XPDUTL("Attaching ""AGTXALL"" option to the export menu ""AGTX"".")
  1. I $$ADD^XPDMENU("AGTX","AGTXALL","ALL",10) D BMES^XPDUTL("....successfully atch'd."),BMES^XPDUTL("NOTE: Security key will *NOT* be allocated.") I 1
  1. E D BMES^XPDUTL("....Attachment *FAILED*.")
  1. ;
  1. Q
  1. ;
  1. IP15 ;
  1. D BMES^XPDUTL("Patch 15 was not installed. Performing P15 items...")
  1. ;
  1. D BMES^XPDUTL("Attaching ""AG TM ELIGIBILITY"" option to the table maintenance menu ""TM"".")
  1. I $$ADD^XPDMENU("AG TM MENU","AG TM ELIGIBILITY","ELUP",10) D BMES^XPDUTL("....successfully atch'd.") I 1
  1. E D BMES^XPDUTL("....Attachment *FAILED*.")
  1. ;
  1. D BMES^XPDUTL("Attaching ""AG3PSUM"" option to the the Third Party Billing Reports ""THR"".")
  1. I $$ADD^XPDMENU("AGBILL","AG3PSUM","AGSM",4) D BMES^XPDUTL("....successfully atch'd.") I 1
  1. E D BMES^XPDUTL("....Attachment *FAILED*.")
  1. ;
  1. I $$VAL^XBDIQ1(9999999.39,1,.15)'="YES" D
  1. . NEW AG
  1. . S AG=0
  1. . F S AG=$O(^ABMDCLM(AG)) Q:'AG I $$FMDIFF^XLFDT(DT,$O(^ABMDCLM(AG,"AC",9999999),-1),1)<180 D Q
  1. .. NEW DA,DIE,DR
  1. .. S DIE=9999999.39,DA=1,DR=".15///Y"
  1. .. D ^DIE
  1. .. I '$D(Y) D Q
  1. ... D BMES^XPDUTL("The 'THIRD-PARTY BILLING PRESENT' field in RPMS SITE had been changed to 'YES',")
  1. ... D MES^XPDUTL("based on 3PB editing activity in the last 6 months."),MES^XPDUTL("'YES' ensures setting of the 'ABILL' x-ref in the VISIT file.")
  1. ...Q
  1. .. D BMES^XPDUTL("** ERROR: EDIT OF .15 IN RPMS SITE FILE FAILED.")
  1. .. Q
  1. .Q
  1. Q
  1. ;
  1. UPLG ; Fix bug in ^AGELUPLG.
  1. D BMES^XPDUTL("Fixing bad info in ELIGIBILITY UPLOAD LOG caused by bug...")
  1. NEW AGDA,AGRUN,AGSUB,DA,DFN,DIK
  1. S AGRUN=0
  1. F S AGRUN=$O(^AGELUPLG(AGRUN)) Q:'AGRUN D
  1. . F AGSUB=1,2 S AGDA=0 F S AGDA=$O(^AGELUPLG(AGRUN,AGSUB,AGDA)) W:'$D(ZTQUEUED) "." Q:'AGDA S DFN=$P(^(AGDA,0),U) I AGDA'=DFN D
  1. .. S DIK="^AGELUPLG("_AGRUN_","_AGSUB_",",DA(1)=AGRUN,DA=AGDA
  1. .. D ^DIK
  1. .. D PTACT^AGELUP2(AGSUB,DFN)
  1. .Q
  1. D MES^XPDUTL("Fix complete.")
  1. Q
  1. ;
  1. CMS ; Deactive the CMS Railroad template and re-name both from "HCFA" to "CMS".
  1. D BMES^XPDUTL("Deactivating HCFA Railroad template, renaming both templates....")
  1. NEW AGY,DIC,X
  1. S DIC=9009062.01,DIC(0)="",X="HCFA RAILROAD RETIREMENT"
  1. D ^DIC
  1. I +Y<1 D MES^XPDUTL("'HCFA RAILROAD RETIREMENT' template not found (that's OK).") I 1
  1. E D
  1. . NEW DA,DIE,DR
  1. . S AGY=$P(Y,U,2),DA=+Y,DIE=DIC,DR=".01///CMS RAILROAD RETIREMENT;.07///"_DT
  1. . D ^DIE
  1. . D MES^XPDUTL("'"_AGY_"' template renamed 'CMS RAILROAD RETIREMENT'.")
  1. .Q
  1. S DIC=9009062.01,DIC(0)="",X="HCFA MEDICARE"
  1. D ^DIC
  1. I +Y<1 D MES^XPDUTL("'HCFA MEDICARE' template not found (that's OK).") I 1
  1. E D
  1. . NEW DA,DIE,DR
  1. . S AGY=$P(Y,U,2),DA=+Y,DIE=DIC,DR=".01///CMS MEDICARE"
  1. . D ^DIE
  1. . D MES^XPDUTL("'"_AGY_"' template renamed 'CMS MEDICARE'.")
  1. .Q
  1. D MES^XPDUTL("CMS complete.")
  1. Q
  1. ;
  1. TS D MES^XPDUTL($$HTE^XLFDT($H)) Q
  1. ;