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

ATXRCH.m

Go to the documentation of this file.
  1. ATXRCH ; IHS/OHPRD/TMJ - SEARCH TEMPLATE PT FILE W/ PAT TAX NAMES ;
  1. ;;5.1;TAXONOMY;**11**;FEB 04, 1997;Build 48
  1. ;
  1. S U="^",ATXFIL=9000001,ATXTSK=0
  1. D DT^DICRW
  1. D START I '$D(ATXTP) S Y="" F ATXL=0:0 Q:Y]"" D SORTEMP^ATXPVT
  1. I '$D(ATXTP) D @$S($D(ATXPAT):"DATES^ATXPVT",1:"^ATXTSK") I '$D(ATXPAT),'ATXTSK,'$D(ATXTP) D SEARCH
  1. D EOJ
  1. Q
  1. ;
  1. START ;
  1. S DIC="^ATXAX(",DIC(0)="AEMQ",DIC("DR")="" D ^DIC K DIC
  1. I Y<1 S ATXTP=1 Q
  1. I $D(^TMP("ATXTAX",+Y)) W !,$C(7),"Taxonomy currently",^(+Y)," Try later.",! G START
  1. I '$O(^ATXPAT(+Y,11,0)) S ATXPAT="" ;IF NO PTS IN PT TAX FILE, GOES TO DATES^ATXPVT TO FIND PT DFNS
  1. S ATXX=+Y
  1. D:'$D(ATXPAT) USER
  1. Q
  1. ;
  1. USER ;INFORMS USER AS TO WHERE ENTRIES COMING FROM
  1. D DATE S ATXONE="W ""Create a search template with patient entries from the patient list"",!,""in the Pt Taxonomy file. This list of patients starts with the visit"",!,""date "",ATXDATE,""."""
  1. S ATXTWO="W ""Create a search template of patients seen during a range of visit dates."",!,""These patients will have had a purpose of visit that falls within this taxonomy."""
  1. ASK W !!,"Select, by number, one of the following: ",!!,1," " X ATXONE W !,2," " X ATXTWO R !,"Your choice (1 or 2): ",ATXPCK:DTIME
  1. I "^"[ATXPCK S ATXTP="" G A
  1. I ATXPCK=2 S ATXPAT="" G A
  1. I $E(ATXPCK)="?" D HELP G ASK
  1. I ATXPCK'=1 G ASK
  1. A Q
  1. ;
  1. DATE ;GET DATE FOR LINE USER+2
  1. S Y=$P(^ATXAX(ATXX,0),U,6) X ^DD("DD")
  1. S ATXDATE=Y
  1. Q
  1. ;
  1. HELP ;
  1. W:$D(IOF) @IOF
  1. W !!,"Either select option one and a template will be automatically created or",!,"select option two and you will be able to enter a range of visit dates during",!,"which time patients who fall within the selected taxonomy were seen."
  1. Q
  1. ;
  1. ZTM ;ENTRY POINT FOR TASKMAN
  1. D SEARCH
  1. I $D(ZTQUEUED) S ZTREQ="@"
  1. D EOJ
  1. Q
  1. ;
  1. S (ATXCNT,ATXDFN)=0
  1. W:'ATXTSK !! F ATXL=0:0 S ATXDFN=$O(^ATXPAT(ATXX,11,ATXDFN)) Q:ATXDFN'=+ATXDFN S ^DIBT(ATXTMP,1,ATXDFN)="" W:'ATXTSK "." S ATXCNT=ATXCNT+1
  1. W !!,"There ",$S(ATXCNT'=1:"were ",1:"was "),ATXCNT,$S(ATXCNT'=1:" entries",1:" entry")," in the ",$P(^DIBT(ATXTMP,0),U)," template."
  1. S ^DIBT(ATXTMP,1,0)=ATXCNT
  1. Q
  1. ;
  1. EOJ ;
  1. K ATXFIL,ATXL,ATXTP,ATXTMP,ATXX,ATXO,ATXHI,ATXLOV,ATXLO,ATXPV,ATXY,ATXL,ATXTP,ATXX,ATXDFN,ATXTMP,ATXPAT,ATXONE,ATXTWO,ATXPCK,ATXCNT,ATXTSK,ATXDATE
  1. Q
  1. ;