Changeset 1679 for cprs/trunk/CPRS-Chart/fReview.pas
- Timestamp:
- May 7, 2015, 12:34:29 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/fReview.pas
r830 r1679 255 255 Result := True; 256 256 if Changes.Count = 0 then Exit; 257 if assigned(frmReview) then Exit; 257 258 frmReview := TfrmReview.Create(Application); 258 259 try … … 299 300 Changes.OnRemove := nil; {**RV**} 300 301 frmReview.Release; 302 frmReview := nil; 301 303 end; 302 304 end; … … 406 408 PrevGrpName, temp: string; 407 409 displayHeader, displaySpacer, otherUserOrders: boolean; 408 410 I, ColHeight: Integer; 409 411 begin 410 412 tempOrderList := TStringList.Create; … … 503 505 end; 504 506 end; 507 OrderGrp.Sorted := false; 505 508 end; {if Orders} 506 509 // determine the appropriate panel to display … … 592 595 end; 593 596 end; 597 598 if lstReview.Count > 0 then begin 599 for I := 1 to lstReview.Count - 1 do begin 600 lstReviewMeasureItem(lstReview, I, ColHeight); 601 lstReview.Perform(LB_SETITEMHEIGHT,I,ColHeight); 602 end; 603 end; 604 RedrawWindow(lstReview.Handle, nil, 0, RDW_ERASE or RDW_FRAME or RDW_INVALIDATE or RDW_ALLCHILDREN); 605 594 606 end; {BuildFullList} 595 607 … … 891 903 OrderList, OrderPrintList: TStringList; 892 904 SaveCoPay: boolean; 893 DigSigErr, DigStoreErr, CryptoChecked, displayEncSwitch : Boolean;905 DigSigErr, DigStoreErr, CryptoChecked, displayEncSwitch, DelayOnly: Boolean; 894 906 SigData, SigUser, SigDrugSch, SigDEA: string; 895 907 cSignature, cHashData, cCrlUrl, cErr, WardName, ASvc: string; 896 908 cProvDUZ: Int64; 897 AList, ClinicList, DCList,WardList: TStringList;909 AList, ClinicList, WardList: TStringList; 898 910 IsOk, ContainsIMOOrders, DoNotPrint : Boolean; 899 EncLocName, EncLocText : string;911 EncLocName, EncLocText, tempInpLoc: string; 900 912 EncLocIEN: integer; 901 913 EncDT: TFMDateTime; … … 943 955 EncLocIEN := 0; 944 956 DoNotPrint := False; 957 tempInpLoc := ''; 958 DelayOnly := false; 945 959 if BILLING_AWARE then 946 960 begin … … 1222 1236 if (cmdOk.Caption = 'Sign') or (cmdOK.Caption = 'OK') and (not frmFrame.TimedOut) then 1223 1237 begin 1224 if ((Patient.Inpatient = false) and (frmClinicWardMeds.rpcIsPatientOnWard(patient.DFN))) or 1238 tempInpLoc := frmPrintLocation.rpcIsPatientOnWard(patient.dfn); 1239 if ((Patient.Inpatient = false) and (tempInpLoc <> '')) or 1225 1240 ((Patient.Inpatient = True) and (Encounter.Location <> Patient.Location)) or 1226 1241 ((Patient.Inpatient = True) and (Encounter.Location = Patient.Location) and 1227 (encounter.Location <> uCore.TempEncounterLoc) and (uCore.TempEncounterLoc <> 0)) then1228 //or ((frmFrame.DoNotChangeEncWindow = true) and (encounter.Location = uCore.TempOutEncounterLoc)) then1242 (encounter.Location <> uCore.TempEncounterLoc) and (uCore.TempEncounterLoc <> 0)) 1243 or((Patient.Inpatient) and (tempInpLoc <> '') and (Piece(tempInpLoc, U, 2) <> InttoStr(Encounter.location))) then 1229 1244 begin 1230 if Encounter.Location <> Patient.Location then 1245 if (Encounter.Location <> Patient.Location) or 1246 ((tempInpLoc <> '') and ((InttoStr(Encounter.location)) <> (Piece(tempInpLoc,U,2)))) then 1231 1247 begin 1232 1248 EncLocName := Encounter.LocationName; … … 1246 1262 if frmFrame.mnuFile.Tag = 0 then displayEncSwitch := false 1247 1263 else displayEncSwitch := true; 1248 1249 (*displayEncSwitch := False; 1250 if (frmFrame.mnuFile.Items[frmFrame.mnuFile.menuIndex].Caption = 'Refresh Patient &Information') or 1251 (frmFrame.mnuFile.Items[frmFrame.mnuFile.menuIndex].Caption = '&Review/Sign Changes...') then 1252 displayEncSwitch := True; *) 1253 DCList := TStringList.Create; 1264 if Encounter.Location = 0 then 1265 begin 1266 DisplayEncSwitch := True; 1267 DelayOnly := True; 1268 end; 1254 1269 for i := 0 to lstReview.Items.Count-1 do 1255 1270 begin 1271 //disregard orders that are not signed 1256 1272 if (lstReview.Checked[i] = false) and (lstReview.State[i] <> cbGrayed) then continue; 1257 1273 TempChangeItem := TChangeItem(lstReview.Items.Objects[i]); 1274 //DC Orders should print at the ward location 1258 1275 if TempChangeItem.DCOrder = True then 1259 1276 begin 1260 DCList.Add(tempChangeItem.ID);1277 WardList.Add(tempChangeItem.ID); 1261 1278 continue; 1262 1279 end; 1280 //disregard Non-VA Meds orders 1263 1281 if TempChangeItem.OrderDG = NONVAMEDGROUP then continue; 1264 1282 if TempChangeItem.OrderDG = 'Clinic Orders' then ContainsIMOORders := true; 1265 1283 if (tempChangeItem.OrderDG = '') then continue; 1284 //Delay orders should be printed when the order is release to service not when the order is sign 1266 1285 if tempChangeItem.Delay = True then continue; 1267 1286 OrderPrintList.Add(tempChangeItem.ID + ':' + tempChangeItem.Text); 1268 end;1269 if OrderPrintList.Count > 0then1287 end; 1288 if (OrderPrintList.Count > 0) and (DelayOnly = False) then 1270 1289 frmPrintLocation.PrintLocation(OrderPrintList, EncLocIEN, EncLocName, EncLocText, EncDT, EncVC, ClinicList, 1271 1290 WardList, wardIEN, wardName, ContainsIMOOrders, displayEncSwitch) 1272 else 1291 //Only Display encounter switch form if staying in the patient chart 1292 else if displayEncSwitch = true then 1273 1293 begin 1274 frmPrintLocation.SwitchEncounterLoction(EncLocIEN, EncLocName, EncLocText, EncDT, EncVC);1275 fframe.frmFrame.OrderPrintForm := True;1276 DoNotPrint := True;1294 frmPrintLocation.SwitchEncounterLoction(EncLocIEN, EncLocName, EncLocText, EncDT, EncVC); 1295 fframe.frmFrame.OrderPrintForm := True; 1296 DoNotPrint := True; 1277 1297 end; 1278 1279 if DCList.Count > 0 then 1280 begin 1281 for i := 0 to DCList.Count - 1 do 1282 WardList.Add(DCList.Strings[i]); 1283 if (WardIEN = 0) and (WardName = '') then 1284 CurrentLocationForPatient(Patient.DFN, WardIEN, WardName, ASvc); 1285 end; 1286 if DCList <> nil then DCList.Free; 1287 end; 1288 end; 1289 if (cmdOk.Caption = 'Don''t Sign') and (not frmFrame.TimedOut) then 1298 if (WardIEN = 0) and (WardName = '') then CurrentLocationForPatient(Patient.DFN, WardIEN, WardName, ASvc); 1299 //All other scenarios should not print 1300 if (ClinicList.count = 0) and (WardList.count = 0) then DoNotPrint := True; 1301 end; 1302 end; //CmdOK.Caption = Sign 1303 if (cmdOk.Caption = 'Don''t Sign') and (not frmFrame.TimedOut) and (frmFrame.mnuFile.Tag <> 0) then 1290 1304 begin 1291 if ((Patient.Inpatient = false) and (frmClinicWardMeds.rpcIsPatientOnWard(patient.DFN))) or 1305 tempInpLoc := frmPrintLocation.rpcIsPatientOnWard(patient.dfn); 1306 if ((Patient.Inpatient = false) and (tempInpLoc <> '')) or 1292 1307 ((Patient.Inpatient = True) and (Encounter.Location <> Patient.Location)) or 1293 1308 ((Patient.Inpatient = True) and (Encounter.Location = Patient.Location) and 1294 (encounter.Location <> uCore.TempEncounterLoc) and (uCore.TempEncounterLoc <> 0)) then1295 //or ((frmFrame.DoNotChangeEncWindow = true) and (encounter.Location = uCore.TempOutEncounterLoc)) then1309 (encounter.Location <> uCore.TempEncounterLoc) and (uCore.TempEncounterLoc <> 0)) 1310 or((Patient.Inpatient) and (tempInpLoc <> '') and (Piece(tempInpLoc, U, 2) <> InttoStr(Encounter.location))) then 1296 1311 begin 1297 if Encounter.Location <> Patient.Location then 1312 if (Encounter.Location <> Patient.Location) or 1313 ((tempInpLoc <> '') and ((InttoStr(Encounter.location)) <> (Piece(tempInpLoc,U,2)))) then 1298 1314 begin 1299 1315 EncLocName := Encounter.LocationName; … … 1317 1333 uCore.TempEncounterLoc := 0; 1318 1334 uCore.TempEncounterLocName := ''; 1335 tempInpLoc := ''; 1319 1336 end; 1320 1337 //hds7591 Clinic/Ward movement. … … 1324 1341 SendOrders(OrderList, ESCode); {*KCM*} 1325 1342 1343 //CQ #15813 Modired code to look for error string mentioned in CQ and change strings to conts - JCS 1326 1344 with OrderList do for i := 0 to Count - 1 do 1327 1345 begin … … 1331 1349 if not FSilent then 1332 1350 begin 1333 if Piece(OrderList[i],U,4) = 'Invalid Pharmacy order number'then1351 if Piece(OrderList[i],U,4) = TX_SAVERR_PHARM_ORD_NUM_SEARCH_STRING then 1334 1352 InfoBox(TX_SAVERR1 + Piece(OrderList[i], U, 4) + TX_SAVERR2 + ChangeItem.Text + CRLF + CRLF + 1335 'The changes to this order have not been saved. You must contact Pharmacy to complete any action on this order.', 1336 TC_SAVERR, MB_OK) 1337 else 1353 TX_SAVERR_PHARM_ORD_NUM, TC_SAVERR, MB_OK) 1354 else if Piece(OrderList[i],U,4) = TX_SAVERR_IMAGING_PROC_SEARCH_STRING then 1355 InfoBox(TX_SAVERR1 + Piece(OrderList[i], U, 4) + TX_SAVERR2 + ChangeItem.Text + CRLF + CRLF + 1356 TX_SAVERR_IMAGING_PROC, TC_SAVERR, MB_OK) 1357 else 1338 1358 InfoBox(TX_SAVERR1 + Piece(OrderList[i], U, 4) + TX_SAVERR2 + ChangeItem.Text, 1339 1359 TC_SAVERR, MB_OK); … … 1366 1386 if (ClinicList.Count > 0) or (WardList.Count > 0) then 1367 1387 PrintOrdersOnSignReleaseMult(OrderList, CLinicList, WardList, Nature, EncLocIEN, WardIEN, EncLocName, wardName) 1368 else if DoNotPrint = false then PrintOrdersOnSignRelease(OrderList, Nature, PrintLoc);1388 else if DoNotPrint = False then PrintOrdersOnSignRelease(OrderList, Nature, PrintLoc); 1369 1389 end; 1370 1390 StatusText(''); … … 1465 1485 begin 1466 1486 ARect := ItemRect(Index); 1487 ARect.Left := lstReview.CheckWidth; 1467 1488 Canvas.FillRect(ARect); 1468 1489 x := FilteredString(Items[Index]); … … 2033 2054 if (lstReview.Top + lstReview.Height) > BottomEdge then 2034 2055 lstReview.Height := BottomEdge - lstReview.Top; 2035 //INITIALIZATIONS 2056 2057 //INITIALIZATIONS 2036 2058 Paste1.Enabled := false; 2037 2059 fReview.srcOrderID := ''; … … 2165 2187 2166 2188 procedure TfrmReview.FormResize(Sender: TObject); 2189 VAR 2190 I, ColHeight: Integer; 2167 2191 begin 2168 2192 inherited; 2169 lstReview.Invalidate; 2193 if lstReview.Count > 0 then begin 2194 for I := 1 to lstReview.Count - 1 do begin 2195 lstReviewMeasureItem(lstReview, I, ColHeight); 2196 lstReview.Perform(LB_SETITEMHEIGHT,I,ColHeight); 2197 end; 2198 end; 2199 RedrawWindow(lstReview.Handle, nil, 0, RDW_ERASE or RDW_FRAME or RDW_INVALIDATE or RDW_ALLCHILDREN); 2170 2200 end; 2171 2201
Note:
See TracChangeset
for help on using the changeset viewer.