[613] | 1 | TIULIP ; SLC/JER - Lipid Profile Loader ;7/7/95 15:22
|
---|
| 2 | ;;1.0;TEXT INTEGRATION UTILITIES;;Jun 20, 1997
|
---|
| 3 | MAIN(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
|
---|
| 15 | LABX Q "~@"_$NA(@TARGET)
|
---|
| 16 | NOLABS ; 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
|
---|
| 21 | LINE ; 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
|
---|