source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORDV08.m@ 619

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

initial load of WorldVistAEHR

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