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

LR52P476.m

Go to the documentation of this file.
  1. LR52P476 ;AITC/CR - Post Installation for Patch 476 ; 11/28/17 12:36pm
  1. ;;5.2;LAB SERVICE;**476**;Sep 27, 1994;Build 11
  1. ; Stuff codes #1, #20.5 and #26.5 in the Execute Code file, #62.07, field #1,
  1. ; for the three records that follow below:
  1. ;
  1. Q
  1. ERR ; keep a history of any error that happened during the installation
  1. D BMES^XPDUTL("Post initialization of LR*5.2*476 did not complete.")
  1. I $D(LRERR) D BMES^XPDUTL(.LRERR)
  1. ;alert the user if any error occurred
  1. I $D(LRERR) D
  1. .N LRTEXT,XMDUZ,XMY,XMDUZ,XMSUB,XMTEXT
  1. .S XMSUB="ERROR ENCOUNTERED WHILE INSTALLING LR*5.2*476"
  1. .S XMDUZ=.5
  1. .S XMY(DUZ)="",XMY(XMDUZ)=""
  1. .S LRTEXT(1)="During the post-installation operations of patch"
  1. .S LRTEXT(2)="LR*5.2*476, an error occurred. Please look at the"
  1. .S LRTEXT(3)="installation log of the patch for details."
  1. .S XMTEXT="LRTEXT("
  1. .D ^XMD
  1. Q
  1. ;
  1. POST ; edit field #1 for the Bacteriology record (#7)
  1. I $G(DUZ)="" D BMES^XPDUTL("Your DUZ is not identified in VistA, quiting...") Q
  1. ;
  1. D BMES^XPDUTL("Starting Post-Initialization for LR*5.2*476 ...")
  1. N DA,DIE,DR,LRFDA,LRCODE1,LRCODE2,LRCODE3,LRNECODE,LRERR,LRMICROEC,LRNEC
  1. ;
  1. S LRCODE1="BACTERIOLOGY",LRCODE2="TB BACTERIOLOGY",LRCODE3="MYCOLOGY"
  1. S LRIEN1=$$FIND1^DIC(62.07,,"MX",LRCODE1) ;IEN for the execute code record
  1. S LRIEN2=$$FIND1^DIC(62.07,,"MX",LRCODE2)
  1. S LRIEN3=$$FIND1^DIC(62.07,,"MX",LRCODE3)
  1. F DA=LRIEN1,LRIEN2,LRIEN3 L +^LAB(62.07,DA):5 I '$T D BMES^XPDUTL("Cannot lock file - try later.") G ERR
  1. ;
  1. S LRMICROEC=$$GET1^DIQ(62.07,LRIEN1_",",1) ; current execute code before changes
  1. D BMES^XPDUTL("Execute Code for Bacteriology before changes:")
  1. D BMES^XPDUTL(LRMICROEC)
  1. S LRNECODE="S DR=""11.55////""_DUZ_"";.055;.05;.99;11.6;11.5;1;S LRSPEC=$P(LRBG0,U,5),Y=$S(LRSPEC=71:11.57,LRSPEC=68:11.58,1:0);11.57;S Y=0;11.58"",LREND=0 D ^DIE S:$D(Y) LREND=1 Q:$D(Y) D ^LRMIBUG Q:LREND S DR=""13;11"" D ^DIE Q"
  1. ; prepare field for new data
  1. S DIE="^LAB(62.07,",DR="1///@",DA=LRIEN1 D ^DIE
  1. ;
  1. S DA=LRIEN1
  1. D UPDATE
  1. D BMES^XPDUTL("Execute Code for Bacteriology after changes:")
  1. S LRNEC=$$GET1^DIQ(62.07,LRIEN1_",",1) ; updated execute code
  1. D BMES^XPDUTL(LRNEC)
  1. D BMES^XPDUTL("============================================================")
  1. ;
  1. ; edit field #1 for the TB Bacteriology record (#8)
  1. S LRMICROEC=$$GET1^DIQ(62.07,LRIEN2_",",1)
  1. D BMES^XPDUTL("Execute Code for TB Bacteriology before changes:")
  1. D BMES^XPDUTL(LRMICROEC)
  1. S LRNECODE="S DR=""25.5////""_DUZ_"";.05;.99;23;24;25;26;26.5;27;22"",DR(2,63.39)="".01;1:99"" D ^DIE Q"
  1. S DIE="^LAB(62.07,",DR="1///@",DA=LRIEN2 D ^DIE
  1. ;
  1. S DA=LRIEN2
  1. D UPDATE
  1. D BMES^XPDUTL("Execute Code for TB Bacteriology after changes:")
  1. S LRNEC=$$GET1^DIQ(62.07,LRIEN2_",",1)
  1. D BMES^XPDUTL(LRNEC)
  1. D BMES^XPDUTL("============================================================")
  1. ; edit field #1 for the Mycology record (#9)
  1. S LRMICROEC=$$GET1^DIQ(62.07,LRIEN3_",",1)
  1. D BMES^XPDUTL("Execute Code for Mycology before changes:")
  1. D BMES^XPDUTL(LRMICROEC)
  1. S LRNECODE="S DR=""19.5////""_DUZ_"";.05;.99;19;19.2;20;20.5;21;18"",DR(2,63.37)="".01:99"" D ^DIE Q"
  1. S DIE="^LAB(62.07,",DR="1///@",DA=LRIEN3 D ^DIE
  1. ;
  1. S DA=LRIEN3
  1. D UPDATE
  1. D BMES^XPDUTL("Execute Code for Mycology after changes:")
  1. S LRNEC=$$GET1^DIQ(62.07,LRIEN3_",",1)
  1. D BMES^XPDUTL(LRNEC)
  1. D BMES^XPDUTL("Post-initialization of LR*5.2*476 completed!")
  1. F DA=LRIEN1,LRIEN2,LRIEN3 L -^LAB(62.07,DA)
  1. Q
  1. ;
  1. UPDATE ; common code for update of field #1, Execute Code File
  1. S LRFDA(62.07,DA_",",1)=LRNECODE
  1. D FILE^DIE("E","LRFDA","LRERR")
  1. I $D(LRERR) D BMES^XPDUTL("Unable to edit the Execute Code field of Record #: "_DA) D ERR
  1. Q