| 1 | //kt -- Modified with SourceScanner on 8/8/2007 | 
|---|
| 2 | unit rOptions; | 
|---|
| 3 |  | 
|---|
| 4 | interface | 
|---|
| 5 |  | 
|---|
| 6 | uses SysUtils, Classes, ORNet, ORFn, uCore, rCore, rTIU, rConsults; | 
|---|
| 7 |  | 
|---|
| 8 | function rpcGetNotifications: TStrings; | 
|---|
| 9 | function rpcGetOrderChecks: TStrings; | 
|---|
| 10 | function rpcGetNotificationDefaults: String; | 
|---|
| 11 | function rpcGetSurrogateInfo: String; | 
|---|
| 12 | procedure rpcCheckSurrogate(surrogate: Int64; var ok: boolean; var msg: string); | 
|---|
| 13 | procedure rpcSetSurrogateInfo(aString: String); | 
|---|
| 14 | procedure rpcClearNotifications; | 
|---|
| 15 | procedure rpcSetNotifications(aList: TStringList); | 
|---|
| 16 | procedure rpcSetOrderChecks(aList: TStringList); | 
|---|
| 17 | procedure rpcSetOtherStuff(aString: String); | 
|---|
| 18 |  | 
|---|
| 19 | function rpcGetOtherTabs: TStrings; | 
|---|
| 20 | function rpcGetOther: String; | 
|---|
| 21 | procedure rpcSetOther(info: String); | 
|---|
| 22 | function rpcGetCosigners(const StartFrom: string; Direction: Integer): TStrings; | 
|---|
| 23 | function rpcGetDefaultCosigner: String; | 
|---|
| 24 | procedure rpcSetDefaultCosigner(value: Int64); | 
|---|
| 25 | function rpcGetSubject: boolean; | 
|---|
| 26 | procedure rpcSetSubject(value: boolean); | 
|---|
| 27 | function rpcGetClasses: TStrings; | 
|---|
| 28 | function rpcGetTitlesForClass(value: integer; const StartFrom: string; Direction: Integer): TStrings; | 
|---|
| 29 | function rpcGetTitlesForUser(value: integer): TStrings; | 
|---|
| 30 | function rpcGetTitleDefault(value: integer): integer; | 
|---|
| 31 | procedure rpcSaveDocumentDefaults(classvalue, titledefault: integer; aList: TStrings); | 
|---|
| 32 |  | 
|---|
| 33 | procedure rpcGetLabDays(var InpatientDays: integer; var OutpatientDays: integer); | 
|---|
| 34 | procedure rpcGetLabUserDays(var InpatientDays: integer; var OutpatientDays: integer); | 
|---|
| 35 | procedure rpcGetApptDays(var StartDays: integer; var StopDays: integer); | 
|---|
| 36 | procedure rpcGetApptUserDays(var StartDays: integer; var StopDays: integer); | 
|---|
| 37 | procedure rpcSetDays(InpatientDays, OutpatientDays, StartDays, StopDays: integer); | 
|---|
| 38 | procedure rpcGetImagingDays(var MaxNum: integer; var StartDays: integer; var StopDays: integer); | 
|---|
| 39 | procedure rpcGetImagingUserDays(var MaxNum: integer; var StartDays: integer; var StopDays: integer); | 
|---|
| 40 | procedure rpcSetImagingDays(MaxNum, StartDays, StopDays: integer); | 
|---|
| 41 |  | 
|---|
| 42 | procedure rpcGetReminders(Dest: TStrings); | 
|---|
| 43 | procedure rpcSetReminders(aList: TStringList); | 
|---|
| 44 |  | 
|---|
| 45 | function rpcGetListOrder: Char; | 
|---|
| 46 | procedure rpcGetClinicUserDays(var StartDays: integer; var StopDays: integer); | 
|---|
| 47 | procedure rpcGetClinicDefaults(var mon, tues, wed, thurs, fri, sat, sun: integer); | 
|---|
| 48 | procedure rpcGetListSourceDefaults(var provider, treating, list, ward: integer); | 
|---|
| 49 | procedure rpcSetClinicDefaults(StartDays, StopDays, mon, tues, wed, thurs, fri, sat, sun: integer); | 
|---|
| 50 | procedure rpcSetPtListDefaults(PLSource, PLSort: Char; prov, spec, team, ward: integer); | 
|---|
| 51 |  | 
|---|
| 52 | procedure rpcGetPersonalLists(Dest: TStrings); | 
|---|
| 53 | procedure rpcGetAllTeams(Dest: TStrings); | 
|---|
| 54 | procedure rpcGetTeams(Dest: TStrings); | 
|---|
| 55 | procedure rpcGetATeams(Dest: TStrings); | 
|---|
| 56 | procedure rpcDeleteList(aString: String); | 
|---|
| 57 | function rpcNewList(aString: String): String; | 
|---|
| 58 | procedure rpcSaveListChanges(aList: TStrings; aListIEN: integer); | 
|---|
| 59 | procedure rpcListUsersByTeam(Dest: TStrings; teamid: integer); | 
|---|
| 60 | procedure rpcRemoveList(aListIEN: integer); | 
|---|
| 61 | procedure rpcAddList(aListIEN: integer); | 
|---|
| 62 |  | 
|---|
| 63 | function rpcGetCombo: TStrings; | 
|---|
| 64 | procedure rpcSetCombo(aList: TStrings); | 
|---|
| 65 |  | 
|---|
| 66 | procedure rpcGetDefaultReportsSetting(var int1: integer; var int2: integer; var int3: integer); | 
|---|
| 67 | procedure rpcDeleteUserLevelReportsSetting; | 
|---|
| 68 | procedure rpcActiveDefaultSetting; | 
|---|
| 69 | procedure rpcSetDefaultReportsSetting(aString: string); | 
|---|
| 70 | procedure rpcSetIndividualReportSetting(aString1:string; aString2:string); | 
|---|
| 71 | procedure rpcRetrieveDefaultSetting(var int1: integer; var int2: integer; var int3: integer; var msg: string); | 
|---|
| 72 |  | 
|---|
| 73 | procedure rpcGetRangeForMeds(var startDt, stopDt: TFMDateTime); | 
|---|
| 74 | procedure rpcPutRangeForMeds(TheVal: string); | 
|---|
| 75 | procedure rpcGetRangeForEncs(var StartDays, StopDays: integer; DefaultParams: Boolean); | 
|---|
| 76 | procedure rpcPutRangeForEncs(StartDays, StopDays: string); | 
|---|
| 77 | procedure rpcGetEncFutureDays(var FutureDays: string); | 
|---|
| 78 |  | 
|---|
| 79 | implementation | 
|---|
| 80 |  | 
|---|
| 81 | //.............................................................................. | 
|---|
| 82 |  | 
|---|
| 83 | function rpcGetNotifications: TStrings; | 
|---|
| 84 | begin | 
|---|
| 85 | CallV('ORWTPP GETNOT', [nil]); | 
|---|
| 86 | MixedCaseList(RPCBrokerV.Results); | 
|---|
| 87 | result :=RPCBrokerV.Results; | 
|---|
| 88 | end; | 
|---|
| 89 |  | 
|---|
| 90 | function rpcGetOrderChecks: TStrings; | 
|---|
| 91 | begin | 
|---|
| 92 | CallV('ORWTPP GETOC', [nil]); | 
|---|
| 93 | MixedCaseList(RPCBrokerV.Results); | 
|---|
| 94 | result :=RPCBrokerV.Results; | 
|---|
| 95 | end; | 
|---|
| 96 |  | 
|---|
| 97 | function rpcGetNotificationDefaults: String; | 
|---|
| 98 | begin | 
|---|
| 99 | result := sCallV('ORWTPP GETNOTO', [nil]); | 
|---|
| 100 | end; | 
|---|
| 101 |  | 
|---|
| 102 | function rpcGetSurrogateInfo: String; | 
|---|
| 103 | begin | 
|---|
| 104 | result := MixedCase(sCallV('ORWTPP GETSURR', [nil])); | 
|---|
| 105 | end; | 
|---|
| 106 |  | 
|---|
| 107 | procedure rpcCheckSurrogate(surrogate: Int64; var ok: boolean; var msg: string); | 
|---|
| 108 | var | 
|---|
| 109 | value: string; | 
|---|
| 110 | begin | 
|---|
| 111 | value := sCallV('ORWTPP CHKSURR', [surrogate]); | 
|---|
| 112 | ok := Piece(value, '^', 1) = '1'; | 
|---|
| 113 | msg := Piece(value, '^', 2); | 
|---|
| 114 | end; | 
|---|
| 115 |  | 
|---|
| 116 | procedure rpcSetSurrogateInfo(aString: String); | 
|---|
| 117 | begin | 
|---|
| 118 | CallV('ORWTPP SAVESURR', [aString]); | 
|---|
| 119 | end; | 
|---|
| 120 |  | 
|---|
| 121 |  | 
|---|
| 122 | procedure rpcClearNotifications; | 
|---|
| 123 | begin | 
|---|
| 124 | CallV('ORWTPP CLEARNOT', [nil]); | 
|---|
| 125 | end; | 
|---|
| 126 |  | 
|---|
| 127 | procedure rpcSetNotifications(aList: TStringList); | 
|---|
| 128 | begin | 
|---|
| 129 | CallV('ORWTPP SAVENOT', [aList]); | 
|---|
| 130 | end; | 
|---|
| 131 |  | 
|---|
| 132 | procedure rpcSetOrderChecks(aList: TStringList); | 
|---|
| 133 | begin | 
|---|
| 134 | CallV('ORWTPP SAVEOC', [aList]); | 
|---|
| 135 | end; | 
|---|
| 136 |  | 
|---|
| 137 | procedure rpcSetOtherStuff(aString: String); | 
|---|
| 138 | begin | 
|---|
| 139 | CallV('ORWTPP SAVENOTO', [aString]); | 
|---|
| 140 | end; | 
|---|
| 141 |  | 
|---|
| 142 | //.............................................................................. | 
|---|
| 143 |  | 
|---|
| 144 | function rpcGetOtherTabs: TStrings; | 
|---|
| 145 | begin | 
|---|
| 146 | CallV('ORWTPO GETTABS', [nil]); | 
|---|
| 147 | MixedCaseList(RPCBrokerV.Results); | 
|---|
| 148 | result :=RPCBrokerV.Results; | 
|---|
| 149 | end; | 
|---|
| 150 |  | 
|---|
| 151 | function rpcGetOther: String; | 
|---|
| 152 | begin | 
|---|
| 153 | result := sCallV('ORWTPP GETOTHER', [nil]); | 
|---|
| 154 | end; | 
|---|
| 155 |  | 
|---|
| 156 | procedure rpcSetOther(info: String); | 
|---|
| 157 | begin | 
|---|
| 158 | CallV('ORWTPP SETOTHER', [info]); | 
|---|
| 159 | end; | 
|---|
| 160 |  | 
|---|
| 161 | function rpcGetCosigners(const StartFrom: string; Direction: Integer): TStrings; | 
|---|
| 162 | begin | 
|---|
| 163 | CallV('ORWTPP GETCOS', [StartFrom, Direction]); | 
|---|
| 164 | MixedCaseList(RPCBrokerV.Results); | 
|---|
| 165 | Result := RPCBrokerV.Results; | 
|---|
| 166 | end; | 
|---|
| 167 |  | 
|---|
| 168 | function rpcGetDefaultCosigner: String; | 
|---|
| 169 | begin | 
|---|
| 170 | result := sCallV('ORWTPP GETDCOS', [nil]); | 
|---|
| 171 | end; | 
|---|
| 172 |  | 
|---|
| 173 | procedure rpcSetDefaultCosigner(value: Int64); | 
|---|
| 174 | begin | 
|---|
| 175 | CallV('ORWTPP SETDCOS', [value]) | 
|---|
| 176 | end; | 
|---|
| 177 |  | 
|---|
| 178 | function rpcGetSubject: boolean; | 
|---|
| 179 | var | 
|---|
| 180 | value: string; | 
|---|
| 181 | begin | 
|---|
| 182 | value := sCallV('ORWTPP GETSUB', [nil]); | 
|---|
| 183 | if value = '1' then result := true | 
|---|
| 184 | else result := false; | 
|---|
| 185 | end; | 
|---|
| 186 |  | 
|---|
| 187 | procedure rpcSetSubject(value: boolean); | 
|---|
| 188 | begin | 
|---|
| 189 | CallV('ORWTPP SETSUB', [value]) | 
|---|
| 190 | end; | 
|---|
| 191 |  | 
|---|
| 192 | function rpcGetClasses: TStrings; | 
|---|
| 193 | begin | 
|---|
| 194 | CallV('ORWTPN GETCLASS', [nil]); | 
|---|
| 195 | MixedCaseList(RPCBrokerV.Results); | 
|---|
| 196 | result :=RPCBrokerV.Results; | 
|---|
| 197 | end; | 
|---|
| 198 |  | 
|---|
| 199 | function rpcGetTitlesForClass(value: integer; const StartFrom: string; Direction: Integer): TStrings; | 
|---|
| 200 | begin | 
|---|
| 201 | (*  case value of | 
|---|
| 202 | CLS_PROGRESS_NOTES: CallV('TIU LONG LIST OF TITLES', [value, StartFrom, Direction]); | 
|---|
| 203 | else | 
|---|
| 204 | CallV('ORWTPN GETTC', [value, StartFrom, Direction]);   //****** original | 
|---|
| 205 | end;*) | 
|---|
| 206 | CallV('TIU LONG LIST OF TITLES', [value, StartFrom, Direction]); | 
|---|
| 207 | //MixedCaseList(RPCBrokerV.Results); | 
|---|
| 208 | result :=RPCBrokerV.Results; | 
|---|
| 209 | end; | 
|---|
| 210 |  | 
|---|
| 211 | function rpcGetTitlesForUser(value: integer): TStrings; | 
|---|
| 212 | begin | 
|---|
| 213 | CallV('ORWTPP GETTU', [value]); | 
|---|
| 214 | //MixedCaseList(RPCBrokerV.Results); | 
|---|
| 215 | result :=RPCBrokerV.Results; | 
|---|
| 216 | end; | 
|---|
| 217 |  | 
|---|
| 218 | function rpcGetTitleDefault(value: integer): integer; | 
|---|
| 219 | begin | 
|---|
| 220 | result := strtointdef(sCallV('ORWTPP GETTD', [value]), -1); | 
|---|
| 221 | end; | 
|---|
| 222 |  | 
|---|
| 223 | procedure rpcSaveDocumentDefaults(classvalue, titledefault: integer; aList: TStrings); | 
|---|
| 224 | begin | 
|---|
| 225 | CallV('ORWTPP SAVET', [classvalue, titledefault, aList]); | 
|---|
| 226 | end; | 
|---|
| 227 |  | 
|---|
| 228 | //.............................................................................. | 
|---|
| 229 |  | 
|---|
| 230 | procedure rpcGetLabDays(var InpatientDays: integer; var OutpatientDays:integer); | 
|---|
| 231 | var | 
|---|
| 232 | values: string; | 
|---|
| 233 | begin | 
|---|
| 234 | values := sCallV('ORWTPO CSLABD', [nil]); | 
|---|
| 235 | InpatientDays := strtointdef(Piece(values, '^', 1), 0); | 
|---|
| 236 | OutpatientDays := strtointdef(Piece(values, '^', 2), 0); | 
|---|
| 237 | end; | 
|---|
| 238 |  | 
|---|
| 239 | procedure rpcGetLabUserDays(var InpatientDays: integer; var OutpatientDays: integer); | 
|---|
| 240 | var | 
|---|
| 241 | values: string; | 
|---|
| 242 | begin | 
|---|
| 243 | values := sCallV('ORWTPP CSLAB', [nil]); | 
|---|
| 244 | InpatientDays := -strtointdef(Piece(values, '^', 1), 0); | 
|---|
| 245 | OutpatientDays := -strtointdef(Piece(values, '^', 2), 0); | 
|---|
| 246 | end; | 
|---|
| 247 |  | 
|---|
| 248 | procedure rpcGetApptDays(var StartDays: integer; var StopDays: integer); | 
|---|
| 249 | var | 
|---|
| 250 | values, start, stop: string; | 
|---|
| 251 | begin | 
|---|
| 252 | values := sCallV('ORWTPD1 GETCSDEF', [nil]); | 
|---|
| 253 | start := Piece(values, '^', 1); | 
|---|
| 254 | stop  := Piece(values, '^', 2); | 
|---|
| 255 | StartDays := strtointdef(Piece(start, 'T', 2), 0); | 
|---|
| 256 | StopDays  := strtointdef(Piece(stop, 'T', 2), 0); | 
|---|
| 257 | end; | 
|---|
| 258 |  | 
|---|
| 259 | procedure rpcGetApptUserDays(var StartDays: integer; var StopDays: integer); | 
|---|
| 260 | var | 
|---|
| 261 | values, start, stop: string; | 
|---|
| 262 | begin | 
|---|
| 263 | values := sCallV('ORWTPD1 GETCSRNG', [nil]); | 
|---|
| 264 | start := Piece(values, '^', 1); | 
|---|
| 265 | stop  := Piece(values, '^', 2); | 
|---|
| 266 | StartDays := strtointdef(Piece(start, 'T', 2), 0); | 
|---|
| 267 | StopDays  := strtointdef(Piece(stop, 'T', 2), 0); | 
|---|
| 268 | end; | 
|---|
| 269 |  | 
|---|
| 270 | procedure rpcSetDays(InpatientDays, OutpatientDays, StartDays, StopDays: integer); | 
|---|
| 271 | var | 
|---|
| 272 | values: string; | 
|---|
| 273 | begin | 
|---|
| 274 | values := ''; | 
|---|
| 275 | values := values + inttostr(InpatientDays) + '^'; | 
|---|
| 276 | values := values + inttostr(OutpatientDays) + '^'; | 
|---|
| 277 | values := values + inttostr(StartDays) + '^'; | 
|---|
| 278 | values := values + inttostr(StopDays) + '^'; | 
|---|
| 279 | CallV('ORWTPD1 PUTCSRNG', [values]); | 
|---|
| 280 | end; | 
|---|
| 281 |  | 
|---|
| 282 | procedure rpcGetImagingDays(var MaxNum: integer; var StartDays: integer; var StopDays: integer); | 
|---|
| 283 | var | 
|---|
| 284 | values, max, start, stop: string; | 
|---|
| 285 | begin | 
|---|
| 286 | values := sCallV('ORWTPO GETIMGD', [nil]); | 
|---|
| 287 | //values := 'T-120;T;;;100'; | 
|---|
| 288 | start := Piece(values, ';', 1); | 
|---|
| 289 | stop  := Piece(values, ';', 2); | 
|---|
| 290 | max  := Piece(values, ';', 5); | 
|---|
| 291 | StartDays := strtointdef(Piece(start, 'T', 2), 0); | 
|---|
| 292 | StopDays  := strtointdef(Piece(stop, 'T', 2), 0); | 
|---|
| 293 | MaxNum  := strtointdef(max, 0); | 
|---|
| 294 | end; | 
|---|
| 295 |  | 
|---|
| 296 | procedure rpcGetImagingUserDays(var MaxNum: integer; var StartDays: integer; var StopDays: integer); | 
|---|
| 297 | var | 
|---|
| 298 | values, max, start, stop: string; | 
|---|
| 299 | begin | 
|---|
| 300 | values := sCallV('ORWTPP GETIMG', [nil]); | 
|---|
| 301 | //values := 'T-180;T;;;15'; | 
|---|
| 302 | start := Piece(values, ';', 1); | 
|---|
| 303 | stop  := Piece(values, ';', 2); | 
|---|
| 304 | max  := Piece(values, ';', 5); | 
|---|
| 305 | StartDays := strtointdef(Piece(start, 'T', 2), 0); | 
|---|
| 306 | StopDays  := strtointdef(Piece(stop, 'T', 2), 0); | 
|---|
| 307 | MaxNum  := strtointdef(max, 0); | 
|---|
| 308 | end; | 
|---|
| 309 |  | 
|---|
| 310 | procedure rpcSetImagingDays(MaxNum, StartDays, StopDays: integer); | 
|---|
| 311 | begin | 
|---|
| 312 | CallV('ORWTPP SETIMG', [MaxNum, StartDays, StopDays]); | 
|---|
| 313 | end; | 
|---|
| 314 |  | 
|---|
| 315 | //.............................................................................. | 
|---|
| 316 |  | 
|---|
| 317 | procedure rpcGetReminders(Dest: TStrings); | 
|---|
| 318 | begin | 
|---|
| 319 | CallV('ORWTPP GETREM', [nil]); | 
|---|
| 320 | MixedCaseList(RPCBrokerV.Results); | 
|---|
| 321 | Dest.Assign(RPCBrokerV.Results); | 
|---|
| 322 | end; | 
|---|
| 323 |  | 
|---|
| 324 | procedure rpcSetReminders(aList: TStringList); | 
|---|
| 325 | begin | 
|---|
| 326 | CallV('ORWTPP SETREM', [aList]); | 
|---|
| 327 | end; | 
|---|
| 328 |  | 
|---|
| 329 | //.............................................................................. | 
|---|
| 330 |  | 
|---|
| 331 | function rpcGetListOrder: Char; | 
|---|
| 332 | begin | 
|---|
| 333 | result := CharAt(sCallV('ORWTPP SORTDEF', [nil]), 1); | 
|---|
| 334 | end; | 
|---|
| 335 |  | 
|---|
| 336 | procedure rpcGetClinicUserDays(var StartDays: integer; var StopDays: integer); | 
|---|
| 337 | var | 
|---|
| 338 | values, start, stop: string; | 
|---|
| 339 | begin | 
|---|
| 340 | values := sCallV('ORWTPP CLRANGE', [nil]); | 
|---|
| 341 | start := Piece(values, '^', 1); | 
|---|
| 342 | stop  := Piece(values, '^', 2); | 
|---|
| 343 | StartDays := strtointdef(Piece(start, 'T', 2), 0); | 
|---|
| 344 | StopDays  := strtointdef(Piece(stop, 'T', 2), 0); | 
|---|
| 345 | end; | 
|---|
| 346 |  | 
|---|
| 347 | procedure rpcGetClinicDefaults(var mon, tues, wed, thurs, fri, sat, sun: integer); | 
|---|
| 348 | var | 
|---|
| 349 | values: string; | 
|---|
| 350 | begin | 
|---|
| 351 | values := sCallV('ORWTPP CLDAYS', [nil]); | 
|---|
| 352 | mon    := strtointdef(Piece(values, '^', 1), 0); | 
|---|
| 353 | tues   := strtointdef(Piece(values, '^', 2), 0); | 
|---|
| 354 | wed    := strtointdef(Piece(values, '^', 3), 0); | 
|---|
| 355 | thurs  := strtointdef(Piece(values, '^', 4), 0); | 
|---|
| 356 | fri    := strtointdef(Piece(values, '^', 5), 0); | 
|---|
| 357 | sat    := strtointdef(Piece(values, '^', 6), 0); | 
|---|
| 358 | sun    := strtointdef(Piece(values, '^', 7), 0); | 
|---|
| 359 | end; | 
|---|
| 360 |  | 
|---|
| 361 | procedure rpcGetListSourceDefaults(var provider, treating, list, ward: integer); | 
|---|
| 362 | var | 
|---|
| 363 | values: string; | 
|---|
| 364 | begin | 
|---|
| 365 | values := sCallV('ORWTPP LSDEF', [nil]); | 
|---|
| 366 | provider := strtointdef(Piece(values, '^', 1), 0); | 
|---|
| 367 | treating := strtointdef(Piece(values, '^', 2), 0); | 
|---|
| 368 | list     := strtointdef(Piece(values, '^', 3), 0); | 
|---|
| 369 | ward     := strtointdef(Piece(values, '^', 4), 0); | 
|---|
| 370 | end; | 
|---|
| 371 |  | 
|---|
| 372 | procedure rpcSetClinicDefaults(StartDays, StopDays, mon, tues, wed, thurs, fri, sat, sun: integer); | 
|---|
| 373 | var | 
|---|
| 374 | values: string; | 
|---|
| 375 | begin | 
|---|
| 376 | values := ''; | 
|---|
| 377 | values := values + inttostr(StartDays) + '^'; | 
|---|
| 378 | values := values + inttostr(StopDays) + '^'; | 
|---|
| 379 | values := values + inttostr(mon) + '^'; | 
|---|
| 380 | values := values + inttostr(tues) + '^'; | 
|---|
| 381 | values := values + inttostr(wed) + '^'; | 
|---|
| 382 | values := values + inttostr(thurs) + '^'; | 
|---|
| 383 | values := values + inttostr(fri) + '^'; | 
|---|
| 384 | values := values + inttostr(sat) + '^'; | 
|---|
| 385 | values := values + inttostr(sun) + '^'; | 
|---|
| 386 | CallV('ORWTPP SAVECD', [values]); | 
|---|
| 387 | end; | 
|---|
| 388 |  | 
|---|
| 389 | procedure rpcSetPtListDefaults(PLSource, PLSort: Char; prov, spec, team, ward: integer); | 
|---|
| 390 | var | 
|---|
| 391 | values: string; | 
|---|
| 392 | begin | 
|---|
| 393 | values := ''; | 
|---|
| 394 | values := values + PLSource + '^'; | 
|---|
| 395 | values := values + PLSort + '^'; | 
|---|
| 396 | values := values + inttostr(prov) + '^'; | 
|---|
| 397 | values := values + inttostr(spec) + '^'; | 
|---|
| 398 | values := values + inttostr(team) + '^'; | 
|---|
| 399 | values := values + inttostr(ward) + '^'; | 
|---|
| 400 | CallV('ORWTPP SAVEPLD', [values]); | 
|---|
| 401 | end; | 
|---|
| 402 |  | 
|---|
| 403 | //.............................................................................. | 
|---|
| 404 |  | 
|---|
| 405 | procedure rpcGetPersonalLists(Dest: TStrings); | 
|---|
| 406 | begin | 
|---|
| 407 | CallV('ORWTPP PLISTS', [nil]); | 
|---|
| 408 | MixedCaseList(RPCBrokerV.Results); | 
|---|
| 409 | Dest.Assign(RPCBrokerV.Results); | 
|---|
| 410 | end; | 
|---|
| 411 |  | 
|---|
| 412 | procedure rpcGetAllTeams(Dest: TStrings); | 
|---|
| 413 | begin | 
|---|
| 414 | CallV('ORWTPP PLTEAMS', [nil]); | 
|---|
| 415 | MixedCaseList(RPCBrokerV.Results); | 
|---|
| 416 | Dest.Assign(RPCBrokerV.Results); | 
|---|
| 417 | end; | 
|---|
| 418 |  | 
|---|
| 419 | procedure rpcGetTeams(Dest: TStrings); | 
|---|
| 420 | begin | 
|---|
| 421 | CallV('ORWTPP TEAMS', [nil]); | 
|---|
| 422 | MixedCaseList(RPCBrokerV.Results); | 
|---|
| 423 | Dest.Assign(RPCBrokerV.Results); | 
|---|
| 424 | end; | 
|---|
| 425 |  | 
|---|
| 426 | procedure rpcGetATeams(Dest: TStrings); | 
|---|
| 427 | begin | 
|---|
| 428 | CallV('ORWTPT ATEAMS', [nil]); | 
|---|
| 429 | MixedCaseList(RPCBrokerV.Results); | 
|---|
| 430 | Dest.Assign(RPCBrokerV.Results); | 
|---|
| 431 | end; | 
|---|
| 432 |  | 
|---|
| 433 | procedure rpcDeleteList(aString: String); | 
|---|
| 434 | begin | 
|---|
| 435 | CallV('ORWTPP DELLIST', [aString]); | 
|---|
| 436 | end; | 
|---|
| 437 |  | 
|---|
| 438 | function rpcNewList(aString: String): String; | 
|---|
| 439 | begin | 
|---|
| 440 | result := sCallV('ORWTPP NEWLIST', [aString]); | 
|---|
| 441 | result := MixedCase(result); | 
|---|
| 442 | end; | 
|---|
| 443 |  | 
|---|
| 444 | procedure rpcSaveListChanges(aList: TStrings; aListIEN: integer); | 
|---|
| 445 | begin | 
|---|
| 446 | CallV('ORWTPP SAVELIST', [aList, aListIEN]); | 
|---|
| 447 | end; | 
|---|
| 448 |  | 
|---|
| 449 | procedure rpcListUsersByTeam(Dest: TStrings; teamid: integer); | 
|---|
| 450 | begin | 
|---|
| 451 | CallV('ORWTPT GETTEAM', [teamid]); | 
|---|
| 452 | MixedCaseList(RPCBrokerV.Results); | 
|---|
| 453 | Dest.Assign(RPCBrokerV.Results); | 
|---|
| 454 | end; | 
|---|
| 455 |  | 
|---|
| 456 | procedure rpcRemoveList(aListIEN: integer); | 
|---|
| 457 | begin | 
|---|
| 458 | CallV('ORWTPP REMLIST', [aListIEN]); | 
|---|
| 459 | end; | 
|---|
| 460 |  | 
|---|
| 461 | procedure rpcAddList(aListIEN: integer); | 
|---|
| 462 | begin | 
|---|
| 463 | CallV('ORWTPP ADDLIST', [aListIEN]); | 
|---|
| 464 | end; | 
|---|
| 465 |  | 
|---|
| 466 | //.............................................................................. | 
|---|
| 467 |  | 
|---|
| 468 | function rpcGetCombo: TStrings; | 
|---|
| 469 | begin | 
|---|
| 470 | CallV('ORWTPP GETCOMBO', [nil]); | 
|---|
| 471 | MixedCaseList(RPCBrokerV.Results); | 
|---|
| 472 | result := RPCBrokerV.Results; | 
|---|
| 473 | end; | 
|---|
| 474 |  | 
|---|
| 475 | procedure rpcSetCombo(aList: TStrings); | 
|---|
| 476 | begin | 
|---|
| 477 | CallV('ORWTPP SETCOMBO', [aList]); | 
|---|
| 478 | end; | 
|---|
| 479 |  | 
|---|
| 480 | //.............................................................................. | 
|---|
| 481 |  | 
|---|
| 482 | procedure rpcGetDefaultReportsSetting(var int1: integer; var int2: integer; var int3: integer); | 
|---|
| 483 | var | 
|---|
| 484 | values: string; | 
|---|
| 485 | startoffset,stopoffset: string; | 
|---|
| 486 | begin | 
|---|
| 487 | values := sCallV('ORWTPD GETDFLT', [nil]); | 
|---|
| 488 | if length(values)=0 then | 
|---|
| 489 | exit; | 
|---|
| 490 | startoffset := Piece(values,';',1); | 
|---|
| 491 | delete(startoffset,1,1); | 
|---|
| 492 | stopoffset := Piece(values,';',2); | 
|---|
| 493 | delete(stopoffset,1,1); | 
|---|
| 494 | int1 := strtointdef(startoffset,0); | 
|---|
| 495 | int2 := strtointdef(stopoffset,0); | 
|---|
| 496 | int3:= strtointdef(Piece(values, ';', 3), 100);  // max occurences | 
|---|
| 497 | end; | 
|---|
| 498 |  | 
|---|
| 499 | procedure rpcDeleteUserLevelReportsSetting; | 
|---|
| 500 | begin | 
|---|
| 501 | sCallV('ORWTPD DELDFLT',[nil]); | 
|---|
| 502 | end; | 
|---|
| 503 |  | 
|---|
| 504 | procedure rpcActiveDefaultSetting; | 
|---|
| 505 | begin | 
|---|
| 506 | sCallV('ORWTPD ACTDF',[nil]); | 
|---|
| 507 | end; | 
|---|
| 508 |  | 
|---|
| 509 | procedure rpcSetDefaultReportsSetting(aString: string); | 
|---|
| 510 | begin | 
|---|
| 511 | sCallV('ORWTPD SUDF',[aString]); | 
|---|
| 512 | end; | 
|---|
| 513 |  | 
|---|
| 514 | procedure rpcSetIndividualReportSetting(aString1:string; aString2:string); | 
|---|
| 515 | begin | 
|---|
| 516 | sCallV('ORWTPD SUINDV',[aString1,aString2]); | 
|---|
| 517 | end; | 
|---|
| 518 |  | 
|---|
| 519 | procedure rpcRetrieveDefaultSetting(var int1: integer; var int2: integer; var int3: integer; var msg: string); | 
|---|
| 520 | var | 
|---|
| 521 | values: string; | 
|---|
| 522 | startoffset,stopoffset: string; | 
|---|
| 523 | begin | 
|---|
| 524 | values :=  sCallV('ORWTPD RSDFLT',[nil]); | 
|---|
| 525 | if length(values)=0 then | 
|---|
| 526 | begin | 
|---|
| 527 | msg := 'NODEFAULT'; | 
|---|
| 528 | exit; | 
|---|
| 529 | end; | 
|---|
| 530 | startoffset := Piece(values,';',1); | 
|---|
| 531 | delete(startoffset,1,1); | 
|---|
| 532 | stopoffset := Piece(values,';',2); | 
|---|
| 533 | delete(stopoffset,1,1); | 
|---|
| 534 | int1 := strtointdef(startoffset,0); | 
|---|
| 535 | int2 := strtointdef(stopoffset,0); | 
|---|
| 536 | int3:= strtointdef(Piece(values, ';', 3), 100);  // max occurences | 
|---|
| 537 | end; | 
|---|
| 538 |  | 
|---|
| 539 | procedure rpcGetRangeForMeds(var startDt, stopDt: TFMDateTime); | 
|---|
| 540 | var | 
|---|
| 541 | rst,sDt,eDt: string; | 
|---|
| 542 | td: TFMDateTime; | 
|---|
| 543 | begin | 
|---|
| 544 | rst := SCallV('ORWTPD GETOCM',[nil]); | 
|---|
| 545 | sDt := Piece(rst,';',1); | 
|---|
| 546 | if lowerCase(sDt) <> 't' then | 
|---|
| 547 | Delete(sDt,1,1); | 
|---|
| 548 | eDt := Piece(rst,';',2); | 
|---|
| 549 | if lowerCase(eDt) <> 't' then | 
|---|
| 550 | Delete(eDt,1,1); | 
|---|
| 551 | td := FMToday; | 
|---|
| 552 | if Length(sDt)>0 then | 
|---|
| 553 | startDt := FMDateTimeOffsetBy(td, StrToIntDef(sDt,0)); | 
|---|
| 554 | if Length(eDt)>0 then | 
|---|
| 555 | stopDt  := FMDateTimeOffsetBy(td, StrToIntDef(eDt,0)); | 
|---|
| 556 | end; | 
|---|
| 557 |  | 
|---|
| 558 | procedure rpcPutRangeForMeds(TheVal: string); | 
|---|
| 559 | begin | 
|---|
| 560 | SCallV('ORWTPD PUTOCM',[TheVal]); | 
|---|
| 561 | end; | 
|---|
| 562 |  | 
|---|
| 563 | procedure rpcGetRangeForEncs(var StartDays, StopDays: integer; DefaultParams: Boolean); | 
|---|
| 564 | var | 
|---|
| 565 | Start, Stop, Values: string; | 
|---|
| 566 | begin | 
|---|
| 567 | if DefaultParams then | 
|---|
| 568 | Values := SCallV('ORWTPD1 GETEFDAT',[nil]) | 
|---|
| 569 | else | 
|---|
| 570 | Values := SCallV('ORWTPD1 GETEDATS',[nil]); | 
|---|
| 571 | Start := Piece(Values, '^', 1); | 
|---|
| 572 | Stop  := Piece(Values, '^', 2); | 
|---|
| 573 | StartDays := StrToIntDef(Start, 0); | 
|---|
| 574 | StopDays  := StrToIntDef(Stop, 0); | 
|---|
| 575 | end; | 
|---|
| 576 |  | 
|---|
| 577 | procedure rpcPutRangeForEncs(StartDays, StopDays: string); | 
|---|
| 578 | var | 
|---|
| 579 | values: string; | 
|---|
| 580 | begin | 
|---|
| 581 | values := ''; | 
|---|
| 582 | values := values + StartDays + '^'; | 
|---|
| 583 | values := values + StopDays; | 
|---|
| 584 | CallV('ORWTPD1 PUTEDATS',[values]); | 
|---|
| 585 | end; | 
|---|
| 586 |  | 
|---|
| 587 | procedure rpcGetEncFutureDays(var FutureDays: string); | 
|---|
| 588 | begin | 
|---|
| 589 | FutureDays := SCallV('ORWTPD1 GETEAFL',[nil]); | 
|---|
| 590 | end; | 
|---|
| 591 |  | 
|---|
| 592 | end. | 
|---|