source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORDV08.m@ 794

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

initial load of FOIAVistA 6/30/08 version

File size: 4.0 KB
Line 
1ORDV08 ;DAN/SLC Testing new component ;8/22/01 11:30
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**109,120**;Dec 17,1997
3 ;
4RIM(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ;Radiology report
5 ;External Calls: MAIN^GMTSRAE(2),RPT^ORWRA
6 N ORX0,ORCNT,ORSITE,SITE,GO,ORMORE,ORROOT
7 Q:'$L(OREXT)
8 S GO=$P(OREXT,";")_"^"_$P(OREXT,";",2)
9 Q:'$L($T(@GO))
10 K ^TMP("ORDATA",$J),^TMP("ORXPND",$J)
11 S ORSITE=$$SITE^VASITE,ORSITE=$P(ORSITE,"^",2)_";"_$P(ORSITE,"^",3)
12 D @GO
13 S ORCNT=0
14 F S ORCNT=$O(^TMP($J,"ORAEXAMS",ORCNT)) Q:'ORCNT D
15 . S ORMORE=0
16 . S ORX0=$G(^TMP($J,"ORAEXAMS",ORCNT))
17 . D RPT^ORWRA(.ORROOT,DFN,$P(ORX0,U))
18 . S SITE=$S($L($G(^TMP($J,"ORAEXAMS",ORCNT,"facility"))):^("facility"),1:ORSITE)
19 . S ^TMP("ORDATA",$J,ORCNT,"WP",1)="1^"_SITE ;Site ID
20 . S ^TMP("ORDATA",$J,ORCNT,"WP",2)="2^"_$$DATE^ORDVU($P(ORX0,U,2)) ;date
21 . S ^TMP("ORDATA",$J,ORCNT,"WP",3)="3^"_$P(ORX0,U,3) ;procedure
22 . S ^TMP("ORDATA",$J,ORCNT,"WP",4)="4^"_$P(ORX0,U,5) ;report status
23 . S ^TMP("ORDATA",$J,ORCNT,"WP",5)="5^"_$P(ORX0,U,4) ;Case #
24 . I $O(^TMP("ORXPND",$J,0)) S ORMORE=1 D SPMRG^ORDVU($NA(^TMP("ORXPND",$J)),$NA(^TMP("ORDATA",$J,ORCNT,"WP",6,1)),6) ;clinical history
25 . I ORMORE S ^TMP("ORDATA",$J,ORCNT,"WP",7)="7^[+]" ;flag for detail
26 . S ^TMP("ORDATA",$J,ORCNT,"WP",8)="8^"_$P(ORX0,U,14) ;Image available
27 K ^TMP("RAE",$J),^TMP("ORXPND",$J)
28 S ROOT=$NA(^TMP("ORDATA",$J))
29 Q
30 ;
31IGET ;Get imaging exams
32 N ORROOT,ORRADATA,I,ID
33 S ORRADATA=$NA(^TMP($J,"RAE1",DFN))
34 S ORROOT=$NA(^TMP($J,"ORAEXAMS"))
35 K @ORRADATA,@ORROOT
36 D EN1^RAO7PC1(DFN,ORDBEG,ORDEND,ORMAX) ;call to Radiology to get exams
37 S I=0,ID=""
38 F S ID=$O(@ORRADATA@(ID)) Q:ID="" D
39 . S I=I+1
40 . S @ORROOT@(I)=ID_U_(9999999.9999-ID)_U_@ORRADATA@(ID)
41 K @ORRADATA
42 Q
43 ;
44MPRO(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ;Medicine Procedures
45 N ORSITE,ORI,ORREC,ORMORE,ORDATE,SITE,ORARRAY,ORPROC,ORSUM
46 Q:'$L(OREXT)
47 S GO=$P(OREXT,";")_"^"_$P(OREXT,";",2)
48 Q:'$L($T(@GO))
49 K ^TMP("ORDATA",$J),^TMP("ORTEMP",$J),^TMP("MCAR",$J)
50 S ORSITE=$$SITE^VASITE,ORSITE=$P(ORSITE,"^",2)_";"_$P(ORSITE,"^",3)
51 D @GO
52 S ORI=0
53 F S ORI=$O(^TMP("MCAR",$J,ORI)) Q:'ORI!(ORI>ORMAX) D
54 .K ^TMP("ORTEMP",$J) D GETREC^ORDV08A(ORI,80,20,56,3)
55 .S SITE=$S($L($G(^TMP("MCAR",$J,ORI,"facility"))):^("facility"),1:ORSITE)
56 .S ^TMP("ORDATA",$J,ORI,"WP",1)="1^"_SITE ;Site ID
57 .S ^TMP("ORDATA",$J,ORI,"WP",2)="2^"_$$DATEMMM^ORDVU(ORDATE) ;Procedure date/time
58 .S ^TMP("ORDATA",$J,ORI,"WP",3)="3^"_ORPROC ;Procedure Name
59 .S ^TMP("ORDATA",$J,ORI,"WP",4)="4^"_$S(ORSUM'="":ORSUM,1:"No Summary") ;Summary
60 .I $D(^TMP("ORTEMP",$J)) S ORMORE=1 D SPMRG^ORDVU($NA(^TMP("ORTEMP",$J)),$NA(^TMP("ORDATA",$J,ORI,"WP",5,1)),5) ;Detailed Report
61 .I ORMORE S ^TMP("ORDATA",$J,ORI,"WP",6)="6^[+]" ;Detailed report flag
62 .Q
63 K ^TMP("ORTEMP",$J),^TMP("MCAR",$J)
64 S ROOT=$NA(^TMP("ORDATA",$J))
65 Q
66MGET ;Get medicine results
67 D HSUM^GMTSMCMA(DFN,ORDBEG,ORDEND,ORMAX,"","F")
68 Q
69DIETNS(ROOT,ORALPHA,OROMEGA,ORMAX,ORDBEG,ORDEND,OREXT) ;Nutrition assessment
70 ;External Calls:SITE^VASITE, NUTR^ORWRP1, LISTNUTR^ORWPR1,FMTE^XLFDT
71 N ORSITE,ORARRAY,ORID,ORCNT,ORMORE,GO,ORDT
72 Q:'$L(OREXT)
73 S GO=$P(OREXT,";")_"^"_$P(OREXT,";",2)
74 Q:'$L($T(@GO))
75 K ^TMP("ORDATA",$J),^TMP("ORXPND",$J)
76 S ORSITE=$$SITE^VASITE,ORSITE=$P(ORSITE,"^",2)_";"_$P(ORSITE,"^",3)
77 D @GO
78 S ORCNT=0,ORDT=OROMEGA
79 F S ORDT=$O(^TMP($J,"FHADT",DFN,ORDT)) Q:(ORDT'>0)!(ORDT>ORALPHA)!(ORCNT>ORMAX) D
80 . S ORID=$$FMTE^XLFDT(9999999-ORDT,2) ;convert inverse date to external date
81 . S ORCNT=ORCNT+1,ORMORE=0
82 . D NUTR^ORWRP1(.ORARRAY,DFN,ORID)
83 . S ORSITE=$S($L($G(^TMP($J,"FHADT",ORDT,"facility"))):^("facility"),1:ORSITE)
84 . S ^TMP("ORDATA",$J,ORCNT,"WP",1)="1^"_ORSITE ;Site ID
85 . S ^TMP("ORDATA",$J,ORCNT,"WP",2)="2^"_ORID ;assessment date/time
86 . I $O(^TMP("ORXPND",$J,0)) S ORMORE=1 D SPMRG^ORDVU($NA(^TMP("ORXPND",$J)),$NA(^TMP("ORDATA",$J,ORCNT,"WP",3,1)),3) ;assessment report
87 . I ORMORE S ^TMP("ORDATA",$J,ORCNT,"WP",4)="4^[+]" ;flag for detail
88 K ^TMP($J,"FHADT"),^TMP("ORXPND",$J)
89 S ROOT=$NA(^TMP("ORDATA",$J))
90 Q
91 ;
92GETNS ;Get nutritional assessments
93 D LISTNUTR^ORWRP1(.ORARRAY,DFN)
94 Q
Note: See TracBrowser for help on using the repository browser.