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

APCLW6.m

Go to the documentation of this file.
  1. APCLW6 ; IHS/CMI/LAB - AGE BUCKET/DIAGNOSIS REPORT ;
  1. ;;2.0;IHS PCC SUITE;**10**;MAY 14, 2009;Build 88
  1. ;
  1. START ;
  1. W !!,"***** PATIENTS MOVING UP OR DOWN 2 PERCENTILES IN THE BMI CURVE *****",!!
  1. W !,"This report will prompt you to enter a date range. The report will"
  1. W !,"list all patients who have moved from the normal to the "
  1. W !,"NHANES 85th-94th Percentile or have moved from the NHANES 85th-94th"
  1. W !,"Percentile to the NHANES >= 95th Percentile in the date range"
  1. W !,"that you specify."
  1. W !
  1. D EXIT
  1. S APCLSEAT="",APCLCMS=""
  1. S APCLTYPE=""
  1. ;
  1. DATES K APCLED,APCLBD
  1. K DIR W ! S DIR(0)="DO^::EXP",DIR("A")="Enter Beginning Visit Date"
  1. D ^DIR Q:Y<1 S APCLBD=Y
  1. K DIR S DIR(0)="DO^:DT:EXP",DIR("A")="Enter Ending Visit Date"
  1. D ^DIR Q:Y<1 S APCLED=Y
  1. ;
  1. I APCLED<APCLBD D G DATES
  1. . W !!,$C(7),"Sorry, Ending Date MUST not be earlier than Beginning Date."
  1. ST ;
  1. S DIR(0)="S^S:Search Template of Patients;P:All Patients within an age range"
  1. S DIR("A")=" Select List " D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. G:$D(DIRUT) EXIT
  1. S APCLTYPE=Y
  1. I APCLTYPE="S" D TEMPLATE G:APCLSEAT="" START
  1. I APCLTYPE="P" D AGE I APCLLOWA=""!(APCLHGHA="")!(APCLBEG="") G DATES
  1. ;
  1. SEX ;
  1. S DIR(0)="S^M:Males;F:Females;B:Both",DIR("A")="Do you want the report to include",DIR("B")="B" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. G:$D(DIRUT) START
  1. S APCLSEX=Y
  1. ZIS ;
  1. DEMO ;
  1. D DEMOCHK^APCLUTL(.APCLDEMO)
  1. I APCLDEMO=-1 G SEX
  1. S XBRC="^APCLW61",XBRP="^APCLW6P",XBNS="APCL",XBRX="EXIT^APCLW6"
  1. D ^XBDBQUE
  1. D EXIT
  1. Q
  1. AGE ;
  1. S (APCLLOWA,APCLHGHA,APCLBEG)=""
  1. S DIR(0)="N^2:74:0",DIR("A")="Enter the low age",DIR("B")="" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. Q:$D(DIRUT)
  1. S APCLLOWA=Y
  1. S DIR(0)="N^"_APCLLOWA_":74:0",DIR("A")="Enter the high age",DIR("B")="" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. Q:$D(DIRUT)
  1. S APCLHGHA=Y
  1. W !!,"When determining which patients are in the ",APCLLOWA," to ",APCLHGHA," age range"
  1. W !,"should the age of the patient be calculated based on the beginning"
  1. W !,"or ending date of the time period?",!
  1. S APCLBEG=""
  1. S DIR(0)="S^B:Beginning of Time Period ("_$$FMTE^XLFDT(APCLBD)_");E:End of Time Period ("_$$FMTE^XLFDT(APCLED)_"):",DIR("A")="Calculate Age based on what date",DIR("B")="B" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. G:$D(DIRUT) AGE
  1. S APCLBEG=Y
  1. Q
  1. EXIT ;
  1. D EN^XBVK("APCL")
  1. D KILL^AUPNPAT
  1. K B,D,DA,DFN,DIC,DIR,DIRUT,J,K,M,P,R,S,T,V,X,X1,X2,Y,Z
  1. K DIR,DA,DIC,J,K,M,S,X,Y,APCLSEAT,APCLTYPE
  1. Q
  1. ;
  1. TEMPLATE ;If Template was selected
  1. S APCLSEAT=""
  1. ;
  1. W ! S DIC("S")="I $P(^(0),U,4)=9000001!($P(^(0),U,4)=2)" S DIC="^DIBT(",DIC("A")="Enter Patient SEARCH TEMPLATE name: ",DIC(0)="AEMQ" D ^DIC K DIC,DA,DR,DICR
  1. I Y=-1 K APCLTYPE Q
  1. S APCLSEAT=+Y
  1. Q