EDPRPT9 ;SLC/MKB - Patient Xref Report ;2/28/12 08:33am
;;2.0;EMERGENCY DEPARTMENT;;May 2, 2012;Build 103
;
XRF(BEG,END,CSV) ; Get Patient Xref Report for EDPSITE by date range
; CNT = counters
N IN,LOG,DFN,ID,X,ROW,TAB
D:'$G(CSV) XML^EDPX("<patients>") I $G(CSV) D ;headers
. S TAB=$C(9),X="ED"_TAB_"Patient ID"_TAB_"Patient DFN"
. D ADD^EDPCSV(X)
S IN=BEG-.000001
F S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN Q:IN>END S LOG=0 F S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1 D
. S DFN=$P($G(^EDP(230,LOG,0)),U,6),ID=$P($G(^(0)),U,11) Q:DFN<1
. I $G(CSV) S X=LOG_TAB_ID_TAB_DFN D ADD^EDPCSV(X) Q
. K ROW S ROW("id")=LOG
. S ROW("patientDfn")=DFN
. S ROW("patientId")=ID
. S X=$$XMLA^EDPX("patient",.ROW) D XML^EDPX(X)
D:'$G(CSV) XML^EDPX("</patients>")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HEDPRPT9 802 printed Dec 13, 2024@01:52:28 Page 2
EDPRPT9 ;SLC/MKB - Patient Xref Report ;2/28/12 08:33am
+1 ;;2.0;EMERGENCY DEPARTMENT;;May 2, 2012;Build 103
+2 ;
XRF(BEG,END,CSV) ; Get Patient Xref Report for EDPSITE by date range
+1 ; CNT = counters
+2 NEW IN,LOG,DFN,ID,X,ROW,TAB
+3 ;headers
if '$GET(CSV)
DO XML^EDPX("<patients>")
IF $GET(CSV)
Begin DoDot:1
+4 SET TAB=$CHAR(9)
SET X="ED"_TAB_"Patient ID"_TAB_"Patient DFN"
+5 DO ADD^EDPCSV(X)
End DoDot:1
+6 SET IN=BEG-.000001
+7 FOR
SET IN=$ORDER(^EDP(230,"ATI",EDPSITE,IN))
if 'IN
QUIT
if IN>END
QUIT
SET LOG=0
FOR
SET LOG=+$ORDER(^EDP(230,"ATI",EDPSITE,IN,LOG))
if LOG<1
QUIT
Begin DoDot:1
+8 SET DFN=$PIECE($GET(^EDP(230,LOG,0)),U,6)
SET ID=$PIECE($GET(^(0)),U,11)
if DFN<1
QUIT
+9 IF $GET(CSV)
SET X=LOG_TAB_ID_TAB_DFN
DO ADD^EDPCSV(X)
QUIT
+10 KILL ROW
SET ROW("id")=LOG
+11 SET ROW("patientDfn")=DFN
+12 SET ROW("patientId")=ID
+13 SET X=$$XMLA^EDPX("patient",.ROW)
DO XML^EDPX(X)
End DoDot:1
+14 if '$GET(CSV)
DO XML^EDPX("</patients>")
+15 QUIT