WVLABWPS ;HCIOFO/FT-Display Surgical Pathology Data from Lab Package ;3/4/99 15:00
;;1.0;WOMEN'S HEALTH;**6**;Sep 30, 1998
;
EN ; Move data from ^TMP("LRA",$J) to ^TMP("WVLAB",$J) for display
; Called from WVLABWP and WVPROC
Q:'$D(^TMP("LRA",$J))
N WVLINE,WVNODE,WVDATE,WVRPTDT,WVSUB2,WVSUB3,WVSUB4,WVSUB5,WVTEXT,X
K ^TMP("WVLAB",$J)
S (WVDATE,WVLINE)=0
F S WVDATE=$O(^TMP("LRA",$J,WVDATE)) Q:'WVDATE D
.S WVSUB2=""
.F S WVSUB2=$O(^TMP("LRA",$J,WVDATE,WVSUB2)) Q:WVSUB2=""!(WVSUB2?1A) S WVNODE=$G(^TMP("LRA",$J,WVDATE,WVSUB2)) D ACCESSN
.I $D(^TMP("LRA",$J,WVDATE,1.2)) D SUPRPT
.Q
; NOTE: Calling routine should kill ^TMP("LRA",$J)
Q
ACCESSN ; Collection date & Lab Accession#
I WVSUB2=0 D
.D ADD^WVLABWPC
.S ^TMP("WVLAB",$J,WVLINE,0)=" Collected: "_$P(WVNODE,U,1)
.D ADD^WVLABWPC
.S ^TMP("WVLAB",$J,WVLINE,0)="Lab Accession #: "_$P(WVNODE,U,2)
.Q
I WVSUB2=.1 D SPEC Q
I $S(WVSUB2=.2:1,WVSUB2=1:1,WVSUB2=1.1:1,WVSUB2=1.3:1,WVSUB2=1.4:1,1:0) D TEXT Q
I WVSUB2=2 D
.S WVSUB3=0
.F S WVSUB3=$O(^TMP("LRA",$J,WVDATE,WVSUB2,WVSUB3)) Q:WVSUB3'>0 D
..S X=^TMP("LRA",$J,WVDATE,WVSUB2,WVSUB3)
..D WRTTM,WRTP
..Q
.Q
Q
SPEC ; Specimen list
S WVSUB4=$O(^TMP("LRA",$J,WVDATE,.1,0))
D ADD^WVLABWPC
S ^TMP("WVLAB",$J,WVLINE,0)="Specimen: "_$G(^TMP("LRA",$J,WVDATE,.1,WVSUB4))
F S WVSUB4=$O(^TMP("LRA",$J,WVDATE,.1,WVSUB4)) Q:'WVSUB4 D
.D ADD^WVLABWPC
.S ^TMP("WVLAB",$J,WVLINE,0)=$$REPEAT^XLFSTR(" ",10)_$G(^TMP("LRA",$J,WVDATE,.1,WVSUB4))
.Q
D ADD^WVLABWPC,BLANK^WVLABWPC
Q
TEXT ; Gross Description & Microscopic Exam/Dx
D ADD^WVLABWPC
S ^TMP("WVLAB",$J,WVLINE,0)="<"_WVNODE_">"
S WVSUB4=0
F S WVSUB4=$O(^TMP("LRA",$J,WVDATE,WVSUB2,WVSUB4)) Q:'WVSUB4 D
.S WVTEXT=^TMP("LRA",$J,WVDATE,WVSUB2,WVSUB4)
.D ADD^WVLABWPC
.S ^TMP("WVLAB",$J,WVLINE,0)=WVTEXT
.Q
Q
SUPRPT ; Supplementary Report
S WVSUB2=0
F S WVSUB2=$O(^TMP("LRA",$J,WVDATE,1.2,WVSUB2)) Q:'WVSUB2 D
.S WVRPTDT=$G(^TMP("LRA",$J,WVDATE,1.2,WVSUB2,0))
.S WVRPTDT=$$FMTE^XLFDT(WVRPTDT,"2P")
.D ADD^WVLABWPC
.S ^TMP("WVLAB",$J,WVLINE,0)="Supplementary Report: "_WVRPTDT
.S WVSUB3=0
.F S WVSUB3=$O(^TMP("LRA",$J,WVDATE,1.2,WVSUB2,WVSUB3)) Q:'WVSUB3 D
..D ADD^WVLABWPC
..S ^TMP("WVLAB",$J,WVLINE,0)=$G(^TMP("LRA",$J,WVDATE,1.2,WVSUB2,WVSUB3))
..Q
.Q
Q
WRTTM ; Display Topography, Disease, Morphology and Etiology values
D ADD^WVLABWPC
S ^TMP("WVLAB",$J,WVLINE,0)="Topography: "_$P(X,U,1)
S WVSUB4=0
F S WVSUB4=$O(^TMP("LRA",$J,WVDATE,WVSUB2,WVSUB3,1,WVSUB4)) Q:'WVSUB4 D
.D ADD^WVLABWPC
.S ^TMP("WVLAB",$J,WVLINE,0)=$S(WVSUB4=1:"Disease: ",1:$$REPEAT^XLFSTR(" ",10))_$G(^TMP("LRA",$J,WVDATE,WVSUB2,WVSUB3,1,WVSUB4))
.Q
D ADD^WVLABWPC
S WVSUB4=0
F S WVSUB4=$O(^TMP("LRA",$J,WVDATE,WVSUB2,WVSUB3,2,WVSUB4)) Q:'WVSUB4 D
.D ADD^WVLABWPC
.S ^TMP("WVLAB",$J,WVLINE,0)="Morphology: "_$G(^TMP("LRA",$J,WVDATE,WVSUB2,WVSUB3,1,WVSUB4))
.S WVSUB5=0
.F S WVSUB4=$O(^TMP("LRA",$J,WVDATE,WVSUB2,WVSUB3,2,WVSUB4,2,WVSUB5)) Q:'WVSUB5 D
..D ADD^WVLABWPC
..S ^TMP("WVLAB",$J,WVLINE,0)=$S(WVSUB5=1:"Etiology: ",1:$$REPEAT^XLFSTR(" ",10))_$G(^TMP("LRA",$J,WVDATE,WVSUB2,WVSUB3,2,WVSUB4,1,WVSUB5))
..Q
.Q
Q
WRTP ; Display Procedure values
Q:'$O(^TMP("LRA",$J,WVDATE,WVSUB2,WVSUB3,4,0))
D ADD^WVLABWPC
S ^TMP("WVLAB",$J,WVLINE,0)="<Procedures>"
S WVSUB4=0
F S WVSUB4=$O(^TMP("LRA",$J,WVDATE,WVSUB2,WVSUB3,4,WVSUB4)) Q:WVSUB4 D
.D ADD^WVLABWPC
.S ^TMP("WVLAB",$J,WVLINE,0)=$P($G(^TMP("LRA",$J,WVDATE,WVSUB2,WVSUB3,4,WVSUB4)),U,1)
.Q
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HWVLABWPS 3563 printed Nov 22, 2024@17:57 Page 2
WVLABWPS ;HCIOFO/FT-Display Surgical Pathology Data from Lab Package ;3/4/99 15:00
+1 ;;1.0;WOMEN'S HEALTH;**6**;Sep 30, 1998
+2 ;
EN ; Move data from ^TMP("LRA",$J) to ^TMP("WVLAB",$J) for display
+1 ; Called from WVLABWP and WVPROC
+2 if '$DATA(^TMP("LRA",$JOB))
QUIT
+3 NEW WVLINE,WVNODE,WVDATE,WVRPTDT,WVSUB2,WVSUB3,WVSUB4,WVSUB5,WVTEXT,X
+4 KILL ^TMP("WVLAB",$JOB)
+5 SET (WVDATE,WVLINE)=0
+6 FOR
SET WVDATE=$ORDER(^TMP("LRA",$JOB,WVDATE))
if 'WVDATE
QUIT
Begin DoDot:1
+7 SET WVSUB2=""
+8 FOR
SET WVSUB2=$ORDER(^TMP("LRA",$JOB,WVDATE,WVSUB2))
if WVSUB2=""!(WVSUB2?1A)
QUIT
SET WVNODE=$GET(^TMP("LRA",$JOB,WVDATE,WVSUB2))
DO ACCESSN
+9 IF $DATA(^TMP("LRA",$JOB,WVDATE,1.2))
DO SUPRPT
+10 QUIT
End DoDot:1
+11 ; NOTE: Calling routine should kill ^TMP("LRA",$J)
+12 QUIT
ACCESSN ; Collection date & Lab Accession#
+1 IF WVSUB2=0
Begin DoDot:1
+2 DO ADD^WVLABWPC
+3 SET ^TMP("WVLAB",$JOB,WVLINE,0)=" Collected: "_$PIECE(WVNODE,U,1)
+4 DO ADD^WVLABWPC
+5 SET ^TMP("WVLAB",$JOB,WVLINE,0)="Lab Accession #: "_$PIECE(WVNODE,U,2)
+6 QUIT
End DoDot:1
+7 IF WVSUB2=.1
DO SPEC
QUIT
+8 IF $SELECT(WVSUB2=.2:1,WVSUB2=1:1,WVSUB2=1.1:1,WVSUB2=1.3:1,WVSUB2=1.4:1,1:0)
DO TEXT
QUIT
+9 IF WVSUB2=2
Begin DoDot:1
+10 SET WVSUB3=0
+11 FOR
SET WVSUB3=$ORDER(^TMP("LRA",$JOB,WVDATE,WVSUB2,WVSUB3))
if WVSUB3'>0
QUIT
Begin DoDot:2
+12 SET X=^TMP("LRA",$JOB,WVDATE,WVSUB2,WVSUB3)
+13 DO WRTTM
DO WRTP
+14 QUIT
End DoDot:2
+15 QUIT
End DoDot:1
+16 QUIT
SPEC ; Specimen list
+1 SET WVSUB4=$ORDER(^TMP("LRA",$JOB,WVDATE,.1,0))
+2 DO ADD^WVLABWPC
+3 SET ^TMP("WVLAB",$JOB,WVLINE,0)="Specimen: "_$GET(^TMP("LRA",$JOB,WVDATE,.1,WVSUB4))
+4 FOR
SET WVSUB4=$ORDER(^TMP("LRA",$JOB,WVDATE,.1,WVSUB4))
if 'WVSUB4
QUIT
Begin DoDot:1
+5 DO ADD^WVLABWPC
+6 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$$REPEAT^XLFSTR(" ",10)_$GET(^TMP("LRA",$JOB,WVDATE,.1,WVSUB4))
+7 QUIT
End DoDot:1
+8 DO ADD^WVLABWPC
DO BLANK^WVLABWPC
+9 QUIT
TEXT ; Gross Description & Microscopic Exam/Dx
+1 DO ADD^WVLABWPC
+2 SET ^TMP("WVLAB",$JOB,WVLINE,0)="<"_WVNODE_">"
+3 SET WVSUB4=0
+4 FOR
SET WVSUB4=$ORDER(^TMP("LRA",$JOB,WVDATE,WVSUB2,WVSUB4))
if 'WVSUB4
QUIT
Begin DoDot:1
+5 SET WVTEXT=^TMP("LRA",$JOB,WVDATE,WVSUB2,WVSUB4)
+6 DO ADD^WVLABWPC
+7 SET ^TMP("WVLAB",$JOB,WVLINE,0)=WVTEXT
+8 QUIT
End DoDot:1
+9 QUIT
SUPRPT ; Supplementary Report
+1 SET WVSUB2=0
+2 FOR
SET WVSUB2=$ORDER(^TMP("LRA",$JOB,WVDATE,1.2,WVSUB2))
if 'WVSUB2
QUIT
Begin DoDot:1
+3 SET WVRPTDT=$GET(^TMP("LRA",$JOB,WVDATE,1.2,WVSUB2,0))
+4 SET WVRPTDT=$$FMTE^XLFDT(WVRPTDT,"2P")
+5 DO ADD^WVLABWPC
+6 SET ^TMP("WVLAB",$JOB,WVLINE,0)="Supplementary Report: "_WVRPTDT
+7 SET WVSUB3=0
+8 FOR
SET WVSUB3=$ORDER(^TMP("LRA",$JOB,WVDATE,1.2,WVSUB2,WVSUB3))
if 'WVSUB3
QUIT
Begin DoDot:2
+9 DO ADD^WVLABWPC
+10 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$GET(^TMP("LRA",$JOB,WVDATE,1.2,WVSUB2,WVSUB3))
+11 QUIT
End DoDot:2
+12 QUIT
End DoDot:1
+13 QUIT
WRTTM ; Display Topography, Disease, Morphology and Etiology values
+1 DO ADD^WVLABWPC
+2 SET ^TMP("WVLAB",$JOB,WVLINE,0)="Topography: "_$PIECE(X,U,1)
+3 SET WVSUB4=0
+4 FOR
SET WVSUB4=$ORDER(^TMP("LRA",$JOB,WVDATE,WVSUB2,WVSUB3,1,WVSUB4))
if 'WVSUB4
QUIT
Begin DoDot:1
+5 DO ADD^WVLABWPC
+6 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$SELECT(WVSUB4=1:"Disease: ",1:$$REPEAT^XLFSTR(" ",10))_$GET(^TMP("LRA",$JOB,WVDATE,WVSUB2,WVSUB3,1,WVSUB4))
+7 QUIT
End DoDot:1
+8 DO ADD^WVLABWPC
+9 SET WVSUB4=0
+10 FOR
SET WVSUB4=$ORDER(^TMP("LRA",$JOB,WVDATE,WVSUB2,WVSUB3,2,WVSUB4))
if 'WVSUB4
QUIT
Begin DoDot:1
+11 DO ADD^WVLABWPC
+12 SET ^TMP("WVLAB",$JOB,WVLINE,0)="Morphology: "_$GET(^TMP("LRA",$JOB,WVDATE,WVSUB2,WVSUB3,1,WVSUB4))
+13 SET WVSUB5=0
+14 FOR
SET WVSUB4=$ORDER(^TMP("LRA",$JOB,WVDATE,WVSUB2,WVSUB3,2,WVSUB4,2,WVSUB5))
if 'WVSUB5
QUIT
Begin DoDot:2
+15 DO ADD^WVLABWPC
+16 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$SELECT(WVSUB5=1:"Etiology: ",1:$$REPEAT^XLFSTR(" ",10))_$GET(^TMP("LRA",$JOB,WVDATE,WVSUB2,WVSUB3,2,WVSUB4,1,WVSUB5))
+17 QUIT
End DoDot:2
+18 QUIT
End DoDot:1
+19 QUIT
WRTP ; Display Procedure values
+1 if '$ORDER(^TMP("LRA",$JOB,WVDATE,WVSUB2,WVSUB3,4,0))
QUIT
+2 DO ADD^WVLABWPC
+3 SET ^TMP("WVLAB",$JOB,WVLINE,0)="<Procedures>"
+4 SET WVSUB4=0
+5 FOR
SET WVSUB4=$ORDER(^TMP("LRA",$JOB,WVDATE,WVSUB2,WVSUB3,4,WVSUB4))
if WVSUB4
QUIT
Begin DoDot:1
+6 DO ADD^WVLABWPC
+7 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$PIECE($GET(^TMP("LRA",$JOB,WVDATE,WVSUB2,WVSUB3,4,WVSUB4)),U,1)
+8 QUIT
End DoDot:1
+9 QUIT