Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ORWGAPI1

ORWGAPI1.m

Go to the documentation of this file.
  1. ORWGAPI1 ; SLC/STAFF - Graph Items ;12/21/05 08:15
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**215,243**;Dec 17, 1997;Build 242
  1. ;
  1. AA(ITEMS,DFN,FMT,OLDEST,NEWEST,CNT,TMP) ; from ORWGAPIR
  1. ; FMT,OLDEST,NEWEST not used
  1. N ITEM,FILE,NUM,REF,RESULT
  1. K ^TMP("ORWGRPC DC",$J)
  1. S ITEM=""
  1. F S ITEM=$O(^PXRMINDX(63,"PI",DFN,ITEM)) Q:ITEM="" D
  1. . I $E(ITEM)="A" Q
  1. . I $E(ITEM)="M" Q
  1. . S RESULT=$$AALAB^ORWGAPIC(ITEM)
  1. . I RESULT="" Q
  1. . S RESULT="68^"_RESULT
  1. . S ^TMP("ORWGRPC DC",$J,RESULT)=""
  1. S RESULT=""
  1. F S RESULT=$O(^TMP("ORWGRPC DC",$J,RESULT)) Q:RESULT="" S CNT=CNT+1 D
  1. . D SETUP^ORWGAPIW(.ITEMS,RESULT,TMP,.CNT)
  1. K ^TMP("ORWGRPC DC",$J)
  1. Q
  1. ;
  1. AP(ITEMS,DFN,FMT,OLDEST,NEWEST,CNT,TMP) ; from ORWGAPIR
  1. N DATE,ITEM,OK,RESULT
  1. S ITEM="A"
  1. F S ITEM=$O(^PXRMINDX(63,"PI",DFN,ITEM)) Q:ITEM="" Q:ITEM]"AZ" D
  1. . S OK=0
  1. . I FMT=6 D
  1. .. S DATE=OLDEST
  1. .. F S DATE=$O(^PXRMINDX(63,"PI",DFN,ITEM,DATE)) Q:DATE="" Q:DATE>NEWEST D Q:OK
  1. ... S CNT=CNT+1
  1. ... S OK=1
  1. ... S RESULT="63AP"_U_ITEM
  1. . I FMT=3 D
  1. .. S DATE=$O(^PXRMINDX(63,"PI",DFN,ITEM,""),-1)
  1. .. I 'DATE Q
  1. .. S OK=1
  1. .. S CNT=CNT+1
  1. .. S RESULT="63AP^"_ITEM_"^^"_$$ITEMPRFX^ORWGAPIU(ITEM)_": "_$$EVALUE^ORWGAPIU(ITEM,63,.01)_"^^"_DATE
  1. . I FMT=0 D
  1. .. S OK=1
  1. .. S CNT=CNT+1
  1. .. S RESULT="63AP^"_ITEM_U_$$ITEMPRFX^ORWGAPIU(ITEM)_": "_$$EVALUE^ORWGAPIU(ITEM,63,.01)
  1. . I OK D SETUP^ORWGAPIW(.ITEMS,RESULT,TMP,.CNT)
  1. Q
  1. ;
  1. LAB(ITEMS,DFN,FMT,OLDEST,NEWEST,CNT,TMP) ; from ORWGAPIR
  1. N DATE,ITEM,OK,RESULT
  1. S ITEM=0
  1. F S ITEM=$O(^PXRMINDX(63,"PI",DFN,ITEM)) Q:ITEM<1 D
  1. . S OK=0
  1. . I FMT=6 D
  1. .. S DATE=OLDEST
  1. .. F S DATE=$O(^PXRMINDX(63,"PI",DFN,ITEM,DATE)) Q:DATE="" Q:DATE>NEWEST D Q:OK
  1. ... S CNT=CNT+1
  1. ... S OK=1
  1. ... S RESULT=63_U_ITEM
  1. . I FMT=3 D
  1. .. S DATE=$O(^PXRMINDX(63,"PI",DFN,ITEM,""),-1)
  1. .. I 'DATE Q
  1. .. S CNT=CNT+1
  1. .. S OK=1
  1. .. S RESULT=63_U_ITEM_"^^"_$$EVALUE^ORWGAPIU(ITEM,63,.01)_"^^"_DATE
  1. . I FMT=0 D
  1. .. S CNT=CNT+1
  1. .. S OK=1
  1. .. S RESULT=63_U_ITEM_U_$$EVALUE^ORWGAPIU(ITEM,63,.01)
  1. . I OK D
  1. .. S RESULT=RESULT_U_$$AALAB^ORWGAPIC(ITEM)
  1. .. D SETUP^ORWGAPIW(.ITEMS,RESULT,TMP,.CNT)
  1. Q
  1. ;
  1. MI(ITEMS,DFN,FMT,OLDEST,NEWEST,CNT,TMP) ; from ORWGAPIR
  1. N DATE,ITEM,OK,RESULT
  1. S ITEM="M"
  1. F S ITEM=$O(^PXRMINDX(63,"PI",DFN,ITEM)) Q:ITEM="" Q:ITEM]"MZ" D
  1. . S OK=0
  1. . I FMT=6 D
  1. .. S DATE=OLDEST
  1. .. F S DATE=$O(^PXRMINDX(63,"PI",DFN,ITEM,DATE)) Q:DATE="" Q:DATE>NEWEST D Q:OK
  1. ... S CNT=CNT+1
  1. ... S OK=1
  1. ... S RESULT="63MI"_U_ITEM
  1. . I FMT=3 D
  1. .. S DATE=$O(^PXRMINDX(63,"PI",DFN,ITEM,""),-1)
  1. .. I 'DATE Q
  1. .. S CNT=CNT+1
  1. .. S OK=1
  1. .. S RESULT="63MI^"_ITEM_"^^"_$$ITEMPRFX^ORWGAPIU(ITEM)_": "_$$EVALUE^ORWGAPIU(ITEM,63,.01)_"^^"_DATE
  1. . I FMT=0 D
  1. .. S CNT=CNT+1
  1. .. S OK=1
  1. .. S RESULT="63MI^"_ITEM_U_$$ITEMPRFX^ORWGAPIU(ITEM)_": "_$$EVALUE^ORWGAPIU(ITEM,63,.01)
  1. . I OK D SETUP^ORWGAPIW(.ITEMS,RESULT,TMP,.CNT)
  1. Q
  1. ;
  1. MED(ITEMS,DFN,FMT,OLDEST,NEWEST,CNT,TMP) ; from ORWGAPIR
  1. D MED1^ORWGAPIE(.ITEMS,DFN,FMT,OLDEST,NEWEST,.CNT,.TMP)
  1. Q
  1. ;
  1. NOTES(ITEMS,DFN,FMT,OLDEST,NEWEST,CNT,TMP) ; from ORWGAPIR
  1. N DATE,DOC,DOCCLASS,DOCIEN,DOCTYPE,DUMMY,RESULT,RESULTS,TITLE K DUMMY
  1. K ^TMP("ORWGRPC TEMP",$J),^TMP("TIUR",$J)
  1. S CNT=$G(CNT)
  1. I FMT=6 D
  1. . F DOCTYPE="P","D","C" D
  1. .. S DOCCLASS=$$DOCCLASS^ORWGAPIA(DOCTYPE)
  1. .. K ^TMP("TIUR",$J)
  1. .. D TIU^ORWGAPIA(.DUMMY,DOCCLASS,5,DFN,$G(OLDEST),$G(NEWEST))
  1. .. S DOC=0
  1. .. F S DOC=$O(^TMP("TIUR",$J,DOC)) Q:DOC<1 D
  1. ... S RESULTS=^TMP("TIUR",$J,DOC)
  1. ... S TITLE=$P(RESULTS,U,2)
  1. ... S DATE=$P(RESULTS,U,3)
  1. ... I '$L(TITLE) Q
  1. ... S ^TMP("ORWGRPC TEMP",$J,TITLE,DATE)=RESULTS
  1. I FMT'=6 D
  1. . F DOCTYPE="P","D","C" D
  1. .. S DOCCLASS=$$DOCCLASS^ORWGAPIA(DOCTYPE)
  1. .. K ^TMP("TIUR",$J)
  1. .. D TIU^ORWGAPIA(.DUMMY,DOCCLASS,5,DFN)
  1. .. S DOC=0
  1. .. F S DOC=$O(^TMP("TIUR",$J,DOC)) Q:DOC<1 D
  1. ... S RESULTS=^TMP("TIUR",$J,DOC)
  1. ... S TITLE=$P(RESULTS,U,2)
  1. ... S DATE=$P(RESULTS,U,3)
  1. ... I '$L(TITLE) Q
  1. ... S ^TMP("ORWGRPC TEMP",$J,TITLE,DATE)=RESULTS
  1. S TITLE=""
  1. F S TITLE=$O(^TMP("ORWGRPC TEMP",$J,TITLE)) Q:TITLE="" D
  1. . S CNT=CNT+1
  1. . I FMT=6 S RESULT=8925_U_TITLE
  1. . I FMT=3 D
  1. .. S DATE=+$O(^TMP("ORWGRPC TEMP",$J,TITLE,""),-1)
  1. .. S DOCIEN=+$G(^TMP("ORWGRPC TEMP",$J,TITLE,DATE))
  1. .. S RESULT=8925_U_TITLE_"^^"_TITLE_"^^"
  1. .. S RESULT=RESULT_DATE
  1. .. S RESULT=RESULT_U_$$TITLE^ORWGAPIA(DOCIEN)
  1. . I FMT=0 S RESULT=8925_U_TITLE_U_TITLE
  1. . S RESULT=$$UP^ORWGAPIX(RESULT)
  1. . D SETUP^ORWGAPIW(.ITEMS,RESULT,TMP,.CNT)
  1. K ^TMP("ORWGRPC TEMP",$J),^TMP("TIUR",$J)
  1. Q
  1. ;
  1. TITLE(ITEMS,DFN,FMT,OLDEST,NEWEST,CNT,TMP) ; from ORWGAPIR
  1. ; FMT,OLDEST,NEWEST not used
  1. N ITEM,FILE,NUM,REF,RESULT
  1. K ^TMP("ORWGRPC DC",$J)
  1. S ITEM=""
  1. F S ITEM=$O(^PXRMINDX(63,"PI",DFN,ITEM)) Q:ITEM="" D
  1. . I $E(ITEM)="A" Q
  1. . I $E(ITEM)="M" Q
  1. . S RESULT=$$AALAB^ORWGAPIC(ITEM)
  1. . I RESULT="" Q
  1. . S RESULT="68^"_RESULT
  1. . S ^TMP("ORWGRPC DC",$J,RESULT)=""
  1. S RESULT=""
  1. F S RESULT=$O(^TMP("ORWGRPC DC",$J,RESULT)) Q:RESULT="" S CNT=CNT+1 D
  1. . D SETUP^ORWGAPIW(.ITEMS,RESULT,TMP,.CNT)
  1. K ^TMP("ORWGRPC DC",$J)
  1. Q
  1. ;