source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORWGAPI8.m@ 861

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

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1ORWGAPI8 ; SLC/STAFF - Graph Data, non-index ;8/21/06 07:52
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**243**;Dec 17, 1997;Build 242
3 ;
4ADMIT(DATA,ITEM,START,DFN,CNT,TMP,BACKTO) ; from ORWGAPIR
5 N DATE,DATE2,DISCH,LINE,LST,NUM,RESULT,VALUE K LST
6 S DATE="",DATE2="",CNT=$G(CNT),BACKTO=+$G(BACKTO)
7 S ITEM=$G(ITEM,"ADMIT")
8 D ADMITLST^ORWPT(.LST,DFN)
9 S NUM=0
10 F S NUM=$O(LST(NUM)) Q:NUM<1 D
11 . S LINE=LST(NUM)
12 . S DATE=$P(LINE,U)
13 . I DATE>START Q
14 . S DISCH=$P(LINE,U,5)
15 . S DATE2=$$DISCH^ORWGAPIA(DISCH)
16 . I DATE2="" D
17 .. S DATE2=$$FMADD^ORWGAPIX(DATE,$$LOS^ORWGAPIA(DISCH)+1)
18 .. I DATE2=-1 S DATE2=$$FMADD^ORWGAPIX(DT,1) ; just make it today + 1
19 .. S DATE2=DATE2\1
20 . S VALUE=$P(LINE,U,3)_" "_$P(LINE,U,4)_U_$P(LINE,U,5,6)
21 . S CNT=CNT+1
22 . S RESULT=405_U_ITEM_U_DATE_U_DATE2_U_VALUE
23 . D SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
24 Q
25 ;
26SURG(DATA,ITEM,START,DFN,CNT,TMP,BACKTO) ; from ORWGAPIR
27 N CASE,DATE,DATE2,NUM,PROC,RESULT,RESULTS,SURG,SURGPROC,VALUE K SURG,SURGPROC
28 S DATE2="",CNT=$G(CNT),BACKTO=+$G(BACKTO)
29 D SURG^ORWGAPIA(.SURG,DFN)
30 K SURG(0),SURG(1)
31 S ITEM=$$UP^ORWGAPIX(ITEM)
32 S NUM=0
33 S CASE=0
34 F S CASE=$O(SURG(CASE)) Q:CASE<1 D
35 . S RESULTS=SURG(CASE)
36 . S PROC=$P(RESULTS,U,3)
37 . I '$L(PROC) Q
38 . S PROC=$$UP^ORWGAPIX(PROC)
39 . I PROC'=ITEM Q
40 . S NUM=NUM+1
41 . S SURGPROC(PROC,NUM)=RESULTS
42 K SURG
43 S PROC=""
44 F S PROC=$O(SURGPROC(PROC)) Q:PROC="" D
45 . S NUM=0
46 . F S NUM=$O(SURGPROC(PROC,NUM)) Q:NUM<1 D
47 .. S RESULTS=SURGPROC(PROC,NUM)
48 .. S DATE=$P(RESULTS,U,5)
49 .. I DATE>START Q
50 .. I DATE<BACKTO Q
51 .. S VALUE=""
52 .. S RESULT=130_U_PROC_U_DATE_U_DATE2_U_VALUE
53 .. S CNT=CNT+1
54 .. D SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
55 Q
56 ;
57VISIT(DATA,ITEM,START,DFN,CNT,TMP,BACKTO) ; from ORWGAPIR
58 N DATE,DATE2,NODE,NUM,RESULT,VALUE
59 S DATE="",DATE2="",CNT=$G(CNT),BACKTO=+$G(BACKTO)
60 F S DATE=$O(^AUPNVSIT("AET",DFN,DATE)) Q:DATE="" D
61 . I DATE>START Q
62 . I DATE<BACKTO Q
63 . S NODE=""
64 . F S NODE=$O(^AUPNVSIT("AET",DFN,DATE,ITEM,NODE)) Q:NODE="" D
65 .. S NUM=0
66 .. F S NUM=$O(^AUPNVSIT("AET",DFN,DATE,ITEM,NODE,NUM)) Q:NUM="" D
67 ... S DATE2=+$P($G(^AUPNVSIT(NUM,0)),U,18)
68 ... I 'DATE2 S DATE2=DATE+.01
69 ... I +$E($P(DATE2,".",2),1,2)>24 S DATE2=(DATE\1)+.2359
70 ... S VALUE=""
71 ... S CNT=CNT+1
72 ... S RESULT=9000010_U_ITEM_U_DATE_U_DATE2_U_VALUE
73 ... D SETUP^ORWGAPIW(.DATA,RESULT,TMP,.CNT)
74 Q
75 ;
Note: See TracBrowser for help on using the repository browser.