source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORWGAPI5.m@ 1211

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

initial load of WorldVistAEHR

File size: 2.6 KB
RevLine 
[613]1ORWGAPI5 ; SLC/STAFF - Graph Items, Meds ;12/21/05 08:15
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**243**;Dec 17, 1997;Build 242
3 ;
4BCMA(ITEMS,DFN,FMT,OLDEST,NEWEST,CNT,TMP) ; from ORWGAPIR
5 N DATE,DRUG,ITEM,NUM,RESULT
6 K ^TMP("ORWGRPC TEMP",$J)
7 I FMT=6 D
8 . S DATE=OLDEST
9 . F S DATE=$O(^PSB(53.79,"AADT",DFN,DATE)) Q:DATE<1 Q:DATE>NEWEST D
10 .. S NUM=0
11 .. F S NUM=$O(^PSB(53.79,"AADT",DFN,DATE,NUM)) Q:NUM<1 D
12 ... S ITEM=$P($G(^PSB(53.79,NUM,0)),U,8) I 'ITEM Q
13 ... I $D(^TMP("ORWGRPC TEMP",$J,ITEM)) Q
14 ... S ^TMP("ORWGRPC TEMP",$J,ITEM)=""
15 ... S CNT=CNT+1
16 ... S RESULT="53.79^"_ITEM
17 ... D SETUP^ORWGAPIW(.ITEMS,RESULT,TMP,.CNT)
18 I FMT'=6 D
19 . S ITEM=""
20 . F S ITEM=$O(^PSB(53.79,"AOIP",DFN,ITEM)) Q:ITEM="" D
21 .. S DATE=$O(^PSB(53.79,"AOIP",DFN,ITEM,""),-1)
22 .. I 'DATE Q
23 .. S NUM=$O(^PSB(53.79,"AOIP",DFN,ITEM,DATE,""),-1)
24 .. I 'NUM Q
25 .. S CNT=CNT+1
26 .. I FMT=3 S RESULT="53.79^"_ITEM_"^^"_$$POINAME^ORWGAPIC(ITEM)_"^^"_DATE
27 .. I FMT=0 S RESULT="53.79^"_ITEM_U_$$POINAME^ORWGAPIC(ITEM)
28 .. S DRUG=$$DRUG^ORWGAPIC(NUM)
29 .. I DRUG S RESULT=RESULT_U_$$DRGCLASS^ORWGAPIC(DRUG)
30 .. D SETUP^ORWGAPIW(.ITEMS,RESULT,TMP,.CNT)
31 K ^TMP("ORWGRPC TEMP",$J)
32 Q
33 ;
34DC(ITEMS,DFN,FMT,OLDEST,NEWEST,CNT,TMP) ; from ORWGAPIR
35 ; FMT,OLDEST,NEWEST not used
36 N DATA,DATE,DATE1,DRUG,ITEM,FILE,NUM,REF,RESULT K DATA
37 K ^TMP("ORWGRPC DC",$J)
38 F FILE=52,55 D
39 . S ITEM=""
40 . F S ITEM=$O(^PXRMINDX(FILE,"PI",DFN,ITEM)) Q:ITEM="" D
41 .. S RESULT=$$DRGCLASS^ORWGAPIC(ITEM)
42 .. I RESULT="" Q
43 .. S RESULT="50.605^"_RESULT
44 .. S ^TMP("ORWGRPC DC",$J,RESULT)=""
45 S ITEM=""
46 F S ITEM=$O(^PSB(53.79,"AOIP",DFN,ITEM)) Q:ITEM="" D
47 . S DATE=$O(^PSB(53.79,"AOIP",DFN,ITEM,""),-1)
48 . I 'DATE Q
49 . S NUM=$O(^PSB(53.79,"AOIP",DFN,ITEM,DATE,""),-1)
50 . I 'NUM Q
51 . S DRUG=$$DRUG^ORWGAPIC(NUM)
52 . I 'DRUG Q
53 . S RESULT=$$DRGCLASS^ORWGAPIC(DRUG)
54 . I 'RESULT Q
55 . S RESULT="50.605^"_RESULT
56 . S ^TMP("ORWGRPC DC",$J,RESULT)=""
57 S ITEM=""
58 F S ITEM=$O(^PXRMINDX("55NVA","PI",DFN,ITEM)) Q:ITEM="" D
59 . S DATE=$O(^PXRMINDX("55NVA","PI",DFN,ITEM,""),-1)
60 . I 'DATE Q
61 . S DATE1=$O(^PXRMINDX("55NVA","PI",DFN,ITEM,DATE,""),-1)
62 . I '$L(DATE1) Q
63 . S REF=$O(^PXRMINDX("55NVA","PI",DFN,ITEM,DATE,DATE1,""),-1)
64 . I '$L(REF) Q
65 . D RXNVA^ORWGAPIC(REF,.DATA)
66 . S DRUG=+$G(DATA("DISPENSE DRUG"))
67 . I 'DRUG Q
68 . S RESULT=$$DRGCLASS^ORWGAPIC(DRUG)
69 . I 'RESULT Q
70 . S RESULT="50.605^"_RESULT
71 . S ^TMP("ORWGRPC DC",$J,RESULT)=""
72 S RESULT=""
73 F S RESULT=$O(^TMP("ORWGRPC DC",$J,RESULT)) Q:RESULT="" S CNT=CNT+1 D
74 . D SETUP^ORWGAPIW(.ITEMS,RESULT,TMP,.CNT)
75 K ^TMP("ORWGRPC DC",$J)
76 Q
77 ;
78NVA(ITEMS,DFN,FMT,OLDEST,NEWEST,CNT,TMP) ; from ORWGAPIR
79 D NVA1^ORWGAPIE(.ITEMS,DFN,FMT,OLDEST,NEWEST,.CNT,.TMP)
80 Q
81 ;
Note: See TracBrowser for help on using the repository browser.