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

TIUABBVP.m

Go to the documentation of this file.
  1. TIUABBVP ;BPOIFO/JLTP - Print Functions ;11/09/2015
  1. ;;1.0;TEXT INTEGRATION UTILITIES;**297**;JUN 20, 1997;Build 40
  1. ;
  1. ; External Reference DBIA#:
  1. ; -------------------------
  1. ; #10086 - %ZIS call (Supported)
  1. ; #10089 - %ZISC call (Supported)
  1. ; #10063 - %ZTLOAD call (Supported)
  1. ; #999 - DD reference (Controlled Subscription)
  1. ; #10026 - DIR call (Supported)
  1. ; #10103 - XLFDT call (Supported)
  1. ; #10104 - XLFSTR call (Supported)
  1. ;
  1. LA ; List All
  1. N INACT
  1. W ! D LI Q:'$D(INACT)
  1. D:$$DEV("DQ1^TIUABBVP","INACT","List of Unauthorized Abbreviations") DQ1
  1. Q
  1. DQ1 ; List of Unauthorized Abbreviations
  1. U IO K ^TMP($J) N ABBV,ACT,CLS,DESC,DLINE,H1,H2,IFN,LINE,MCH,STOP,X,Y
  1. S (STOP,IFN)=0 F S IFN=$O(^TIU(8927.9,IFN)) Q:'IFN D
  1. .S X=^TIU(8927.9,IFN,0),ABBV=$P(X,U),CLS=$P(X,U,2),MCH=$P(X,U,3),ACT=$P(X,U,4),DESC=$P(X,U,5)
  1. .I ACT]"" S ^TMP($J,ACT,$$UP^XLFSTR(ABBV),IFN)=ABBV_U_CLS_U_MCH_U_DESC
  1. D P1("A","Active Unauthorized Abbreviations","No active entries on file.") D:'$G(STOP) PG
  1. I INACT,'$G(STOP) D P1("I","Inactive Unauthorized Abbreviations","No inactive entries on file.") D:'$G(STOP) PG
  1. K ^TMP($J) D ^%ZISC
  1. Q
  1. P1(ACT,H1,NONE) ; Print one STATUS
  1. N ABBV,CLASS,EXACT,IFN,LINE,NOTE,REC,UABBV
  1. S $P(LINE,"-",IOM)="" D DHD
  1. I '$D(^TMP($J,ACT)) W !,NONE,!
  1. S UABBV="" F S UABBV=$O(^TMP($J,ACT,UABBV)) Q:UABBV=""!($G(STOP)) D
  1. .S IFN=0 F S IFN=$O(^TMP($J,ACT,UABBV,IFN)) Q:'IFN!($G(STOP)) S REC=^(IFN) D
  1. ..I $Y>(IOSL-5) D:$E(IOST)="C" PG Q:STOP D DHD
  1. ..S ABBV=$P(REC,U),CLASS=$P(REC,U,2),EXACT=$P(REC,U,3),NOTE=$P(REC,U,4)
  1. ..W !,ABBV,?32,$$SET(CLASS,.02),?52,$$SET(EXACT,.03),!?3,"Note: ",NOTE
  1. ..W !,LINE
  1. Q
  1. DHD ; Report Heading
  1. ;;Abbreviation Class Exact Match
  1. N PRTTIM,DLINE,H2
  1. S $P(DLINE,"=",IOM)="",H2=$P($T(DHD+1),";;",2),PRTTIM=$$FMTE^XLFDT($$NOW^XLFDT,5)
  1. S PRTTIM=$P(PRTTIM,"@")_" @"_$P(PRTTIM,"@",2)
  1. W @IOF W !,$$CNTR(H1),!
  1. W $$CNTR("Printed: "_PRTTIM),!!,H2,!,DLINE
  1. Q
  1. PG ; Stop for page break
  1. N X,Y
  1. I $E(IOST)="C" S DIR(0)="E" D ^DIR S STOP='Y W @IOF
  1. I $E(IOST)'="C" S STOP=0
  1. Q
  1. CNTR(X) ; Center X based on IOM
  1. N LM,Y S LM=(IOM\2)-($L(X)\2),Y="",$P(Y," ",LM)=""
  1. Q Y_X
  1. SET(INT,FLD) ; Get External Set-of-Codes Value
  1. N DD,I,P,VAL
  1. S DD=$P(^DD(8927.9,FLD,0),U,3),VAL=""
  1. F I=1:1 S P=$P(DD,";",I) Q:'$L(P) I $P(P,":")=INT S VAL=$P(P,":",2) Q
  1. Q VAL
  1. WR(X,LMARG,WIDTH) ; Word wrap
  1. N I,SIZ,Y
  1. S SIZ=WIDTH-LMARG-1,I=$L(X)
  1. F Q:$L(X)<1 D:$L(X)>SIZ W ?LMARG,X S X=$E(X,I+1,$L(X))
  1. .F I=SIZ:-1 Q:I<1 Q:$E(X,I)?1P
  1. .S:I<1 I=SIZ S Y=$E(X,1,I) W ?LMARG,Y,! S X=$E(X,I+1,$L(X))
  1. Q
  1. LI ; Ask to List Inactive Abbreviations
  1. N DIR,DIRUT,X,Y
  1. S DIR(0)="Y",DIR("A")="Include inactive entries",DIR("B")="No"
  1. D ^DIR Q:$D(DIRUT) S INACT=+Y
  1. Q
  1. DEV(R,VARS,DESC) ; Device Selection
  1. N %ZIS,POP,ZTDESC,ZTRTN,ZTSAVE
  1. S %ZIS="QM" W !! D ^%ZIS Q:POP 0 Q:'$D(%ZIS("Q")) 1
  1. S ZTRTN=R,ZTSAVE(VARS)="",ZTDESC=DESC D ^%ZTLOAD,^%ZISC
  1. Q 0