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

APCLHCT.m

Go to the documentation of this file.
  1. APCLHCT ; IHS/CMI/LAB - DRIVER FOR ACTIVE POP ;
  1. ;;2.0;IHS PCC SUITE;;MAY 14, 2009
  1. START ;
  1. D INIT
  1. G:$D(APCLEOJ) EOJ
  1. F ;
  1. W !,"For which Hospital (Location of Encounter) should the report be run?",!
  1. S DIC("A")="Which Location (Hospital)? ",DIC="^AUTTLOC(",DIC(0)="AEMQ" D ^DIC K DIC,DA G:Y<0 EOJ
  1. S APCLLOC=+Y
  1. IND ;
  1. W ! S APCLIND="",DIR(0)="YO",DIR("A")="Do you wish to include only INDIAN patients",DIR("?")="If you wish to exclude Non-Indians from the report enter a Y" D ^DIR K DIR
  1. G:$D(DIRUT) F
  1. S APCLIND=Y
  1. SD ;
  1. W !
  1. S Y=DT X ^DD("DD") S APCLDTP=Y
  1. S %DT("A")="Starting Discharge Date for Inpatient Counts: ",%DT="AEPX" W ! D ^%DT
  1. I Y=-1 G IND
  1. S APCLSD=Y X ^DD("DD") S APCLSDY=Y
  1. ED S %DT("A")="Ending Discharge Date for Inpatient Counts: " W ! D ^%DT K %DT
  1. I Y=-1 G SD
  1. S APCLED=Y X ^DD("DD") S APCLEDY=Y
  1. I APCLED<APCLSD W !!,"Ending Date cannot be before Starting Date! Please reenter.",! G SD
  1. SBT ;subtotal by tribe?
  1. G:APCLSORT'="C" SBC
  1. W ! S APCLSUB="" S DIR(0)="YO",DIR("A")="Do you wish to Sub-Total by Tribe",DIR("?")="If you want sub-totals by tribe for each community enter a Y" D ^DIR K DIR
  1. G:$D(DIRUT) SD
  1. S APCLSUB=Y
  1. G ZIS
  1. SBC ;subtotal by community
  1. W ! S APCLSUB="" S DIR(0)="YO",DIR("A")="Do you wish to Sub-Total by Current Community of Residence",DIR("?")="If you want sub-totals by community for each Tribe enter a Y" D ^DIR K DIR
  1. G:$D(DIRUT) SD
  1. S APCLSUB=Y
  1. W !!!,"THIS REPORT WILL SEARCH THE ENTIRE PATIENT AND VISIT FILES!",!!,"IT IS STRONGLY RECOMMENDED THAT YOU QUEUE THIS REPORT FOR A TIME WHEN THE",!,"SYSTEM IS NOT IN HEAVY USE!",!
  1. ZIS ;
  1. DEMO ;
  1. D DEMOCHK^APCLUTL(.APCLDEMO)
  1. I APCLDEMO=-1 G SD
  1. S XBRP="^APCLHCT1",XBRC="^APCLHCT2",XBRX="EOJ^APCLHCT",XBNS="APCL"
  1. D ^XBDBQUE
  1. D EOJ
  1. Q
  1. EOJ K DIC,%DT,IO("Q"),I,J,K,JK,X,Y,DIRUT,POP,H,M,S,TS
  1. D EN^XBVK("APCL")
  1. Q
  1. ;
  1. INIT ;
  1. I '$D(APCLSORT) W $C(7),$C(7),!!,"Report Type Missing!!",! S APCLQUIT="" Q
  1. W:$D(IOF) @IOF
  1. W !!,"This Option will search the Patient file for all patients registered",!,"at the Service Unit or the facility that you select.",!
  1. W "A Report will result which will give the following counts:",!
  1. ;W ?5,"- All Living Patients registered at the facility or SU selected",!
  1. W ?5,"- The Number of ADULT/PEDIATRIC Discharges in the date range specified",!
  1. W ?5,"- Total number of Inpatient Days by Adult/Peds",!
  1. W ?5,"- The Number of NEWBORN discharges",!
  1. W ?5,"- The number of NEWBORN Days",!
  1. W ?5,"- The number of transfers in",!
  1. W ?5,"- The number with MCR/MCD/PI on the date of admission",!
  1. W "The report will be sorted by ",$S(APCLSORT="C":"COMMUNITY OF RESIDENCE",APCLSORT="T":"TRIBE OF MEMBERSHIP",1:"SERVICE UNIT OF RESIDENCE"),".",!!
  1. Q