EDPBPM ;SLC/KCM - Parameters for Tracking Area ; 4/18/23 8:00am
;;2.0;EMERGENCY DEPARTMENT;**23**;Feb 24, 2012;Build 4
;
LOAD(AREA) ; load parameters for area
N X,X1,TOKEN
D READL^EDPBLK(AREA,"param",.TOKEN) ; read param config -- LOCK
D XML^EDPX("<paramToken>"_TOKEN_"</paramToken>")
S X1=$G(^EDPB(231.9,AREA,1))
S X("reqDiag")=+$P(X1,U,1)
S X("codedDiag")=+$P(X1,U,2)
S X("reqDisp")=+$P(X1,U,3)
S X("reqDelay")=+$P(X1,U,4)
S X("minDelay")=+$P(X1,U,5)
S X("shiftOne")=$P(X1,U,6)
S X("shiftLen")=$P(X1,U,7)
S X("residents")=$P(X1,U,8)
S X("clinics")=$P(X1,U,9)
S X("ambulance")=$P(X1,U,11)
S X("dfltroom")=$P(X1,U,12)
D XML^EDPX($$XMLA^EDPX("params",.X,""))
D XML^EDPX("<waittxt1><![CDATA["_$G(^EDPB(231.9,AREA,232))_"]]></waittxt1>")
D XML^EDPX("<waittxt2><![CDATA["_$G(^EDPB(231.9,AREA,233))_"]]></waittxt2>")
D XML^EDPX("<waittxtupd><![CDATA["_$G(^EDPB(231.9,AREA,234))_"]]></waittxtupd>")
D XML^EDPX("</params>")
D READU^EDPBLK(AREA,"param",.TOKEN) ; read param config -- UNLOCK
Q
SAVE(AREA,PARAM) ; save updated parameters
I '$D(^EDPB(231.9,AREA,0)) D SAVERR^EDPX("fail","Area not set up") Q
;
N TOKEN,LOCKERR
S TOKEN=$G(REQ("paramToken",1))
D SAVEL^EDPBLK(AREA,"param",.TOKEN,.LOCKERR) ; save param config -- LOCK
I $L(LOCKERR) D SAVERR^EDPX("collide",LOCKERR),LOAD(AREA) Q
;
N FLD D NVPARSE^EDPX(.FLD,PARAM)
N FDA,FDAIEN,DIERR
S AREA=AREA_","
I FLD("ambulance")=-1 S FLD("ambulance")="@"
I FLD("dfltroom")=-1 S FLD("dfltroom")="@"
S FDA(231.9,AREA,1.1)=FLD("reqDiag")
S FDA(231.9,AREA,1.2)=FLD("codedDiag")
S FDA(231.9,AREA,1.3)=FLD("reqDisp")
S FDA(231.9,AREA,1.4)=FLD("reqDelay")
S FDA(231.9,AREA,1.5)=FLD("minDelay")
S FDA(231.9,AREA,1.6)=FLD("shiftOne")
S FDA(231.9,AREA,1.7)=FLD("shiftLen")
S FDA(231.9,AREA,1.8)=FLD("residents")
S FDA(231.9,AREA,1.9)=FLD("clinics")
S FDA(231.9,AREA,1.11)=FLD("ambulance")
S FDA(231.9,AREA,1.12)=FLD("dfltroom")
S FDA(231.9,AREA,2)=FLD("waittxt1")
S FDA(231.9,AREA,5)=FLD("waittxt2")
S FDA(231.9,AREA,6)=FLD("waittxtupd")
D FILE^DIE("","FDA","ERR")
D SAVEU^EDPBLK(+AREA,"param",.TOKEN) ; save param config -- UNLOCK
;
I $D(DIERR) D SAVERR^EDPX("fail",$G(ERR("DIERR",1,"TEXT",1))) Q
D XML^EDPX("<save status='ok' />")
D LOAD(+AREA)
K ERR,REC
Q
TZSAVE(AREA,TZDIFF) ; save time zone difference in minutes
N FDA,FDAIEN,DIERR
S AREA=AREA_","
S FDA(231.9,AREA,.03)=TZDIFF
D FILE^DIE("","FDA","ERR")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HEDPBPM 2481 printed Nov 22, 2024@17:01:44 Page 2
EDPBPM ;SLC/KCM - Parameters for Tracking Area ; 4/18/23 8:00am
+1 ;;2.0;EMERGENCY DEPARTMENT;**23**;Feb 24, 2012;Build 4
+2 ;
LOAD(AREA) ; load parameters for area
+1 NEW X,X1,TOKEN
+2 ; read param config -- LOCK
DO READL^EDPBLK(AREA,"param",.TOKEN)
+3 DO XML^EDPX("<paramToken>"_TOKEN_"</paramToken>")
+4 SET X1=$GET(^EDPB(231.9,AREA,1))
+5 SET X("reqDiag")=+$PIECE(X1,U,1)
+6 SET X("codedDiag")=+$PIECE(X1,U,2)
+7 SET X("reqDisp")=+$PIECE(X1,U,3)
+8 SET X("reqDelay")=+$PIECE(X1,U,4)
+9 SET X("minDelay")=+$PIECE(X1,U,5)
+10 SET X("shiftOne")=$PIECE(X1,U,6)
+11 SET X("shiftLen")=$PIECE(X1,U,7)
+12 SET X("residents")=$PIECE(X1,U,8)
+13 SET X("clinics")=$PIECE(X1,U,9)
+14 SET X("ambulance")=$PIECE(X1,U,11)
+15 SET X("dfltroom")=$PIECE(X1,U,12)
+16 DO XML^EDPX($$XMLA^EDPX("params",.X,""))
+17 DO XML^EDPX("<waittxt1><![CDATA["_$GET(^EDPB(231.9,AREA,232))_"]]></waittxt1>")
+18 DO XML^EDPX("<waittxt2><![CDATA["_$GET(^EDPB(231.9,AREA,233))_"]]></waittxt2>")
+19 DO XML^EDPX("<waittxtupd><![CDATA["_$GET(^EDPB(231.9,AREA,234))_"]]></waittxtupd>")
+20 DO XML^EDPX("</params>")
+21 ; read param config -- UNLOCK
DO READU^EDPBLK(AREA,"param",.TOKEN)
+22 QUIT
SAVE(AREA,PARAM) ; save updated parameters
+1 IF '$DATA(^EDPB(231.9,AREA,0))
DO SAVERR^EDPX("fail","Area not set up")
QUIT
+2 ;
+3 NEW TOKEN,LOCKERR
+4 SET TOKEN=$GET(REQ("paramToken",1))
+5 ; save param config -- LOCK
DO SAVEL^EDPBLK(AREA,"param",.TOKEN,.LOCKERR)
+6 IF $LENGTH(LOCKERR)
DO SAVERR^EDPX("collide",LOCKERR)
DO LOAD(AREA)
QUIT
+7 ;
+8 NEW FLD
DO NVPARSE^EDPX(.FLD,PARAM)
+9 NEW FDA,FDAIEN,DIERR
+10 SET AREA=AREA_","
+11 IF FLD("ambulance")=-1
SET FLD("ambulance")="@"
+12 IF FLD("dfltroom")=-1
SET FLD("dfltroom")="@"
+13 SET FDA(231.9,AREA,1.1)=FLD("reqDiag")
+14 SET FDA(231.9,AREA,1.2)=FLD("codedDiag")
+15 SET FDA(231.9,AREA,1.3)=FLD("reqDisp")
+16 SET FDA(231.9,AREA,1.4)=FLD("reqDelay")
+17 SET FDA(231.9,AREA,1.5)=FLD("minDelay")
+18 SET FDA(231.9,AREA,1.6)=FLD("shiftOne")
+19 SET FDA(231.9,AREA,1.7)=FLD("shiftLen")
+20 SET FDA(231.9,AREA,1.8)=FLD("residents")
+21 SET FDA(231.9,AREA,1.9)=FLD("clinics")
+22 SET FDA(231.9,AREA,1.11)=FLD("ambulance")
+23 SET FDA(231.9,AREA,1.12)=FLD("dfltroom")
+24 SET FDA(231.9,AREA,2)=FLD("waittxt1")
+25 SET FDA(231.9,AREA,5)=FLD("waittxt2")
+26 SET FDA(231.9,AREA,6)=FLD("waittxtupd")
+27 DO FILE^DIE("","FDA","ERR")
+28 ; save param config -- UNLOCK
DO SAVEU^EDPBLK(+AREA,"param",.TOKEN)
+29 ;
+30 IF $DATA(DIERR)
DO SAVERR^EDPX("fail",$GET(ERR("DIERR",1,"TEXT",1)))
QUIT
+31 DO XML^EDPX("<save status='ok' />")
+32 DO LOAD(+AREA)
+33 KILL ERR,REC
+34 QUIT
TZSAVE(AREA,TZDIFF) ; save time zone difference in minutes
+1 NEW FDA,FDAIEN,DIERR
+2 SET AREA=AREA_","
+3 SET FDA(231.9,AREA,.03)=TZDIFF
+4 DO FILE^DIE("","FDA","ERR")
+5 QUIT