source: WorldVistAEHR/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIULF.m@ 1489

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

initial load of WorldVistAEHR

File size: 1.5 KB
Line 
1TIULF ; SLC/JER - More computational functions ; 4/2/03
2 ;;1.0;TEXT INTEGRATION UTILITIES;**162**;Jun 20, 1997
3 ;
4STATUS(TIUDA) ; Returns external status for document TIUDA
5 Q $$GET1^DIQ(8925,TIUDA_",",.05)
6 ;
7EMPTYDOC(DA) ;Checks to see if text for DCS is blank
8 ; returns a 1 if empty
9 ; returns a 0 if contains data
10 N TIULINE,TIUQUIT,TIUSTART,TIUX,TIUY,TIUCHAR,TIUDATA
11 S TIUY=1
12 I +$O(^TIU(8925,+DA,"TEXT",0))'>0,+$O(^TIU(8925,"DAD",+DA,0))'>0 G EMPTYX ;Text not entered
13 S TIULINE=0 F S TIULINE=$O(^TIU(8925,+DA,"TEXT",TIULINE)) Q:TIULINE'>0!(TIUY=0) D Q:TIUY=0
14 . S TIUDATA=$G(^TIU(8925,+DA,"TEXT",TIULINE,0)),TIUQUIT=$L(TIUDATA)
15 . I TIUQUIT>0 S TIUSTART=1 D ;Line contains data
16 . . ;Checks a char at a time for valid data. If found, TIUY set to 0
17 . . ;Data between two | indicates format command and not valid data
18 . . F TIUSTART=TIUSTART:1:TIUQUIT S TIUCHAR=$E(TIUDATA,TIUSTART) D Q:(TIUY=0)
19 . . . ;Char is not a control char or | char
20 . . . I $A(TIUCHAR)'<33&($A(TIUCHAR)'>123)!($A(TIUCHAR)=125) S TIUY=0 Q
21 . . . I $A(TIUCHAR)=124 D ;Char is a |
22 . . . . S TIUX=$F(TIUDATA,"|",TIUSTART+1) ;Find second |
23 . . . . I TIUX>TIUSTART S TIUSTART=TIUX-1 ;Making sure there is a second |
24 I +TIUY,$O(^TIU(8925,"DAD",+DA,0)) D
25 . N TIUC S TIUC=0
26 . F TIUC=$O(^TIU(8925,"DAD",+DA,TIUC)) Q:+TIUC'>0 D Q:+TIUY=0
27 . . S TIUY=$$EMPTYDOC(TIUC)
28EMPTYX ; EXIT
29 Q TIUY
30DOCTYPE(TIUDA) ; Evaluates Definition of a Document
31 N TYPE S TYPE=+$G(^TIU(8925,+TIUDA,0))
32 S TYPE=$P($G(^TIU(8925.1,+TYPE,0)),U,4)_U_$$PNAME^TIULC1(+TYPE)
33 Q TYPE
Note: See TracBrowser for help on using the repository browser.