source: WorldVistAEHR/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUSRVPL.m@ 1147

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

initial load of WorldVistAEHR

File size: 1.5 KB
RevLine 
[613]1TIUSRVPL ; SLC/JER - RPC's Supporting Links ;4/20/2001 09:46
2 ;;1.0;TEXT INTEGRATION UTILITIES;**63,114**;Jun 20, 1997
3PUTIMAGE(TIUY,TIUDA,IMGDA) ; Create link Image-to-Document
4 N D,D0,DI,DQ,DIC,DA,DIE,DR,X,Y
5 I $S('+$G(IMGDA):1,'$D(^MAG(2005,+IMGDA,0)):1,1:0) D Q
6 . S TIUY="0^ Invalid Image Pointer."
7 I $S('+$G(TIUDA):1,'$D(^TIU(8925,+TIUDA,0)):1,1:0) D Q
8 . S TIUY="0^ Invalid Document Pointer."
9 I $$DUPLINK(TIUDA,IMGDA) S TIUY="0^ Document already linked to this image." Q
10 S X=""""_"`"_TIUDA_"""",(DIC,DLAYGO)=8925.91,DIC(0)="LX"
11 D ^DIC I +Y'>0 S TIUY="0^ Unable to create Image Link" Q
12 S TIUY=+Y
13 S DIE=DIC,DR=".02////^S X=IMGDA" D ^DIE
14 Q
15DUPLINK(TIUDA,IMGDA) ; identify duplicate links
16 Q $S(+$O(^TIU(8925.91,"ADI",+TIUDA,+IMGDA,0)):1,1:0)
17DELIMAGE(TIUY,TIUDA,IMGDA) ; Delete link Image-to-Document
18 N TIUI
19 I '+$O(^TIU(8925.91,"ADI",TIUDA,IMGDA,0)) D Q
20 . S TIUY="0^ Document and Image not currently linked."
21 S TIUI=0
22 F S TIUI=$O(^TIU(8925.91,"ADI",TIUDA,IMGDA,TIUI)) Q:+TIUI'>0 D
23 . N DIDEL,DIE,DA,DR
24 . S (DIE,DIDEL)=8925.91,DR=".01///@",DA=TIUI D ^DIE
25 S TIUY=1
26 Q
27GETILST(TIUY,TIUDA) ; Given a document, get list of associated images
28 N IMGDA,TIUI S (IMGDA,TIUI)=0
29 F S IMGDA=$O(^TIU(8925.91,"ADI",TIUDA,IMGDA)) Q:+IMGDA'>0 D
30 . S TIUI=TIUI+1,TIUY(TIUI)=IMGDA
31 Q
32GETDLST(TIUY,IMGDA) ; Given an Image, get list of associated documents
33 N TIUDA,TIUI S (TIUDA,TIUI)=0
34 F S TIUDA=$O(^TIU(8925.91,"AID",IMGDA,TIUDA)) Q:+TIUDA'>0 D
35 . S TIUI=TIUI+1,TIUY(TIUI)=TIUDA
36 Q
Note: See TracBrowser for help on using the repository browser.