VistA-FOIAVistA/r/TEXT_INTEGRATION_UTILITIES-.../TIUPR222.m

69 lines
2.2 KiB
Mathematica

TIUPR222 ; SLC/AJB - TIU Form Letter Update;06Mar07
;;1.0;TEXT INTEGRATION UTILITIES;**222**;Jun 20, 1997
Q
EN ;
N TIUQUIT
I $$PATCH^XPDUTL("TIU*1.0*222") D
. F NAME="FORM LETTERS","FORM LETTER EXAMPLE" D
. . I $$CHKTITLE(8925.1,NAME)>0 S TIUQUIT=1
I +$G(TIUQUIT) W !!,"Titles have already been installed and will not be installed again." Q
I '$D(ZTQUEUED) X ^%ZOSF("EON") W IOCUON,@IOF
I $$CHKTITLE(8925.1,"PROGRESS NOTES")<0 G EXIT
W !!,"Creating the new DOCUMENT CLASS ""FORM LETTERS"" and"
W !,"and the new TITLE ""FORM LETTER EXAMPLE"" in FILE #8925.1"
F NAME="FORM LETTERS","FORM LETTER EXAMPLE" D
. I $$CHKTITLE(8925.1,NAME)>0 D
. . W !!,"The entry "_NAME_" already exists in "
. . W !,"File #8925.1 and must be renamed or deleted "
. . W !,"before installation can continue."
. . S XPDABORT=1
I +$G(XPDABORT) G EXIT
F NAME="FORM LETTERS^DC^PROGRESS NOTES^Form Letters","FORM LETTER EXAMPLE^DOC^FORM LETTERS^Form Letter Example" D
. D CREATE($P(NAME,U),$P(NAME,U,2))
. D ATTACH($$CHKTITLE(8925.1,$P(NAME,U)),$$CHKTITLE(8925.1,$P(NAME,U,3)),$P(NAME,U,4))
. W !!,$P(NAME,U)," created"
W !!,"Done!"
EXIT D
. N DIR,X,Y
. S DIR(0)="E"
. W ! D ^DIR
Q
CHKTITLE(FILE,NAME) ;
N DIC,X,Y
S DIC=FILE,DIC(0)="X"
S X=NAME
D ^DIC
Q +Y
ATTACH(KID,PARENT,NAME) ;
N MSG,TIU,TIUIEN
S TIU(8925.14,"+2,"_PARENT_",",.01)=KID
S TIU(8925.14,"+2,"_PARENT_",",4)=NAME
D UPDATE^DIE("","TIU","TIUIEN","MSG")
Q
CREATE(NAME,CLASS) ;
N MSG,TIU,TIUIEN
S TIU(8925.1,"+1,",.01)=NAME
S TIU(8925.1,"+1,",.02)=""
S TIU(8925.1,"+1,",.03)=NAME
S TIU(8925.1,"+1,",.04)=CLASS
S TIU(8925.1,"+1,",.05)=""
S TIU(8925.1,"+1,",.06)=$$LU(8930,"CLINICAL COORDINATOR","X")
S TIU(8925.1,"+1,",.07)=13
S TIU(8925.1,"+1,",3.02)=1
S TIU(8925.1,"+1,",6)="D ENTRY^TIUFLP"
S TIU(8925.1,"+1,",99)=$H
D UPDATE^DIE("","TIU","TIUIEN","MSG")
Q
MEMBEROF(TITLE,CLASS) ;
N TIUY S TIUY=0
S CLASS=+$$CLASS(CLASS) Q:+CLASS'>0 TIUY
S TIUY=+$$ISA^TIULX(TITLE,CLASS)
S:TITLE=CLASS TIUY=1
Q TIUY
CLASS(CLNAME) ;
N TIUY S TIUY=+$O(^TIU(8925.1,"B",CLNAME,0))
I +TIUY>0,$S($P($G(^TIU(8925.1,+TIUY,0)),U,4)="CL":0,$P($G(^(0)),U,4)="DC":0,1:1) S TIUY=0
Q TIUY
LU(FILE,NAME,FLAGS,SCREEN,INDEXES) ;
Q $$FIND1^DIC(FILE,"",$G(FLAGS),NAME,$G(INDEXES),$G(SCREEN),"TIUERR")