source: FOIAVistA/tag/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIULG.m@ 636

Last change on this file since 636 was 628, checked in by George Lilly, 14 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.3 KB
Line 
1TIULG ; SLC/JER - More Library functions ;5/27/03
2 ;;1.0;TEXT INTEGRATION UTILITIES;**1,89,137**;Jun 20, 1997
3 ;
4TYPSHORT(INTTYPE) ; Return "TL" for Interior Type "DOC",
5 ;Return int type for others
6 N TIUY
7 S TIUY=$S(INTTYPE="DOC":"TL",1:INTTYPE)
8 Q TIUY
9TYPEXT(INTTYPE) ; Given interior type DOC, DC, or CL of Docmt Def,
10 ;return exterior type
11 N TIUY
12 S TIUY=$S(INTTYPE="DOC":"TITLE",INTTYPE="DC":"DOCUMENT CLASS",INTTYPE="CL":"CLASS",1:"Document Definition")
13 Q TIUY
14 ;
15BADSIG(TIUX,NOAUTH) ; Sig failed
16 N TIUTNAME
17 I TIUX=0 D
18 . W !!,"Use 'Edit Electronic Signature Code' option"
19 . W !,"on Secondary Menu under User's Toolbox." H 4
20 I +$G(NOAUTH) W !!,$C(7),$C(7),"Only authorized PROVIDERS may sign. Contact IRM for PROVIDER Key allocation."
21 S TIUTNAME=$S(+$G(TIUTYP):$$PNAME^TIULC1(TIUTYP),$G(TIUTYP)]"":TIUTYP,1:"DOCUMENT")
22 W !!,$C(7),"< ",$$UPPER^TIULS($G(TIUTNAME))
23 W " SAVED - WITHOUT SIGNATURE >",!
24 S TIUX=$$READ^TIUU("FOA","Press RETURN to continue...")
25 Q
26PRNTMTHD(TIUTYP,TIUDA) ; Get print method/enforce inheritance
27 N TIUDAD,TIUY S TIUDAD=0
28 I +$G(TIUDA),+$$ISADDNDM^TIULC1(TIUDA) S TIUTYP=$$PRNTYP(TIUDA)
29 S TIUY=$G(^TIU(8925.1,+TIUTYP,6))
30 I TIUY']"" S TIUDAD=$O(^TIU(8925.1,"AD",+TIUTYP,0))
31 I +TIUDAD S TIUY=$$PRNTMTHD(TIUDAD)
32 Q TIUY
33PRNTGRP(TIUTYP,TIUDA) ; Get print group/enforce inheritance
34 N TIUDAD,TIUY S TIUDAD=0
35 I +$G(TIUDA),+$$ISADDNDM^TIULC1(TIUDA) S TIUTYP=$$PRNTYP(TIUDA)
36 S TIUY=$P($G(^TIU(8925.1,+TIUTYP,6.1)),U,3)
37 I TIUY']"" S TIUDAD=$O(^TIU(8925.1,"AD",+TIUTYP,0))
38 I +TIUDAD S TIUY=$$PRNTGRP(TIUDAD)
39 Q TIUY
40PRNTHDR(TIUTYP,TIUDA) ; Get print form header/enforce inheritance
41 N TIUDAD,TIUY S TIUDAD=0
42 I +$G(TIUDA),+$$ISADDNDM^TIULC1(TIUDA) S TIUTYP=$$PRNTYP(TIUDA)
43 S TIUY=$P($G(^TIU(8925.1,+TIUTYP,6.1)),U)
44 I TIUY']"" S TIUDAD=$O(^TIU(8925.1,"AD",+TIUTYP,0))
45 I +TIUDAD S TIUY=$$PRNTHDR(TIUDAD)
46 Q TIUY
47PRNTNBR(TIUTYP,TIUDA) ; Get print form number/enforce inheritance
48 N TIUDAD,TIUY S TIUDAD=0
49 I +$G(TIUDA),+$$ISADDNDM^TIULC1(TIUDA) S TIUTYP=$$PRNTYP(TIUDA)
50 S TIUY=$P($G(^TIU(8925.1,+TIUTYP,6.1)),U,2)
51 I TIUY']"" S TIUDAD=$O(^TIU(8925.1,"AD",+TIUTYP,0))
52 I +TIUDAD S TIUY=$$PRNTNBR(TIUDAD)
53 Q TIUY
54PRNTYP(TIUDA) ; Get the type of an addendum's parent document
55 N TIUDADA
56 S TIUDADA=+$P($G(^TIU(8925,+TIUDA,0)),U,6)
57 Q +$G(^TIU(8925,+TIUDADA,0))
58XTRASGNR(TIUY,TIUDA) ; Get List of Extra Expected Signers
59 N TIUI S TIUI=0
60 F S TIUI=$O(^TIU(8925.7,"B",TIUDA,TIUI)) Q:+TIUI'>0 D
61 . N TIUDUZ,TIUREQ
62 . S TIUDUZ=+$P(^TIU(8925.7,+TIUI,0),U,3),TIUREQ=$P(^(0),U,2)
63 . Q:+TIUDUZ'>0!(+$P($G(^TIU(8925.7,+TIUI,0)),U,4)>0)
64 . S TIUY(TIUDUZ)=TIUREQ_U_$$SIGNAME^TIULS(TIUDUZ)_U_$$SIGTITL^TIULS(TIUDUZ)
65 Q
66 ;
67ACTIVATE(TIUARRAY,SUCCESS) ; Activate DDEFs
68 ; Activates IENs in received array TIUARRAY(IEN)=whatever
69 ; Sets SUCCESS(IEN) = 1 if IEN activated successfully
70 ; = 0^whynot if not
71 ; Sets SUCCESS = 1 if all activated successfully
72 ; = 0 if not
73 ; Called when exporting new DDEFS and Business Rules, after we
74 ;know that rules were created successfully.
75 ; Skips safeguards present when using DDEF utility to
76 ;activate DDEFs
77 N IEN,TIUFPRIV
78 S IEN=0,TIUFPRIV=1
79 S SUCCESS=1
80 F S IEN=$O(TIUARRAY(IEN)) Q:'IEN D
81 . N FDA,TIUERR
82 . S FDA(8925.1,IEN_",",.07)="ACTIVE"
83 . D FILE^DIE("KE","FDA","TIUERR")
84 . I '$D(TIUERR) S SUCCESS(IEN)=1 Q
85 . S SUCCESS(IEN)="0^"_$G(TIUERR("DIERR",1,"TEXT",1))
86 . S SUCCESS=0
87 Q
Note: See TracBrowser for help on using the repository browser.