EDPCTRL ;SLC/KCM - Controller for ED Tracking ;5/23/13 11:19am
;;2.0;EMERGENCY DEPARTMENT;**6**;Feb 24, 2012;Build 200
;
RPC(EDPXML,PARAMS,PARAMS2) ; Process request via RPC instead of CSP
N X,REQ,EDPSITE,EDPUSER,EDPDBUG
K EDPXML
S EDPUSER=DUZ,EDPSITE=DUZ(2),EDPSTA=$$STA^XUAF4(DUZ(2))
S X="" F S X=$O(PARAMS(X)) Q:X="" D
. I $D(PARAMS(X))>9 M REQ(X)=PARAMS(X)
. E S REQ(X,1)=PARAMS(X)
S EDPDBUG=$$DEBUG^EDPCDBG($G(PARAMS("swfID")))
I EDPDBUG D PUTREQ^EDPCDBG(EDPDBUG,.PARAMS)
;
COMMON ; Come here for both CSP and RPC Mode
;
N EDPFAIL,CMD
S CMD=$G(REQ("command",1))
;
; switch on command
;
; ---------------------------------
;
; initUser
; return <user />
; <view />...
I CMD="initUser" D G OUT
. S AREA=$$VAL("area")
. D SESS^EDPFAA,VIEWS^EDPFAA
. D GETROLES^EDPBWS(EDPSITE,AREA)
;
; ---------------------------------
;
; matchPatients
; return <ptlk />...<ptlk />
I CMD="matchPatients" D G OUT
. D MATCH^EDPFPTL($$VAL("partial"))
;
; ---------------------------------
;
; getPatientChecks
; return <checks />
; <similar />
; <warning> </warning>
; <patientRecordFlags><flag> <text> </text></flag>...</patientRecordFlags>
I CMD="getPatientChecks" D G OUT
. D CHK^EDPFPTC($$VAL("area"),$$VAL("patient"),$$VAL("name"))
;
; ---------------------------------
;
; saveSecurityLog
; return <save />
I CMD="saveSecurityLog" D G OUT
. D LOG^EDPFPTC($$VAL("patient"))
;
; ---------------------------------
;
; getLexiconMatches
; return <items><item />...</items>
I CMD="getLexiconMatches" D G OUT
. D ICD^EDPFLEX($$VAL("text"))
;
; ---------------------------------
;
; initLogArea
; return <udp />
; <params disposition="" diagnosis="" delay="" delayMinutes="" />
; <logEntries><log />...</logEntries>
I CMD="initLogArea" D G OUT
. I $L($$VAL("logEntry")) S EDPFAIL=$$UPD^EDPLOG($$VAL("logEntry")) Q:$G(EDPFAIL)
. D PARAM^EDPQAR($$VAL("area"))
. D GET^EDPQLP($$VAL("area"),-1) ;-1 = force refresh
;
; ---------------------------------
;
; checkLogin -- OBSOLETE
; return <user />
I CMD="checkLogin" D SESS^EDPFAA G OUT
;
; ---------------------------------
;
; refreshLogSelector
; return <logEntries><log />...</logEntries>
I CMD="refreshLogSelector" D G OUT
. D GET^EDPQLP($$VAL("area"),$$VAL("token"))
;
; ---------------------------------
;
; switchLogEntry
; return <udp />
; <logEntry>log fields...</logEntry>
; <choices>choice lists...</choices>
I CMD="switchLogEntry" D G OUT
. I $L($$VAL("logEntry")) S EDPFAIL=$$UPD^EDPLOG($$VAL("logEntry")) Q:$G(EDPFAIL)
. ;D GET^EDPQLE($S($$VAL("logID"):$$VAL("logID"),1:$$VAL("logEntry")),$$VAL("choiceTS"))
. D GET^EDPQLE($$VAL("logID"),$$VAL("choiceTS"))
;
; ---------------------------------
;
; saveLogEntry
; return <upd />
I CMD="saveLogEntry" D G OUT
. S EDPFAIL=$$UPD^EDPLOG($$VAL("logEntry"),"",$$VAL("restorePatient")) Q:$G(EDPFAIL)
. ; get updated data after a save
. ;D GET^EDPQLE($$VAL("logID"),$$VAL("choiceTS"))
. N PAR,REC S PAR=$$VAL("logEntry") D NVPARSE^EDPX(.REC,PAR)
. D GET^EDPQLE($$VAL^EDPLOG("id"),$$VAL("choiceTS"))
;
; ---------------------------------
;
; addPatientToLog
; return <upd />
; <add />
; <logEntry>log fields...</logEntry>
; <choices>choice lists...</choices>
; <logEntries><log />...</logEntries>
I CMD="addPatientToLog" D G OUT
. S EDPFAIL=$$ADD^EDPLOGA($$VAL("addPatient"),$$VAL("area"),$$VAL("localTime"),$$VAL("choiceTS"))
. Q:$G(EDPFAIL)
. D GET^EDPQLP($$VAL("area"),-1)
;
; ---------------------------------
;
; deleteStubEntry
; return <upd />
I CMD="deleteStubEntry" D G OUT
. D DEL^EDPLOGA($$VAL("area"),$$VAL("logID"))
;
; ---------------------------------
;
; removeLogEntry
; return <upd />
; <logEntries><log />...</logEntries>
I CMD="removeLogEntry" D G OUT
. D UPD^EDPLOG($$VAL("logEntry"),1) Q:$G(EDPFAIL)
. D GET^EDPQLP($$VAL("area"),-1)
;
; ---------------------------------
;
; matchClosed
; return <visit />...
I CMD="matchClosed" D G OUT
. D CLOSED^EDPQLP($$VAL("area"),$$VAL("partial"))
;
; ---------------------------------
;
; loadConfiguration
; return <color><map />...</color>...
; <columnList><col />...</columnList>
; <colorMapList><colorMap><map />...</colorMapList>
; <beds><bed />...</beds>
; <params />
; <defaultRoomList><item />...</defaultRoomList>
; <displayWhen><when />...</displayWhen>
; <statusList><status />...</statusList>
I CMD="loadConfiguration" D G OUT
. D LOAD^EDPBCF($$VAL("area"))
;
; ---------------------------------
;
; loadBoardConfig
; return <spec><row /><col />...</spec>
I CMD="loadBoardConfig" D G OUT
. D LOADBRD^EDPBCF($$VAL("area"),$$VAL("boardID"))
;
; ---------------------------------
;
; saveConfigBoard
; return <save />
I CMD="saveConfigBoard" D G OUT
. D SAVEBRD^EDPBCF(.REQ) ; pass whole request for parsing
;
; ---------------------------------
;
; saveBedConfig
; return <save />
I CMD="saveBedConfig" D G OUT
. D SAVE^EDPBRM(.REQ,$$VAL("area")) ; pass whole request for parsing
;
; ---------------------------------
;
; saveColorConfig
; return <save />
I CMD="saveColorConfig" D G OUT
. D SAVE^EDPBCM(.REQ) ; pass whole request for parsing
;
; ---------------------------------
;
; loadSelectionConfig
; return <selectionName><code />....</selectionName>...
I CMD="loadSelectionConfig" D G OUT
. D LOAD^EDPBSL($$VAL("area"))
;
; ---------------------------------
;
; loadStaffConfig
; return providers, nurses, staff for area
I CMD="loadStaffConfig" D G OUT
. D LOAD^EDPBST($$VAL("area"))
;
; ---------------------------------
;
; saveStaffConfig
; return <save />
I CMD="saveStaffConfig" D G OUT
. D SAVE^EDPBST(.REQ) ; pass whole request for parsing
;
; ---------------------------------
;
; matchPersons
; return <per />...<per />
I CMD="matchPersons" D G OUT
. D MATCH^EDPFPER($$VAL("partial"),$$VAL("personType"))
;
; ---------------------------------
;
; saveParamConfig
; return <save />
I CMD="saveParamConfig" D G OUT
. D SAVE^EDPBPM($$VAL("area"),$$VAL("param"))
;
; ---------------------------------
;
; saveSelectionConfig
; return <save />
I CMD="saveSelectionConfig" D G OUT
. D SAVE^EDPBSL($$VAL("area"),.REQ)
;
; ---------------------------------
;
; getReport
; return <logEntries><log />...</logEntries>
; <averages><all /><not /><adm /></averages>
; <providers><md />...</providers>
I CMD="getReport" D G OUT
. D EN^EDPRPT($$VAL("start"),$$VAL("stop"),$$VAL("report"),$$VAL("id"),0,$$VAL("task"))
;
; ---------------------------------
;
; getCSV
; return TAB separated values for report
I CMD="getCSV" D G OUT
. N EDPCSV ; CSV mode uses EDPCSV instead of EDPXML
. D EN^EDPRPT($$VAL("start"),$$VAL("stop"),$$VAL("report"),$$VAL("id"),1,$$VAL("task"))
. M EDPXML=EDPCSV
;
; ---------------------------------
;
; getDetails
I CMD="getDetails" D G OUT
. D EN^EDPDTL($$VAL("logEntryId"),$$VAL("attribute"))
;
; ---------------------------------
;
; getVitals
I CMD="getVitals" D G OUT
. D GET^EDPVIT($$VAL("dfn"),$$VAL("start"),$$VAL("stop"))
;
; ---------------------------------
;
; saveVitals
I CMD="saveVitals" D G OUT
. D PUT^EDPVIT($$VAL("dfn"),$$VAL("vital"))
;
; ---------------------------------
;
; savePhoneNumbers
I CMD="savePhoneNumbers" D G OUT
. D PHONE^EDPUPD($$VAL("patient"),$$VAL("phone"),$$VAL("cell"),$$VAL("nokPhone"))
;
; ---------------------------------
;
; getLabOrderHistory
I CMD="getLabOrderHistory" D G OUT
. N EDPREQ M EDPREQ=REQ
. I '$D(EDPREQ("order")) D ;find lab orders
.. N LOG,I,N,X
.. S LOG=$$VAL("id"),(I,N)=0 Q:LOG<1
.. F S I=$O(^EDP(230,LOG,8,I)) Q:I<1 S X=$G(^(I,0)) I X,$P(X,U,2)="L" S N=N+1,EDPREQ("order",N)=+X
. D LAB^EDPHIST(.EDPXML,.EDPREQ)
;
; ---------------------------------
;
; getMedEfficacy
; I CMD="getMedEfficacy" D G OUT
; . N EDPREQ M EDPREQ=REQ
; . D MEDHIST^VPRXML(.EDPXML,.EDPREQ)
;
; ---------------------------------
;
; saveClinicalEvent
I CMD="saveClinicalEvent" D G OUT
. N EDPREQ M EDPREQ=REQ
. D EVENT^EDPUPD(.EDPREQ)
;
; ---------------------------------
;
; ackOrders
I CMD="ackOrders" D G OUT
. N EDPREQ M EDPREQ=REQ
. D ACK^EDPUPD(.EDPREQ)
;
; ---------------------------------
;
; getLabs = return lab results
I CMD="getLabs" D G OUT
. D EN^EDPLAB(.EDPXML,.REQ)
;
; ---------------------------------
;
; getRoomBedSelections
I CMD="getRoomBedSelections" D G OUT
. N AREA,LOG,X3,CURBED
. S AREA=$$VAL("area"),LOG=$$VAL("logEntryId")
. S X3=$G(^EDP(230,+LOG,3)),CURBED=+$P(X3,U,4)_U_$P(X3,U,9)
. D BEDS^EDPQLE
;
; ---------------------------------
;
; getChart
; I CMD="getChart" D G OUT
; . D ALL^VPRXML(.EDPXML,$$VAL("patient"))
;
; ---------------------------------
;
; loadWorksheet
I CMD="loadWorksheet" D G OUT
. D LOAD^EDPWS(.REQ) ;; need to create CTXT (patient, visit, etc.)
; --- OLD:
I CMD="loadDefinition" D G OUT
. D LOAD^EDPWS(0)
;
; ---------------------------------
;
; loadWorksheetConfig
I CMD="loadWorksheetConfig" D G OUT
. D LOADALL^EDPBWS($$VAL("area"),$$VAL("role"))
;
; ---------------------------------
; loadWorksheetList
I CMD="loadWorksheetList" D G OUT
. D LDWSLIST^EDPBWS(EDPSITE,$$VAL("area"),$$VAL("roleID"))
;
; ---------------------------------
; getWorksheet
I CMD="getWorksheet" D G OUT
. D GETWORKS^EDPBWS(EDPSITE,$$VAL("id"),.REQ,.EDPXML)
;
; ---------------------------------
; getSectionList
I CMD="getSectionList" D G OUT
. D GETSECTS^EDPBWS($$VAL("area"),.EDPXML,$$VAL("role"))
;
; ---------------------------------
; getSection
;I CMD="getSection" D G OUT
;. D GET1SEC^EDPBWS($$val("sectionID"))
; ---------------------------------
; getComponentList
I CMD="getComponentList" D G OUT
. D GETCMPTS^EDPBWS($$VAL("area"),.EDPXML,$$VAL("componentID"),$$VAL("role"))
; ---------------------------------
; saveWorksheetConfig
I CMD="saveWorksheetConfig" D G OUT
. ;D SAVEALL^EDPBWS(.REQ)
. D SAVEWORK^EDPBWS(.PARAMS,.PARAMS2,EDPSITE,$$VAL("area"))
; ---------------------------------
; loadUserProfile
I CMD="loadUserProfile" D G OUT
. D BOOT^EDPFAA($$VAL("appName"))
;
; ---------------------------------
;
; getPatientPanel
I CMD="getPatientPanel" D G OUT
. D GET^EDPQDBS($$VAL("area"),$$VAL("board"))
. D GET^EDPQPP($$VAL("area"),$$VAL("board"),-1)
. D LISTS^EDPQPP($$VAL("area"))
;
; ---------------------------------
;
; else
D XML^EDPX("<error msg='"_$$MSG^EDPX(2300010)_CMD_"' />")
; end switch
;
OUT ; output the XML
I EDPDBUG D PUTXML^EDPCDBG(EDPDBUG,.EDPXML)
I $L($G(EDPHTTP)) D ; if in CSP mode
. U EDPHTTP
. W "<results>",!
. N I S I=0 F S I=$O(EDPXML(I)) Q:'I W EDPXML(I),!
. W "</results>",!
K EDPHTTP
END Q
;
VAL(X) ; return value from request
Q $G(REQ(X,1))
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HEDPCTRL 11377 printed Nov 22, 2024@17:01:54 Page 2
EDPCTRL ;SLC/KCM - Controller for ED Tracking ;5/23/13 11:19am
+1 ;;2.0;EMERGENCY DEPARTMENT;**6**;Feb 24, 2012;Build 200
+2 ;
RPC(EDPXML,PARAMS,PARAMS2) ; Process request via RPC instead of CSP
+1 NEW X,REQ,EDPSITE,EDPUSER,EDPDBUG
+2 KILL EDPXML
+3 SET EDPUSER=DUZ
SET EDPSITE=DUZ(2)
SET EDPSTA=$$STA^XUAF4(DUZ(2))
+4 SET X=""
FOR
SET X=$ORDER(PARAMS(X))
if X=""
QUIT
Begin DoDot:1
+5 IF $DATA(PARAMS(X))>9
MERGE REQ(X)=PARAMS(X)
+6 IF '$TEST
SET REQ(X,1)=PARAMS(X)
End DoDot:1
+7 SET EDPDBUG=$$DEBUG^EDPCDBG($GET(PARAMS("swfID")))
+8 IF EDPDBUG
DO PUTREQ^EDPCDBG(EDPDBUG,.PARAMS)
+9 ;
COMMON ; Come here for both CSP and RPC Mode
+1 ;
+2 NEW EDPFAIL,CMD
+3 SET CMD=$GET(REQ("command",1))
+4 ;
+5 ; switch on command
+6 ;
+7 ; ---------------------------------
+8 ;
+9 ; initUser
+10 ; return <user />
+11 ; <view />...
+12 IF CMD="initUser"
Begin DoDot:1
+13 SET AREA=$$VAL("area")
+14 DO SESS^EDPFAA
DO VIEWS^EDPFAA
+15 DO GETROLES^EDPBWS(EDPSITE,AREA)
End DoDot:1
GOTO OUT
+16 ;
+17 ; ---------------------------------
+18 ;
+19 ; matchPatients
+20 ; return <ptlk />...<ptlk />
+21 IF CMD="matchPatients"
Begin DoDot:1
+22 DO MATCH^EDPFPTL($$VAL("partial"))
End DoDot:1
GOTO OUT
+23 ;
+24 ; ---------------------------------
+25 ;
+26 ; getPatientChecks
+27 ; return <checks />
+28 ; <similar />
+29 ; <warning> </warning>
+30 ; <patientRecordFlags><flag> <text> </text></flag>...</patientRecordFlags>
+31 IF CMD="getPatientChecks"
Begin DoDot:1
+32 DO CHK^EDPFPTC($$VAL("area"),$$VAL("patient"),$$VAL("name"))
End DoDot:1
GOTO OUT
+33 ;
+34 ; ---------------------------------
+35 ;
+36 ; saveSecurityLog
+37 ; return <save />
+38 IF CMD="saveSecurityLog"
Begin DoDot:1
+39 DO LOG^EDPFPTC($$VAL("patient"))
End DoDot:1
GOTO OUT
+40 ;
+41 ; ---------------------------------
+42 ;
+43 ; getLexiconMatches
+44 ; return <items><item />...</items>
+45 IF CMD="getLexiconMatches"
Begin DoDot:1
+46 DO ICD^EDPFLEX($$VAL("text"))
End DoDot:1
GOTO OUT
+47 ;
+48 ; ---------------------------------
+49 ;
+50 ; initLogArea
+51 ; return <udp />
+52 ; <params disposition="" diagnosis="" delay="" delayMinutes="" />
+53 ; <logEntries><log />...</logEntries>
+54 IF CMD="initLogArea"
Begin DoDot:1
+55 IF $LENGTH($$VAL("logEntry"))
SET EDPFAIL=$$UPD^EDPLOG($$VAL("logEntry"))
if $GET(EDPFAIL)
QUIT
+56 DO PARAM^EDPQAR($$VAL("area"))
+57 ;-1 = force refresh
DO GET^EDPQLP($$VAL("area"),-1)
End DoDot:1
GOTO OUT
+58 ;
+59 ; ---------------------------------
+60 ;
+61 ; checkLogin -- OBSOLETE
+62 ; return <user />
+63 IF CMD="checkLogin"
DO SESS^EDPFAA
GOTO OUT
+64 ;
+65 ; ---------------------------------
+66 ;
+67 ; refreshLogSelector
+68 ; return <logEntries><log />...</logEntries>
+69 IF CMD="refreshLogSelector"
Begin DoDot:1
+70 DO GET^EDPQLP($$VAL("area"),$$VAL("token"))
End DoDot:1
GOTO OUT
+71 ;
+72 ; ---------------------------------
+73 ;
+74 ; switchLogEntry
+75 ; return <udp />
+76 ; <logEntry>log fields...</logEntry>
+77 ; <choices>choice lists...</choices>
+78 IF CMD="switchLogEntry"
Begin DoDot:1
+79 IF $LENGTH($$VAL("logEntry"))
SET EDPFAIL=$$UPD^EDPLOG($$VAL("logEntry"))
if $GET(EDPFAIL)
QUIT
+80 ;D GET^EDPQLE($S($$VAL("logID"):$$VAL("logID"),1:$$VAL("logEntry")),$$VAL("choiceTS"))
+81 DO GET^EDPQLE($$VAL("logID"),$$VAL("choiceTS"))
End DoDot:1
GOTO OUT
+82 ;
+83 ; ---------------------------------
+84 ;
+85 ; saveLogEntry
+86 ; return <upd />
+87 IF CMD="saveLogEntry"
Begin DoDot:1
+88 SET EDPFAIL=$$UPD^EDPLOG($$VAL("logEntry"),"",$$VAL("restorePatient"))
if $GET(EDPFAIL)
QUIT
+89 ; get updated data after a save
+90 ;D GET^EDPQLE($$VAL("logID"),$$VAL("choiceTS"))
+91 NEW PAR,REC
SET PAR=$$VAL("logEntry")
DO NVPARSE^EDPX(.REC,PAR)
+92 DO GET^EDPQLE($$VAL^EDPLOG("id"),$$VAL("choiceTS"))
End DoDot:1
GOTO OUT
+93 ;
+94 ; ---------------------------------
+95 ;
+96 ; addPatientToLog
+97 ; return <upd />
+98 ; <add />
+99 ; <logEntry>log fields...</logEntry>
+100 ; <choices>choice lists...</choices>
+101 ; <logEntries><log />...</logEntries>
+102 IF CMD="addPatientToLog"
Begin DoDot:1
+103 SET EDPFAIL=$$ADD^EDPLOGA($$VAL("addPatient"),$$VAL("area"),$$VAL("localTime"),$$VAL("choiceTS"))
+104 if $GET(EDPFAIL)
QUIT
+105 DO GET^EDPQLP($$VAL("area"),-1)
End DoDot:1
GOTO OUT
+106 ;
+107 ; ---------------------------------
+108 ;
+109 ; deleteStubEntry
+110 ; return <upd />
+111 IF CMD="deleteStubEntry"
Begin DoDot:1
+112 DO DEL^EDPLOGA($$VAL("area"),$$VAL("logID"))
End DoDot:1
GOTO OUT
+113 ;
+114 ; ---------------------------------
+115 ;
+116 ; removeLogEntry
+117 ; return <upd />
+118 ; <logEntries><log />...</logEntries>
+119 IF CMD="removeLogEntry"
Begin DoDot:1
+120 DO UPD^EDPLOG($$VAL("logEntry"),1)
if $GET(EDPFAIL)
QUIT
+121 DO GET^EDPQLP($$VAL("area"),-1)
End DoDot:1
GOTO OUT
+122 ;
+123 ; ---------------------------------
+124 ;
+125 ; matchClosed
+126 ; return <visit />...
+127 IF CMD="matchClosed"
Begin DoDot:1
+128 DO CLOSED^EDPQLP($$VAL("area"),$$VAL("partial"))
End DoDot:1
GOTO OUT
+129 ;
+130 ; ---------------------------------
+131 ;
+132 ; loadConfiguration
+133 ; return <color><map />...</color>...
+134 ; <columnList><col />...</columnList>
+135 ; <colorMapList><colorMap><map />...</colorMapList>
+136 ; <beds><bed />...</beds>
+137 ; <params />
+138 ; <defaultRoomList><item />...</defaultRoomList>
+139 ; <displayWhen><when />...</displayWhen>
+140 ; <statusList><status />...</statusList>
+141 IF CMD="loadConfiguration"
Begin DoDot:1
+142 DO LOAD^EDPBCF($$VAL("area"))
End DoDot:1
GOTO OUT
+143 ;
+144 ; ---------------------------------
+145 ;
+146 ; loadBoardConfig
+147 ; return <spec><row /><col />...</spec>
+148 IF CMD="loadBoardConfig"
Begin DoDot:1
+149 DO LOADBRD^EDPBCF($$VAL("area"),$$VAL("boardID"))
End DoDot:1
GOTO OUT
+150 ;
+151 ; ---------------------------------
+152 ;
+153 ; saveConfigBoard
+154 ; return <save />
+155 IF CMD="saveConfigBoard"
Begin DoDot:1
+156 ; pass whole request for parsing
DO SAVEBRD^EDPBCF(.REQ)
End DoDot:1
GOTO OUT
+157 ;
+158 ; ---------------------------------
+159 ;
+160 ; saveBedConfig
+161 ; return <save />
+162 IF CMD="saveBedConfig"
Begin DoDot:1
+163 ; pass whole request for parsing
DO SAVE^EDPBRM(.REQ,$$VAL("area"))
End DoDot:1
GOTO OUT
+164 ;
+165 ; ---------------------------------
+166 ;
+167 ; saveColorConfig
+168 ; return <save />
+169 IF CMD="saveColorConfig"
Begin DoDot:1
+170 ; pass whole request for parsing
DO SAVE^EDPBCM(.REQ)
End DoDot:1
GOTO OUT
+171 ;
+172 ; ---------------------------------
+173 ;
+174 ; loadSelectionConfig
+175 ; return <selectionName><code />....</selectionName>...
+176 IF CMD="loadSelectionConfig"
Begin DoDot:1
+177 DO LOAD^EDPBSL($$VAL("area"))
End DoDot:1
GOTO OUT
+178 ;
+179 ; ---------------------------------
+180 ;
+181 ; loadStaffConfig
+182 ; return providers, nurses, staff for area
+183 IF CMD="loadStaffConfig"
Begin DoDot:1
+184 DO LOAD^EDPBST($$VAL("area"))
End DoDot:1
GOTO OUT
+185 ;
+186 ; ---------------------------------
+187 ;
+188 ; saveStaffConfig
+189 ; return <save />
+190 IF CMD="saveStaffConfig"
Begin DoDot:1
+191 ; pass whole request for parsing
DO SAVE^EDPBST(.REQ)
End DoDot:1
GOTO OUT
+192 ;
+193 ; ---------------------------------
+194 ;
+195 ; matchPersons
+196 ; return <per />...<per />
+197 IF CMD="matchPersons"
Begin DoDot:1
+198 DO MATCH^EDPFPER($$VAL("partial"),$$VAL("personType"))
End DoDot:1
GOTO OUT
+199 ;
+200 ; ---------------------------------
+201 ;
+202 ; saveParamConfig
+203 ; return <save />
+204 IF CMD="saveParamConfig"
Begin DoDot:1
+205 DO SAVE^EDPBPM($$VAL("area"),$$VAL("param"))
End DoDot:1
GOTO OUT
+206 ;
+207 ; ---------------------------------
+208 ;
+209 ; saveSelectionConfig
+210 ; return <save />
+211 IF CMD="saveSelectionConfig"
Begin DoDot:1
+212 DO SAVE^EDPBSL($$VAL("area"),.REQ)
End DoDot:1
GOTO OUT
+213 ;
+214 ; ---------------------------------
+215 ;
+216 ; getReport
+217 ; return <logEntries><log />...</logEntries>
+218 ; <averages><all /><not /><adm /></averages>
+219 ; <providers><md />...</providers>
+220 IF CMD="getReport"
Begin DoDot:1
+221 DO EN^EDPRPT($$VAL("start"),$$VAL("stop"),$$VAL("report"),$$VAL("id"),0,$$VAL("task"))
End DoDot:1
GOTO OUT
+222 ;
+223 ; ---------------------------------
+224 ;
+225 ; getCSV
+226 ; return TAB separated values for report
+227 IF CMD="getCSV"
Begin DoDot:1
+228 ; CSV mode uses EDPCSV instead of EDPXML
NEW EDPCSV
+229 DO EN^EDPRPT($$VAL("start"),$$VAL("stop"),$$VAL("report"),$$VAL("id"),1,$$VAL("task"))
+230 MERGE EDPXML=EDPCSV
End DoDot:1
GOTO OUT
+231 ;
+232 ; ---------------------------------
+233 ;
+234 ; getDetails
+235 IF CMD="getDetails"
Begin DoDot:1
+236 DO EN^EDPDTL($$VAL("logEntryId"),$$VAL("attribute"))
End DoDot:1
GOTO OUT
+237 ;
+238 ; ---------------------------------
+239 ;
+240 ; getVitals
+241 IF CMD="getVitals"
Begin DoDot:1
+242 DO GET^EDPVIT($$VAL("dfn"),$$VAL("start"),$$VAL("stop"))
End DoDot:1
GOTO OUT
+243 ;
+244 ; ---------------------------------
+245 ;
+246 ; saveVitals
+247 IF CMD="saveVitals"
Begin DoDot:1
+248 DO PUT^EDPVIT($$VAL("dfn"),$$VAL("vital"))
End DoDot:1
GOTO OUT
+249 ;
+250 ; ---------------------------------
+251 ;
+252 ; savePhoneNumbers
+253 IF CMD="savePhoneNumbers"
Begin DoDot:1
+254 DO PHONE^EDPUPD($$VAL("patient"),$$VAL("phone"),$$VAL("cell"),$$VAL("nokPhone"))
End DoDot:1
GOTO OUT
+255 ;
+256 ; ---------------------------------
+257 ;
+258 ; getLabOrderHistory
+259 IF CMD="getLabOrderHistory"
Begin DoDot:1
+260 NEW EDPREQ
MERGE EDPREQ=REQ
+261 ;find lab orders
IF '$DATA(EDPREQ("order"))
Begin DoDot:2
+262 NEW LOG,I,N,X
+263 SET LOG=$$VAL("id")
SET (I,N)=0
if LOG<1
QUIT
+264 FOR
SET I=$ORDER(^EDP(230,LOG,8,I))
if I<1
QUIT
SET X=$GET(^(I,0))
IF X
IF $PIECE(X,U,2)="L"
SET N=N+1
SET EDPREQ("order",N)=+X
End DoDot:2
+265 DO LAB^EDPHIST(.EDPXML,.EDPREQ)
End DoDot:1
GOTO OUT
+266 ;
+267 ; ---------------------------------
+268 ;
+269 ; getMedEfficacy
+270 ; I CMD="getMedEfficacy" D G OUT
+271 ; . N EDPREQ M EDPREQ=REQ
+272 ; . D MEDHIST^VPRXML(.EDPXML,.EDPREQ)
+273 ;
+274 ; ---------------------------------
+275 ;
+276 ; saveClinicalEvent
+277 IF CMD="saveClinicalEvent"
Begin DoDot:1
+278 NEW EDPREQ
MERGE EDPREQ=REQ
+279 DO EVENT^EDPUPD(.EDPREQ)
End DoDot:1
GOTO OUT
+280 ;
+281 ; ---------------------------------
+282 ;
+283 ; ackOrders
+284 IF CMD="ackOrders"
Begin DoDot:1
+285 NEW EDPREQ
MERGE EDPREQ=REQ
+286 DO ACK^EDPUPD(.EDPREQ)
End DoDot:1
GOTO OUT
+287 ;
+288 ; ---------------------------------
+289 ;
+290 ; getLabs = return lab results
+291 IF CMD="getLabs"
Begin DoDot:1
+292 DO EN^EDPLAB(.EDPXML,.REQ)
End DoDot:1
GOTO OUT
+293 ;
+294 ; ---------------------------------
+295 ;
+296 ; getRoomBedSelections
+297 IF CMD="getRoomBedSelections"
Begin DoDot:1
+298 NEW AREA,LOG,X3,CURBED
+299 SET AREA=$$VAL("area")
SET LOG=$$VAL("logEntryId")
+300 SET X3=$GET(^EDP(230,+LOG,3))
SET CURBED=+$PIECE(X3,U,4)_U_$PIECE(X3,U,9)
+301 DO BEDS^EDPQLE
End DoDot:1
GOTO OUT
+302 ;
+303 ; ---------------------------------
+304 ;
+305 ; getChart
+306 ; I CMD="getChart" D G OUT
+307 ; . D ALL^VPRXML(.EDPXML,$$VAL("patient"))
+308 ;
+309 ; ---------------------------------
+310 ;
+311 ; loadWorksheet
+312 IF CMD="loadWorksheet"
Begin DoDot:1
+313 ;; need to create CTXT (patient, visit, etc.)
DO LOAD^EDPWS(.REQ)
End DoDot:1
GOTO OUT
+314 ; --- OLD:
+315 IF CMD="loadDefinition"
Begin DoDot:1
+316 DO LOAD^EDPWS(0)
End DoDot:1
GOTO OUT
+317 ;
+318 ; ---------------------------------
+319 ;
+320 ; loadWorksheetConfig
+321 IF CMD="loadWorksheetConfig"
Begin DoDot:1
+322 DO LOADALL^EDPBWS($$VAL("area"),$$VAL("role"))
End DoDot:1
GOTO OUT
+323 ;
+324 ; ---------------------------------
+325 ; loadWorksheetList
+326 IF CMD="loadWorksheetList"
Begin DoDot:1
+327 DO LDWSLIST^EDPBWS(EDPSITE,$$VAL("area"),$$VAL("roleID"))
End DoDot:1
GOTO OUT
+328 ;
+329 ; ---------------------------------
+330 ; getWorksheet
+331 IF CMD="getWorksheet"
Begin DoDot:1
+332 DO GETWORKS^EDPBWS(EDPSITE,$$VAL("id"),.REQ,.EDPXML)
End DoDot:1
GOTO OUT
+333 ;
+334 ; ---------------------------------
+335 ; getSectionList
+336 IF CMD="getSectionList"
Begin DoDot:1
+337 DO GETSECTS^EDPBWS($$VAL("area"),.EDPXML,$$VAL("role"))
End DoDot:1
GOTO OUT
+338 ;
+339 ; ---------------------------------
+340 ; getSection
+341 ;I CMD="getSection" D G OUT
+342 ;. D GET1SEC^EDPBWS($$val("sectionID"))
+343 ; ---------------------------------
+344 ; getComponentList
+345 IF CMD="getComponentList"
Begin DoDot:1
+346 DO GETCMPTS^EDPBWS($$VAL("area"),.EDPXML,$$VAL("componentID"),$$VAL("role"))
End DoDot:1
GOTO OUT
+347 ; ---------------------------------
+348 ; saveWorksheetConfig
+349 IF CMD="saveWorksheetConfig"
Begin DoDot:1
+350 ;D SAVEALL^EDPBWS(.REQ)
+351 DO SAVEWORK^EDPBWS(.PARAMS,.PARAMS2,EDPSITE,$$VAL("area"))
End DoDot:1
GOTO OUT
+352 ; ---------------------------------
+353 ; loadUserProfile
+354 IF CMD="loadUserProfile"
Begin DoDot:1
+355 DO BOOT^EDPFAA($$VAL("appName"))
End DoDot:1
GOTO OUT
+356 ;
+357 ; ---------------------------------
+358 ;
+359 ; getPatientPanel
+360 IF CMD="getPatientPanel"
Begin DoDot:1
+361 DO GET^EDPQDBS($$VAL("area"),$$VAL("board"))
+362 DO GET^EDPQPP($$VAL("area"),$$VAL("board"),-1)
+363 DO LISTS^EDPQPP($$VAL("area"))
End DoDot:1
GOTO OUT
+364 ;
+365 ; ---------------------------------
+366 ;
+367 ; else
+368 DO XML^EDPX("<error msg='"_$$MSG^EDPX(2300010)_CMD_"' />")
+369 ; end switch
+370 ;
OUT ; output the XML
+1 IF EDPDBUG
DO PUTXML^EDPCDBG(EDPDBUG,.EDPXML)
+2 ; if in CSP mode
IF $LENGTH($GET(EDPHTTP))
Begin DoDot:1
+3 USE EDPHTTP
+4 WRITE "<results>",!
+5 NEW I
SET I=0
FOR
SET I=$ORDER(EDPXML(I))
if 'I
QUIT
WRITE EDPXML(I),!
+6 WRITE "</results>",!
End DoDot:1
+7 KILL EDPHTTP
END QUIT
+1 ;
VAL(X) ; return value from request
+1 QUIT $GET(REQ(X,1))