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 ;06/25/15  15:47
 ;;2.7;Health Summary;**28,49,71,101,111**;Oct 20, 1995;Build 17
 ;
 ; External Reference
 ;   ICR  5699  $$ICDDATA^ICDXCODE
 ;   ICR    17  ^DGPM("ATID"
 ;   ICR  1372  ^DGPT(
 ;   ICR  2929  DSP^A7RHSM
 ;   ICR  2929  LST^A7RHSM
 ;   ICR   512  ^DGPMLOS
 ;   ICR 10061  IN5^VADPT
 ;   ICR 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
 N GMTSDATE,GMTSTEMP,GMTSTAB S GMTSTEMP="",GMTSTAB="  "
 S PTF=$S($D(VAIP(12)):VAIP(12),1:"") Q:PTF=""  Q:'$D(^DGPT(PTF,70))
 S ICD=^DGPT(PTF,70)
 S GMTSDATE=+$P(ICD,U) I $G(GMTSDATE)="" S GMTSDATE=DT
 S ICDI=+$P(ICD,U,11) I ICDI>0 D
 . S ICDX=$$CODESYS^GMTSPXU1(ICDI,80)
 . I $P($G(ICDX),U)=-1 D  Q
 .. S ICD(ADM,1,80,ICDI,.01)=$J(" ",38)_$P($G(ICDX),"^",2)
 .. S ICD(ADM,1,80,ICDI,3)=""
 . S ICD(ADM,1,80,ICDI,.01)=GMTSTAB_$P(ICDX,U)_"("_$P(ICDX,U,2)_")"
 . S GMTSTEMP=$$VLT^ICDEX(80,ICDI,GMTSDATE)
 . S ICD(ADM,1,80,ICDI,3)=GMTSTEMP
 S ICDI=+$P(ICD,U,10) I ICDI>0 D
 . S ICDX=$$CODESYS^GMTSPXU1(ICDI,80)
 . I $P($G(ICDX),U)=-1 D  Q
 .. S ICD(ADM,1,80,ICDI,.01)=$J(" ",38)_$P($G(ICDX),"^",2)
 .. S ICD(ADM,1,80,ICDI,3)=""
 . S ICD(ADM,1,80,ICDI,.01)=GMTSTAB_$P(ICDX,U)_"("_$P(ICDX,U,2)_")"
 . S GMTSTEMP=$$VLT^ICDEX(80,ICDI,GMTSDATE)
 . S ICD(ADM,1,80,ICDI,3)=GMTSTEMP
 F GMTSI=16:1:24 S ICDI=+$P(ICD,U,GMTSI) I ICDI>0 D
 . S ICDX=$$CODESYS^GMTSPXU1(ICDI,80)
 . I $P($G(ICDX),U)=-1 D  Q
 .. S ICD(ADM,(GMTSI-13),80,ICDI,.01)=$J(" ",38)_$P($G(ICDX),"^",2)
 .. S ICD(ADM,(GMTSI-13),80,ICDI,3)=""
 . S ICD(ADM,(GMTSI-13),80,ICDI,.01)=GMTSTAB_$P(ICDX,U)_"("_$P(ICDX,U,2)_")"
 . S GMTSTEMP=$$VLT^ICDEX(80,ICDI,GMTSDATE)
 . S ICD(ADM,(GMTSI-13),80,ICDI,3)=GMTSTEMP
 Q:'$D(^DGPT(PTF,71))
 S ICD=^DGPT(PTF,71)
 F GMTSI=1:1:15 S ICDI=+$P(ICD,U,GMTSI) I ICDI>0 D
 . S ICDX=$$CODESYS^GMTSPXU1(ICDI,80)
 . I $P($G(ICDX),U)=-1 D  Q
 .. S ICD(ADM,(GMTSI+11),80,ICDI,.01)=$J(" ",38)_$P($G(ICDX),"^",2)
 .. S ICD(ADM,(GMTSI+11),80,ICDI,3)=""
 . S ICD(ADM,(GMTSI+11),80,ICDI,.01)=GMTSTAB_$P(ICDX,U)_"("_$P(ICDX,U,2)_")"
 . S GMTSTEMP=$$VLT^ICDEX(80,ICDI,GMTSDATE)
 . S ICD(ADM,(GMTSI+11),80,ICDI,3)=GMTSTEMP
 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