source: WorldVistAEHR/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIULIP.m@ 839

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

initial load of WorldVistAEHR

File size: 1.2 KB
Line 
1TIULIP ; SLC/JER - Lipid Profile Loader ;7/7/95 15:22
2 ;;1.0;TEXT INTEGRATION UTILITIES;;Jun 20, 1997
3MAIN(DFN,EARLY,LATE,DISPLAY,TARGET,LINE) ; Control branching
4 N TIUI,TIUCNT,TIUDT,TIUY S TIUCNT=0
5 K ^TMP("LRAPI",$J)
6 I '$D(^DPT(DFN,"LR")) D NOLABS G LABX
7 S LRDFN=+^DPT(DFN,"LR") I '$D(^LR(LRDFN)) D NOLABS G LABX
8 I +$G(DISPLAY) W !,"Gathering Laboratory Data."
9 D LIPIDS^TIULO(.TIUY,DFN,$G(EARLY),$G(LATE))
10 I $G(TIUY(1))="No Lab Data" D NOLABS G LABX
11 S TIUI="" F S TIUI=$O(TIUY(TIUI)) Q:TIUI="" D
12 . N TIUX
13 . S TIUDT=0 F S TIUDT=$O(TIUY(TIUI,TIUDT)) Q:+TIUDT'>0 D
14 . . S TIUCNT=TIUCNT+1 D LINE
15LABX Q "~@"_$NA(@TARGET)
16NOLABS ; Handles Case Where no Labs are found to satisfy criteria
17 S LINE=$S(+$G(LINE):+$G(LINE),1:1),@TARGET@(LINE,0)="No data available"
18 S LINE=+$G(LINE)+1,@TARGET@(LINE,0)=" "
19 S @TARGET@(0)="^^"_LINE_"^"_LINE_"^"_DT_"^^"
20 Q
21LINE ; Line-wrap with comma-delimited data
22 N X,Y
23 I TIUCNT#2'>0 Q
24 S TIUX=$$SETSTR^VALM1(TIUI_":","",15,24)
25 S TIUX=$$SETSTR^VALM1($G(TIUY(TIUI,TIUDT)),TIUX,47,8)
26 S TIUX=$$SETSTR^VALM1($G(TIUY(TIUI,+$O(TIUY(TIUI,TIUDT)))),TIUX,63,8)
27 S LINE=+$G(LINE)+1
28 S @TARGET@(LINE,0)=TIUX
29 S @TARGET@(0)="^^"_LINE_"^"_LINE_"^"_DT_"^^"
30 I +$G(DISPLAY) W "."
31 Q
Note: See TracBrowser for help on using the repository browser.