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

ACMGTP.m

Go to the documentation of this file.
ACMGTP ; IHS/TUCSON/TMJ - LOOKUP AND EDIT OF CMS REGISTER ; [ 02/10/2009  9:47 AM ]
 ;;2.0;ACM CASE MANAGEMENT SYSTEM;**5,6,8**;JAN 10, 1996
 ;PATCH #6 DISPLAYS REGISTER CREATOR TO NON-SECURED USER
EN ;PEP - SELECT AND CREATE A REGISTER
 D RGTP
EXIT K ACMU1,ACMU11,ACMX,ACMI,ACMJ,ACM,ACMQKI,ACMQK,ACMY,ACMRGCUS,ACMRGMGR,ACMRGUSR,ACMQUIT,ACMOLDN,ACMNEWN
 K ACMQUIT,ACMZ
 I '$D(ACMRGTP) K ACMRG,ACMRGNA
 Q
RGTP ;EP;TO SELECT AND CREATE A REGISTER
 D HEAD^ACMMENU
RGTPX ;EP;SELECT/CREATE REG W/O HEADER
 S ACMX="REGISTER SELECTION UTILITY"
 W !!,?80-$L(ACMX)\2,ACMX,!
 K:$D(ACMRGTP) ACMRGMGR,ACMRGUSR,ACMRGCUS
 K:$D(ACMRGMGR) ACMRGTP,ACMRGUSR
 K:$D(ACMRGUSR) ACMRGMGR,ACMRGTP,ACMRGCUS
 K:$D(ACMRGCUS) ACMRGTP,ACMRGUSR
 S ACMRGX(3)="I '$D(^ACM(41.1,ACMRG,""AU"",""B"",DUZ)) S ACMJ=ACMJ-1",ACMRGX(4)="I $D(^ACM(41.1,ACMRG,""AU"",""B"",DUZ)) X ACMRGX(5)",ACMRGX(5)="W:ACMJ#2=1 !?14 W:ACMJ#2=0 ?45 W ACMRGX"
 S ACMRGX=""
 F ACMJ=1:1 S ACMRGX=$O(^ACM(41.1,"B",ACMRGX)) Q:ACMRGX=""  D RGTPA
 K ACMRG,ACMRGX,ACMJ,ACMI
 D RGTP1,EXIT
 Q
RGTPA S ACMRG="",ACMRG=$O(^ACM(41.1,"B",ACMRGX,ACMRG))
 X:$D(ACMRGTP) ACMRGX(3)
 X:$D(ACMRGTP) ACMRGX(4)
 X:'$D(ACMRGTP) ACMRGX(5)
 Q
RGTP1 I $D(ACMRGUSR) S ACMRGUSR=DUZ,DIC(0)="AEMQZ"
 I $D(ACMRGCUS) S ACMRGCUS=DUZ,DIC(0)="AEMQZ"
 I $D(ACMRGTP) S DIC(0)="AEMQZ"
 I $D(ACMRGMGR) S ACMRGMGR=DUZ,DIC(0)="AELMQZ",DLAYGO=9002241
 S (DIC,DIE)="^ACM(41.1,",DIC("A")="    REGISTER: "
 I $D(ACMRGTP) S ACMZZDIC="^ACM(41.1)",DIC("S")="I $D(@ACMZZDIC@(+Y,""AU"",""B"",DUZ)) ;IHS/CIM/LAB 12/23/06 FIX"
 D DIC K ACMZZDIC ;IHS/LAB 12/23/04 FIX
 I $E(X)=U!(X="")!(Y<1) S (XQUIT,ACMQUIT)="" K ACMRG,ACMRGNA Q
 S (DA,ACMRG)=+Y,ACMRGNA=$P(^ACM(41.1,ACMRG,0),U)
 D DECEASED(+Y) ;IHS/CIM/THL PATCH 5
 Q:$D(ACMTRN)
 I $D(ACMDELRG) S ACMRGTP="" Q
 I $D(ACMRGTP),'$D(ACMTRN) S (ACMEP,ACMES,ACMEP,ACMPP)="" D ^ACMCTRL Q
