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

GMTSDGA.m

Go to the documentation of this file.
GMTSDGA ; SLC/MKB,KER/NDBI - Admissions for HS ; 03/24/2004
 ;;2.7;Health Summary;**28,49,71**;Oct 20, 1995
 ;                   
 ; External Reference
 ;   DBIA  3390  $$ICDDX^ICDCODE
 ;   DBIA    17  ^DGPM("ATID"
 ;   DBIA  1372  ^DGPT(
 ;   DBIA 10082  ^ICD9(
 ;   DBIA  2929  DSP^A7RHSM
 ;   DBIA  2929  LST^A7RHSM
 ;   DBIA   512  ^DGPMLOS
 ;   DBIA 10061  IN5^VADPT
 ;   DBIA 10061  KVAR^VADPT
 ;                    
ENAD ; Gets Admission Information 
 S TT=1,FLGDX=0,FLGDC=0
 D PATINFO Q
ENDC ; Discharge Information
 S TT=3,FLGDC=1,FLGDX=0
 D PATINFO Q
ENDX ; PTF Discharge Diagnosis
 S TT=3,FLGDX=1,FLGDC=0
 D PATINFO Q
ENTS ; Treating Speciality Information
 S TT=6,FLGDX=0,FLGDC=0
 D PATINFO Q
ENTR ; Transfers
 S TT=2,FLGDX=0,FLGDC=0
 D PATINFO Q
PATINFO ; Patient Information
 S VA200=1 K DIQ
 I $D(GMTSNDM),GMTSNDM>0 S CNTR=GMTSNDM
 E  S CNTR=100
 S GMC=-1,GMN="",ADM=GMTS1,FLAG=0
 I TT=1 D FADM^GMTSDGA2
 D:$$ROK^GMTSU("A7RHSM")&($$NDBI^GMTSU) LST^A7RHSM(DFN,.A7RHS)
 F  S ADM=$O(^DGPM("ATID"_TT,DFN,ADM)) D:$$ROK^GMTSU("A7RHSM")&($$NDBI^GMTSU) DSP^A7RHSM(ADM) Q:('ADM!(ADM>GMTS2)!($D(GMTSQIT)))  D GET Q:$D(GMTSQIT)!($G(CNTR)<0)
 D KILLADM K:$$NDBI^GMTSU A7RHS
 Q
GET ; Admission Data
 N VAHOW
 S ADA=$O(^DGPM("ATID"_TT,DFN,ADM,0)) Q:'ADA
 S CNTR=CNTR-1 I CNTR<0 Q
 S VAIP("E")=ADA D IN5^VADPT
 S (X,ADATE)=+VAIP(3) D REGDT4^GMTSU S ADT=X
 K DGPMIFN S:TT=1 DGPMIFN=ADA S:TT'=1 DGPMIFN=VAIP(13)
 S GMC=2
 D CONTGET
 S LIN=$S(TT=2:"TROUT^GMTSDGA1",FLGDX:"DXOUT^GMTSDGA1",FLGDC:"DCOUT^GMTSDGA1",TT=6:"TSOUT^GMTSDGA2",TT=1:"ADOUT^GMTSDGA1") D @LIN
 K ICD(ADM)
 Q
CONTGET ; ICD and LOS info only needed for certain MAS components
 Q:TT=2  Q:TT=6  N ICDX,ICDI I DGPMIFN D ^DGPMLOS S LOS=+X
 S PTF=$S($D(VAIP(12)):VAIP(12),1:"") Q:'$D(^ICD9)  Q:PTF=""  Q:'$D(^DGPT(PTF,70))
 S ICD=^DGPT(PTF,70)
 S ICDI=+$P(ICD,U,11) I ICDI>0 D
 . S ICDX=$$ICDDX^ICDCODE(ICDI)
 . S ICD(ADM,1,80,ICDI,.01)=$P(ICDX,"^",2)
 . S ICD(ADM,1,80,ICDI,3)=$P(ICDX,"^",4)
 S ICDI=+$P(ICD,U,10) I ICDI>0 D
 . S ICDX=$$ICDDX^ICDCODE(ICDI)
 . S ICD(ADM,2,80,ICDI,.01)=$P(ICDX,"^",2)
 . S ICD(ADM,2,80,ICDI,3)=$P(ICDX,"^",4)
 F GMTSI=16:1:24 S ICDI=+$P(ICD,U,GMTSI) I ICDI>0 D
 . S ICDX=$$ICDDX^ICDCODE(ICDI)
 . S ICD(ADM,(GMTSI-13),80,ICDI,.01)=$P(ICDX,"^",2)
 . S ICD(ADM,(GMTSI-13),80,ICDI,3)=$P(ICDX,"^",4)
 Q
KILLADM ; Kill Admission variables
 D KVAR^VADPT
 K ADA,ADATE,ADT,BD,BDSC,DA,DIC,DDT,DP,DSPL,GMJ,GMJ1,OP,OPTR,FLAG,FLGDX,FLGDC,X,DR,GMI,GMTO,GMTNO,GMTSI,GMX,ADM,CNTR,GMC,GMZ,GMN,ICD,PTF,PTF70,PTFLG,LOS,II,DGPMIFN,IN,LIN,TI,TT,TS,SPEC
 Q