source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORDV02A.m@ 1476

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

initial load of WorldVistAEHR

File size: 2.6 KB
Line 
1ORDV02A ; slc/dcm - OE/RR Report Extracts ; 10/8/03 11:18
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**243**;Dec 17, 1997;Build 242
3 ;LAB Components
4EM(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ;Electron Microscopy
5 ;External references to ^DPT(DFN,"LR"), ^ORDVX1,
6 ;
7 S OROMEGA=1,ORALPHA=9999999,ORMAX=9999
8 I $L($T(GCPR^OMGCOAS1)) D ; Call if FHIE station 200
9 . N BEG,END
10 . Q:'$G(ORALPHA) Q:'$G(OROMEGA)
11 . S ORMAX=$S(+$G(ORMAX)>0:ORMAX,1:999)
12 . S BEG=9999999-OROMEGA,END=9999999-ORALPHA
13 . D GCPR^OMGCOAS1(DFN,"EM",BEG,END,ORMAX)
14 D GET
15 Q
16CY(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ;Cytology
17 ;External references to ^DPT(DFN,"LR"), ^ORDVX1,
18 ;
19 S OROMEGA=1,ORALPHA=9999999,ORMAX=9999
20 I $L($T(GCPR^OMGCOAS1)) D ; Call if FHIE station 200
21 . N BEG,END
22 . Q:'$G(ORALPHA) Q:'$G(OROMEGA)
23 . S ORMAX=$S(+$G(ORMAX)>0:ORMAX,1:999)
24 . S BEG=9999999-OROMEGA,END=9999999-ORALPHA
25 . D GCPR^OMGCOAS1(DFN,"CY",BEG,END,ORMAX)
26 D GET
27 Q
28SP(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ;Surgical Pathology
29 ;External references to ^DPT(DFN,"LR"), ^ORDVX1,
30 ;
31 S OROMEGA=1,ORALPHA=9999999,ORMAX=9999
32 I $L($T(GCPR^OMGCOAS1)) D ; Call if FHIE station 200
33 . N BEG,END
34 . Q:'$G(ORALPHA) Q:'$G(OROMEGA)
35 . S ORMAX=$S(+$G(ORMAX)>0:ORMAX,1:999)
36 . S BEG=9999999-OROMEGA,END=9999999-ORALPHA
37 . D GCPR^OMGCOAS1(DFN,"SP",BEG,END,ORMAX)
38 D GET
39 Q
40 ;
41GET ;Get data
42 N ORDT,ORX0,ORCNT,GMI,LRDFN,IX,X,IX0,ORSITE,ORSS,SITE,GO
43 Q:'$L(OREXT)
44 S GO=$P(OREXT,";")_"^"_$P(OREXT,";",2)
45 Q:'$L($T(@GO))
46 S LRDFN=+$G(^DPT(DFN,"LR"))
47 Q:'LRDFN
48 S ORMAX=$S(+$G(ORMAX)>0:ORMAX,1:999)
49 S ORSITE=$$SITE^VASITE,ORSITE=$P(ORSITE,"^",2)_";"_$P(ORSITE,"^",3)
50 K ^TMP("ORDATA",$J)
51 I '$L($T(GCPR^OMGCOAS1)) D
52 . K ^TMP("OROOT",$J)
53 . D @GO
54 S ORDT=OROMEGA,ORCNT=0
55 F S ORDT=$O(^TMP("OROOT",$J,ORDT)) Q:(ORDT'>0)!(ORDT>ORALPHA)!(ORCNT>ORMAX) D
56 . S ORSS="" F S ORSS=$O(^TMP("OROOT",$J,ORDT,ORSS)) Q:ORSS=""!(ORCNT>ORMAX) S ORX0=^(ORSS,0) D
57 .. S SITE=$S($L($G(^TMP("OROOT",$J,ORDT,ORSS,"facility"))):^("facility"),1:ORSITE)
58 .. S ^TMP("ORDATA",$J,ORDT_ORSS,"WP",1)="1^"_SITE ;Station ID
59 .. S ^TMP("ORDATA",$J,ORDT_ORSS,"WP",2)="2^"_$P(ORX0,U) ;collection date
60 .. S ^TMP("ORDATA",$J,ORDT_ORSS,"WP",4)="4^"_$P(ORX0,U,2) ;accession number
61 .. D SPMRG^ORDVU("^TMP(""OROOT"","_$J_","_ORDT_","_""""_ORSS_""""_",.1)","^TMP(""ORDATA"","_$J_","_""""_ORDT_ORSS_""""_",""WP"",3)",3) ;specimen
62 .. D SPMRG^ORDVU("^TMP(""OROOT"","_$J_","_ORDT_","_""""_ORSS_""""_",.2)","^TMP(""ORDATA"","_$J_","_""""_ORDT_ORSS_""""_",""WP"",5)",5) ;report text
63 .. S ^TMP("ORDATA",$J,ORDT_ORSS,"WP",6)="6^[+]",ORCNT=ORCNT+1 ;flag for detail
64 K ^TMP("OROOT",$J)
65 S ROOT=$NA(^TMP("ORDATA",$J))
66 Q
Note: See TracBrowser for help on using the repository browser.