Changeset 1679 for cprs/trunk/CPRS-Chart/fPrintLocation.pas
- Timestamp:
- May 7, 2015, 12:34:29 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/fPrintLocation.pas
r830 r1679 25 25 cboEncLoc: TComboBox; 26 26 procedure pnlFieldsResize(Sender: TObject); 27 //procedure FormCreate(Sender: TObject);28 27 procedure orderGridMouseDown(Sender: TObject; Button: TMouseButton; 29 28 Shift: TShiftState; X, Y: Integer); … … 38 37 procedure FormResize(Sender: TObject); 39 38 procedure FormClose(Sender: TObject; var Action: TCloseAction); 39 procedure FormDestroy(Sender: TObject); 40 40 private 41 41 { Private declarations } 42 CLoc,WLoc: string; 43 CIEN,WIEN: integer; 42 44 function ValFor(FieldID, ARow: Integer): string; 43 45 procedure ShowEditor(ACol, ARow: Integer; AChar: Char); 44 46 procedure ProcessClinicOrders(WardList, ClinicList: TStringList; WardIEN, ClinicIEN: integer; ContainsIMO: boolean); 45 47 procedure rpcChangeOrderLocation(pOrderList:TStringList; ContainsIMO: boolean); 48 function ClinicText(ALoc: integer): string; 46 49 public 47 50 { Public declarations } 48 CLoc,WLoc: string;49 51 CloseOK: boolean; 50 52 DisplayOrders: boolean; … … 53 55 var wardIEN: integer; var wardLocation: string; ContainsIMOOrders: boolean; displayEncSwitch: boolean = false); 54 56 procedure SwitchEncounterLoction(pEncounterLoc: integer; pEncounterLocName, pEncounterLocText: string; pEncounterDT: TFMDateTime; pEncounterVC: Char); 57 function rpcIsPatientOnWard(Patient: string): string; 55 58 end; 56 59 … … 73 76 COL_LOCATION = 2; 74 77 TAB = #9; 75 LOCATION_CHANGE_1 = 'This patient is currently admitted to ward'; 76 LOCATION_CHANGE_2 = 'These orders are written at clinic'; 77 LOCATION_CHANGE_3 = 'What Location are these orders associated with?'; 78 LOCATION_CHANGE_4 = 'The encounter location is currently at clinic'; 78 LOCATION_CHANGE_1 = 'The patient is admitted to ward'; 79 LOCATION_CHANGE_2 = 'You have the chart open to a clinic location of'; 80 LOCATION_CHANGE_2W = 'You have the chart open with the patient still on ward'; 81 LOCATION_CHANGE_3 = 'What Location are these orders associated with?'; 82 LOCATION_CHANGE_4 = 'The patient has now been admitted to ward: '; 79 83 80 84 … … 179 183 end; 180 184 185 procedure TfrmPrintLocation.FormDestroy(Sender: TObject); 186 begin 187 inherited; 188 frmPrintLocation := nil; 189 end; 190 181 191 procedure TfrmPrintLocation.FormResize(Sender: TObject); 182 192 begin … … 185 195 end; 186 196 187 (*procedure TfrmPrintLocation.FormCreate(Sender: TObject); 188 var 189 ListCount: Integer; 190 x: string; 191 begin 192 inherited; 193 with OrderGrid do 194 begin 195 ColWidths[0] := 8; 196 ColWidths[1] := 50; 197 ColWidths[2] := 50; 198 Cells[1,0] := 'Order'; 199 Cells[2,0] := 'Location'; 200 end; 201 //TAccessibleStringGrid.WrapControl(OrderGrid); 202 203 end; *) 197 function TfrmPrintLocation.ClinicText(ALoc: integer): string; 198 begin 199 if SCallV('ORIMO ISCLOC', [ALoc]) = '1' then Result := LOCATION_CHANGE_2 200 else Result := LOCATION_CHANGE_2W 201 end; 204 202 205 203 procedure TfrmPrintLocation.OrderGridDrawCell(Sender: TObject; ACol, … … 251 249 if frmPrintLocation.DisplayOrders = false then 252 250 begin 253 lblText.Caption := lblText.Caption + LOCATION_CHANGE_4 + ': ' + frmPrintLocation.CLoc + CRLF; 251 if frmPrintlocation.CLoc = '' then 252 begin 253 lblText.Caption := LOCATION_CHANGE_4 + frmPrintLocation.WLoc + CRLF; 254 cboEncLoc.Enabled := false; 255 lblEncounter.Enabled := false; 256 end 257 else lblText.Caption := lblText.Caption + ClinicText(frmPrintLocation.CIEN) + ': ' + frmPrintLocation.CLoc + CRLF; 254 258 btnClinic.Visible := false; 255 259 btnWard.Visible := false; … … 265 269 else 266 270 begin 267 lblText.Caption := lblText.Caption + LOCATION_CHANGE_2+ ': ' + frmPrintLocation.CLoc + CRLF + CRLF;271 lblText.Caption := lblText.Caption + ClinicText(frmPrintLocation.CIEN) + ': ' + frmPrintLocation.CLoc + CRLF + CRLF; 268 272 lblText.Caption := lblText.Caption + LOCATION_CHANGE_3; 269 lblText.Caption := lblText.Caption + CRLF + 'One clinic location allowed; ' + frmPrintLocation.CLoc + ' will be used';273 //lblText.Caption := lblText.Caption + CRLF + 'One clinic location allowed; ' + frmPrintLocation.CLoc + ' will be used'; 270 274 btnClinic.Caption := 'All ' + frmPrintLocation.CLoc; 271 275 btnWard.Caption := 'All ' + frmPrintLocation.WLoc; … … 335 339 begin 336 340 frmPrintLocation := TfrmPrintLocation.Create(Application); 341 try 337 342 frmPrintLocation.DisplayOrders := true; 338 343 frmPrintLocation.CloseOK := false; … … 345 350 frmPrintLocation.Cloc := pEncounterLocName; 346 351 frmPrintLocation.WLoc := WardLocation; 352 frmPrintLocation.CIEN := pEncounterLoc; 353 frmPrintLocation.WIEN := wardIEN; 347 354 ResizeAnchoredFormToFont(frmPrintLocation); 348 355 frmPrintLocation.orderGrid.DefaultRowHeight := frmPrintLocation.cbolocation.Height; … … 369 376 if frmPrintLocation.cboEncLoc.ItemIndex = cidx then 370 377 begin 371 //Encounter.Location := pEncounterLoc;372 //Encounter.LocationName := pEncounterLocName;373 //Encounter.LocationText := pEncounterLocText;374 378 uCore.Encounter.EncounterSwitch(pEncounterLoc, pEncounterLocName, pEncounterLocText, pEncounterDT, pEncounterVC); 375 379 fframe.frmFrame.DisplayEncounterText; 376 //fframe.frmFrame.DoNotChangeEncWindow := true;377 380 fframe.frmFrame.OrderPrintForm := True; 378 381 end 379 382 else if frmPrintLocation.cboEncLoc.ItemIndex = widx then 380 383 begin 381 uCore.Encounter.EncounterSwitch(WardIEN, WardLocation, '', Patient.AdmitTime, 'H'); 382 (* Encounter.Location := WardIEN; 383 Encounter.DateTime := Patient.AdmitTime; 384 Encounter.VisitCategory := 'H'; 385 Encounter.Location := WardIEN; 386 Encounter.LocationName := WardLocation; *) 387 //fframe.frmFrame.DoNotChangeEncWindow := false; 384 uCore.Encounter.EncounterSwitch(WardIEN, WardLocation, WardLocation, Patient.AdmitTime, 'H'); 388 385 fFrame.frmFrame.DisplayEncounterText; 389 386 end; 390 frmPrintLocation.Close; 387 finally 388 frmPrintLocation.Destroy; 389 end; 391 390 end; 392 391 … … 422 421 423 422 423 function TfrmPrintLocation.rpcIsPatientOnWard(Patient: string): string; 424 begin 425 //Ward Loction Name^Ward Location IEN 426 result := sCallV('ORWDX1 PATWARD',[Patient]); 427 end; 428 424 429 procedure TfrmPrintLocation.ShowEditor(ACol, ARow: Integer; AChar: Char); 425 430 var 426 431 tmpText: string; 427 //Index: integer;428 432 429 433 procedure PlaceControl(AControl: TWinControl); … … 455 459 begin 456 460 inherited; 457 //if AChar = ' ' then AChar := #0;458 461 if ARow = 0 then Exit; 459 //with OrderGrid do if (Acol > COL_ORDER) and (ValFor(COL_ORDER, ARow) = '') then Exit;460 //if (ACol = COL_Order) and (ARow > 1) and (ValFor(COL_Order, ARow-1) = '') then Exit;461 462 Case ACol of 462 463 COL_LOCATION: begin … … 475 476 Asvc, WardLocation: string; 476 477 begin 477 //frmPrintLocation.Caption := 'Refresh Encounter Location Form';478 478 frmPrintLocation := TfrmPrintLocation.Create(Application); 479 try 479 480 frmPrintLocation.DisplayOrders := false; 480 481 frmPrintLocation.CloseOK := false; … … 484 485 frmPrintLocation.Cloc := pEncounterLocName; 485 486 frmPrintLocation.WLoc := WardLocation; 487 frmPrintLocation.CIEN := pEncounterLoc; 488 frmPrintLocation.WIEN := wardIEN; 486 489 ResizeAnchoredFormToFont(frmPrintLocation); 487 490 frmPrintLocation.cboEncLoc.Items.Add(frmPrintLocation.CLoc); … … 491 494 cidx := frmPrintLocation.cboEncLoc.Items.IndexOf(frmPrintLocation.CLoc); 492 495 widx := frmPrintLocation.cboEncLoc.Items.IndexOf(frmPrintLocation.WLoc); 496 if frmPrintLocation.cboEncLoc.Enabled = FALSE then frmPrintLocation.cboEncLoc.ItemIndex := widx; 497 493 498 if frmPrintLocation.cboEncLoc.ItemIndex = cidx then 494 499 begin … … 497 502 Encounter.LocationText := pEncounterLocText; 498 503 fframe.frmFrame.DisplayEncounterText; 499 //fframe.frmFrame.DoNotChangeEncWindow := true;500 504 end 501 505 else if frmPrintLocation.cboEncLoc.ItemIndex = widx then 502 506 begin 503 507 uCore.Encounter.EncounterSwitch(WardIEN, WardLocation, '', Patient.AdmitTime, 'H'); 504 (*Encounter.Location := WardIEN;505 Encounter.LocationName := WardLocation; *)506 //fframe.frmFrame.DoNotChangeEncWindow := false;507 508 fFrame.frmFrame.DisplayEncounterText; 508 509 end; 509 frmPrintLocation.Close; 510 finally 511 frmPrintLocation.Destroy; 512 end; 510 513 end; 511 514
Note:
See TracChangeset
for help on using the changeset viewer.