source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORDV05.m@ 634

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

initial load of WorldVistAEHR

File size: 1.7 KB
RevLine 
[613]1ORDV05 ; slc/jdl - OE/RR Report Extracts ;10/8/03 11:18
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**109,208**;Dec 17, 1997
3 ;
4MI(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ;Microbiology
5 ;External references to ^DPT(DFN,"LR"),^LR(LRDFN, extract:GET^ORDV05E
6 ;
7 I $L($T(GCPR^OMGCOAS1)) D ; Call if FHIE station 200
8 . N BEG,END,MAX
9 . Q:'$G(ORALPHA) Q:'$G(OROMEGA)
10 . S MAX=$S(+$G(ORMAX)>0:ORMAX,1:999)
11 . S BEG=9999999-ORALPHA,END=9999999-OROMEGA
12 . D GCPR^OMGCOAS1(DFN,"MI",BEG,END,MAX)
13 ;
14 N MAX,GMTS1,GMTS2,ORSITE,SITE,GO,N1,S1,OREC,CNT
15 Q:'$L(OREXT)
16 S GO=$P(OREXT,";")_"^"_$P(OREXT,";",2)
17 Q:'$L($T(@GO))
18 S GMTSNDM=$S(+$G(ORMAX)>0:ORMAX,1:999),GMTS2=ORALPHA,GMTS1=OROMEGA
19 S ORSITE=$$SITE^VASITE,ORSITE=$P(ORSITE,"^",2)_";"_$P(ORSITE,"^",3)
20 K ^TMP("ORDATA",$J)
21 I '$L($T(GCPR^OMGCOAS1)) D
22 . K ^TMP("ORM",$J),^TMP("OR7OGX",$J),^TMP("OR7OG",$J)
23 . D @GO
24 S N1=0,CNT=0
25 F S N1=$O(^TMP("ORM",$J,N1)) Q:'N1 S S1="" F S S1=$O(^TMP("ORM",$J,N1,S1)) Q:S1="" S OREC=^(S1) D
26 . S CNT=CNT+1,SITE=$S($L($G(^TMP("ORM",$J,N1,S1,"facility"))):^("facility"),1:ORSITE)
27 . S ^TMP("ORDATA",$J,CNT,"WP",1)="1^"_SITE ;Station ID
28 . S ^TMP("ORDATA",$J,CNT,"WP",2)="2^"_$P(OREC,U) ;Collect dt
29 . S ^TMP("ORDATA",$J,CNT,"WP",3)="3^"_$P(OREC,U,5) ;Test name
30 . S ^TMP("ORDATA",$J,CNT,"WP",4)="4^"_$P(OREC,U,3) ;Collection sample
31 . S ^TMP("ORDATA",$J,CNT,"WP",5)="5^"_$P(OREC,U,4) ;Specimen
32 . S ^TMP("ORDATA",$J,CNT,"WP",6)="6^"_$P(OREC,U,2) ;Accession
33 . D SPMRG^ORDVU($NA(^TMP("ORM",$J,N1,S1,"REPORT")),$NA(^TMP("ORDATA",$J,CNT,"WP",7)),7) ;report
34 . I $O(^TMP("ORM",$J,N1,S1,"REPORT",0)) S ^TMP("ORDATA",$J,CNT,"WP",8)="8^[+]" ;flag for detail
35 K ^TMP("ORM",$J),^TMP("OR7OGX",$J),^TMP("OR7OG",$J)
36 S ROOT=$NA(^TMP("ORDATA",$J))
37 Q
Note: See TracBrowser for help on using the repository browser.