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

GMRC3P52.m

Go to the documentation of this file.
  1. GMRC3P52 ;ALB/MRY - POST INIT ;04/14/06
  1. ;;3.0;CONSULT/REQUEST TRACKING;**52**;DEC 27, 1997
  1. ;
  1. EN ;
  1. S XPDABORT=""
  1. I '$G(DUZ)!($G(DUZ(0))'="@")!('$G(DT))!($G(U)'="^") D G ABRT
  1. . D BMES^XPDUTL("*****")
  1. . D MES^XPDUTL("Your programming variables are not set up properly.")
  1. . D MES^XPDUTL("Installation aborted.")
  1. W !!,">> Environment check complete and okay."
  1. I XPDABORT="" K XPDABORT
  1. Q
  1. ;
  1. ABRT ; Abort transport, but leave in ^XTMP.
  1. S XPDABORT=2 Q
  1. ;
  1. PRE ;Set seed flag, so, 'AHST' xref of the new Consult Link field (#688)
  1. ;of the Hospital Location file (#44) doesn't get set during install.
  1. S SDSEED=1
  1. Q
  1. POST ;-------------------------------------------------------------------
  1. ;Add option to menu.
  1. N GMRCOK
  1. S GMRCOK=$$ADD^XPDMENU("GMRC REPORTS","GMRC RPT SD SCH-MGT CONSULTS","SH",6)
  1. D BMES^XPDUTL("*****")
  1. I GMRCOK=1 D
  1. .D MES^XPDUTL("Adding option 'Service Consults Schedule-Management Report'")
  1. .D MES^XPDUTL(" to 'Consult Tracking Reports' menu.")
  1. E D
  1. .D MES^XPDUTL("Error - 'Service Consults Schedule-Management Report' option not added.")
  1. .D BMES^XPDUTL("*****")
  1. ;
  1. ;---------------------------------------------------------------------
  1. ;Post-init for sites running Class 3 software.
  1. ;
  1. ;Quit, if Class 3 field not installed.
  1. ;
  1. ;File 123.5
  1. ; Loop down Class 3 ^GMR("AB" xref. to build new entries.
  1. ; Sites can remove Class 3 field when satisfied of changes.
  1. ;
  1. ;---------------------------------------------------------------------
  1. ;Convert #123.5 Class 3 ASSOCIATED STOP CODE field and xrefs.
  1. I '$D(^GMR(123.5,"AB")),'$D(^XTMP("GMRC3P52")) Q ;quit, no Class 3 data.
  1. D BMES^XPDUTL("*****")
  1. N GMRX,GMRDA,GMRSTOP,DIC
  1. ;Check/create ^XTMP for conversion run to completion.
  1. I $D(^XTMP("GMRC3P52")) D I $G(GMRSTOP) G CONS
  1. . I $P($G(^XTMP("GMRC3P52",1)),U,2)="DONE" D
  1. .. S GMRSTOP=1
  1. .. D MES^XPDUTL("Conversion of Class III Associated Stop Codes already run to completion.")
  1. .. D MES^XPDUTL(" ")
  1. . E S GMRX=+$P($G(^XTMP("GMRC3P52",1)),U)
  1. E S ^XTMP("GMRC3P52",0)=$$FMADD^XLFDT(DT,90)_"^"_DT
  1. D MES^XPDUTL("...Moving File #123.5, ASSOCIATED STOP CODE (Class 3) field entries...")
  1. D MES^XPDUTL(" ")
  1. I $G(GMRX)']0 S GMRX=0
  1. F S GMRX=$O(^GMR(123.5,"AB",GMRX)) Q:'GMRX D
  1. . S GMRDA=0 F S GMRDA=$O(^GMR(123.5,"AB",GMRX,GMRDA)) Q:'GMRDA D
  1. .. ;check for duplicate. FILE^DICN call will add duplicates.
  1. .. I +$O(^GMR(123.5,"AB1",GMRX,GMRDA,0)) Q
  1. .. K DIC("DR")
  1. .. S DA(1)=GMRDA
  1. .. S DIC="^GMR(123.5,"_DA(1)_",688,"
  1. .. S DIC(0)="L",DIC("P")=$P(^DD(123.5,688,0),"^",2)
  1. .. S DIC("DR")="688///"_GMRX
  1. .. S X=GMRX
  1. .. K D0 D FILE^DICN
  1. .. I Y=-1 Q
  1. .. S $P(^XTMP("GMRC3P52",1),U)=GMRX
  1. S $P(^XTMP("GMRC3P52",1),U,2)="DONE"
  1. ;
  1. CONS ;---------------------------------------------------------------------
  1. ;Post-init for sites running Class 3 software.
  1. ;
  1. ;Quit, if Class 3 field not installed.
  1. ;
  1. ;File 44
  1. ; Loop down Class 3 ^SC("AWAS" xref. to build new entries.
  1. ;---------------------------------------------------------------------
  1. ;
  1. ;Convert HOSPITAL LOCATION Class III CONSULT LINK field and xrefs.
  1. I '$D(^SC("AWAS")),'$D(^XTMP("SD53P478")) Q ;quit, no Class 3 data
  1. N CNSLTLNK,SDC,SDT,SDY,DA,DIE,DR,SDSTOP
  1. ;Check/create ^XTMP for conversion run to completion.
  1. I $D(^XTMP("SD53P478")) D I $G(SDSTOP) Q
  1. . I $P($G(^XTMP("SD53P478",1)),U,2)="DONE" D
  1. .. S SDSTOP=1
  1. .. D MES^XPDUTL("Conversion of Class III Consult Link entries already run to completion.")
  1. .. D MES^XPDUTL(" ")
  1. . E S CNSLTLNK=+$P($G(^XTMP("SD53P478",1)),U)
  1. E S ^XTMP("SD53P478",0)=$$FMADD^XLFDT(DT,90)_"^"_DT
  1. D MES^XPDUTL("...Moving File #44, CONSULT LINK (Class 3) field entries...")
  1. ;Loop down Class III CONSULT LINK "AWAS" xref (if exits).
  1. I $G(CNSLTLNK)']0 S CNSLTLNK=0
  1. F S CNSLTLNK=$O(^SC("AWAS",CNSLTLNK)) Q:'CNSLTLNK D
  1. .S SDC=0 F S SDC=$O(^SC("AWAS",CNSLTLNK,SDC)) Q:'SDC D
  1. ..S SDT=0 F S SDT=$O(^SC("AWAS",CNSLTLNK,SDC,SDT)) Q:'SDT D
  1. ...S SDY=0 F S SDY=$O(^SC("AWAS",CNSLTLNK,SDC,SDT,SDY)) Q:'SDY D
  1. ....;don't process if already exists (install rerun).
  1. ....Q:$D(^SC("AWAS1",CNSLTLNK,SDC,SDT,SDY))
  1. ....;create Class I CONSULT LINK field and xrefs.
  1. ....S DA(2)=SDC,DA(1)=SDT,DA=SDY
  1. ....S DIE="^SC("_DA(2)_",""S"","_DA(1)_",1,",DR="688////^S X=CNSLTLNK"
  1. ....D ^DIE
  1. . S $P(^XTMP("SD53P478",1),U)=CNSLTLNK
  1. S $P(^XTMP("SD53P478",1),U,2)="DONE"
  1. ;move Class 3 'AHST' Consult history to new 'AHST1' xref.
  1. D MES^XPDUTL(" ....Restoring historical cross reference entries.")
  1. M ^SC("AHST1")=^SC("AHST")
  1. D BMES^XPDUTL("Class III Conversion Complete.")
  1. K SDSEED
  1. D BMES^XPDUTL("*****")
  1. ;
  1. NOTIFY ;Send notification
  1. N DIFROM,XMDUZ,XMSUB,XMTEXT,XMY,XMZ
  1. I '$G(GMRSTOP),'$G(SDSTOP),($P($G(^XTMP("GMRC3P52",1)),U,2)="DONE"),($P($G(^XTMP("SD53P478",1)),U,2)="DONE") D
  1. . S XMDUZ="APPOINTMENT/CONSULT LINK"
  1. . S XMSUB="Class 3 Consults Conversion Complete"
  1. . S XMTEXT="^TMP(""GMRC3P52"",$J,"
  1. . S XMY(DUZ)=""
  1. . S ^TMP("GMRC3P52",$J,1)=" "
  1. . S ^TMP("GMRC3P52",$J,2)="The conversion of your ASSOCIATED STOP CODES and CONSULT LINK Class III entries"
  1. . S ^TMP("GMRC3P52",$J,3)="to the new Class I fields in patch SD*5.3*478 has successfully completed."
  1. . S ^TMP("GMRC3P52",$J,4)=" "
  1. . S ^TMP("GMRC3P52",$J,5)="After completely satified with you conversion, please follow the instructions"
  1. . S ^TMP("GMRC3P52",$J,6)="in the Patch Installation Guide for removing your Class III fields."
  1. . D ^XMD K ^TMP("GMRC3P52",$J),XMY
  1. Q