source: WorldVistAEHR/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIURB1.m@ 1608

Last change on this file since 1608 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.6 KB
RevLine 
[613]1TIURB1 ; SLC/JER - TIURB-associated subroutines ;9/12/00 11:52
2 ;;1.0;TEXT INTEGRATION UTILITIES;**78**;Jun 20, 1997
3DELPROB(TIUDA) ; Delete linked problems
4 N DA,DIK S DIK="^TIU(8925.9,",DA=0
5 F S DA=$O(^TIU(8925.9,"B",TIUDA,DA)) Q:+DA'>0 D ^DIK
6 Q
7DELSGNR(TIUDA) ; Delete associated additional signers
8 N DA,DIK S DIK="^TIU(8925.7,",DA=0
9 F S DA=$O(^TIU(8925.7,"B",TIUDA,DA)) Q:+DA'>0 D ^DIK
10 Q
11AUDEL(TIUDA,TIURSN) ; Audit deletions
12 N DIC,DIE,DA,DR,X,Y
13 S X=""""_"`"_TIUDA_"""",(DIC,DLAYGO)=8925.5,DIC(0)="FLX" D ^DIC Q:+Y'>0
14 S DA=+Y
15 S DIE=DIC,DR="2.01////"_$$NOW^TIULC_";2.02////"_DUZ_";2.03////"_TIURSN
16 D ^DIE
17 Q
18AUDREASS(TIUDA,TIUD0,TIUD12) ; Audit reassignments
19 N DIC,DIE,DA,DR,X,Y
20 S X=""""_"`"_TIUDA_"""",(DIC,DLAYGO)=8925.5,DIC(0)="FLX" D ^DIC Q:+Y'>0
21 S DA=+Y,DIE=DIC
22 S DR="1.01////"_$$NOW^TIULC_";1.02////"_DUZ
23 S DR=DR_";1.03////"_$P(TIUD0(0),U,2)_";1.05////"_$P(TIUD0(0),U,7)
24 S DR=DR_";1.07////"_$S(+$P(TIUD12(0),U,11):$P(TIUD12(0),U,11),1:$P(TIUD12(0),U,5))
25 S DR=DR_";1.09////"_$P(TIUD0(0),U,13)_";1.11////"_$P(TIUD0(0),U,3)
26 D ^DIE
27 S DR="1.04////"_$P(TIUD0(1),U,2)_";1.06////"_$P(TIUD0(1),U,7)
28 S DR=DR_";1.08////"_$S(+$P(TIUD12(1),U,11):$P(TIUD12(1),U,11),1:$P(TIUD12(1),U,5))
29 S DR=DR_";1.1////"_$P(TIUD0(1),U,13)_";1.12////"_$P(TIUD0(1),U,3)
30 D ^DIE
31 Q
32LINK1 ; Link a single document to Problem(s)
33 N DFN,GMPLUSER,GMPDFN,VADM,VA,VALMY
34 S GMPLUSER=1
35 S DFN=+$P($G(^TIU(8925,+TIUDA,0)),U,2)
36 I +DFN D DEM^VADPT S GMPDFN=DFN_U_VADM(1)_U_$E(VADM(1))_VA("BID")
37 D EN^VALM("TIU LINK TO PROBLEM")
38 Q
39PROBLEM ; Link selected document to problems
40 N TIUI
41 I '$D(VALMY) D EN^VALM2(XQORNOD(0))
42 S TIUI=0
43 F S TIUI=$O(VALMY(TIUI)) Q:+TIUI'>0 D
44 . N DA,DIC,DIE,DLAYGO,DR,X,Y,TIUTYP,TIUPRBLM,TIUPROB,TIUPOV,TIUEXPR
45 . N TIUPNARR,TIUDX
46 . S TIUTYP=$P($G(^TIU(8925.1,+$G(^TIU(8925,+TIUDA,0)),0)),U)
47 . S TIUPRBLM=$G(^TMP("TIURPIDX",$J,+TIUI)),TIUPROB=+$P(TIUPRBLM,U,2)
48 . I +$$DUPROB(TIUDA,TIUPROB) D Q
49 . . W $C(7)
50 . . W !!,$P(TIUPRBLM,U,5)," is already associated with this document.",!
51 . . I $$READ^TIUU("EA","Press RETURN to continue...") W ""
52 . S TIUPOV=$P(TIUPRBLM,U,3),TIUEXPR=+$P(TIUPRBLM,U,4)
53 . S TIUPNARR=$P(TIUPRBLM,U,5),TIUDX=+$P(TIUPRBLM,U,6)
54 . S X=""""_"`"_TIUDA_"""",(DIC,DLAYGO)=8925.9,DIC(0)="LX" D ^DIC Q:+Y'>0
55 . S DIE=DIC,DR=".02////"_$G(TIUPROB)_";.03////"_$G(TIUPOV)_";.04////"_$G(TIUEXPR)_";.05////"_$G(TIUPNARR)_";.06////"_$G(TIUDX)
56 . D ^DIE W !,TIUTYP," linked to ",TIUPNARR,"." H 2
57 . S TIUCHNG=1 K VALMY(TIUI)
58 Q
59DUPROB(TIUDA,TIUPROB) ; Check whether document is already linked to problem
60 N TIUI,TIUY S (TIUI,TIUY)=0
61 F S TIUI=$O(^TIU(8925.9,"B",TIUDA,TIUI)) Q:+TIUI'>0!+TIUY D
62 . I +$P($G(^TIU(8925.9,TIUI,0)),U,2)=+TIUPROB S TIUY=1
63 Q +$G(TIUY)
Note: See TracBrowser for help on using the repository browser.