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

ACMSTMP.m

Go to the documentation of this file.
  1. ACMSTMP ; IHS/TUCSON/TMJ - CREATE SEARCH TEMPLATE FOR CMS REPORTS ;
  1. ;;2.0;ACM CASE MANAGEMENT SYSTEM;;JAN 10, 1996
  1. ;;Routine added for Patch 2
  1. ;EP;ENTRY POINT
  1. EN D EN1
  1. EXIT K ACMSDIC,ACMSNAM,ACMSTN,DHD
  1. Q
  1. EN1 S DIR(0)="YO",DIR("A")="Store Report Result as Search Template",DIR("B")="NO"
  1. W !
  1. D ^DIR
  1. K DIR
  1. Q:Y'=1
  1. EN2 S DIC="^DIBT(",DIC(0)="AELMQZ",DIC("A")="Search Template: ",DIC("S")="I $P(^(0),U,4)=9000001&($P(^(0),U,5)=DUZ)"
  1. W !
  1. D ^DIC
  1. I +Y<1 W !!,"No Search Template selected." H 2 Q
  1. S ACMSTMP=+Y,ACMSNAM=$P(^DIBT(ACMSTMP,0),U)
  1. DUP I '$P(Y,U,3) D I Q K ACMSTMP,Y G EN2
  1. .S Q=""
  1. .W !!,$C(7),$C(7)
  1. .S DIR(0)="Y",DIR("A")="That template already exists!! Do you want to overwrite it",DIR("B")="N" K DA D ^DIR K DIR
  1. .I $D(DIRUT) S Q=1 Q
  1. .I 'Y S Q=1 Q
  1. .L +^DIBT(ACMSTMP):10
  1. .S ACMSTN=$P(^DIBT(ACMSTMP,0),U) S DA=ACMSTMP,DIK="^DIBT(" D ^DIK
  1. .S ^DIBT(ACMSTMP,0)=ACMSNAM,DA=ACMSTMP,DIK="^DIBT(" D IX1^DIK
  1. .L -^DIBT(ACMSTMP)
  1. .Q
  1. I ACMSTMP,$D(^DIBT(ACMSTMP)) D
  1. .W !!,?5,"An unduplicated patient list resulting from this report",!,?5,"will be stored in the.........>",!!?18,"** ",ACMSNAM," ** Search Template."
  1. .K ^DIBT(ACMSTMP,1)
  1. .S DHIT="S ^DIBT("_ACMSTMP_",1,$P("_ACMDIC_"D0,0),U,2))="""""
  1. .S DIE="^DIBT(",DA=ACMSTMP,DR="2////"_DT_";3////M;4////9000001;5////"_DUZ_";6////M"
  1. .D ^DIE
  1. .K DIE,DA,DR
  1. ;Q
  1. ;Run Template in Background Mode
  1. ;
  1. BACK ;
  1. S DHD="W ?0 D HDR^ACMSTMP",FLDS="!.01"
  1. W !!,"A brief report will be printed after the search template is complete.",!,"You must enter a device for this report OR you may queue at this time.",!
  1. Q
  1. HDR ;
  1. W !!,?15,"***CASE MANAGEMENT SYSTEM, SEARCH TEMPLATE CREATION***"
  1. W !!,?1,"Template Created: ",$P(^DIBT(ACMSTMP,0),U)
  1. W !,?1,"Created by: ",$P(^VA(200,DUZ,0),U)
  1. W !,"------------------------------------------------------------------------------",!
  1. Q