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

ACMEP.m

Go to the documentation of this file.
ACMEP ; IHS/TUCSON/TMJ - EDIT SEQUENCE DATA ENTRY ;
 ;;2.0;ACM CASE MANAGEMENT SYSTEM;;JAN 10, 1996
 ;EDITING SEQUENCE FOR PATIENT DATA ENTRY
 ;ENTRY DISPLAY OF EXISTING DATA
 ;HEADER DISPLAY FORMAT CALLED FROM ACMCTRL2
 ;ENTRY FIELD & POSITION NUMBER DISPLAYS CALLED FROM ACMCTRL1
 ;
 ;
EN D INIT
EN1 D HEAD
 G EXIT:$D(ACMPROB)
 D LIST:'$D(ACMCT)&'$D(ACMREG)
 I '$D(ACMREG),'$D(ACMCT),'$D(ACMNT),'$D(ACMCH) D DIC
 I $D(ACMDEL) K ACMDEL G EN1
 I '$D(ACMQUIT),'$D(ACMOUT) D DIE I ACMDIC=44,$D(ACMY),$D(^ACM(44.3,"AC",ACMY)) S DIR(0)="YO",DIR("A")="Add/Edit Standard Interventions",DIR("B")="NO" W ! D ^DIR K DIR I Y=1 S ACMDXDA=ACMY D EN2^ACMDXIT
 G EN1:'$D(ACMQUIT)&'$D(ACMOUT)&'$D(ACMCT)&'$D(ACMCH)&'$D(ACMCR)
EXIT K ACMPROB,ACMENTRY,ACMREG,ACMCT,ACMNT,ACMCH,ACMFM,ACMTL,ACMEN1,ACMY
 K ACMEN,ACMLE,ACMDIQF,ACMDIC,DIC,DR,DA,ACMPOSS,ACMDIQF,ACMDR,ACMDIC
 K ACMDIC1,ACMDIC2,ACMFLD,ACMUTIL,ACMDICK
 Q
 ;
INIT K ACMQUIT,ACMOUT
 I $D(ACMEP) S ACMEN1=$P(ACMENTRY," ;;")_1,ACMLE=$P($T(@ACMEN1^ACMCTRL2),";;",2)
 S ACMTL=$P(ACMENTRY,";;",2),ACMDIC=$P(ACMENTRY,";;",3),ACMDR=$P(ACMENTRY,";;",4),ACMDIQF=$P(ACMENTRY,";;",5),ACMPOSS=$P(ACMENTRY,";;",6)
 Q
 ;
