WVLABWPC ;HCIOFO/FT-Display Report Data from Lab Package ;3/4/99 14:58
;;1.0;WOMEN'S HEALTH;**6**;Sep 30, 1998
;
EN ; Move data from ^TMP("LRCY",$J) to ^TMP("WVLAB",$J) for display.
; Called from WVLABWP and WVPROC
Q:'$D(^TMP("LRCY",$J))
N WVDATE,WVLINE,WVNODE,WVRPTDT,WVSUB2,WVSUB3,WVSUB4,WVTMP
K ^TMP("WVLAB",$J)
S WVDATE=$O(^TMP("LRCY",$J,0)) Q:'WVDATE
S WVTMP=$G(^TMP("LRCY",$J,WVDATE,0))
S WVLINE=0
D ADD
S ^TMP("WVLAB",$J,WVLINE,0)=" Collected: "_$P(WVTMP,U,1)
D ADD
S ^TMP("WVLAB",$J,WVLINE,0)="Lab Accession #: "_$P(WVTMP,U,2)
D ADD
S WVTMP=$G(^TMP("LRCY",$J,WVDATE,1))
S ^TMP("WVLAB",$J,WVLINE,0)=" Specimen: "_$P(WVTMP,U,1)
S WVSUB2=0
F S WVSUB2=$O(^TMP("LRCY",$J,WVDATE,1,WVSUB2)) Q:'WVSUB2 D
.D ADD
.S ^TMP("WVLAB",$J,WVLINE,0)=$$REPEAT^XLFSTR(" ",17)_^TMP("LRCY",$J,WVDATE,1,WVSUB2)
.Q
D ADD,BLANK
I $P(WVTMP,U,2)'>0 D Q
.D ADD
.S ^TMP("WVLAB",$J,WVLINE,0)=$$REPEAT^XLFSTR(" ",18)_"** REPORT NOT YET RELEASED **"
.Q
S WVSUB2=1
F S WVSUB2=$O(^TMP("LRCY",$J,WVDATE,WVSUB2)) Q:WVSUB2="" D
.D @$E(WVSUB2,1,2)
.Q
; NOTE: Calling routine should kill ^TMP("LRCY",$J)
Q
AH ; Clinical History
D ADD
S ^TMP("WVLAB",$J,WVLINE,0)="<Brief Clinical Hx>"
S WVSUB3=0
F S WVSUB3=$O(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3)) Q:'WVSUB3 D
.D ADD
.S ^TMP("WVLAB",$J,WVLINE,0)=$G(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3))
.Q
D ADD,BLANK
Q
G ; Gross Description
D ADD
S ^TMP("WVLAB",$J,WVLINE,0)="<Gross Description>"
S WVSUB3=0
F S WVSUB3=$O(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3)) Q:'WVSUB3 D
.D ADD
.S ^TMP("WVLAB",$J,WVLINE,0)=$G(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3))
.Q
D ADD,BLANK
Q
MI ; Microscopic exam/diagnosis field
D ADD
S ^TMP("WVLAB",$J,WVLINE,0)="<Microscopic Exam>"
S WVSUB3=0
F S WVSUB3=$O(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3)) Q:'WVSUB3 D
.D ADD
.S ^TMP("WVLAB",$J,WVLINE,0)=$G(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3))
.Q
D ADD,BLANK
Q
ND ; Cytopathology Dx
D ADD
S ^TMP("WVLAB",$J,WVLINE,0)="<Cytopathology Dx>"
S WVSUB3=0
F S WVSUB3=$O(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3)) Q:'WVSUB3 D
.D ADD
.S ^TMP("WVLAB",$J,WVLINE,0)=$G(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3))
.Q
D ADD,BLANK
Q
OT ; Topography
D ADD
S WVSUB3=0
S ^TMP("WVLAB",$J,WVLINE,0)="Topography: "_$G(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3))
F S WVSUB3=$O(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3)) Q:WVSUB3="" D @$E(WVSUB3,1)
Q
D ; Disease
D ADD
S ^TMP("WVLAB",$J,WVLINE,0)=$$REPEAT^XLFSTR(" ",8)_$S(WVSUB3="D1":"Diseases: ",1:$$REPEAT^XLFSTR(" ",10))_$G(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3))
Q
M ; Morphology
D ADD
S ^TMP("WVLAB",$J,WVLINE,0)=$$REPEAT^XLFSTR(" ",8)_$P($G(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3)),U,1)
S WVSUB4=""
F S WVSUB4=$O(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3,WVSUB4)) Q:WVSUB4="" D
.D ADD
.S ^TMP("WVLAB",$J,WVLINE,0)=$$REPEAT^XLFSTR(" ",8)_$S(WVSUB4=1:"Diseases: ",1:$$REPEAT^XLFSTR(" ",10))_$G(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3,WVSUB4))
.Q
Q
P ; Procedure
D ADD
S ^TMP("WVLAB",$J,WVLINE,0)=$$REPEAT^XLFSTR(" ",7)_$S(WVSUB3="P1":"Procedures: ",1:$$REPEAT^XLFSTR(" ",12))_$P($G(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3)),U,1)
Q
SR ; Supplementary Report
S WVSUB3=0
F S WVSUB3=$O(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3)) Q:'WVSUB3 D
.S WVRPTDT=$G(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3,0))
.S WVRPTDT=$$FMTE^XLFDT(WVRPTDT,"2P")
.D ADD
.S ^TMP("WVLAB",$J,WVLINE,0)="Supplementary Rpt: "_WVRPTDT
.S WVSUB4=0
.F S WVSUB4=$O(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3,WVSUB4)) Q:'WVSUB4 D
..S WVNODE=$G(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3,WVSUB4))
..D ADD
..S ^TMP("WVLAB",$J,WVLINE,0)=WVNODE
..Q
.Q
Q
XI ; ICD Diagnoses
D ADD
S ^TMP("WVLAB",$J,WVLINE,0)="<ICD-9 Diagnoses>"
S WVSUB3=0
F S WVSUB3=$O(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3)) Q:'WVSUB3 D
.D ADD
.S WVTMP=$G(^TMP("LRCY",$J,WVDATE,WVSUB2,WVSUB3))
.S ^TMP("WVLAB",$J,WVLINE,0)=$P(WVTMP,U,1)_" "_$P(WVTMP,U,2)
.Q
Q
ADD ; Bump up line counter
S WVLINE=WVLINE+1
Q
BLANK ; Add a blank line
S ^TMP("WVLAB",$J,WVLINE,0)=" "
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HWVLABWPC 4103 printed Dec 13, 2024@02:47:09 Page 2
WVLABWPC ;HCIOFO/FT-Display Report Data from Lab Package ;3/4/99 14:58
+1 ;;1.0;WOMEN'S HEALTH;**6**;Sep 30, 1998
+2 ;
EN ; Move data from ^TMP("LRCY",$J) to ^TMP("WVLAB",$J) for display.
+1 ; Called from WVLABWP and WVPROC
+2 if '$DATA(^TMP("LRCY",$JOB))
QUIT
+3 NEW WVDATE,WVLINE,WVNODE,WVRPTDT,WVSUB2,WVSUB3,WVSUB4,WVTMP
+4 KILL ^TMP("WVLAB",$JOB)
+5 SET WVDATE=$ORDER(^TMP("LRCY",$JOB,0))
if 'WVDATE
QUIT
+6 SET WVTMP=$GET(^TMP("LRCY",$JOB,WVDATE,0))
+7 SET WVLINE=0
+8 DO ADD
+9 SET ^TMP("WVLAB",$JOB,WVLINE,0)=" Collected: "_$PIECE(WVTMP,U,1)
+10 DO ADD
+11 SET ^TMP("WVLAB",$JOB,WVLINE,0)="Lab Accession #: "_$PIECE(WVTMP,U,2)
+12 DO ADD
+13 SET WVTMP=$GET(^TMP("LRCY",$JOB,WVDATE,1))
+14 SET ^TMP("WVLAB",$JOB,WVLINE,0)=" Specimen: "_$PIECE(WVTMP,U,1)
+15 SET WVSUB2=0
+16 FOR
SET WVSUB2=$ORDER(^TMP("LRCY",$JOB,WVDATE,1,WVSUB2))
if 'WVSUB2
QUIT
Begin DoDot:1
+17 DO ADD
+18 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$$REPEAT^XLFSTR(" ",17)_^TMP("LRCY",$JOB,WVDATE,1,WVSUB2)
+19 QUIT
End DoDot:1
+20 DO ADD
DO BLANK
+21 IF $PIECE(WVTMP,U,2)'>0
Begin DoDot:1
+22 DO ADD
+23 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$$REPEAT^XLFSTR(" ",18)_"** REPORT NOT YET RELEASED **"
+24 QUIT
End DoDot:1
QUIT
+25 SET WVSUB2=1
+26 FOR
SET WVSUB2=$ORDER(^TMP("LRCY",$JOB,WVDATE,WVSUB2))
if WVSUB2=""
QUIT
Begin DoDot:1
+27 DO @$EXTRACT(WVSUB2,1,2)
+28 QUIT
End DoDot:1
+29 ; NOTE: Calling routine should kill ^TMP("LRCY",$J)
+30 QUIT
AH ; Clinical History
+1 DO ADD
+2 SET ^TMP("WVLAB",$JOB,WVLINE,0)="<Brief Clinical Hx>"
+3 SET WVSUB3=0
+4 FOR
SET WVSUB3=$ORDER(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3))
if 'WVSUB3
QUIT
Begin DoDot:1
+5 DO ADD
+6 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$GET(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3))
+7 QUIT
End DoDot:1
+8 DO ADD
DO BLANK
+9 QUIT
G ; Gross Description
+1 DO ADD
+2 SET ^TMP("WVLAB",$JOB,WVLINE,0)="<Gross Description>"
+3 SET WVSUB3=0
+4 FOR
SET WVSUB3=$ORDER(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3))
if 'WVSUB3
QUIT
Begin DoDot:1
+5 DO ADD
+6 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$GET(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3))
+7 QUIT
End DoDot:1
+8 DO ADD
DO BLANK
+9 QUIT
MI ; Microscopic exam/diagnosis field
+1 DO ADD
+2 SET ^TMP("WVLAB",$JOB,WVLINE,0)="<Microscopic Exam>"
+3 SET WVSUB3=0
+4 FOR
SET WVSUB3=$ORDER(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3))
if 'WVSUB3
QUIT
Begin DoDot:1
+5 DO ADD
+6 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$GET(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3))
+7 QUIT
End DoDot:1
+8 DO ADD
DO BLANK
+9 QUIT
ND ; Cytopathology Dx
+1 DO ADD
+2 SET ^TMP("WVLAB",$JOB,WVLINE,0)="<Cytopathology Dx>"
+3 SET WVSUB3=0
+4 FOR
SET WVSUB3=$ORDER(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3))
if 'WVSUB3
QUIT
Begin DoDot:1
+5 DO ADD
+6 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$GET(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3))
+7 QUIT
End DoDot:1
+8 DO ADD
DO BLANK
+9 QUIT
OT ; Topography
+1 DO ADD
+2 SET WVSUB3=0
+3 SET ^TMP("WVLAB",$JOB,WVLINE,0)="Topography: "_$GET(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3))
+4 FOR
SET WVSUB3=$ORDER(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3))
if WVSUB3=""
QUIT
DO @$EXTRACT(WVSUB3,1)
+5 QUIT
D ; Disease
+1 DO ADD
+2 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$$REPEAT^XLFSTR(" ",8)_$SELECT(WVSUB3="D1":"Diseases: ",1:$$REPEAT^XLFSTR(" ",10))_$GET(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3))
+3 QUIT
M ; Morphology
+1 DO ADD
+2 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$$REPEAT^XLFSTR(" ",8)_$PIECE($GET(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3)),U,1)
+3 SET WVSUB4=""
+4 FOR
SET WVSUB4=$ORDER(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3,WVSUB4))
if WVSUB4=""
QUIT
Begin DoDot:1
+5 DO ADD
+6 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$$REPEAT^XLFSTR(" ",8)_$SELECT(WVSUB4=1:"Diseases: ",1:$$REPEAT^XLFSTR(" ",10))_$GET(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3,WVSUB4))
+7 QUIT
End DoDot:1
+8 QUIT
P ; Procedure
+1 DO ADD
+2 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$$REPEAT^XLFSTR(" ",7)_$SELECT(WVSUB3="P1":"Procedures: ",1:$$REPEAT^XLFSTR(" ",12))_$PIECE($GET(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3)),U,1)
+3 QUIT
SR ; Supplementary Report
+1 SET WVSUB3=0
+2 FOR
SET WVSUB3=$ORDER(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3))
if 'WVSUB3
QUIT
Begin DoDot:1
+3 SET WVRPTDT=$GET(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3,0))
+4 SET WVRPTDT=$$FMTE^XLFDT(WVRPTDT,"2P")
+5 DO ADD
+6 SET ^TMP("WVLAB",$JOB,WVLINE,0)="Supplementary Rpt: "_WVRPTDT
+7 SET WVSUB4=0
+8 FOR
SET WVSUB4=$ORDER(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3,WVSUB4))
if 'WVSUB4
QUIT
Begin DoDot:2
+9 SET WVNODE=$GET(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3,WVSUB4))
+10 DO ADD
+11 SET ^TMP("WVLAB",$JOB,WVLINE,0)=WVNODE
+12 QUIT
End DoDot:2
+13 QUIT
End DoDot:1
+14 QUIT
XI ; ICD Diagnoses
+1 DO ADD
+2 SET ^TMP("WVLAB",$JOB,WVLINE,0)="<ICD-9 Diagnoses>"
+3 SET WVSUB3=0
+4 FOR
SET WVSUB3=$ORDER(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3))
if 'WVSUB3
QUIT
Begin DoDot:1
+5 DO ADD
+6 SET WVTMP=$GET(^TMP("LRCY",$JOB,WVDATE,WVSUB2,WVSUB3))
+7 SET ^TMP("WVLAB",$JOB,WVLINE,0)=$PIECE(WVTMP,U,1)_" "_$PIECE(WVTMP,U,2)
+8 QUIT
End DoDot:1
+9 QUIT
ADD ; Bump up line counter
+1 SET WVLINE=WVLINE+1
+2 QUIT
BLANK ; Add a blank line
+1 SET ^TMP("WVLAB",$JOB,WVLINE,0)=" "
+2 QUIT