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

APCLTEN.m

Go to the documentation of this file.
  1. APCLTEN ; IHS/CMI/LAB - TOP TEN POVS ;
  1. ;;2.0;IHS PCC SUITE;**7,11**;MAY 14, 2009;Build 58
  1. ;
  1. W !!?20,"***** FREQUENCY OF DIAGNOSES REPORT *****",!!
  1. D EXIT
  1. GETDATES ;
  1. BD ;get beginning date
  1. W ! S DIR(0)="D^:DT:EP",DIR("A")="Enter beginning Visit Date" D ^DIR S:$D(DUOUT) DIRUT=1 K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) G EXIT
  1. S APCLBD=Y
  1. ED ;get ending date
  1. W ! S DIR(0)="DA^"_APCLBD_":DT:EP",DIR("A")="Enter ending Visit Date: " S Y=APCLBD D DD^%DT S Y="" D ^DIR S:$D(DUOUT) DIRUT=1 K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) G BD
  1. S APCLED=Y
  1. S X1=APCLBD,X2=-1 D C^%DTC S APCLSD=X
  1. S Y=APCLBD D DD^%DT S APCLBDD=Y S Y=APCLED D DD^%DT S APCLEDD=Y
  1. ;
  1. TEMP ;template of patients?
  1. S APCLSEAT=""
  1. S DIR(0)="S^A:ALL PATIENTS;S:SEARCH TEMPLATE OF PATIENTS",DIR("A")="Include which patients in the tally of diagnoses",DIR("B")="A" KILL DA D ^DIR KILL DIR
  1. G:$D(DIRUT) BD
  1. I Y="A" G CONT
  1. S APCLSEAT=""
  1. ;
  1. W ! S DIC("S")="I $P(^(0),U,4)=9000001" S DIC="^DIBT(",DIC("A")="Enter Patient SEARCH TEMPLATE name: ",DIC(0)="AEMQ" D ^DIC K DIC,DA,DR,DICR
  1. I Y=-1 S APCLSEAT="" G TEMP
  1. S APCLSEAT=+Y
  1. CONT ;
  1. S APCLNCAN=1 D ADD^APCLVL01 I $D(APCLQUIT) D DEL^APCLVL K APCLQUIT G GETDATES
  1. NUM S DIR(0)="NO^5:100:0",DIR("A")="How many entries do you want in the list",DIR("B")="10",DIR("?")="" D ^DIR S:$D(DUOUT) DIRUT=1 K DIR
  1. I $D(DIRUT) G GETDATES
  1. S APCLLNO=Y
  1. SCREEN ;
  1. S APCLTCW=0,APCLPTVS="V",APCLTYPE="D",APCLCTYP="T"
  1. K ^APCLVRPT(APCLRPT,11) S APCLCNTL="S" D ^APCLVL4 K APCLCNTL I $D(APCLQUIT) D DEL^APCLVL G GETDATES
  1. POV ;
  1. K APCLPRIM,APCLALL
  1. S DIR(0)="SO^P:Primary Purpose of Visit;A:All Purpose of Visits (Primary and Secondary)",DIR("A")="Report should include"
  1. S DIR("?")="If you wish to count only the primary purpose of visit enter a 'P'. To include ALL purpose of visits enter an 'A'. For outpatient visits (non-H service category) the primary pov is the first one entered." D ^DIR K DIR
  1. I $D(DIRUT) S APCLQUIT="" G SCREEN
  1. I Y="A" S APCLALL=""
  1. I Y="P" S APCLPRIM=""
  1. EXCL ;
  1. W !!,"You have the opportunity to exclude certain diagnoses from this report."
  1. W !,"For example, to eliminate Pharmacy refill diagnoses, you need to exclude",!,"ICD-9 code V68.1 and ICD-10 code Z76.0 from this report."
  1. W !,"If you chose to include only the primary pov then visits with "
  1. W !,"a primary pov of V68.1/Z76.0 will be excluded.",!
  1. ;exclude any diagnoses codes?
  1. S APCLEXCL=""
  1. S DIR(0)="Y",DIR("A")="Do you wish to exclude any diagnoses codes from the report",DIR("B")="N" KILL DA D ^DIR KILL DIR
  1. I $D(DIRUT) G POV
  1. S APCLEXCL=Y
  1. EXCL1 ;which ones to exclude
  1. K APCLDXT
  1. I 'APCLEXCL G CHRT
  1. W !,"Enter the diagnoses to be excluded.",!
  1. DX1 ;
  1. S X="DIAGNOSIS",DIC="^AMQQ(5,",DIC(0)="FM",DIC("S")="I $P(^(0),U,14)" D ^DIC K DIC,DA I Y=-1 W "OOPS - QMAN NOT CURRENT - QUITTING" G EXIT
  1. D PEP^AMQQGTX0(+Y,"APCLDXT(")
  1. I '$D(APCLDXT) G EXCL
  1. I $D(APCLDXT("*")) K APCLDXT
  1. CHRT ;
  1. S DIR(0)="S^L:List of items with Counts;B:Bar Chart (132 col)",DIR("A")="Select TYPE OF OUTPUT",DIR("B")="L" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) G POV
  1. S APCLCHRT=Y
  1. ZIS ;
  1. DEMO ;
  1. D DEMOCHK^APCLUTL(.APCLDEMO)
  1. I APCLDEMO=-1 G EXCL
  1. K APCLANS,APCLCNT,APCLCRIT,APCLCUT,AMQQTAX,APCLDISP,APCLHIGH,APCLI,APCLCAN,APCLSEL,APCLSKIP,APCLTEXT,APCLVAR,APCLVIEN,APCLVREC
  1. S XBRC="^APCLTEN1",XBRP="^APCLTENP",XBNS="APCL",XBRX="EXIT^APCLTEN"
  1. D ^XBDBQUE
  1. D EXIT
  1. Q
  1. EXIT ;
  1. D EXIT^APCLTEN1
  1. Q
  1. ;
  1. ;
  1. ;
  1. ;