DIC S DIC="^ACM("_ACMDIC_".1,",DIC("A")=$P(ACMENTRY,";;",7),DIC(0)="AEMQZL",ACMDIC1="^ACM("_ACMDIC_")",ACMDIC2="^ACM("_ACMDIC_".1)"
 S:ACMDIC["57" DIC="^AUTTMSR("
 S:$D(ACMFM) DIC="^AUPNPAT("
 I DIC["AUPNPAT"!(ACMDIC=47) S DIC(0)="AEMQZ"
 I $P(^ACM(41.1,ACMRG,0),U,11)'=1 S DIC(0)="AEMQZ"
 I '$P(^ACM(41.1,ACMRG,0),U,8) S:ACMDIC'=41&(ACMDIC'=46)&(ACMDIC'=57)&(ACMDIC'=50) DIC("S")="I $D(@ACMDIC2@(+Y,""RG"",""B"",ACMRG))"
 S:ACMDIC=47 DIC("S")="I $D(@ACMDIC2@(+Y,""RG"",""B"",ACMRG))"
 W !
 D ^DIC K DIC,DA
 I $E(X)=U!(X="")!(Y=-1) S ACMQUIT="" S:X["^" ACMOUT="" Q
 S ACMY=+Y
 I $P(Y,U,3)=1 S DR=".02T;.03///"_ACMRGNA D ADD
 I '$D(@ACMDIC2@(ACMY,"RG","B",ACMRG)) S DR=".03///"_ACMRGNA D ADD
 I $D(@ACMDIC1@("AC",ACMRG,ACMPTNO,ACMY)) S DA=(^(ACMY)) D DEL Q
DICN ;EP
 K DIC,DD,DR
 S X=ACMY,DIC="^ACM("_ACMDIC_",",DIC(0)="L",DIC("DR")=".02////"_ACMPTNO_";.03////"_ACMRGDFN_";.04////"_ACMRG
 K DD,DO D FILE^DICN K DIC,DR,DD S (ACMDA,DA)=+Y
 Q
 ;
ADD S DIE="^ACM("_ACMDIC_".1,",DA=ACMY
 D ^DIE S Y=DA K DIE,DA,DR
 Q
 ;
DIE ;EP
 S:ACMDIC=41 DA=ACMRGDFN
 S DR=ACMDR,DIE="^ACM("_ACMDIC_","
 W:'$D(ACMREG)&'$D(ACMNT)&'$D(ACMCH) !
 D DIE1
 Q
 ;
DIE1 W ! D ^DIE K DIC,DIE,DA,DR
 I $D(Y) S ACMOUT="" Q
 S DIE="^ACM(41,",DA=ACMRGDFN,DR="11///TODAY" D ^DIE K DIC,DIE,DA,DR
 Q
 ;
DEL W !!?10,"Delete this entry"
 S %=2 D YN^DICN
 I %=-1 S ACMQUIT="" Q
 I %=0 W !!?10,"Type 'Y' to delete entry or 'N' to retain it." G DEL
 I %Y='"",(%Y'?1"Y".E)!(%Y'?1"N".E) W !!?10,"Type 'Y' to delete entry or 'N' to retain it." G DEL
 I %=2 Q
 S DIC="^ACM("_ACMDIC_",",X=+Y,DIC(0)="E"
 D ^DIC K DIC
 S DIE="^ACM("_ACMDIC_",",DR=".01///@"
 D DIE1 S ACMDEL=""
 Q
 ;
 W !!?14,$S(ACMTL["PCC":"  View ",1:"Update "),@ACMRVON,ACMTL,@ACMRVOFF,!?17,"for ",@ACMRVON,ACMPTNA2,@ACMRVOFF
 X ACMLE
 Q
 ;
LIST S DIC="90022"_ACMDIC,ACMDIC1="^ACM("_ACMDIC_")",ACMDIC2="^ACM("_ACMDIC_","
 I ACMDIC=41 S DA=ACMRGDFN D LIST2 Q
 S ACMA=""
 F ACMI=0:0 S ACMA=$O(@ACMDIC1@("AC",ACMRG,ACMPTNO,ACMA)) Q:ACMA=""  S DA=^(ACMA) D LIST2
 S ACMDICK="90022"_ACMDIC
 K ^UTILITY("DIQ1",$J,ACMDICK),ACMA,ACMI,ACMDIC1
 Q
 ;
LIST2 S ACMCNT=$L(ACMDIQF,";"),DR=ACMDIQF
 D EN^DIQ1
 S ACMUTIL="^UTILITY(""DIQ1"""_","_$J_",90022"_ACMDIC_","_DA_")"
 W !
 F ACMJ=1:1:ACMCNT S ACMFLD=$P(ACMDIQF,";",ACMJ),ACMPOS=$P(ACMPOSS,";",ACMJ)  D
 .S G=$P(ACMUTIL,")")_","_ACMFLD_",1)" I $D(@G) D WP Q
 .S ACMX=$S($D(@ACMUTIL@(ACMFLD)):^(ACMFLD),1:"") W:ACMX'="" ?ACMPOS,ACMX
 .Q
 K ACMJ,ACMUTIL,ACMFLD,ACMPOS
 Q
WP ;Display of Word Processing Field
 K ^UTILITY($J,"W")
 S ACMG=$P(ACMUTIL,")")_","_ACMFLD_",ACMI)"
 S ACMI=0 F  S ACMI=$O(@ACMG)  Q:ACMI=""  D WP2
 D WPDISP
 Q
 ;
WP2 ;WP Length Format from 1-40 Characters rather than 80 standard
 ;
 S DIWL=1,DIWR=40,X=@ACMG D ^DIWP
 Q
WPDISP ;
 S Z=0 F  S Z=$O(^UTILITY($J,"W",DIWL,Z)) Q:Z'=+Z  W ?ACMPOS,^UTILITY($J,"W",DIWL,Z,0),!
 K ^UTILITY($J,"W")
 Q