EDPQLE1 ;SLC/KCM - Retrive Log Entry - Supporting Info ;2/28/12 08:33am
;;2.0;EMERGENCY DEPARTMENT;**6**;Feb 24, 2012;Build 200
;
CHOICES(AREA) ; Add choice lists for editing log entry to XML
; called from EDPQLE
;
N ROLIEN,RNAME,RABBR,RXML,R0
S ROLEIEN=0 F S ROLEIEN=$O(^EDPB(232.5,ROLEIEN)) Q:'ROLEIEN D
.S R0=$G(^EDPB(232.5,ROLEIEN,0)),RNAME=$P(R0,U),RABBR=$P(R0,U,2),RXML=$P(R0,U,3)
.D STAFF($S(RXML="@rn":"nurse",1:$P(RXML,"@",2)),ROLEIEN,RABBR)
;D STAFF("md","P")
;D STAFF("res","R")
;D STAFF("nurse","N")
;
D CODES("arrival","arrival")
D CODES("acuity","acuity")
D CODES("status","status")
D CODES("disposition","disposition")
D CODES("delay","delay")
Q
STAFF(LABEL,ROLEIEN,RABBR) ; add staff for this area to XML
N IEN,X0,NM,PER,ALPHA,EDPNURS,ROW
I RABBR="N" S EDPNURS=$$GET^XPAR("ALL","EDPF NURSE STAFF SCREEN")
D XML^EDPX("<"_LABEL_"List>")
D XML^EDPX($$XMLS^EDPX(LABEL,0,"None")) ;non-selected (-1 will delete)
S IEN=0 F S IEN=$O(^EDPB(231.7,"AC",EDPSITE,AREA,ROLEIEN,IEN)) Q:'IEN D
. S X0=^EDPB(231.7,IEN,0),PER=$P(X0,U)
. I '$$ALLOW^EDPFPER(PER,RABBR) Q
. S ALPHA($P(^VA(200,PER,0),U),PER)=$P(^VA(200,PER,0),U,2)
S NM="" F S NM=$O(ALPHA(NM)) Q:NM="" D
. S PER=0 F S PER=$O(ALPHA(NM,PER)) Q:'PER D
. . K ROW S ROW("data")=PER,ROW("label")=NM
. . S ROW("initials")=ALPHA(NM,PER)
. . D XML^EDPX($$XMLA^EDPX(LABEL,.ROW))
. . ;D XML^EDPX($$XMLS^EDPX(LABEL,PER,NM))
D XML^EDPX("</"_LABEL_"List>")
Q
CODES(LABEL,SETNM) ; build nodes for set of codes
D XML^EDPX("<"_LABEL_"List>")
I "^arrival^acuity^status^disposition^delay^"[(U_LABEL_U) D
. ;N NOVAL S NOVAL=+$O(^EDPB(233.1,"B","edp.reserved.novalue",0))
. ;D XML^EDPX($$XMLS^EDPX(LABEL,NOVAL,"Not Set")) ; non-selected value
. D XML^EDPX($$XMLS^EDPX(LABEL,0,"Not Set")) ; non-selected value ;
I $D(^EDPB(233.2,"B",EDPSTA_"."_SETNM)) S SETNM=EDPSTA_"."_SETNM I 1
E S SETNM="edp."_SETNM
;
N SET,SEQ,I,X0,IEN,SHOW
S SET=$O(^EDPB(233.2,"B",SETNM,0))
S SEQ=0 F S SEQ=$O(^EDPB(233.2,SET,1,"B",SEQ)) Q:'SEQ D
. S I=0 F S I=$O(^EDPB(233.2,SET,1,"B",SEQ,I)) Q:'I D
. . S X0=^EDPB(233.2,SET,1,I,0)
. . Q:$P(X0,U,3) ; inactive
. . S IEN=$P(X0,U,2)
. . S SHOW=$P(X0,U,4)
. . I SHOW="" S SHOW=$P(^EDPB(233.1,IEN,0),U,2)
. . D XML^EDPX($$XMLS^EDPX(LABEL,IEN,SHOW))
;
D XML^EDPX("</"_LABEL_"List>")
Q
CLINLST(USEALL) ; build nodes for selectable clinics
N EDPLST,INSTANCE,IEN,NAME,LST,CURTM
D GETLST^XPAR(.EDPLST,EDPSITE_";DIC(4,","EDPF LOCATION","N")
S CURTM=$E($P($$NOW^XLFDT,".",2)_"0000",1,4)
S INSTANCE="" F S INSTANCE=$O(EDPLST(INSTANCE)) Q:INSTANCE="" D
. S IEN=+EDPLST(INSTANCE),NAME=$P(EDPLST(INSTANCE),U,2)
. I 'USEALL,$$OUTSIDE(CURTM,INSTANCE) Q ; outside time range, get next
. S LST(NAME)=IEN
;
D XML^EDPX("<clinicList>")
D XML^EDPX($$XMLS^EDPX("clinic",0,"None")) ;non-selected (-1 will delete)
S NAME="" F S NAME=$O(LST(NAME)) Q:NAME="" D
. D XML^EDPX($$XMLS^EDPX("clinic",LST(NAME),NAME))
D XML^EDPX("</clinicList>")
Q
OUTSIDE(TM,RNG) ; return true if the time is OUTSIDE of the range
N BEG,END
I RNG'["-" Q 0
;
S BEG=+$P(RNG,"-"),END=+$P(RNG,"-",2)
I (TM<BEG)!(TM>END) Q 1
Q 0
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HEDPQLE1 3220 printed Dec 13, 2024@01:52:09 Page 2
EDPQLE1 ;SLC/KCM - Retrive Log Entry - Supporting Info ;2/28/12 08:33am
+1 ;;2.0;EMERGENCY DEPARTMENT;**6**;Feb 24, 2012;Build 200
+2 ;
CHOICES(AREA) ; Add choice lists for editing log entry to XML
+1 ; called from EDPQLE
+2 ;
+3 NEW ROLIEN,RNAME,RABBR,RXML,R0
+4 SET ROLEIEN=0
FOR
SET ROLEIEN=$ORDER(^EDPB(232.5,ROLEIEN))
if 'ROLEIEN
QUIT
Begin DoDot:1
+5 SET R0=$GET(^EDPB(232.5,ROLEIEN,0))
SET RNAME=$PIECE(R0,U)
SET RABBR=$PIECE(R0,U,2)
SET RXML=$PIECE(R0,U,3)
+6 DO STAFF($SELECT(RXML="@rn":"nurse",1:$PIECE(RXML,"@",2)),ROLEIEN,RABBR)
End DoDot:1
+7 ;D STAFF("md","P")
+8 ;D STAFF("res","R")
+9 ;D STAFF("nurse","N")
+10 ;
+11 DO CODES("arrival","arrival")
+12 DO CODES("acuity","acuity")
+13 DO CODES("status","status")
+14 DO CODES("disposition","disposition")
+15 DO CODES("delay","delay")
+16 QUIT
STAFF(LABEL,ROLEIEN,RABBR) ; add staff for this area to XML
+1 NEW IEN,X0,NM,PER,ALPHA,EDPNURS,ROW
+2 IF RABBR="N"
SET EDPNURS=$$GET^XPAR("ALL","EDPF NURSE STAFF SCREEN")
+3 DO XML^EDPX("<"_LABEL_"List>")
+4 ;non-selected (-1 will delete)
DO XML^EDPX($$XMLS^EDPX(LABEL,0,"None"))
+5 SET IEN=0
FOR
SET IEN=$ORDER(^EDPB(231.7,"AC",EDPSITE,AREA,ROLEIEN,IEN))
if 'IEN
QUIT
Begin DoDot:1
+6 SET X0=^EDPB(231.7,IEN,0)
SET PER=$PIECE(X0,U)
+7 IF '$$ALLOW^EDPFPER(PER,RABBR)
QUIT
+8 SET ALPHA($PIECE(^VA(200,PER,0),U),PER)=$PIECE(^VA(200,PER,0),U,2)
End DoDot:1
+9 SET NM=""
FOR
SET NM=$ORDER(ALPHA(NM))
if NM=""
QUIT
Begin DoDot:1
+10 SET PER=0
FOR
SET PER=$ORDER(ALPHA(NM,PER))
if 'PER
QUIT
Begin DoDot:2
+11 KILL ROW
SET ROW("data")=PER
SET ROW("label")=NM
+12 SET ROW("initials")=ALPHA(NM,PER)
+13 DO XML^EDPX($$XMLA^EDPX(LABEL,.ROW))
+14 ;D XML^EDPX($$XMLS^EDPX(LABEL,PER,NM))
End DoDot:2
End DoDot:1
+15 DO XML^EDPX("</"_LABEL_"List>")
+16 QUIT
CODES(LABEL,SETNM) ; build nodes for set of codes
+1 DO XML^EDPX("<"_LABEL_"List>")
+2 IF "^arrival^acuity^status^disposition^delay^"[(U_LABEL_U)
Begin DoDot:1
+3 ;N NOVAL S NOVAL=+$O(^EDPB(233.1,"B","edp.reserved.novalue",0))
+4 ;D XML^EDPX($$XMLS^EDPX(LABEL,NOVAL,"Not Set")) ; non-selected value
+5 ; non-selected value ;
DO XML^EDPX($$XMLS^EDPX(LABEL,0,"Not Set"))
End DoDot:1
+6 IF $DATA(^EDPB(233.2,"B",EDPSTA_"."_SETNM))
SET SETNM=EDPSTA_"."_SETNM
IF 1
+7 IF '$TEST
SET SETNM="edp."_SETNM
+8 ;
+9 NEW SET,SEQ,I,X0,IEN,SHOW
+10 SET SET=$ORDER(^EDPB(233.2,"B",SETNM,0))
+11 SET SEQ=0
FOR
SET SEQ=$ORDER(^EDPB(233.2,SET,1,"B",SEQ))
if 'SEQ
QUIT
Begin DoDot:1
+12 SET I=0
FOR
SET I=$ORDER(^EDPB(233.2,SET,1,"B",SEQ,I))
if 'I
QUIT
Begin DoDot:2
+13 SET X0=^EDPB(233.2,SET,1,I,0)
+14 ; inactive
if $PIECE(X0,U,3)
QUIT
+15 SET IEN=$PIECE(X0,U,2)
+16 SET SHOW=$PIECE(X0,U,4)
+17 IF SHOW=""
SET SHOW=$PIECE(^EDPB(233.1,IEN,0),U,2)
+18 DO XML^EDPX($$XMLS^EDPX(LABEL,IEN,SHOW))
End DoDot:2
End DoDot:1
+19 ;
+20 DO XML^EDPX("</"_LABEL_"List>")
+21 QUIT
CLINLST(USEALL) ; build nodes for selectable clinics
+1 NEW EDPLST,INSTANCE,IEN,NAME,LST,CURTM
+2 DO GETLST^XPAR(.EDPLST,EDPSITE_";DIC(4,","EDPF LOCATION","N")
+3 SET CURTM=$EXTRACT($PIECE($$NOW^XLFDT,".",2)_"0000",1,4)
+4 SET INSTANCE=""
FOR
SET INSTANCE=$ORDER(EDPLST(INSTANCE))
if INSTANCE=""
QUIT
Begin DoDot:1
+5 SET IEN=+EDPLST(INSTANCE)
SET NAME=$PIECE(EDPLST(INSTANCE),U,2)
+6 ; outside time range, get next
IF 'USEALL
IF $$OUTSIDE(CURTM,INSTANCE)
QUIT
+7 SET LST(NAME)=IEN
End DoDot:1
+8 ;
+9 DO XML^EDPX("<clinicList>")
+10 ;non-selected (-1 will delete)
DO XML^EDPX($$XMLS^EDPX("clinic",0,"None"))
+11 SET NAME=""
FOR
SET NAME=$ORDER(LST(NAME))
if NAME=""
QUIT
Begin DoDot:1
+12 DO XML^EDPX($$XMLS^EDPX("clinic",LST(NAME),NAME))
End DoDot:1
+13 DO XML^EDPX("</clinicList>")
+14 QUIT
OUTSIDE(TM,RNG) ; return true if the time is OUTSIDE of the range
+1 NEW BEG,END
+2 IF RNG'["-"
QUIT 0
+3 ;
+4 SET BEG=+$PIECE(RNG,"-")
SET END=+$PIECE(RNG,"-",2)
+5 IF (TM<BEG)!(TM>END)
QUIT 1
+6 QUIT 0