- XU8P540 ;SFISC/GB- POST INSTALL ;24 DEC 2009
- ;;8.0;KERNEL;**540**;Jul 10, 1995;Build 4
- PRE ; Pre-Init
- D GROUP
- Q
- ;
- GROUP ; Check to see if mail group has correct remote address. If not, correct it.
- N XUGIEN,XUOIEN,XUNIEN
- D BMES^XPDUTL("Checking Mail Group 'XUOAA CLIN TRAINEE'...")
- S XUGIEN=$$FIND1^DIC(3.8,"","X","XUOAA CLIN TRAINEE") ; eXact match only
- I 'XUGIEN D Q
- . D BMES^XPDUTL("ERROR: Cannot find mail group 'XUOAA CLIN TRAINEE'")
- . S XPDABORT=1
- S XUOIEN=$$FIND1^DIC(3.812,","_XUGIEN_",","X","AIMCDATA@LRN.DOMAIN.EXT")
- I $D(DIERR) D Q
- . D BMES^XPDUTL("ERROR: Lookup of old remote address failed.")
- . S XPDABORT=1
- I XUOIEN D ; Delete the old remote address from the group.
- . N DIR,X,Y,DA,DIK
- . S DA(1)=XUGIEN,DA=XUOIEN,DIK="^XMB(3.8,"_XUGIEN_",6,"
- . D ^DIK
- . D MES^XPDUTL("I've deleted the old remote address from the group.")
- E D
- . D MES^XPDUTL("The old remote address was already deleted. No action taken.")
- S XUNIEN=$$FIND1^DIC(3.812,","_XUGIEN_",","X","AIMCDATA@DOMAIN.EXT")
- I $D(DIERR) D Q
- . D BMES^XPDUTL("ERROR: Lookup of new remote address failed.")
- . S XPDABORT=1
- I XUNIEN D
- . D MES^XPDUTL("The new remote address 'AIMCDATA@DOMAIN.EXT' was already added. No action taken.")
- E D ; Add the new remote address to the group.
- . N XUFDA
- . S XUFDA(3.812,"?+1,"_XUGIEN_",",.01)="AIMCDATA@DOMAIN.EXT"
- . D UPDATE^DIE("","XUFDA")
- . I $D(DIERR) D Q
- . . D BMES^XPDUTL("ERROR: Cannot add the new remote address to the group.")
- . . S XPDABORT=1
- . D MES^XPDUTL("I've added the new remote address 'AIMCDATA@DOMAIN.EXT' to the group.")
- D MES^XPDUTL("Finished Mail Group Check.")
- Q
- ;
- POST ; Post-Init
- I '$$PROD^XUPROD D BMES^XPDUTL("Not a production UCI. Quitting without reindexing/transmitting.") Q
- D REINDEX
- D XMIT
- Q
- ;
- REINDEX ; Re-index the ATR xref
- ; We do this to ensure that data for ALL clinical trainees are transmitted.
- D BMES^XPDUTL("Reindexing ""ATR"" cross-reference in the NEW PERSON [#200] file...")
- N DIK
- S DIK="^VA(200,"
- S DIK(1)="12.2^ATR"
- D ENALL^DIK
- D MES^XPDUTL("Finished reindexing.")
- Q
- ;
- XMIT ; Transmit Data to OAA database
- D MES^XPDUTL("Initiating transmission of OAA Clinical Trainee data...")
- D OAA^XUOAAHL7
- D MES^XPDUTL("Finished with transmission.")
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXU8P540 2303 printed Feb 18, 2025@23:34:30 Page 2
- XU8P540 ;SFISC/GB- POST INSTALL ;24 DEC 2009
- +1 ;;8.0;KERNEL;**540**;Jul 10, 1995;Build 4
- PRE ; Pre-Init
- +1 DO GROUP
- +2 QUIT
- +3 ;
- GROUP ; Check to see if mail group has correct remote address. If not, correct it.
- +1 NEW XUGIEN,XUOIEN,XUNIEN
- +2 DO BMES^XPDUTL("Checking Mail Group 'XUOAA CLIN TRAINEE'...")
- +3 ; eXact match only
- SET XUGIEN=$$FIND1^DIC(3.8,"","X","XUOAA CLIN TRAINEE")
- +4 IF 'XUGIEN
- Begin DoDot:1
- +5 DO BMES^XPDUTL("ERROR: Cannot find mail group 'XUOAA CLIN TRAINEE'")
- +6 SET XPDABORT=1
- End DoDot:1
- QUIT
- +7 SET XUOIEN=$$FIND1^DIC(3.812,","_XUGIEN_",","X","AIMCDATA@LRN.DOMAIN.EXT")
- +8 IF $DATA(DIERR)
- Begin DoDot:1
- +9 DO BMES^XPDUTL("ERROR: Lookup of old remote address failed.")
- +10 SET XPDABORT=1
- End DoDot:1
- QUIT
- +11 ; Delete the old remote address from the group.
- IF XUOIEN
- Begin DoDot:1
- +12 NEW DIR,X,Y,DA,DIK
- +13 SET DA(1)=XUGIEN
- SET DA=XUOIEN
- SET DIK="^XMB(3.8,"_XUGIEN_",6,"
- +14 DO ^DIK
- +15 DO MES^XPDUTL("I've deleted the old remote address from the group.")
- End DoDot:1
- +16 IF '$TEST
- Begin DoDot:1
- +17 DO MES^XPDUTL("The old remote address was already deleted. No action taken.")
- End DoDot:1
- +18 SET XUNIEN=$$FIND1^DIC(3.812,","_XUGIEN_",","X","AIMCDATA@DOMAIN.EXT")
- +19 IF $DATA(DIERR)
- Begin DoDot:1
- +20 DO BMES^XPDUTL("ERROR: Lookup of new remote address failed.")
- +21 SET XPDABORT=1
- End DoDot:1
- QUIT
- +22 IF XUNIEN
- Begin DoDot:1
- +23 DO MES^XPDUTL("The new remote address 'AIMCDATA@DOMAIN.EXT' was already added. No action taken.")
- End DoDot:1
- +24 ; Add the new remote address to the group.
- IF '$TEST
- Begin DoDot:1
- +25 NEW XUFDA
- +26 SET XUFDA(3.812,"?+1,"_XUGIEN_",",.01)="AIMCDATA@DOMAIN.EXT"
- +27 DO UPDATE^DIE("","XUFDA")
- +28 IF $DATA(DIERR)
- Begin DoDot:2
- +29 DO BMES^XPDUTL("ERROR: Cannot add the new remote address to the group.")
- +30 SET XPDABORT=1
- End DoDot:2
- QUIT
- +31 DO MES^XPDUTL("I've added the new remote address 'AIMCDATA@DOMAIN.EXT' to the group.")
- End DoDot:1
- +32 DO MES^XPDUTL("Finished Mail Group Check.")
- +33 QUIT
- +34 ;
- POST ; Post-Init
- +1 IF '$$PROD^XUPROD
- DO BMES^XPDUTL("Not a production UCI. Quitting without reindexing/transmitting.")
- QUIT
- +2 DO REINDEX
- +3 DO XMIT
- +4 QUIT
- +5 ;
- REINDEX ; Re-index the ATR xref
- +1 ; We do this to ensure that data for ALL clinical trainees are transmitted.
- +2 DO BMES^XPDUTL("Reindexing ""ATR"" cross-reference in the NEW PERSON [#200] file...")
- +3 NEW DIK
- +4 SET DIK="^VA(200,"
- +5 SET DIK(1)="12.2^ATR"
- +6 DO ENALL^DIK
- +7 DO MES^XPDUTL("Finished reindexing.")
- +8 QUIT
- +9 ;
- XMIT ; Transmit Data to OAA database
- +1 DO MES^XPDUTL("Initiating transmission of OAA Clinical Trainee data...")
- +2 DO OAA^XUOAAHL7
- +3 DO MES^XPDUTL("Finished with transmission.")
- +4 QUIT