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

DGTSSET.m

Go to the documentation of this file.
  1. DGTSSET ;ALB/LM - TREATING SPECIALTY SETUP & INITIALIZATION ; 4-1-93
  1. ;;5.3;Registration;**27,36,39,64,68,85,242**;Aug 13, 1993
  1. ;
  1. START S DGEGL=+^DG(43,1,"G")\1 ; G&L init date
  1. S DGTSDIV=+$P($G(^DG(43,1,"GL")),"^",2) ; Multidivision Med Center
  1. ;
  1. I DGEGL'?7N W !!,"I cannot run this program until you specify an early date",!,"to run the G&L in the site parameters.",!!,*7,*7 G END
  1. ;
  1. S DGEGL=$O(^DG(40.8,0)) I '$D(^DG(40.8,DGEGL)) W !!,"I cannot run this program until you set up your Medical Center's",!,"Division File",!!,*7,*7 G END
  1. ;
  1. TSR ; Day before TSR Initialiation Date
  1. S DGTSIN=$S($D(^DG(43,1,"G")):+$P(^DG(43,1,"G"),"^",11),1:"")
  1. ;
  1. I DGTSIN'>0 S DGTSIN=2921001
  1. S DGTSINDT=$$FMTE^XLFDT(DGTSIN) ; init date - external format
  1. S X1=DGTSIN,X2=-1 D C^%DTC S DGTSIN=X ; Internal format of date
  1. ;
  1. S DGTSDT=$$FMTE^XLFDT(DGTSIN)
  1. ;
  1. FTS ; Facility Treating Specialty File
  1. W !
  1. S DIC="^DIC(45.7,",DIC(0)="AEQMZL",DLAYGO=45.7 D ^DIC G END:+Y'>0
  1. ;
  1. ;S DIE=DIC,DA=+Y,DGTS=$P(^DIC(45.7,DA,0),"^"),DR=".01;1;2;10;99" D ^DIE ; DGTS = TS Name
  1. S DIE=DIC,(DGTSIEN,DA)=+Y,DGTS=$P(^DIC(45.7,DA,0),"^"),DR="[DGTREAT]" D ^DIE ; DGTS = TS Name
  1. ;
  1. K DGEGL,DIC,DIE,Y,DA,DR,X,X1,X2
  1. ;
  1. ; This note was commented out (in patch DG*5.3*39) because it is only
  1. ; applicable to the initial setup of existing treating specialties for
  1. ; the Treating Specialty report. It does not apply to new
  1. ; treating specialties. (RESTORED - PATCH DG*5.3*85)
  1. ;
  1. NOTE ; note to be displayed;
  1. W !!?5,"The information for the ",DGTS," treating specialty"
  1. W !?5,"should be entered ",$S($D(DGTSDIV):"by Medical Center Division",1:"")," as of midnight on "
  1. W !?5,DGTSDT," to properly initialize the Treating Specialty Report!",!!
  1. W ?5,"Following any new entries to or revisions of this data, "
  1. W !?5,"the G&L MUST BE recalculated back to ",DGTSINDT,".",!!
  1. ;
  1. W !
  1. S DGTSIF=$S($D(^DIC(45.7,"B",DGTS)):$O(^DIC(45.7,"B",DGTS,0)),1:-1) ; TS Internal Format (IEN) of Facility Treating Specialty
  1. ;
  1. DV ; Medical Center Division File
  1. S DIC="^DG(40.8,",DIC(0)="AEQZ"
  1. ;
  1. I DGTSDIV D ^DIC G FTS:+Y'>0 S (DGTSDV,DA)=+Y
  1. ;
  1. I 'DGTSDIV S (DGTSDV,DA)=$O(^DG(40.8,0))
  1. ;
  1. C ; Treating Specialty Multiple
  1. ; Census Multiple
  1. S DIE="^DG(40.8,",DR="[DGTS]" D ^DIE
  1. ;
  1. K DA,DR,DIE,DIC,Y,X
  1. ;
  1. I DGTSDIV G DV
  1. ;
  1. I 'DGTSDIV G FTS
  1. ;
  1. PR ;
  1. W !!,"This report should be printed on 132 columns.",!
  1. S L=0,DIC="^DIC(45.7,",FLDS="[DGTREAT]",DHD="" D EN1^DIP Q
  1. ;
  1. END K DGEGL,DGTSIN,DGTSDT,DGTSIF,DGTSDV,DGTSDIV,DGTS,DGTSIEN,DGTSPT,DIC,DIE,DA,DR,X,X1,X2 Q