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

ATXPAT.m

Go to the documentation of this file.
ATXPAT ; IHS/OHPRD/TMJ -  ENTER/EDIT PAT TAX FILE ; 
 ;;5.1;TAXONOMY;**11**;FEB 04, 1997;Build 48
 ;
 Q:$D(ATXQT)
 ;
START ;
 D INIT
 I '$D(^ATXAX(ATXDT,0))!('$D(^ATXPAT(ATXDT,0))#2) D EOJ Q
 S ATXPV=0
 F ATXL=0:0 S ATXPV=$O(^AUPNVPOV("B",ATXDI,ATXPV)) Q:ATXPV'=+ATXPV  S ATXPD=$P(^AUPNVPOV(ATXPV,0),U,2),ATXVIS=$P(^(0),U,3),ATXVIS=$P(^AUPNVSIT(ATXVIS,0),U) D @$S($D(ATXAD):"DIEADD",1:"DIEDEL")
 D EOJ
 Q
 ;
INIT ;
 S ATXDI=DA(1) ;DFN OF THE ICD CODE
 S ATXDT=DA ;DFN OF THE TAXONOMY
 Q
 ;
DIEADD ; ENTRY POINT - ADD PT TO PT TAXONOMY FILE FOR THIS TAXONOMY
 Q:'$D(^ATXPAT(ATXDT,0))#2
 I $P(^ATXAX(ATXDT,0),U,6)="" Q
 I ATXVIS<$P(^ATXAX(ATXDT,0),U,6) Q
 I '$P(^ATXAX(ATXDT,0),U,18)
 E  S ATXLV=$P(^AUPNVSIT(ATXVISDA,0),U,6) I ATXLV'=$P(^ATXAX(ATXDT,0),U,18) Q
 I $D(^ATXPAT(ATXDT,11,ATXPD)) S $P(^(0),U,2)=$P(^(ATXPD,0),U,2)+1 Q
 S ^ATXPAT(ATXDT,11,ATXPD,0)=ATXPD_"^1"
 S $P(^ATXPAT(ATXDT,11,0),U,3)=ATXPD,$P(^(0),U,4)=$P(^(0),U,4)+1
 NEW (DT,DTIME,DUZ,IO,IOF,IOM,IOS,IOSL,IOXY,U,XQDIC,XQPSM,XQY,IOST,XQYO,ZTQUEUED,ATXPD,ATXD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