RGTP2 I '$D(ACMRGTP)&($D(ACMRGMGR)!$D(ACMRGUSR)) S DR=$S($D(ACMRGMGR):"[ACM REGISTER SETUP]",$D(ACMRGUSR):".05T",1:"") D:$D(ACMRGUSR) USER D  Q:'$D(^ACM(41.1,ACMRG,0))
 .I $D(ACMRGUSR),$D(ACMQUIT) Q
 .I DUZ'=$P($G(^ACM(41.1,ACMRG,4)),U) D SECMSG H 5 S ACMQUIT=1 Q
 .S ACMOLDN=$P($G(^ACM(41.1,ACMRG,0)),U)
 .D DIE
 .S ACMNEWN=$P($G(^ACM(41.1,ACMRG,0)),U)
 .D:ACMOLDN'=ACMNEWN NAMEREX
 I $D(ACMRGUSR),$D(ACMQUIT) K ACMQUIT G EN
 I $D(ACMRGCUS),'$D(ACMQUIT) D SLCT
 Q
SLCT F  D SELECT Q:$D(ACMQUIT)
 K ACMQUIT
 Q
SELECT D HEAD^ACMMENU
 W !!
 S ACMX="",ACMU1=0
 ;F ACMU1=1:1 S ACMX=$O(^ACM(56,"B",ACMX)) Q:ACMX=""  S ACMY=$O(^ACM(56,"B",ACMX,"")),ACMZ(ACMU1)=ACMY,ACMX(ACMU1)=ACMX
 F  S ACMX=$O(^ACM(56,"B",ACMX)) Q:ACMX=""  S ACMY=$O(^ACM(56,"B",ACMX,"")) I $P(^ACM(56,ACMY,0),U,4)'="D" S ACMU1=ACMU1+1,ACMZ(ACMU1)=ACMY,ACMX(ACMU1)=ACMX
 S ACMU11=ACMU1\2+(ACMU1#2)
 F ACM=1:1:ACMU11 D
 .S ACMU1=ACM,ACMY=ACMZ(ACMU1)
 .W !?10,$J(ACMU1,3)_")",?$X+2,ACMX(ACMU1)
 .I ACMX(ACMU1)["CASE REVIEW" W ?37,"<**"
 .E  I $D(^ACM(41.1,ACMRG,2,ACMY)) W ?37,"<=="
 .S ACMU1=ACM+ACMU11
 .;Q:'$D(ACMZ(ACMU1))  ;S ACMU1=ACMU1-1 Q
 .I '$D(ACMZ(ACMU1)) S ACMU1=ACMU1-1 Q
 .S ACMY=ACMZ(ACMU1)
 .W ?45,$J(ACMU1,3)_")",?$X+2,ACMX(ACMU1)
 .I ACMX(ACMU1)["REGISTER" W ?68,"<**"
 .E  I $D(^ACM(41.1,ACMRG,2,ACMY)) W ?68,"<=="
 S ACMU1=ACMU1+1
 I ACMU1#2 W !?10
 W ?45
 W $J(ACMU1,3)_")","  All data types"
 W !!,?12,"<** Indicates automatic selection of Register Component"
SLCT1 S DIR(0)="SOA^A:ADD;D:DELETE;H:HELP",DIR("A")="'A' to ADD, 'D' to DELETE option(s) or 'H' for HELP  ==> ",DIR("?")="Type 'A' to ADD, 'D' to DELETE 'H' for HELP "
 W !!
 D ^DIR K DIR
 I U[$E(X)!(X="") S ACMQUIT="" Q
 S ACMQK=Y
 I ACMQK="H" D ^ACMHELP Q
 W !!?10,"'<==' indicates option already selected for this register.",!?10,"To select several data types separate them with commas.",!?10,"For example:  ==> 1,3,7,9"
 K DR
 S:$E(ACMQK)="D" DR=".01///@"
 S DIR(0)="LOA^1:"_ACMU1,DIR("A")="Select option(s) ==> ",DIR("?")="Type a number from 1 to "_ACMU1
 W !
 D ^DIR K DIR
 I U[$E(X)!(X="") S ACMQUIT="" Q
 S ACMQK=Y
 S:$E(ACMQK,$L(ACMQK))="," ACMQK=$E(ACMQK,1,$L(ACMQK)-1)
 I ACMQK=ACMU1 D ALL Q
LOOP S ACMCNT=$L(ACMQK,","),ACMQK1=ACMQK
 W ! D WAIT^DICD W !
 F ACMLI=1:1:ACMCNT S ACMQK=$P(ACMQK1,",",ACMLI) D SET
 Q
SET Q:ACMQK>(ACMU1-1)
 ;Q:'$D(ACMZ(ACMQK))
 S (DA,X,DINUM)=ACMZ(ACMQK),DA(1)=ACMRG
 K DIC,DD S (DIE,DIC)="^ACM(41.1,"_ACMRG_",2,",DIC(0)="L"
 S:'$D(^ACM(41.1,ACMRG,2,0)) ^ACM(41.1,ACMRG,2,0)="^9002241.13P^^"
 I '$D(DR) K DD,DO D FILE^DICN K DIC,DD,DR
 D:$D(DR) DIE
 Q
 ;
ALL W ! D WAIT^DICD W !
 F ACMQK=1:1:(ACMU1-1) D SET
 Q
USER D HEAD^ACMMENU
 S ACMX="AUTHORIZED USERS"
 W !?80-$L(ACMX)\2,ACMX,!!
 S ACMX=""
 ;2ND SEC LEVEL
 S ACMRDEV=$P($G(^ACM(41.1,ACMRG,4)),U) ;IHS/CMI/TMJ PATCH #6
 I ACMRDEV'="" S ACMRDEV=$P($G(^VA(200,ACMRDEV,0)),U)
 I DUZ'=$P($G(^ACM(41.1,ACMRG,4)),U) W !!,$C(7),$C(7),?20,"You are NOT the Creator of this Register",!,?19,"Therefore, you cannot Add Users!",!!
 I DUZ'=$P($G(^ACM(41.1,ACMRG,4)),U) W !,"Contact the Register Developer- "_ACMRDEV_" -for more information.",!! H 5 S ACMQUIT=1 Q
 ;I DUZ'=$P($G(^ACM(41.1,ACMRG,4)),U) W !!!,$C(7),$C(7),?5,"You are NOT the Creator of this Register; therefore, you cannot Add Users!",!! H 5 S ACMQUIT=1 Q 
 F ACMU1=1:1 S ACMX=$O(^ACM(41.1,ACMRG,"AU","B",ACMX)) Q:ACMX=""  D USR1
 K ACMU1,ACMX,ACMY
 W !
 Q
USR1 Q:'$D(^VA(200,ACMX,0))
 S ACMY=$P(^VA(200,ACMX,0),U)
 I $D(ACMY) W:ACMU1#2=1 !?14 W:ACMU1#2=0 ?45 W ACMY
 Q
DIC W ! D ^DIC K DIC,DR,DD,DLAYGO Q
DIE D ^DIE K DIC,DIE,DA Q
SECMSG ;
 D SECMSG^ACMGTP1
 Q
NAMEREX ;
 D NAMEREX^ACMGTP1
 Q
DECEASED(ACMRGDA) ;PEP;PUBLISHED ENTRY POINT TO CHECK REGISTER PATIENTS FOR ;IHS/CIM/THL PATCH 5
 ;DECEASED STATUS
 ;ACMRGDA - IEN FOR THE REGISTER
 Q:'$G(ACMRGDA)
 Q:'$D(^ACM(41,"B",ACMRGDA))
 W !!,"Register being checked to update status of deceased patients."
 S ZTRTN="DEC1^ACMGTP"
 S ZTSAVE("ACM*")=""
 S ZTDTH=$H
 S ZTIO=""
 S ZTDESC="CHECK CMS REGISTER FOR DECEASED PATIENTS"
 D ^%ZTLOAD
 Q
DEC1 ;PEP;TO CHECK FOR DECEASED PATIENTS
 Q:'$G(ACMRGDA)
 N ACMDA,DFN
 S ACMDA=0
 F  S ACMDA=$O(^ACM(41,"B",ACMRGDA,ACMDA)) Q:'ACMDA  D
 .S DFN=$P($G(^ACM(41,ACMDA,0)),U,2)
 .Q:'$G(^DPT(+DFN,.35))
 .D DECEASED^ACMLPAT(DFN,ACMDA)
 Q