Changeset 1679 for cprs/trunk/CPRS-Chart/Orders/fODBBank.pas
- Timestamp:
- May 7, 2015, 12:34:29 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/Orders/fODBBank.pas
r829 r1679 57 57 txtImmedColl: TCaptionEdit; 58 58 pnlCollTimeButton: TKeyClickPanel; 59 lblTNS: TLabel; 60 lblNoBloodReq: TLabel; 59 61 cmdImmedColl: TSpeedButton; 60 lblTNS: TLabel;62 Splitter1: TSplitter; 61 63 procedure FormCreate(Sender: TObject); 62 64 procedure cboAvailTestSelect(Sender: TObject); … … 97 99 procedure cboModifiersChange(Sender: TObject); 98 100 procedure lvSelectionListClick(Sender: TObject); 99 procedure cboAvailCompChange(Sender: TObject);100 101 procedure cboCollTimeChange(Sender: TObject); 101 102 procedure memDiagCommentChange(Sender: TObject); 102 103 procedure cboUrgencyExit(Sender: TObject); 104 procedure pnlBloodComponentsEnter(Sender: TObject); 105 procedure pnlDiagnosticTestsEnter(Sender: TObject); 106 procedure pnlDiagnosticTestsExit(Sender: TObject); 107 procedure pnlBloodComponentsExit(Sender: TObject); 108 procedure pnlBloodComponentsClick(Sender: TObject); 109 procedure pnlDiagnosticTestsClick(Sender: TObject); 110 procedure cboCollTypeClick(Sender: TObject); 111 procedure cboAvailTestEnter(Sender: TObject); 112 procedure cboCollTypeEnter(Sender: TObject); 113 procedure txtImmedCollEnter(Sender: TObject); 114 procedure calCollTimeEnter(Sender: TObject); 115 procedure cboCollTimeEnter(Sender: TObject); 116 procedure cboModifiersEnter(Sender: TObject); 117 procedure calWantTimeEnter(Sender: TObject); 118 procedure cboAvailCompEnter(Sender: TObject); 119 procedure FormShow(Sender: TObject); 103 120 protected 104 121 FCmtTypes: TStringList ; … … 244 261 ALabTest: TLabTest; 245 262 UserHasLRLABKey: boolean; 263 uChangingMSBOS: boolean; 246 264 LRFZX : string; //the default collection type (LC,WC,SP,I) 247 265 LRFSAMP : string; //the default sample (ptr) … … 293 311 uSelUrgency := ''; 294 312 uSelSurgery := 0; 313 uChangingMSBOS := false; 295 314 TabResults.Caption := 'Lab Results'; 296 315 edtResults.Lines.Clear; … … 314 333 UserHasLRLABKey := User.HasKey('LRLAB'); 315 334 AllowQuickOrder := True; 335 if GetDiagnosticPanelLocation then 336 begin 337 pnlDiagnosticTests.Left := 0; 338 pnlBloodComponents.Left := (pnlDiagnosticTests.Width + 10); 339 pnlDiagnosticTests.TabOrder := 0; 340 pnlBloodComponents.TabOrder := 1; 341 end 342 else 343 begin 344 pnlBloodComponents.Left := 0; 345 pnlDiagnosticTests.Left := (pnlBloodComponents.Width + 10); 346 pnlBloodComponents.TabOrder := 0; 347 pnlDiagnosticTests.TabOrder := 1; 348 end; 316 349 StatusText('Loading Dialog Definition'); 317 350 FCmtTypes := TStringList.Create; … … 342 375 else 343 376 cboCollType.SelectByID('SP'); 344 SetupCollTimes(cboCollType.ItemID); 345 StatusText('Initializing List of Tests'); 346 FVbecLookup := 'S.VBT'; 347 cboAvailTest.InitLongList(''); //Populates cboAvailTest control based on S.VBT xref 348 end; 377 //SetupCollTimes(cboCollType.ItemID); 378 end; 379 cboAvailTest.Clear; 380 aList.Clear; 381 GetDiagnosticTests(aList); //Get Tests in right order 382 for i := 0 to aList.Count - 1 do 383 cboAvailTest.Items.Add(aList[i]); 349 384 cboAvailComp.Clear; 350 385 aList.Clear; … … 365 400 AList.Clear; 366 401 ExtractUrgencies(uUrgencyList, uVBECList); 367 ExtractTNSOrders(uTNSOrders, uVBECList);402 if not(self.EvtID > 0) then ExtractTNSOrders(uTNSOrders, uVBECList); 368 403 LoadUrgencies(cboUrgency); 369 404 ExtractModifiers(uModifierList, uVBECList); … … 371 406 LoadModifiers(cboModifiers); 372 407 LoadReasons(cboReasons); 373 calWantTime.Text := 'NOW'; //FormatFMDateTime('mmm dd,yyyy@hh:nn',DateTimeToFMDateTime(Now));374 408 pgeProduct.TabIndex := TI_INFO; 375 409 lvSelectionList.Column[0].Width := 240; … … 378 412 DisableComponentControls; 379 413 DisableDiagTestControls; 414 pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 380 415 pgeProduct.ActivePageIndex := TI_INFO; 381 416 StatusText(''); … … 425 460 AnInstance, CurAdd: Integer; 426 461 AResponse: TResponse; 427 i, j, k, aTNS, aTNSDays, getTest, TestAdded: integer;428 aStr, aTestYes, aName, aTypeScreen, aSpecimen, a Modifier, sub, sub1, x, aTNSString: string;462 i, j, k, aTNS, getTest, TestAdded, aMSBOSContinue: integer; 463 aStr, aTestYes, aName, aTypeScreen, aSpecimen, aSpecimenUID, aSpecimenReq, aModifier, sub, sub1, x, aTNSString, aUrgText: string; 429 464 ListItem: TListItem; 430 aList : TStringList;465 aList, cList: TStringList; 431 466 aTests: TStringList; 467 xLabTest: TLabTest; 468 aGotTNS : Boolean; 432 469 begin 433 470 inherited; 434 471 aList := TStringList.Create; 472 cList := TStringList.Create; 435 473 aTests:= TStringList.Create; 474 aGotTNS := false; 436 475 try 437 476 FOrderAction := OrderAction; … … 439 478 sub1 := ''; 440 479 aTypeScreen := ''; 441 aSpecimen := '^'; 480 aSpecimen := ''; 481 aSpecimenUID := ''; 482 aSpecimenReq := ''; 442 483 aModifier := ''; 443 484 if OrderAction in [ORDER_COPY, ORDER_EDIT, ORDER_QUICK] then with Responses, ALabTest do 444 485 begin 486 pgeProduct.ActivePageIndex := TI_COMPONENT; 445 487 AnInstance := NextInstance('ORDERABLE', 0); 446 488 while AnInstance > 0 do … … 453 495 begin 454 496 SetControl(cboAvailTest, 'ORDERABLE', AnInstance); 455 ALabTest := TLabTest.Create(cboAvailTest.ItemID, Responses); 497 changing := true; 498 cboAvailTestSelect(Self); 499 changing := false; 456 500 end 457 501 else … … 468 512 SetControl(chkConsent, 'YN', AnInstance); 469 513 //DetermineCollectionDefaults(Responses); 470 SetControl(cboCollType, 'COLLECT', AnInstance); 471 SetControl(cboCollTime, 'START', AnInstance); 472 SetupCollTimes(cboCollType.ItemID); 514 SetControl(cboSurgery, 'MISC', AnInstance); 473 515 SetControl(cboUrgency, 'URGENCY', AnInstance); 474 SetControl(cboSurgery, 'MISC', AnInstance); 516 if cboUrgency.ItemIEN = 0 then 517 begin 518 if StrToIntDef(LRFURG, 0) > 0 then 519 cboUrgency.SelectByID(LRFURG) 520 else if (Urgency = 0) and (cboUrgency.Items.Count = 1) then 521 cboUrgency.ItemIndex := 0; 522 end; 475 523 Urgency := cboUrgency.ItemIEN; 476 524 if (Urgency = 0) and (cboUrgency.Items.Count = 1) then … … 487 535 AResponse := Responses.FindResponseByName('COMMENT',i); 488 536 end ; 537 cboUrgencyChange(self); 489 538 end; 490 539 if sub = 't' then with ALabTest do //DIAGNOSTIC TEST … … 494 543 EnableDiagTestControls; 495 544 LRORDERMODE := TORDER_MODE_DIAG; 545 //DetermineCollectionDefaults(Responses); 496 546 aList.Clear; 497 547 aTestYes := '1'; … … 499 549 if aList.Count > 0 then aTypeScreen := aList[0]; 500 550 aList.Clear; 501 with lvSelectionList do502 begin503 ListItem := Items.Add;504 ListItem.Caption := piece(cboAvailTest.Items[cboAvailTest.ItemIndex],'^',2);505 ListItem.SubItems.Add('');506 ListItem.SubItems.Add('');507 ListItem.SubItems.Add('');508 ListItem.SubItems.Add(piece(cboAvailTest.Items[cboAvailTest.ItemIndex],'^',1));509 if piece(cboAvailTest.Items[cboAvailTest.ItemIndex],'^',1) = aTypeScreen then510 begin511 lblTNS.Caption := '';512 lblTNS.Visible := false;513 memMessage.Text := '';514 pnlMessage.Visible := false;515 uGetTnS := 0;516 pnlDiagnosticTests.Caption := 'Diagnostic Tests';517 end;518 end;519 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimen + '^' + IntToStr(aLabTest.ItemID); //aSpecimen has 2 pieces additional pieces added for Tests520 uSelectedItems.Add(aStr);521 551 if Length(calWantTime.Text) > 0 then Responses.Update('DATETIME',1,ValidCollTime(calWantTime.Text),calWantTime.Text); 522 {with cboCollType do if Length(ItemID) > 0 then 523 begin 524 Responses.Update('COLLECT', 1, ItemID, ItemID) ; 525 FLastCollType := ItemID; 526 end; } 527 if Length(cboUrgency.Text) > 0 then Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text); 552 if Length(cboUrgency.Text) > 0 then Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text) 553 else 554 begin 555 cboUrgency.ItemIndex := 2; 556 for i := 0 to cboUrgency.Items.Count - 1 do 557 begin 558 aUrgText := cboUrgency.Items[i]; 559 if aUrgText = '9^ROUTINE' then // Find urgency default of ROUTINE 560 begin 561 cboUrgency.ItemIndex := i; 562 break; 563 end; 564 end; 565 Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text); 566 cboUrgencyChange(self); 567 end; 528 568 if Length(memDiagComment.Text) > 0 then Responses.Update('COMMENT',1,memDiagComment.Text,memDiagComment.Text); 529 569 if Length(cboReasons.Text) > 0 then Responses.Update('REASON',1,cboReasons.Text,cboReasons.Text); 530 LoadCollType(cboCollType);531 if (cboCollType.ItemID = 'LC') or (cboCollType.ItemID = 'I') then532 if not(ALabTest.LabCanCollect) and OrderForInpatient then533 cboCollType.SelectByID('WC')534 else if not(ALabTest.LabCanCollect) then535 cboCollType.SelectByID('SP');536 SetupCollTimes(cboCollType.ItemID);537 if cboCollType.ItemID = 'LC' then538 begin539 with cboCollTime do540 if Length(ItemID) > 0 then541 begin542 Responses.Update('START', 1, Copy(ItemID, 2, 999), Copy(ItemID, 2, 999));543 FLastLabCollTime := ItemID + U + Text;544 end545 else if Length(Text) > 0 then546 begin547 Responses.Update('START', 1, ValidCollTime(Text), Text) ;548 FLastLabCollTime := ValidCollTime(Text);549 end;550 end551 else552 begin553 with calCollTime do554 if FMDateTime > 0 then555 begin556 Responses.Update('START', 1, ValidCollTime(Text), Text);557 FLastColltime := ValidCollTime(Text);558 end559 else560 begin561 Responses.Update('START', 1, '', '') ;562 FLastCollTime := '';563 end;564 end;565 with cboCollType do if Length(ItemID) > 0 then566 begin567 Responses.Update('COLLECT', 1, ItemID, ItemID) ;568 FLastCollType := ItemID;569 end;570 //if Length(cboCollType.Text) > 0 then Responses.Update('COLLECT',1,cboCollType.ItemID,cboCollType.ItemID);571 570 memOrder.Text := Responses.OrderText; 572 571 Changing := False; … … 625 624 if TestAdded = 1 then 626 625 begin 627 edtResults.Clear;628 626 aTests.Clear; 629 627 GetPatientBloodResults(aTests, Patient.DFN, uTestsForResults); 630 QuickCopy(ATests,edtResults); 631 if edtResults.Lines.Count > 0 then TabResults.Caption := 'Lab Results Available'; //TabResults.ImageIndex := 1; 632 uRaw.Clear; 633 GetPatientBloodResultsRaw(uRaw, Patient.DFN, uTestsForResults); 628 if aTests.Count > 0 then 629 begin 630 edtResults.Clear; 631 QuickCopy(ATests,edtResults); 632 TabResults.Caption := 'Lab Results Available'; 633 uRaw.Clear; 634 GetPatientBloodResultsRaw(uRaw, Patient.DFN, uTestsForResults); 635 end; 634 636 end; 635 637 CurAdd := 1; … … 640 642 Inc(CurAdd); 641 643 end; 644 for i := lvSelectionList.Items.Count - 1 downto 0 do 645 begin 646 if lvSelectionList.Items[i].SubItems[3] = aTypeScreen then 647 begin 648 aGotTNS := true; 649 break; 650 end; 651 end; 652 if (uTNSOrders.Count < 1) and (aGotTNS = false) and (SpecimenNeeded(aList, uVBECList, aLabTest.ItemID)) then //check to see if type and screen is needed CQ 17349 653 begin 654 uGetTnS := 1; 655 end; 656 if aList.Count > 0 then 657 begin 658 aSpecimen := piece(aList[0], '^',1); 659 aSpecimenUID := piece(aList[0], '^',2); 660 end; 661 aList.Clear; 662 ExtractSpecimens(aList, uVBECList); //Get specimen values to pass back to Server 663 for i := 0 to aList.Count - 1 do 664 begin 665 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) then 666 begin 667 aSpecimenReq := piece(aList[i],'^',2); 668 if (SpecimenNeeded(aList, uVBECList, aLabTest.ItemID)) then 669 aSpecimenUID := ''; 670 break; 671 end; 672 end; 642 673 with lvSelectionList do 643 674 begin … … 657 688 ListItem.SubItems.Add(piece(cboAvailComp.Items[cboAvailComp.ItemIndex],'^',1)); 658 689 end; 659 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimen + '^' + IntToStr(aLabTest.ItemID); //aSpecimen has 2 pieces additional pieces added for Tests690 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimenReq + '^' + aSpecimen + '^' + aSpecimenUID + '^' + IntToStr(aLabTest.ItemID); 660 691 uSelectedItems.Add(aStr); 661 692 memOrder.Text := Responses.OrderText; 662 693 Changing := False; 694 if (Length(cboSurgery.Text) > 0) then 695 begin 696 for i := 0 to cboSurgery.Items.Count - 1 do 697 if uppercase(cboSurgery.Text) = uppercase(piece(cboSurgery.Items[i],'^',2)) then 698 begin 699 cboSurgery.ItemIndex := i; 700 Break; 701 end; 702 cboSurgeryChange(self); 703 end; 663 704 end; 664 705 end; … … 669 710 DisableDiagTestControls; 670 711 end; 712 cList.Clear; 713 if (Length(cboSurgery.ItemID) > 0) then 714 begin 715 for j := 0 to uSelectedItems.Count - 1 do 716 begin 717 xLabTest := TLabTest.Create(piece(uSelectedItems[j],'^',2), Responses); 718 if (piece(uSelectedItems[j],'^',1) = '0') and (not(piece(uSelectedItems[j],'^',3)='')) and (StrToInt(piece(uSelectedItems[j],'^',3)) > 0) and (piece(cboSurgery.Items[cboSurgery.ItemIndex],'^',3) = '1') then 719 begin 720 cList.Add(xLabTest.TestName + '^' + piece(uSelectedItems[j],'^',3)); 721 end; 722 xLabTest.Free; 723 end; 724 end; 725 if (uChangingMSBOS = false) and (cList.Count > 0) then 726 begin 727 lblNoBloodReq.Visible := true; 728 with Application do 729 begin 730 NormalizeTopMosts; 731 aMSBOSContinue := 732 MessageBox(PChar('No blood is required for the surgical procedure: ' + cboSurgery.text + 733 '.' + CRLF + 734 'If you still need to order any components, please enter a justification in the Comment box.' 735 + CRLF + CRLF + 'Do you want me to remove ALL the component orders you''ve just entered? '), 736 PChar('No Blood Required'),MB_YESNO); 737 RestoreTopMosts; 738 end; 739 if aMSBOSContinue = 6 then 740 begin 741 tQuantity.Text := ''; 742 for j := uSelectedItems.Count - 1 downto 0 do 743 begin 744 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '0') then 745 begin 746 lvSelectionList.Items[j].Delete; 747 uSelectedItems.Delete(j); 748 Responses.Update('ORDERABLE', (j+1) ,'', ''); 749 Responses.Update('MODIFIER', (j+1), '', ''); 750 Responses.Update('QTY', (j+1), '', ''); 751 end; 752 end; 753 cboAvailComp.Text := ''; 754 cboAvailComp.ItemIndex := -1; 755 cboModifiers.Text := ''; 756 cboModifiers.ItemIndex := -1; 757 lblNoBloodReq.Visible := false; 758 //if fODBBank. Active then cboAvailTest.SetFocus; 759 lblTNS.Caption := ''; 760 lblTNS.Visible := false; 761 DisableComponentControls; 762 end; 763 end; 764 for i := 0 to lvSelectionList.Items.Count - 1 do 765 begin 766 if lvSelectionList.Items[i].SubItems[3] = aTypeScreen then 767 begin 768 uGetTnS := 0; 769 aGotTNS := true; 770 uDfltUrgency := cboUrgency.ItemID; 771 lblTNS.Caption := ''; 772 lblTNS.Visible := false; 773 memMessage.Text := ''; 774 pnlMessage.Visible := false; 775 pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 776 if uTNSOrders.Count > 0 then 777 begin 778 for j := 0 to uTNSOrders.Count - 1 do 779 aTNSString := aTNSString + CRLF + uTNSOrders[j]; 780 with Application do 781 begin 782 NormalizeTopMosts; 783 aTNS := 784 MessageBox(PChar(aTNSString + CRLF + CRLF + 785 'Do you wish to cancel this request for Type & Screen?'), 786 PChar('Type & Screen Entered in Past ' + IntToStr(TNSDaysBack) + ' Days'), 787 MB_YESNO); 788 RestoreTopMosts; 789 if aTNS = 6 then 790 begin 791 lvSelectionList.ItemIndex := i; 792 lvSelectionListClick(self); 793 btnRemoveClick(self); 794 break; 795 end; 796 end; 797 end; 798 break; 799 end; 800 end; 801 if uSelectedItems.Count < 1 then uGetTNS := 0; 802 803 for i := uSelectedItems.Count - 1 downto 0 do 804 begin 805 if (aGotTNS = false) and not(piece(uSelectedItems[i],'^',1) = '1') and (uTNSOrders.Count < 1) and (piece(uSelectedItems[i],'^',5) = '1') then //CQ 17349 806 begin 807 uGetTnS := 1; 808 break; 809 end; 810 end; 811 671 812 CurAdd := 1; 672 813 for i := 0 to uSelectedItems.Count - 1 do … … 689 830 else 690 831 begin 691 cboUrgency.ItemIndex := 1; 832 cboUrgency.ItemIndex := 2; 833 for j := 0 to cboUrgency.Items.Count - 1 do 834 begin 835 aUrgText := cboUrgency.Items[j]; 836 if aUrgText = '9^ROUTINE' then // Find urgency default of ROUTINE 837 begin 838 cboUrgency.ItemIndex := j; 839 break; 840 end; 841 end; 692 842 Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text); 693 843 cboUrgencyChange(self); … … 696 846 Inc(CurAdd); 697 847 end; 698 for i := 0 to lvSelectionList.Items.Count - 1 do 699 begin 700 if lvSelectionList.Items[i].SubItems[3] = aTypeScreen then 701 begin 702 if uTNSOrders.Count > 0 then 703 begin 704 for j := 0 to uTNSOrders.Count - 1 do 705 aTNSString := aTNSString + CRLF + uTNSOrders[j]; 706 with Application do 707 begin 708 NormalizeTopMosts; 709 aTNSDays := TNSDaysBack; 710 aTNS := 711 MessageBox(PChar(aTNSString + CRLF + CRLF + 712 'Do you wish to continue with this request for Type & Screen?'), 713 PChar('Type & Screen Entered in Past ' + IntToStr(TNSDaysBack) + ' Days'), 714 MB_YESNO); 715 RestoreTopMosts; 716 if aTNS = 7 then 717 begin 718 lvSelectionList.ItemIndex := i; 719 lvSelectionListClick(self); 720 btnRemoveClick(self); 721 break; 722 end; 723 end; 724 end; 725 break; 726 end; 727 end; 728 {if OrderAction in [ORDER_COPY, ORDER_EDIT, ORDER_QUICK] then with Responses, ALabTest do 729 begin 730 if OrderAction in [ORDER_QUICK, ORDER_EDIT] then uQuickInProcess := 1; 731 AnInstance := NextInstance('ORDERABLE', 0); 732 while AnInstance > 0 do 733 begin 734 AResponse := FindResponseByName('ORDERABLE', AnInstance); 735 if AResponse <> nil then 736 begin 737 sub := GetSubtype(AResponse.EValue); 738 if sub = 't' then 739 begin 740 SetControl(cboAvailTest, 'ORDERABLE', AnInstance); 741 ALabTest := TLabTest.Create(cboAvailTest.ItemID, Responses); 742 end 743 else 744 begin 745 SetControl(cboAvailComp, 'ORDERABLE', AnInstance); 746 ALabTest := TLabTest.Create(cboAvailComp.ItemID, Responses); 747 end; 748 //SetControl(cboTests, 'ORDERABLE', AnInstance); 749 //ALabTest := TLabTest.Create(cboTests.ItemID, Responses); 750 if ALabTest = nil then Exit; // Causes access violation 751 //sub := GetSubtype(ALabTest.TestName); 752 if AnInstance = 1 then 753 begin 754 DetermineCollectionDefaults(Responses); 755 SetControl(cboReasons, 'REASON', AnInstance); 756 SetControl(chkConsent, 'YN', AnInstance); 757 SetControl(cboSurgery, 'MISC', AnInstance); 758 //SetControl(cboCollType, 'COLLECT', AnInstance); 759 //SetControl(cboCollTime, 'START', AnInstance); 760 SetControl(calWantTime, 'DATETIME', AnInstance); 761 //LoadUrgency(cboCollType.ItemID, cboUrgency); 762 SetControl(cboUrgency, 'URGENCY', AnInstance); 763 Urgency := cboUrgency.ItemIEN; 764 if (Urgency = 0) and (cboUrgency.Items.Count = AnInstance) then 765 begin 766 cboUrgency.ItemIndex := 0; 767 Urgency := cboUrgency.ItemIEN; 768 end; 769 i := 1 ; 770 AResponse := Responses.FindResponseByName('COMMENT',i); 771 while AResponse <> nil do 772 begin 773 if Length(AResponse.Evalue) > 0 then 774 Comment.Add(AResponse.EValue); 775 Inc(i); 776 AResponse := Responses.FindResponseByName('COMMENT',i); 777 end ; 778 end; 779 if sub = 't' then with ALabTest do //DIAGNOSTIC TEST 780 begin 781 Changing := True; 782 DisableComponentControls; 783 EnableDiagTestControls; 784 LRORDERMODE := TORDER_MODE_DIAG; 785 with Responses do 786 begin 787 StatusText('Initializing Order'); 788 AResponse := FindResponseByName('ORDERABLE', AnInstance); 789 if AResponse <> nil then 790 sub1 := GetSubtype(AResponse.EValue); 791 if sub1 = 't' then 792 begin 793 SetControl(cboAvailTest, 'ORDERABLE', AnInstance); 794 //SetControl(cboTests, 'ORDERABLE', AnInstance); 795 //DetermineCollectionDefaults(Responses); //cboCollType = COLLECT , calCollTime = START 796 cboAvailTestSelect(self); 797 end; 798 end; 799 Changing := False; 800 if ObtainCollSamp then 801 begin 802 //For BloodBank orders, this condition should never occur 803 end 804 else 805 begin 806 with ALabTest do 807 with TCollSamp(CollSampList.Items[IndexOfCollSamp(CollSamp)]) do 808 begin 809 x := '' ; 810 for i := 0 to WardComment.Count-1 do 811 x := x + WardComment.strings[i]+#13#10 ; 812 pnlMessage.TabOrder := cboAvailTest.TabOrder + 1; 813 OrderMessage(x) ; 814 end ; 815 end; 816 end; 817 if sub = 'c' then with ALabTest do //COMPONENT 818 begin 819 Changing := True; 820 DisableDiagTestControls; 821 EnableComponentControls; 822 LRORDERMODE := TORDER_MODE_COMP; 823 with Responses do 824 begin 825 StatusText('Initializing Order'); 826 AResponse := FindResponseByName('ORDERABLE', AnInstance); 827 if AResponse <> nil then 828 sub1 := GetSubtype(AResponse.EValue); 829 if sub1 = 'c' then 830 begin 831 SetControl(cboAvailComp, 'ORDERABLE', AnInstance); 832 //SetControl(cboTests, 'ORDERABLE', AnInstance); 833 SetControl(cboModifiers, 'MODIFIER', AnInstance); 834 SetControl(tQuantity, 'QTY', AnInstance); 835 //DetermineCollectionDefaults(Responses); 836 cboAvailCompSelect(self); 837 end; 838 end; 839 Changing := False; 840 end; 841 with ALabTest do 842 begin 843 if ObtainComment then 844 LoadRequiredComment(FCmtTypes.IndexOf(CurReqComment)) 845 else 846 DisableCommentPanels; 847 x := '' ; 848 for i := 0 to CurWardComment.Count-1 do 849 x := x + CurWardComment.strings[i]+#13#10 ; 850 i := IndexOfCollSamp(CollSamp); 851 if i > -1 then with TCollSamp(CollSampList.Items[IndexOfCollSamp(CollSamp)]) do 852 for i := 0 to WardComment.Count-1 do 853 x := x + WardComment.strings[i]+#13#10 ; 854 pnlMessage.TabOrder := cboAvailTest.TabOrder + 1; 855 if Length(x) > 0 then 856 begin 857 OrderMessage(x) ; 858 end; 859 end; 860 StatusText(''); 861 Changing := True; 862 //if not(FOrderAction = ORDER_EDIT) then DetermineCollectionDefaults(Responses); 863 Changing := False; 864 end; 865 AnInstance := NextInstance('ORDERABLE', AnInstance); 866 end; //while AnInstance - ORDERABLE 867 DisableComponentControls; 868 DisableDiagTestControls; 869 uQuickInProcess := 0; 870 end; } 848 if uGetTnS = 1 then 849 begin 850 lblTNS.Caption := 'TYPE + SCREEN must be added to order'; 851 lblTNS.Visible := true; 852 memMessage.Text := 'TYPE + SCREEN must be added to order'; 853 pnlMessage.Visible := true; 854 pnlDiagnosticTests.Caption := 'Diagnostic Tests*'; 855 end 856 else pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 871 857 finally 872 858 aList.Free; 859 cList.Free; 873 860 aTests.Free; 874 861 end; 875 edtResults.Height := 247;876 edtInfo.Height := 247;877 862 if lvSelectionList.Items.Count > 0 then 878 863 begin … … 881 866 memOrder.Visible := True; 882 867 GroupBox1.Visible := False; 868 lvSelectionList.Items[0].Selected := true; 869 lvSelectionListClick(self); 883 870 end; 884 871 end; … … 890 877 i: integer; 891 878 x,sub,sub1,aTNSString: string; 892 aList : TStringList;893 aGotIt : boolean;879 aList, cList: TStringList; 880 aGotIt, aGotTNS: boolean; 894 881 aTests: TStringList; 895 882 ListItem: TListItem; 896 aName, aMsg, aStr, aModifier, aReason, aSurgery, aCollTime, aTestYes, aSpecimen, aTypeScreen: String; 897 CurAdd, j, k, getTest, TestAdded, aMSBOS, aMSBOSContinue, aTNS, aTNSDays: Integer; 883 xLabTest: TLabTest; 884 aName, aMsg, aStr, aModifier, aReason, aSurgery, aCollTime, aTestYes, aSpecimen, aSpecimenUID, aSpecimenReq, aTypeScreen, aUrgText: String; 885 CurAdd, j, k, getTest, TestAdded, aMSBOS, aMSBOSContinue, aTNS: Integer; 898 886 begin 899 887 inherited; 900 888 aList := TStringList.Create; 889 cList := TStringList.Create; 901 890 aTests := TStringList.Create; 891 pgeProduct.ActivePageIndex := TI_COMPONENT; 902 892 try 903 893 aModifier := ''; … … 908 898 aTypeScreen := ''; 909 899 aSpecimen := ''; 900 aSpecimenUID := ''; 901 aSpecimenReq := ''; 910 902 sub1 := ''; 903 aGotTNS := false; 911 904 ExtractTypeScreen(aList, uVBECList); 912 905 if aList.Count > 0 then aTypeScreen := aList[0]; 913 906 aList.Clear; 914 Extractspecimen(aList, uVBECList); 915 if aList.Count > 0 then aSpecimen := aList[0]; 907 ExtractSpecimen(aList, uVBECList); 908 if aList.Count > 0 then 909 begin 910 aSpecimen := piece(aList[0], '^',1); 911 aSpecimenUID := piece(aList[0], '^',2); 912 end; 916 913 with Responses, ALabTest do 917 914 begin … … 963 960 SetControl(chkConsent, 'YN', AnInstance); 964 961 //DetermineCollectionDefaults(Responses); 965 SetControl(cboCollType, 'COLLECT', AnInstance);966 SetupCollTimes(cboCollType.ItemID);967 //SetControl(cboCollTime, 'START', AnInstance);968 //LoadUrgency(cboCollType.ItemID, cboUrgency);969 962 SetControl(cboUrgency, 'URGENCY', AnInstance); 970 Urgency := cboUrgency.ItemIEN; 971 if (Urgency = 0) and (cboUrgency.Items.Count = AnInstance) then 963 if cboUrgency.ItemIEN = 0 then 972 964 begin 973 cboUrgency.ItemIndex := 0; 974 Urgency := cboUrgency.ItemIEN; 975 cboUrgencyChange(self); 965 if StrToIntDef(LRFURG, 0) > 0 then 966 cboUrgency.SelectByID(LRFURG) 967 else if (Urgency = 0) and (cboUrgency.Items.Count = 1) then 968 cboUrgency.ItemIndex := 0; 976 969 end; 977 970 SetControl(cboSurgery, 'MISC', AnInstance); 971 if Length(cboSurgery.Text) > 0 then 972 begin 973 for i := 0 to cboSurgery.Items.Count - 1 do 974 if uppercase(cboSurgery.Text) = uppercase(piece(cboSurgery.Items[i],'^',2)) then 975 begin 976 cboSurgery.ItemIndex := i; 977 Break; 978 end; 979 cboSurgeryChange(self); 980 end; 978 981 if not(ALabTest = nil) then 979 982 begin 980 Urgency := cboUrgency.ItemIEN;981 if (Urgency = 0) and (cboUrgency.Items.Count = 1) then982 begin983 cboUrgency.ItemIndex := 0;984 Urgency := cboUrgency.ItemIEN;985 end;986 983 i := 1 ; 987 984 AResponse := Responses.FindResponseByName('COMMENT',i); … … 992 989 AResponse := Responses.FindResponseByName('COMMENT',i); 993 990 end ; 994 end;995 if not(cboCollType.ItemID = 'LC') then996 begin997 if Length(cboCollTime.Text) > 0 then998 begin999 calCollTime.FMDateTime := StrToFMDateTime(cboCollTime.Text);1000 FLastCollTime := cboCollTime.Text;1001 end1002 else1003 begin1004 FLastCollTime := '';1005 end;1006 991 end; 1007 992 end; … … 1014 999 SetControl(cboModifiers, 'MODIFIER', AnInstance); 1015 1000 SetControl(tQuantity, 'QTY', AnInstance); 1016 //DetermineCollectionDefaults(Responses);1017 //Check for and display any associated Lab Results1018 1001 aList.Clear; 1019 1002 TestAdded := 0; … … 1043 1026 if TestAdded = 1 then 1044 1027 begin 1045 edtResults.Clear;1046 1028 aTests.Clear; 1047 1029 GetPatientBloodResults(aTests, Patient.DFN, uTestsForResults); 1048 QuickCopy(ATests,edtResults); 1049 if edtResults.Lines.Count > 0 then TabResults.Caption := 'Lab Results Available'; //TabResults.ImageIndex := 1; 1050 uRaw.Clear; 1051 GetPatientBloodResultsRaw(uRaw, Patient.DFN, uTestsForResults); 1030 if aTests.Count > 0 then 1031 begin 1032 edtResults.Clear; 1033 QuickCopy(ATests,edtResults); 1034 TabResults.Caption := 'Lab Results Available'; 1035 uRaw.Clear; 1036 GetPatientBloodResultsRaw(uRaw, Patient.DFN, uTestsForResults); 1037 end; 1052 1038 end; 1053 1039 CurAdd := 1; … … 1058 1044 Inc(CurAdd); 1059 1045 end; 1060 aSpecimen := '^'; 1046 aSpecimen := ''; 1047 aSpecimenUID := ''; 1048 aSpecimenReq := ''; 1061 1049 aTestYes := '0'; 1062 1050 aReason := ''; … … 1064 1052 aCollTime := ''; 1065 1053 ExtractSpecimen(aList, uVBECList); 1066 if aList.Count > 0 then aSpecimen := aList[0]; 1054 if aList.Count > 0 then 1055 begin 1056 aSpecimen := piece(aList[0], '^', 1); 1057 aSpecimenUID := piece(aList[0], '^', 2); 1058 end; 1067 1059 if length(cboModifiers.ItemID) > 0 then aModifier := cboModifiers.Items[cboModifiers.ItemIndex]; 1068 1060 if length(cboReasons.ItemID) > 0 then aReason := cboReasons.Items[cboReasons.ItemIndex]; 1069 1061 if length(cboSurgery.ItemID) > 0 then aSurgery := cboSurgery.Items[cboSurgery.ItemIndex]; 1070 if length(cboCollTime.ItemID) > 0 then aCollTime := cboCollTime.Items[cboCollTime.ItemIndex];1071 1062 if Length(cboSurgery.ItemID) > 0 then 1072 1063 begin … … 1076 1067 begin 1077 1068 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) 1078 and ( piece(aList[i],'^',3) = cboSurgery.Text) then1069 and (uppercase((piece(aList[i],'^',3))) = uppercase(cboSurgery.Text)) then 1079 1070 begin 1080 1071 aMSBOS := StrToInt(piece(aList[i],'^',4)); … … 1086 1077 aMSBOSContinue := 1087 1078 MessageBox(PChar('The number of units ordered (' + tQuantity.Text + 1088 ') for ' + aLabTest.TestName + ' exceeds the maximum number of units (' 1089 + IntToStr(aMSBOS) + 1090 ') for the ' + cboSurgery.text + 1091 ' surgical procedure selected.' + CRLF + CRLF + 'Do you wish to continue?'), 1092 PChar('Maximum Number of Units Exceeded'), 1093 MB_YESNO); 1079 ') for ' + aLabTest.TestName + ' Exceeds the maximum number recommended (' 1080 + IntToStr(aMSBOS) + 1081 ') for the ' + cboSurgery.text + 1082 ' surgical procedure.' + CRLF + 1083 'If you need to order more than the maximum number of units, please enter a justification in the Comment box.' 1084 + CRLF + CRLF + 'Edit the Blood component Quantity?'), 1085 PChar('Maximum Number of Units Exceeded'), 1086 MB_YESNO); 1094 1087 RestoreTopMosts; 1095 1088 end; 1096 if aMSBOSContinue = 7then1089 if aMSBOSContinue = 6 then 1097 1090 begin 1098 1091 ShowMsg(cboAvailComp.Text + ' has NOT been added to this request.'); 1092 lvSelectionList.Clear; 1093 uSelectedItems.Clear; 1094 uTestsForResults.Clear; 1095 uRaw.Clear; 1096 uGetTnS := 0; 1097 lblTNS.Caption := ''; 1098 lblTNS.Visible := false; 1099 memMessage.Text := ''; 1100 pnlMessage.Visible := false; 1101 FLastItemID := ''; 1102 InitDialog; 1103 cboModifiers.ItemIndex := -1; 1104 cboAvailTest.ItemIndex := -1; 1105 cboAvailComp.ItemIndex := -1; 1106 cboSurgery.ItemIndex := -1; 1107 cboUrgency.ItemIndex := -1; 1108 cboReasons.ItemIndex := -1; 1109 cboCollType.ItemIndex := -1; 1110 cboCollTime.ItemIndex := -1; 1111 cboQuick.ItemIndex := -1; 1112 calWantTime.Text := ''; 1113 memDiagComment.Text := ''; 1114 GroupBox1.Visible := true; 1115 tQuantity.Text := ''; 1116 FLastCollType := ''; 1117 FLastCollTime := ''; 1118 FLastLabCollTime := ''; 1119 txtImmedColl.Text := ''; 1120 calCollTime.text := ''; 1099 1121 exit; 1100 1122 end; … … 1103 1125 end; 1104 1126 end; 1105 if (uTNSOrders.Count < 1) then //SpecimenNeeded(aList, uVBECList, aLabTest.ItemID) then //check to see if type and screen is needed 1127 for i := lvSelectionList.Items.Count - 1 downto 0 do 1128 begin 1129 if lvSelectionList.Items[i].SubItems[3] = aTypeScreen then 1130 begin 1131 aGotTNS := true; 1132 break; 1133 end; 1134 end; 1135 if (uTNSOrders.Count < 1) and (aGotTNS = false) and (SpecimenNeeded(aList, uVBECList, aLabTest.ItemID)) then //check to see if type and screen is needed CQ 17349 1106 1136 begin 1107 1137 uGetTnS := 1; … … 1113 1143 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) then 1114 1144 begin 1115 aSpecimen := piece(aList[i],'^',2) + '^' + aSpecimen; 1145 aSpecimenReq := piece(aList[i],'^',2); 1146 if (SpecimenNeeded(aList, uVBECList, aLabTest.ItemID)) then 1147 aSpecimenUID := ''; 1116 1148 break; 1117 1149 end; … … 1136 1168 end; 1137 1169 CurAdd := 1; 1138 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimen + '^' + IntToStr(aLabTest.ItemID); //aSpecimen has 2 pieces additional pieces added for Tests1170 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimenReq + '^' + aSpecimen + '^' + aSpecimenUID + '^' + IntToStr(aLabTest.ItemID); 1139 1171 uSelectedItems.Add(aStr); 1140 1172 for i := 0 to uSelectedItems.Count - 1 do … … 1160 1192 aMsg := ''; 1161 1193 LRORDERMODE := TORDER_MODE_INFO; 1162 {if uGetTnS = 1 then1163 begin1164 lblTNS.Caption := 'TYPE + SCREEN must be added to order';1165 lblTNS.Visible := true;1166 memMessage.Text := 'TYPE + SCREEN must be added to order';1167 memMessage.Visible := false;1168 pnlMessage.Visible := true;1169 pnlDiagnosticTests.Caption := 'Diagnostic Tests*';1170 end; }1171 {if uGetTnS = 1 then1172 begin1173 if responses.QuickOrder < 1 then1174 begin1175 for i := 1 to cboAvailTest.Items.Count - 1 do1176 begin1177 if piece(cboAvailTest.Items[i],'^',1) = aTypeScreen then1178 begin1179 if piece(aSpecimen,'^',1) = '1' then1180 begin1181 cboCollTime.Text := calWantTime.Text;1182 aCollSave := cboCollTime.Text + '^' + cboCollTime.ItemID + '^' + cboCollType.Text + '^' + cboCollType.ItemID;1183 cboCollTime.Text := '';1184 cboCollType.Text := '';1185 uSpecimen := 1;1186 end;1187 cboModifiers.Text := '';1188 cboAvailTest.SelectByID(aTypeScreen);1189 cboTests.SelectByID(aTypeScreen);1190 cboTestsClick(self);1191 //cboAvailTestSelect(Self);1192 uSpecimen := 0;1193 cboCollTime.Text := piece(aCollSave,'^',1);1194 cboCollType.Text := piece(aCollSave,'^',3);1195 aCollSave := '';1196 break;1197 end;1198 end;1199 aMsg := 'An order for Type and Screen has been added to this request' + '.';1200 end1201 else1202 begin1203 lblTNS.Caption := 'TYPE + SCREEN must be added to order';1204 lblTNS.Visible := true;1205 memMessage.Text := 'TYPE + SCREEN must be added to order';1206 memMessage.Visible := false;1207 pnlMessage.Visible := true;1208 end;1209 end;1210 if (uGetTnS = 1) then1211 begin1212 if length(aMsg) > 0 then aMsg := aMsg + crlf + crlf;1213 ShowMsg(aMsg);1214 end; }1215 1216 //cboModifiers.Text := '';1217 edtResults.Height := 247;1218 edtInfo.Height := 247;1219 1194 if lvSelectionList.Items.Count > 0 then 1220 1195 begin … … 1234 1209 aTestYes := '1'; 1235 1210 SetControl(cboAvailTest, 'ORDERABLE', AnInstance); 1236 //DetermineCollectionDefaults(Responses); 1211 //DetermineCollectionDefaults(Responses); //cboCollType = COLLECT , calCollTime = START 1237 1212 i := 1 ; 1238 1213 AResponse := Responses.FindResponseByName('COMMENT',i); … … 1260 1235 end; 1261 1236 if Length(calWantTime.Text) > 0 then Responses.Update('DATETIME',1,ValidCollTime(calWantTime.Text),calWantTime.Text); 1262 with cboCollType do if Length(ItemID) > 0 then1263 begin1264 Responses.Update('COLLECT', 1, ItemID, ItemID) ;1265 FLastCollType := ItemID;1266 end;1267 1237 if Length(cboUrgency.Text) > 0 then Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text) 1268 1238 else 1269 1239 begin 1270 cboUrgency.ItemIndex := 1; 1240 cboUrgency.ItemIndex := 2; 1241 for i := 0 to cboUrgency.Items.Count - 1 do 1242 begin 1243 aUrgText := cboUrgency.Items[i]; 1244 if aUrgText = '9^ROUTINE' then // Find urgency default of ROUTINE 1245 begin 1246 cboUrgency.ItemIndex := i; 1247 break; 1248 end; 1249 end; 1271 1250 Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text); 1272 1251 cboUrgencyChange(self); … … 1274 1253 if Length(memDiagComment.Text) > 0 then Responses.Update('COMMENT',1,memDiagComment.Text,memDiagComment.Text); 1275 1254 if Length(cboReasons.Text) > 0 then Responses.Update('REASON',1,cboReasons.Text,cboReasons.Text); 1276 LoadCollType(cboCollType);1277 if (cboCollType.ItemID = 'LC') or (cboCollType.ItemID = 'I') then1278 if not(ALabTest.LabCanCollect) and OrderForInpatient then1279 cboCollType.SelectByID('WC')1280 else if not(ALabTest.LabCanCollect) then1281 cboCollType.SelectByID('SP');1282 SetupCollTimes(cboCollType.ItemID);1283 if cboCollType.ItemID = 'LC' then1284 begin1285 with cboCollTime do1286 if Length(ItemID) > 0 then1287 begin1288 Responses.Update('START', 1, Copy(ItemID, 2, 999), Copy(ItemID, 2, 999));1289 FLastLabCollTime := ItemID + U + Text;1290 end1291 else if Length(Text) > 0 then1292 begin1293 Responses.Update('START', 1, ValidCollTime(Text), Text) ;1294 FLastLabCollTime := ValidCollTime(Text);1295 end;1296 end1297 else1298 begin1299 with calCollTime do1300 if FMDateTime > 0 then1301 begin1302 Responses.Update('START', 1, ValidCollTime(Text), Text);1303 FLastColltime := ValidCollTime(Text);1304 end1305 else1306 begin1307 Responses.Update('START', 1, '', '') ;1308 FLastCollTime := '';1309 end;1310 end;1311 if length(cboCollTime.ItemID) > 0 then aCollTime := cboCollTime.Items[cboCollTime.ItemIndex];1312 with cboCollType do if Length(ItemID) > 0 then1313 begin1314 Responses.Update('COLLECT', 1, ItemID, ItemID) ;1315 FLastCollType := ItemID;1316 end;1317 1255 uTestSelected := true; 1318 1256 with lvSelectionList do … … 1326 1264 end; 1327 1265 CurAdd := 1; 1328 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimen + '^' + aCollTime + '^' + cboCollType.Text + '^' + IntToStr(aLabTest.ItemID); //aSpecimen has 2 pieces1266 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimenReq + '^' + aSpecimen + '^' + aSpecimenUID + '^' + IntToStr(aLabTest.ItemID); 1329 1267 uSelectedItems.Add(aStr); 1330 1268 for i := 0 to uSelectedItems.Count - 1 do … … 1339 1277 end; 1340 1278 memOrder.Text := Responses.OrderText; 1341 edtResults.Height := 247;1342 edtInfo.Height := 247;1343 1279 if lvSelectionList.Items.Count > 0 then 1344 1280 begin … … 1353 1289 end; 1354 1290 //Quick Order 1291 end; 1292 cList.Clear; 1293 if (Length(cboSurgery.ItemID) > 0) then 1294 begin 1295 for j := 0 to uSelectedItems.Count - 1 do 1296 begin 1297 xLabTest := TLabTest.Create(piece(uSelectedItems[j],'^',2), Responses); 1298 if (piece(uSelectedItems[j],'^',1) = '0') and (not(piece(uSelectedItems[j],'^',3)='')) and (StrToInt(piece(uSelectedItems[j],'^',3)) > 0) and (piece(cboSurgery.Items[cboSurgery.ItemIndex],'^',3) = '1') then 1299 begin 1300 cList.Add(xLabTest.TestName + '^' + piece(uSelectedItems[j],'^',3)); 1301 end; 1302 xLabTest.Free; 1303 end; 1304 end; 1305 if (uChangingMSBOS = false) and (cList.Count > 0) then 1306 begin 1307 lblNoBloodReq.Visible := true; 1308 with Application do 1309 begin 1310 NormalizeTopMosts; 1311 aMSBOSContinue := 1312 MessageBox(PChar('No blood is required for the surgical procedure: ' + cboSurgery.text + 1313 '.' + CRLF + 1314 'If you still need to order any components, please enter a justification in the Comment box.' 1315 + CRLF + CRLF + 'Do you want me to remove ALL the component orders you''ve just entered? '), 1316 PChar('No Blood Required'),MB_YESNO); 1317 RestoreTopMosts; 1318 end; 1319 if aMSBOSContinue = 6 then 1320 begin 1321 tQuantity.Text := ''; 1322 for j := uSelectedItems.Count - 1 downto 0 do 1323 begin 1324 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '0') then 1325 begin 1326 lvSelectionList.Items[j].Delete; 1327 uSelectedItems.Delete(j); 1328 Responses.Update('ORDERABLE', (j+1) ,'', ''); 1329 Responses.Update('MODIFIER', (j+1), '', ''); 1330 Responses.Update('QTY', (j+1), '', ''); 1331 end; 1332 end; 1333 cboAvailComp.Text := ''; 1334 cboAvailComp.ItemIndex := -1; 1335 cboModifiers.Text := ''; 1336 cboModifiers.ItemIndex := -1; 1337 lblNoBloodReq.Visible := false; 1338 //if fODBBank. Active then cboAvailTest.SetFocus; 1339 lblTNS.Caption := ''; 1340 lblTNS.Visible := false; 1341 DisableComponentControls; 1342 end; 1355 1343 end; 1356 1344 for i := 0 to lvSelectionList.Items.Count - 1 do … … 1372 1360 begin 1373 1361 NormalizeTopMosts; 1374 aTNSDays := TNSDaysBack;1375 1362 aTNS := 1376 1363 MessageBox(PChar(aTNSString + CRLF + CRLF + 1377 'Do you wish to continue withthis request for Type & Screen?'),1378 1379 1364 'Do you wish to cancel this request for Type & Screen?'), 1365 PChar('Type & Screen Entered in Past ' + IntToStr(TNSDaysBack) + ' Days'), 1366 MB_YESNO); 1380 1367 RestoreTopMosts; 1381 if aTNS = 7then1368 if aTNS = 6 then 1382 1369 begin 1383 1370 lvSelectionList.ItemIndex := i; … … 1398 1385 pnlMessage.Visible := true; 1399 1386 pnlDiagnosticTests.Caption := 'Diagnostic Tests*'; 1400 end; 1387 end 1388 else pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 1401 1389 if ALabTest <> nil then 1402 1390 begin … … 1440 1428 finally //**SubTest 1441 1429 alist.Free; 1430 cList.Free; 1442 1431 aTests.Free; 1443 1432 end; … … 1719 1708 procedure TLabTest.LoadUrgency(CollType: string; AComboBox:TORComboBox); 1720 1709 var 1721 i: integer; 1710 i, PreviousSelectionIndex: integer; 1711 PreviousSelectionString: String; 1722 1712 begin 1723 1713 if UrgencyList.Count < 1 then Exit; 1724 1714 with AComboBox do 1725 1715 begin 1716 PreviousSelectionIndex := -1; 1717 PreviousSelectionString := SelText; 1726 1718 Clear; 1727 1719 for i := 0 to UrgencyList.Count - 1 do 1720 begin 1728 1721 if (CollType = 'LC') and (Piece(UrgencyList[i], U, 3) = '') then 1729 1722 Continue 1730 1723 else 1731 1724 Items.Add(UrgencyList[i]); 1725 if (PreviousSelectionString <> '') and (PreviousSelectionString = Piece(UrgencyList[i], U, 2)) then 1726 PreviousSelectionIndex := i; 1727 end; 1732 1728 if (LRFURG <> '') and (ALabTest.ObtainUrgency) then 1733 1729 SelectByID(LRFURG) 1730 else if PreviousSelectionIndex > -1 then 1731 ItemIndex := PreviousSelectionIndex 1734 1732 else 1735 1733 SelectByIEN(uDfltUrgency); … … 1864 1862 i:integer; 1865 1863 aborh: boolean; 1866 aSpecimen, aSpecimen Date: string;1864 aSpecimen, aSpecimenUID, aSpecimenDate: string; 1867 1865 aWantDateTime, aExpiredSpecimenDate: TFMDateTime; 1868 1866 begin … … 1870 1868 aborh := false; 1871 1869 aSpecimen := ''; 1870 aSpecimenUID := ''; 1872 1871 OutList.Clear; 1873 1872 ExtractItems(OutList,Alist,'ABORH'); … … 1886 1885 OutList.Clear; 1887 1886 ExtractSpecimen(OutList, uVBECList); 1888 if OutList.Count > 0 then aSpecimen := OutList[0]; 1887 if OutList.Count > 0 then 1888 begin 1889 aSpecimen := Piece(OutList[0], '^',1); 1890 aSpecimenUID := Piece(OutList[0], '^',2); 1891 end; 1889 1892 OutList.Clear; 1890 1893 ExtractItems(OutList,AList,'SPECIMENS'); 1891 1894 aWantDateTime := calWantTime.FMDateTime; 1892 aSpecimenDate := piece(aSpecimen,'^',1);1895 aSpecimenDate := aSpecimen; 1893 1896 aExpiredSpecimenDate := 0; 1894 1897 if Length(aSpecimenDate) > 0 then aExpiredSpecimenDate := StrToFloat(aSpecimenDate); 1895 1896 1898 for i := 0 to OutList.Count - 1 do 1897 1899 begin 1898 1900 if (IntToStr(aLabTest.ItemID) = piece(OutList[i],'^',1)) and (piece(OutList[i],'^',2) = '1') then 1899 if aSpecimen = '' then 1900 begin 1901 result := true; 1902 exit; 1903 end 1904 else if (Length(calWantTime.Text) > 0) and (aExpiredSpecimenDate < aWantDateTime) then 1905 begin 1906 result := true; 1907 exit; 1908 end; 1901 begin 1902 if self.EvtID > 0 then 1903 begin 1904 result := true; 1905 exit; 1906 end; 1907 if aSpecimen = '' then 1908 begin 1909 result := true; 1910 exit; 1911 end 1912 else if (Length(calWantTime.Text) > 0) and (aExpiredSpecimenDate < aWantDateTime) then 1913 begin 1914 result := true; 1915 exit; 1916 end; 1917 end; 1909 1918 end; 1910 1919 end; … … 1963 1972 TX_TOO_MANY_DAYS = 'Maximum number of days allowed is '; 1964 1973 TX_TOO_MANY_TIMES = 'For this frequency, the maximum number of times allowed is: X'; 1965 //TX_NO_COMMENT = 'A comment is required for this test and collection sample.';1966 1974 TX_NUMERIC_REQD = 'A numeric value is required for urine volume'; 1967 1975 TX_DOSEDRAW_REQD = 'Both DOSE and DRAW times are required for this order'; 1968 1976 TX_TDM_REQD = 'A value for LEVEL is required for this order'; 1969 //TX_ANTICOAG_REQD = 'You must specify an anticoagulant on this order.' ;1970 1977 TX_NO_COLLSAMPLE = 'A collection sample MUST be specified'; 1971 1978 TX_NO_SPECIMEN = 'A specimen MUST be specified'; … … 2189 2196 tmpImmTime, tmpTime: TFMDateTime; 2190 2197 x, tmpORECALLType, tmpORECALLTime: string; 2191 begin 2198 j: integer; 2199 havetest: boolean; 2200 begin 2201 havetest := false; 2202 for j := uSelectedItems.Count - 1 downto 0 do 2203 begin 2204 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '1') and ((length(calCollTime.Text) > 0) or (length(cboCollTime.Text) > 0)) then 2205 begin 2206 havetest := true; 2207 Break; 2208 end; 2209 end; 2210 //if (havetest = True) and (not(FOrderAction in [ORDER_QUICK, ORDER_EDIT])) then havetest := false; 2192 2211 x := GetLastCollectionTime; 2193 2212 tmpORECALLType := Piece(x, U, 1); 2194 2213 tmpORECALLTime := Piece(x, U, 2); 2195 2214 if CollType = 'SP' then 2215 begin 2216 cboColltime.Visible := False; 2217 txtImmedColl.Visible := False; 2218 pnlCollTimeButton.Visible := False; 2219 pnlCollTimeButton.TabStop := False; 2220 calCollTime.Visible := True; 2221 calCollTime.Enabled := True; 2222 if FLastCollTime <> '' then 2223 begin 2224 calCollTime.Text := ValidCollTime(FLastColltime); 2225 if IsFMDateTime(calCollTime.Text) then 2226 begin 2227 calCollTime.Text := FormatFMDateTime('mmm dd,yy@hh:nn', StrToFMDateTime(calColltime.Text)); 2228 calCollTime.FMDateTime := StrToFMDateTime(FLastCollTime); 2229 end; 2230 end 2231 else if tmpORECALLTime <> '' then 2232 begin 2233 calCollTime.Text := ValidCollTime(tmpORECALLTime); 2234 if IsFMDateTime(calCollTime.Text) then 2235 begin 2236 calCollTime.Text := FormatFMDateTime('mmm dd,yy@hh:nn', StrToFMDateTime(calColltime.Text)); 2237 calCollTime.FMDateTime := StrToFMDateTime(tmpORECALLTime); 2238 end; 2239 end 2240 else if LRFDATE <> '' then 2241 calCollTime.Text := LRFDATE 2242 else if not(FOrderAction in [ORDER_EDIT]) then 2243 calCollTime.Text := 'TODAY' 2244 else if (havetest = false) then 2245 calCollTime.Text := 'TODAY'; 2246 if (havetest = false) and (RemoveCollTimeDefault = True) then 2247 begin 2248 calCollTime.Text := ''; 2249 calCollTime.FMDateTime := 0; 2250 end; 2251 end 2252 else if CollType = 'WC' then 2196 2253 begin 2197 2254 cboColltime.Visible := False; … … 2203 2260 if FLastCollTime <> '' then 2204 2261 begin 2205 calCollTime.Text := ValidColl Time(FLastColltime);2262 calCollTime.Text := ValidColltime(FLastColltime); 2206 2263 if IsFMDateTime(calCollTime.Text) then 2207 2264 begin 2208 2265 calCollTime.Text := FormatFMDateTime('mmm dd,yy@hh:nn', StrToFMDateTime(calColltime.Text)); 2209 calColl time.FMDateTime := StrToFMDateTime(FLastCollTime);2266 calCollTime.FMDateTime := StrToFMDateTime(FLastCollTime); 2210 2267 end; 2211 2268 end 2212 2269 else if tmpORECALLTime <> '' then 2213 2270 begin 2214 calCollTime.Text := ValidColl Time(tmpORECALLTime);2271 calCollTime.Text := ValidColltime(tmpORECALLTime); 2215 2272 if IsFMDateTime(calCollTime.Text) then 2216 2273 begin 2217 2274 calCollTime.Text := FormatFMDateTime('mmm dd,yy@hh:nn', StrToFMDateTime(calColltime.Text)); 2218 calColl time.FMDateTime := StrToFMDateTime(tmpORECALLTime);2275 calCollTime.FMDateTime := StrToFMDateTime(tmpORECALLTime); 2219 2276 end; 2220 2277 end 2221 2278 else if LRFDATE <> '' then 2222 2279 calCollTime.Text := LRFDATE 2223 else 2224 calCollTime.Text := 'TODAY'; 2225 end 2226 else if CollType = 'WC' then 2227 begin 2228 cboColltime.Visible := False; 2229 txtImmedColl.Visible := False; 2230 pnlCollTimeButton.Visible := False; 2231 pnlCollTimeButton.TabStop := False; 2232 calCollTime.Visible := True; 2233 calColltime.Enabled := True; 2234 if FLastCollTime <> '' then 2235 begin 2236 calCollTime.Text := ValidColltime(FLastColltime); 2237 if IsFMDateTime(calCollTime.Text) then 2238 begin 2239 calCollTime.Text := FormatFMDateTime('mmm dd,yy@hh:nn', StrToFMDateTime(calColltime.Text)); 2240 calColltime.FMDateTime := StrToFMDateTime(FLastCollTime); 2241 end; 2242 end 2243 else if tmpORECALLTime <> '' then 2244 begin 2245 calCollTime.Text := ValidColltime(tmpORECALLTime); 2246 if IsFMDateTime(calCollTime.Text) then 2247 begin 2248 calCollTime.Text := FormatFMDateTime('mmm dd,yy@hh:nn', StrToFMDateTime(calColltime.Text)); 2249 calColltime.FMDateTime := StrToFMDateTime(tmpORECALLTime); 2250 end; 2251 end 2252 else if LRFDATE <> '' then 2253 calCollTime.Text := LRFDATE 2254 else 2280 else if not(FOrderAction in [ORDER_EDIT]) then 2255 2281 calCollTime.Text := 'NOW'; 2282 if (havetest = false) and (RemoveCollTimeDefault = True) then 2283 begin 2284 calCollTime.Text := ''; 2285 calCollTime.FMDateTime := 0; 2286 end; 2256 2287 end 2257 2288 else if CollType = 'LC' then … … 2274 2305 else 2275 2306 cboCollTime.ItemIndex := 0; 2307 if (havetest = false) and (RemoveCollTimeDefault = True) then 2308 begin 2309 cboCollTime.Text := ''; 2310 end; 2276 2311 end 2277 2312 else if CollType = 'I' then … … 2279 2314 cboColltime.Visible := False; 2280 2315 calCollTime.Visible := False; 2281 calColl time.Enabled := False;2316 calCollTime.Enabled := False; 2282 2317 txtImmedColl.Visible := True; 2283 2318 pnlCollTimeButton.Visible := True; … … 2291 2326 else if LRFDATE <> '' then 2292 2327 tmpTime := StrToFMDateTime(LRFDATE); 2293 2294 2328 if tmpTime > tmpImmTime then 2295 2329 begin … … 2301 2335 calCollTime.FMDateTime := GetDefaultImmCollTime; 2302 2336 txtImmedColl.Text := FormatFMDateTime('mmm dd,yy@hh:nn', calCollTime.FMDateTime); 2337 end; 2338 if (havetest = false) and (RemoveCollTimeDefault = True) then 2339 begin 2340 calCollTime.Text := ''; 2341 calCollTime.FMDateTime := 0; 2342 txtImmedColl.Text := ''; 2303 2343 end; 2304 2344 end; … … 2387 2427 begin 2388 2428 inherited; 2429 cboReasons.Text := StringReplace(cboReasons.Text,CRLF,' ',[rfReplaceAll]); 2389 2430 if (length(cboReasons.Text) > 75) then 2390 2431 begin … … 2414 2455 var 2415 2456 i: integer; 2416 text : string;2417 2457 ListItem: TListItem; 2418 aCollTime,aTypeScreen,aStr,aModifier,aSpecimen,a TestYes,x,aName,aTNSString: string;2458 aCollTime,aTypeScreen,aStr,aModifier,aSpecimen,aSpecimenUID,aSpecimenReq,aTestYes,x,aName,aTNSString, aUrgText: string; 2419 2459 aList: TStringList; 2420 curAdd, AnInstance,aTNS,aTNSDays: Integer;2460 curAdd,aTNS: Integer; 2421 2461 sub,sub1: string; 2422 AResponse: TResponse;2462 aChanging: Boolean; 2423 2463 begin 2424 2464 if cboAvailTest.ItemID = '' then Exit; 2425 2465 aList := TStringList.Create; 2466 aChanging := changing; 2426 2467 try 2427 2468 ALabTest := nil; 2428 2469 aTypeScreen := ''; 2429 aSpecimen := '^'; 2470 aSpecimen := ''; 2471 aSpecimenUID := ''; 2472 aSpecimenReq := ''; 2430 2473 aTestYes := '1'; 2431 2474 aModifier := ''; 2432 2475 changing := true; 2433 2476 tQuantity.Text := ''; 2477 changing := aChanging; 2434 2478 sub1 := ''; 2435 2479 cboModifiers.ItemIndex := -1; … … 2439 2483 ALabTest := TLabTest.Create(cboAvailTest.ItemID, Responses); 2440 2484 sub := GetSubtype(ALabTest.TestName); 2441 with CtrlInits do 2442 begin 2443 SetControl(cboCollType, 'Collection Types'); 2444 LoadCollType(cboCollType); 2445 if FLastCollType <> '' then 2446 cboCollType.SelectByID(FLastCollType) 2447 else if uDfltCollType <> '' then 2448 cboCollType.SelectByID(uDfltCollType) 2449 else if OrderForInpatient then 2450 if (ALabTest.LabCanCollect) then 2451 cboCollType.SelectByID('LC') 2452 else 2453 cboCollType.SelectByID('WC') 2454 else 2455 cboCollType.SelectByID('SP'); 2456 SetupCollTimes(cboCollType.ItemID); 2457 end; 2485 {if not(FOrderAction in [ORDER_COPY, ORDER_EDIT, ORDER_QUICK]) then 2486 DetermineCollectionDefaults(Responses); } 2487 DetermineCollectionDefaults(Responses); 2458 2488 with cboAvailTest do 2459 2489 begin 2460 if (Length(ItemID) = 0) or (ItemID = '0') then Exit; 2490 if (Length(ItemID) = 0) or (ItemID = '0') then 2491 begin 2492 changing := aChanging; 2493 Exit; 2494 end; 2461 2495 FLastLabID := ItemID ; 2462 2496 FLastItemID := ItemID; … … 2467 2501 lvSelectionList.Items[i].Selected := true; 2468 2502 lvSelectionListClick(self); 2503 changing := aChanging; 2469 2504 Exit; 2470 2505 end; 2471 Changing := True;2472 Changing := False;2473 2506 ExtractTypeScreen(aList, uVBECList); 2474 2507 if aList.Count > 0 then aTypeScreen := aList[0]; 2475 2508 aList.Clear; 2476 2509 aTNSString := ''; 2477 if ( StrToInt(aTypeScreen) = cboAvailTest.ItemID) and (uTNSOrders.Count > 0) then2510 if (Changing = false) and (StrToInt(aTypeScreen) = cboAvailTest.ItemID) and (uTNSOrders.Count > 0) then 2478 2511 begin 2479 2512 for i := 0 to uTNSOrders.Count - 1 do … … 2482 2515 begin 2483 2516 NormalizeTopMosts; 2484 aTNSDays := TNSDaysBack;2485 2517 aTNS := 2486 2518 MessageBox(PChar(aTNSString + CRLF + CRLF + 2487 'Do you wish to continue?'),2488 2489 2519 'Do you wish to cancel this request for Type & Screen?'), 2520 PChar('Type & Screen Entered in Past ' + IntToStr(TNSDaysBack) + ' Days'), 2521 MB_YESNO); 2490 2522 RestoreTopMosts; 2491 if aTNS = 7then2523 if aTNS = 6 then 2492 2524 begin 2493 2525 cboAvailTest.ItemIndex := -1; … … 2515 2547 end; 2516 2548 end; 2517 Changing := False;2518 2549 end; 2519 2550 if LRORDERMODE = TORDER_MODE_DIAG then 2520 2551 begin 2521 2552 if Length(calWantTime.Text) > 0 then Responses.Update('DATETIME',1,ValidCollTime(calWantTime.Text),calWantTime.Text); 2522 with cboCollType do if Length(ItemID) > 0 then 2553 if Length(cboUrgency.Text) > 0 then Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text) 2554 else if changing = false then 2523 2555 begin 2524 Responses.Update('COLLECT', 1, ItemID, ItemID) ; 2525 FLastCollType := ItemID; 2526 end; 2527 if Length(cboUrgency.Text) > 0 then Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text) 2528 else 2529 begin 2530 cboUrgency.ItemIndex := 1; 2556 for i := 0 to cboUrgency.Items.Count - 1 do 2557 begin 2558 aUrgText := cboUrgency.Items[i]; 2559 if aUrgText = '9^ROUTINE' then // Find urgency default of ROUTINE 2560 begin 2561 cboUrgency.ItemIndex := i; 2562 break; 2563 end; 2564 end; 2531 2565 Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text); 2532 2566 end; 2533 2567 if Length(memDiagComment.Text) > 0 then Responses.Update('COMMENT',1,memDiagComment.Text,memDiagComment.Text); 2534 2568 if Length(cboReasons.Text) > 0 then Responses.Update('REASON',1,cboReasons.Text,cboReasons.Text); 2569 with cboCollTime do 2570 2535 2571 if cboCollType.ItemID = 'LC' then 2536 2572 begin … … 2547 2583 end; 2548 2584 end 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2585 else 2586 begin 2587 with calCollTime do 2588 if FMDateTime > 0 then 2589 begin 2590 Responses.Update('START', 1, ValidCollTime(Text), Text); 2591 FLastColltime := ValidCollTime(Text); 2592 end 2593 else 2594 begin 2595 Responses.Update('START', 1, '', '') ; 2596 FLastCollTime := ''; 2597 end; 2598 end; 2599 if Length(cboCollType.Text) > 0 then Responses.Update('COLLECT',1,cboCollType.ItemID,cboCollType.ItemID); 2564 2600 end; 2565 if length(cboCollTime.ItemID) > 0 then aCollTime := cboCollTime.Items[cboCollTime.ItemIndex];2566 2601 uTestSelected := true; 2567 2602 with lvSelectionList do … … 2583 2618 end; 2584 2619 end; 2585 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimen + '^' + aCollTime + '^' + cboCollType.Text + '^' + IntToStr(aLabTest.ItemID); //aSpecimen has 2 pieces2620 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimenReq + '^' + aSpecimen + '^' + aSpecimenUID + '^' + IntToStr(aLabTest.ItemID); 2586 2621 uSelectedItems.Add(aStr); 2587 2622 CurAdd := 1; … … 2600 2635 aList.Free; 2601 2636 end; 2602 edtResults.Height := 247;2603 edtInfo.Height := 247;2604 2637 if lvSelectionList.Items.Count > 0 then 2605 2638 begin … … 2618 2651 aMSBOS,aMSBOSContinue,curAdd,AnInstance: integer; 2619 2652 sub,sub1: string; 2620 AResponse: TResponse;2621 2653 ListItem: TListItem; 2622 aTypeScreen,aSpecimen,aTestYes,aStr,aMsg,aModifier,x,x1,aReason,aSurgery,aCollTime,aCollSave,aName: String; 2654 aTypeScreen,aSpecimen,aSpecimenUID,aSpecimenReq,aTestYes,aStr,aMsg,aModifier,x,x1,aReason,aSurgery,aCollTime,aCollSave,aName,aUrgText: String; 2655 aChanging: Boolean; 2623 2656 begin 2624 2657 if cboAvailComp.ItemID = '' then Exit; … … 2626 2659 aTests := TStringList.Create; 2627 2660 sub1 := ''; 2661 aChanging := changing; 2628 2662 try 2629 2663 DisableDiagTestControls; … … 2634 2668 tQuantity.Text := ''; 2635 2669 cboModifiers.ItemIndex := -1; 2636 changing := false;2670 changing := aChanging; 2637 2671 end; 2638 2672 LRORDERMODE := TORDER_MODE_COMP; … … 2652 2686 ALabTest := TLabTest.Create(ItemID, Responses); 2653 2687 sub := GetSubtype(ALabTest.TestName); 2654 Changing := False;2688 changing := aChanging; 2655 2689 StatusText(''); 2656 2690 end; 2657 //Check for and display any associated Lab Results2658 2691 aList.Clear; 2659 2692 TestAdded := 0; 2660 2693 getTest := 0; 2661 ExtractTests(aList, uVBECList); //Get Results associated with ordered components2694 ExtractTests(aList, uVBECList); //Get Lab Results associated with ordered components 2662 2695 for j := 0 to aList.Count - 1 do 2663 2696 begin … … 2683 2716 if TestAdded = 1 then 2684 2717 begin 2685 edtResults.Clear;2686 2718 aTests.Clear; 2687 2719 GetPatientBloodResults(aTests, Patient.DFN, uTestsForResults); 2688 QuickCopy(ATests,edtResults); 2689 if edtResults.Lines.Count > 0 then TabResults.Caption := 'Lab Results Available'; 2690 uRaw.Clear; 2691 GetPatientBloodResultsRaw(uRaw, Patient.DFN, uTestsForResults); 2720 if aTests.Count > 0 then 2721 begin 2722 edtResults.Clear; 2723 QuickCopy(ATests,edtResults); 2724 TabResults.Caption := 'Lab Results Available'; 2725 uRaw.Clear; 2726 GetPatientBloodResultsRaw(uRaw, Patient.DFN, uTestsForResults); 2727 end; 2692 2728 end; 2693 2729 CurAdd := 1; … … 2699 2735 end; 2700 2736 aTypeScreen := ''; 2701 aSpecimen := '^'; 2737 aSpecimen := ''; 2738 aSpecimenUID := ''; 2739 aSpecimenReq := ''; 2702 2740 aTestYes := '0'; 2703 2741 aReason := ''; … … 2709 2747 aList.Clear; 2710 2748 ExtractSpecimen(aList, uVBECList); 2711 if aList.Count > 0 then aSpecimen := aList[0]; 2749 if aList.Count > 0 then 2750 begin 2751 aSpecimen := piece(aList[0], '^', 1); 2752 aSpecimenUID := piece(aList[0], '^', 2); 2753 end; 2754 if (cboSurgery.ItemID = '') and (length(cboSurgery.Text) > 0) then 2755 begin 2756 for i := 0 to cboSurgery.Items.Count - 1 do 2757 if uppercase(cboSurgery.Text) = uppercase(piece(cboSurgery.Items[i],'^',2)) then 2758 begin 2759 cboSurgery.ItemIndex := i; 2760 Break; 2761 end; 2762 end; 2712 2763 if length(cboModifiers.ItemID) > 0 then aModifier := cboModifiers.Items[cboModifiers.ItemIndex]; 2713 2764 if length(cboReasons.ItemID) > 0 then aReason := cboReasons.Items[cboReasons.ItemIndex]; 2714 2765 if length(cboSurgery.ItemID) > 0 then aSurgery := cboSurgery.Items[cboSurgery.ItemIndex]; 2715 if length(cboCollTime.ItemID) > 0 then aCollTime := cboCollTime.Items[cboCollTime.ItemIndex]; 2716 if Length(cboSurgery.ItemID) > 0 then 2717 begin 2766 if (Length(cboSurgery.ItemID) > 0) and (length(tQuantity.Text) > 0) and (strToInt(tQuantity.Text) > 0) then 2767 begin 2768 uChangingMSBOS := true; 2769 cboSurgeryChange(self); 2770 uChangingMSBOS := false; 2771 if cboAvailComp.ItemIndex = -1 then Exit; 2718 2772 aList.Clear; 2719 2773 ExtractMSBOS(aList, uVBECList); //Get maximum units for selected Surgey … … 2721 2775 begin 2722 2776 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) 2723 and ( piece(aList[i],'^',3) = cboSurgery.Text) then2777 and (uppercase((piece(aList[i],'^',3))) = uppercase(cboSurgery.Text)) then 2724 2778 begin 2725 2779 aMSBOS := StrToInt(piece(aList[i],'^',4)); … … 2731 2785 aMSBOSContinue := 2732 2786 MessageBox(PChar('The number of units ordered (' + tQuantity.Text + 2733 ') for ' + aLabTest.TestName + ' exceeds the maximum number of units (' 2734 + IntToStr(aMSBOS) + 2735 ') for the ' + cboSurgery.text + 2736 ' surgical procedure selected.' + CRLF + CRLF + 'Do you wish to continue?'), 2737 PChar('Maximum Number of Units Exceeded'), 2738 MB_YESNO); 2787 ') for ' + aLabTest.TestName + ' Exceeds the maximum number recommended (' 2788 + IntToStr(aMSBOS) + 2789 ') for the ' + cboSurgery.text + 2790 ' surgical procedure.' + CRLF + 2791 'If you need to order more than the maximum number of units, please enter a justification in the Comment box.' 2792 + CRLF + CRLF + 'Edit the Blood component Quantity?'), 2793 PChar('Maximum Number of Units Exceeded'), 2794 MB_YESNO); 2739 2795 RestoreTopMosts; 2740 2796 end; 2741 if aMSBOSContinue = 7then2797 if aMSBOSContinue = 6 then 2742 2798 begin 2743 2799 ShowMsg(cboAvailComp.Text + ' has NOT been added to this request.'); … … 2748 2804 end; 2749 2805 end; 2750 if (uTNSOrders.Count < 1) then // SpecimenNeeded(aList, uVBECList, aLabTest.ItemID) then //check to see if type and screen is needed2806 if (uTNSOrders.Count < 1) and (SpecimenNeeded(aList, uVBECList, aLabTest.ItemID)) then //check to see if type and screen is needed CQ 17349 2751 2807 begin 2752 2808 uGetTnS := 1; … … 2772 2828 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) then 2773 2829 begin 2774 aSpecimen := piece(aList[i],'^',2) + '^' + aSpecimen; 2830 aSpecimenReq := piece(aList[i],'^',2); 2831 if (SpecimenNeeded(aList, uVBECList, aLabTest.ItemID)) then 2832 aSpecimenUID := ''; 2775 2833 break; 2776 2834 end; … … 2794 2852 ListItem.SubItems.Add(piece(cboAvailComp.Items[cboAvailComp.ItemIndex],'^',1)); 2795 2853 end; 2796 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimen + '^' + IntToStr(aLabTest.ItemID); //aSpecimen has 2 pieces additional pieces added for Tests2854 aStr := aTestYes + '^' + IntToStr(aLabTest.TestID) + '^' + tQuantity.Text + '^' + aModifier + '^' + aSpecimenReq + '^' + aSpecimen + '^' + aSpecimenUID + '^' + IntToStr(aLabTest.ItemID); 2797 2855 uSelectedItems.Add(aStr); 2798 2856 CurAdd := 1; … … 2816 2874 else 2817 2875 begin 2818 cboUrgency.ItemIndex := 1; 2876 cboUrgency.ItemIndex := 2; 2877 for j := 0 to cboUrgency.Items.Count - 1 do 2878 begin 2879 aUrgText := cboUrgency.Items[j]; 2880 if aUrgText = '9^ROUTINE' then // Find urgency default of ROUTINE 2881 begin 2882 cboUrgency.ItemIndex := i; 2883 break; 2884 end; 2885 end; 2819 2886 Responses.Update('URGENCY',1,cboUrgency.ItemID,cboUrgency.Text); 2820 2887 end; … … 2836 2903 pnlMessage.Visible := true; 2837 2904 pnlDiagnosticTests.Caption := 'Diagnostic Tests*'; 2838 end; 2839 {if uGetTnS = 1 then 2840 begin 2841 if responses.QuickOrder < 1 then 2842 begin 2843 for i := 1 to cboAvailTest.Items.Count - 1 do 2844 begin 2845 if piece(cboAvailTest.Items[i],'^',1) = aTypeScreen then 2846 begin 2847 if piece(aSpecimen,'^',1) = '1' then 2848 begin 2849 cboCollTime.Text := calWantTime.Text; 2850 aCollSave := cboCollTime.Text + '^' + cboCollTime.ItemID + '^' + cboCollType.Text + '^' + cboCollType.ItemID; 2851 cboCollTime.Text := ''; 2852 cboCollType.Text := ''; 2853 uSpecimen := 1; 2854 end; 2855 cboModifiers.Text := ''; 2856 cboAvailTest.SelectByID(aTypeScreen); 2857 cboTests.SelectByID(aTypeScreen); 2858 cboTestsClick(self); 2859 //cboAvailTestSelect(Self); 2860 uSpecimen := 0; 2861 cboCollTime.Text := piece(aCollSave,'^',1); 2862 cboCollType.Text := piece(aCollSave,'^',3); 2863 aCollSave := ''; 2864 break; 2865 end; 2866 end; 2867 aMsg := 'An order for Type and Screen has been added to this request' + '.'; 2868 end 2869 else 2870 begin 2871 lblTNS.Caption := 'TYPE + SCREEN must be added to order'; 2872 lblTNS.Visible := true; 2873 memMessage.Text := 'TYPE + SCREEN must be added to order'; 2874 memMessage.Visible := false; 2875 pnlMessage.Visible := true; 2876 end; 2877 end; 2878 if (uGetTnS = 1) then 2879 begin 2880 if length(aMsg) > 0 then aMsg := aMsg + crlf + crlf; 2881 ShowMsg(aMsg); 2882 end; } 2883 edtResults.Height := 247; 2884 edtInfo.Height := 247; 2905 end 2906 else pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 2885 2907 if lvSelectionList.Items.Count > 0 then 2886 2908 begin … … 2899 2921 2900 2922 procedure TfrmODBBank.DisableComponentControls; 2923 var 2924 j: integer; 2901 2925 begin 2902 2926 lblQuantity.Enabled := false; … … 2904 2928 lblModifiers.Enabled := false; 2905 2929 cboModifiers.Enabled := false; 2930 lblQuantity.Caption := 'Quantity'; 2931 lblWanted.Caption := 'Date/Time Wanted'; 2932 lblReason.Caption := 'Reason for Request'; 2906 2933 cboAvailComp.ItemIndex := -1; 2934 for j := uSelectedItems.Count - 1 downto 0 do 2935 begin 2936 if piece(uSelectedItems[j],'^',1) = '0' then 2937 begin 2938 lblReason.Caption := 'Reason for Request*'; 2939 lblWanted.Caption := 'Date/Time Wanted*'; 2940 Break; 2941 end; 2942 end; 2907 2943 end; 2908 2944 … … 2913 2949 lblModifiers.Enabled := true; 2914 2950 cboModifiers.Enabled := true; 2951 lblQuantity.Caption := 'Quantity*'; 2952 lblWanted.Caption := 'Date/Time Wanted*'; 2953 lblReason.Caption := 'Reason for Request*'; 2915 2954 if not(changing) then 2916 2955 if not(uSelUrgency = 'PRE-OP') then … … 2919 2958 cboUrgency.SelectByID(IntToStr(uDfltUrgency)); 2920 2959 if cboUrgency.Text = 'PRE-OP' then 2921 begin 2922 lblSurgery.Enabled := true; 2923 cboSurgery.Enabled := true; 2924 lblSurgery.Caption := 'Surgery*'; 2925 end 2926 else 2927 begin 2928 lblSurgery.Enabled := false; 2929 cboSurgery.Enabled := false; 2930 lblSurgery.Caption := 'Surgery'; 2931 end; 2960 begin 2961 lblSurgery.Enabled := true; 2962 cboSurgery.Enabled := true; 2963 lblSurgery.Caption := 'Surgery*'; 2964 end 2965 else 2966 begin 2967 if Length(cboSurgery.Text) > 0 then 2968 begin 2969 lblSurgery.Enabled := true; 2970 cboSurgery.Enabled := true; 2971 lblSurgery.Caption := 'Surgery*'; 2972 end 2973 else 2974 begin 2975 lblSurgery.Enabled := false; 2976 cboSurgery.Enabled := false; 2977 lblSurgery.Caption := 'Surgery'; 2978 cboSurgery.ItemIndex := -1; 2979 Responses.Update('MISC',1,cboSurgery.Text,cboSurgery.Text); 2980 end; 2981 end; 2982 2932 2983 lblDiagComment.Enabled := true; 2933 2984 end; 2934 2985 2935 2986 procedure TfrmODBBank.DisableDiagTestControls; 2936 begin 2937 lblCollTime.Enabled := false; 2938 calCollTime.Enabled := false; 2939 cboCollTime.Enabled := false; 2940 lblCollType.Enabled := false; 2941 cboCollType.Enabled := false; 2942 cmdImmedColl.Enabled := false; 2987 var 2988 i,j: integer; 2989 diagflg: boolean; 2990 begin 2991 diagflg := false; 2992 for i := 0 to uSelectedItems.Count - 1 do 2993 begin 2994 if (piece(uSelectedItems[i],'^',1) = '1') then 2995 begin 2996 diagflg := true; 2997 Break; 2998 end; 2999 end; 3000 if diagflg = false then 3001 begin 3002 lblCollTime.Enabled := false; 3003 calCollTime.Enabled := false; 3004 cboCollTime.Enabled := false; 3005 lblCollType.Enabled := false; 3006 cboCollType.Enabled := false; 3007 cmdImmedColl.Enabled := false; 3008 end; 3009 lblCollTime.Caption := 'Collection Date/Time'; 3010 lblCollType.Caption := 'Collection Type'; 2943 3011 cboAvailTest.ItemIndex := -1; 2944 cboAvailTest.InitLongList(''); 3012 for j := uSelectedItems.Count - 1 downto 0 do 3013 begin 3014 if piece(uSelectedItems[j],'^',1) = '1' then 3015 begin 3016 lblCollTime.Caption := 'Collection Date/Time*'; 3017 lblCollType.Caption := 'Collection Type*'; 3018 Break; 3019 end; 3020 end; 2945 3021 end; 2946 3022 … … 2953 3029 cboCollType.Enabled := true; 2954 3030 cmdImmedColl.Enabled := true; 3031 lblCollTime.Caption := 'Collection Date/Time*'; 3032 lblCollType.Caption := 'Collection Type*'; 2955 3033 if not(changing) then 2956 3034 if not(uSelUrgency = 'PRE-OP') then … … 2971 3049 begin 2972 3050 if ALabTest = nil then exit; 2973 if ALabTest.LabSubscript = 'BB' then exit;2974 calCollTime.Clear;2975 cboCollTime.Clear;2976 3051 calCollTime.Enabled := True; 2977 3052 lblCollTime.Enabled := True; … … 3024 3099 begin 3025 3100 calCollTime.Enabled := False; 3026 if RespStart <> nil then txtImmedColl.Text := RespStart.EValue; 3101 cboCollType.SelectByID('I'); 3102 SetupCollTimes('I'); 3103 //cboCollTypeClick(self); 3104 //txtImmedColl.Enabled := True; 3105 if RespStart <> nil then 3106 begin 3107 txtImmedColl.Text := RespStart.EValue; 3108 end; 3027 3109 end; 3028 3110 end … … 3032 3114 end; 3033 3115 3116 procedure TfrmODBBank.cboAvailTestEnter(Sender: TObject); 3117 var 3118 j: integer; 3119 begin 3120 inherited; 3121 if Length(cboAvailTest.Text) > 0 then Exit; 3122 for j := uSelectedItems.Count - 1 downto 0 do 3123 begin 3124 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '1') then 3125 begin 3126 lvSelectionList.Items[j].Selected := true; 3127 lvSelectionListClick(self); 3128 Break; 3129 end; 3130 end; 3131 end; 3132 3034 3133 procedure TfrmODBBank.cboAvailTestExit(Sender: TObject); 3035 3134 begin 3036 3135 inherited; 3037 if (Length(cboAvailTest.ItemID) = 0) or (cboAvailTest.ItemID = '0') then Exit; 3136 if (Length(cboAvailTest.Text)>0) and (Length(cboAvailTest.ItemID) = 0) or (cboAvailTest.ItemID = '0') then 3137 begin 3138 ShowMsg('Invalid Test Selection. Please select a valid Test.'); 3139 cboAvailTestSelect(cboAvailTest); 3140 cboAvailTest.SetFocus; 3141 Exit; 3142 end; 3038 3143 if cboAvailTest.ItemID = FLastLabID then Exit; 3039 cboAvailTestSelect(cboAvailTest); 3040 cboAvailTest.SetFocus; 3041 PostMessage(Handle, WM_NEXTDLGCTL, 0, 0); 3042 end; 3043 3044 procedure TfrmODBBank.cboAvailCompChange(Sender: TObject); 3045 begin 3046 inherited; 3047 changing := true; 3048 changing := false; 3144 if not (Length(cboAvailTest.ItemID) = 0) then cboAvailTestSelect(cboAvailTest); 3145 end; 3146 3147 procedure TfrmODBBank.cboAvailCompEnter(Sender: TObject); 3148 var 3149 j: integer; 3150 begin 3151 inherited; 3152 if Length(cboAvailComp.Text) > 0 then Exit; 3153 for j := uSelectedItems.Count - 1 downto 0 do 3154 begin 3155 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '0') then 3156 begin 3157 lvSelectionList.Items[j].Selected := true; 3158 lvSelectionListClick(self); 3159 Break; 3160 end; 3161 end; 3049 3162 end; 3050 3163 … … 3052 3165 begin 3053 3166 inherited; 3054 if (Length(cboAvailComp.ItemID) = 0) or (cboAvailComp.ItemID = '0') then Exit; 3167 if (Length(cboAvailComp.Text)>0) and (Length(cboAvailComp.ItemID) = 0) or (cboAvailComp.ItemID = '0') then 3168 begin 3169 ShowMsg('Invalid Component selection. Please select a valid Component.'); 3170 cboAvailCompSelect(cboAvailComp); 3171 cboAvailComp.SetFocus; 3172 Exit; 3173 end; 3055 3174 if cboAvailComp.ItemID = FLastLabID then Exit; 3056 cboAvailCompSelect(cboAvailComp); 3057 cboAvailComp.SetFocus; 3058 PostMessage(Handle, WM_NEXTDLGCTL, 0, 0); 3175 if not (Length(cboAvailComp.ItemID) = 0) then cboAvailCompSelect(cboAvailComp); 3059 3176 end; 3060 3177 … … 3130 3247 end; 3131 3248 3249 procedure TfrmODBBank.pnlBloodComponentsClick(Sender: TObject); 3250 begin 3251 inherited; 3252 cboAvailComp.SetFocus; 3253 end; 3254 3255 procedure TfrmODBBank.pnlBloodComponentsEnter(Sender: TObject); 3256 begin 3257 inherited; 3258 pnlBloodComponents.Color := clActiveborder; 3259 end; 3260 3261 procedure TfrmODBBank.pnlBloodComponentsExit(Sender: TObject); 3262 begin 3263 inherited; 3264 pnlBloodcomponents.Color := clBtnFace; 3265 end; 3266 3267 procedure TfrmODBBank.pnlDiagnosticTestsClick(Sender: TObject); 3268 begin 3269 inherited; 3270 cboAvailTest.SetFocus; 3271 end; 3272 3273 procedure TfrmODBBank.pnlDiagnosticTestsEnter(Sender: TObject); 3274 begin 3275 inherited; 3276 pnlDiagnosticTests.Color := clActiveBorder; 3277 end; 3278 3279 procedure TfrmODBBank.pnlDiagnosticTestsExit(Sender: TObject); 3280 begin 3281 inherited; 3282 pnlDiagnosticTests.Color := clBtnFace; 3283 end; 3284 3132 3285 procedure TfrmODBBank.cboCollTimeChange(Sender: TObject); 3133 3286 var … … 3163 3316 end; 3164 3317 3318 procedure TfrmODBBank.cboCollTimeEnter(Sender: TObject); 3319 var 3320 j: integer; 3321 begin 3322 inherited; 3323 if Length(cboAvailTest.Text) > 0 then Exit; 3324 for j := uSelectedItems.Count - 1 downto 0 do 3325 begin 3326 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '1') then 3327 begin 3328 lvSelectionList.Items[j].Selected := true; 3329 lvSelectionListClick(self); 3330 Break; 3331 end; 3332 end; 3333 end; 3334 3165 3335 procedure TfrmODBBank.cboCollTypeChange(Sender: TObject); 3166 3336 begin … … 3180 3350 SetupCollTimes(cboCollType.ItemID); 3181 3351 if Length(cboCollType.Text) > 0 then Responses.Update('COLLECT',1,cboCollType.ItemID,cboCollType.ItemID); 3182 FLastCollType := cboCollType.ItemID;3183 3352 calCollTimeChange(self); 3353 end; 3354 3355 procedure TfrmODBBank.cboCollTypeClick(Sender: TObject); 3356 begin 3357 inherited; 3358 FOrderAction := 0; 3359 end; 3360 3361 procedure TfrmODBBank.cboCollTypeEnter(Sender: TObject); 3362 var 3363 j: integer; 3364 begin 3365 inherited; 3366 if Length(cboAvailTest.Text) > 0 then Exit; 3367 for j := uSelectedItems.Count - 1 downto 0 do 3368 begin 3369 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '1') then 3370 begin 3371 lvSelectionList.Items[j].Selected := true; 3372 lvSelectionListClick(self); 3373 Break; 3374 end; 3375 end; 3184 3376 end; 3185 3377 … … 3226 3418 end; 3227 3419 3420 procedure TfrmODBBank.cboModifiersEnter(Sender: TObject); 3421 var 3422 j: integer; 3423 begin 3424 inherited; 3425 if Length(cboAvailComp.Text) > 0 then Exit; 3426 for j := uSelectedItems.Count - 1 downto 0 do 3427 begin 3428 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '0') then 3429 begin 3430 lvSelectionList.Items[j].Selected := true; 3431 lvSelectionListClick(self); 3432 Break; 3433 end; 3434 end; 3435 end; 3436 3228 3437 procedure TfrmODBBank.LoadModifiers(AComboBox:TORComboBox); 3229 3438 var … … 3257 3466 begin 3258 3467 Clear; 3259 for i := 0 to uUrgencyList.Count - 1 do3468 {for i := 0 to uUrgencyList.Count - 1 do 3260 3469 if (piece(uUrgencyList[i],'^',2) = 'STAT') and (StatAllowed(Patient.DFN) = false) then 3261 3470 Continue 3262 3471 else 3263 Items.Add(uUrgencyList[i]); 3472 Items.Add(uUrgencyList[i]); } 3473 for i := 0 to uUrgencyList.Count - 1 do 3474 Items.Add(uUrgencyList[i]); 3264 3475 end; 3265 3476 end; … … 3281 3492 if cboCollType.ItemID = 'LC' then 3282 3493 begin 3283 if FLastLabCollTime <> ''then3494 if (FLastLabCollTime <> '') and (length(cboCollTime.Text) < 1) then 3284 3495 cboCollTime.SelectByID(piece(FLastLabCollTime,'^',1)); 3285 3496 end 3286 else 3497 else if length(calcollTime.Text) < 1 then 3287 3498 begin 3288 3499 if FLastCollTime = 'TODAY' then … … 3293 3504 calCollTime.Text := FormatFMDateTime('mmm dd,yyyy@hh:nn',StrToFMDateTime(FLastCollTime)); 3294 3505 end; 3295 if FLastCollType <> ''then3506 if (FLastCollType <> '') and (length(cboCollType.Text) < 1) then 3296 3507 cboCollType.SelectByID(FLastCollType); 3297 3508 if uSelectedItems.Count > 0 then … … 3325 3536 begin 3326 3537 inherited; 3538 memDiagComment.Text := StringReplace(memDiagComment.Text,CRLF,' ',[rfReplaceAll]); 3327 3539 if (length(memDiagComment.Text) > 250) then 3328 3540 begin … … 3353 3565 end; 3354 3566 3567 procedure TfrmODBBank.FormShow(Sender: TObject); 3568 begin 3569 inherited; 3570 pgeProduct.SetFocus; 3571 end; 3572 3355 3573 procedure TfrmODBBank.btnRemoveClick(Sender: TObject); 3356 3574 var … … 3358 3576 x, aName, aModifier, aReason, aTypeScreen: string; 3359 3577 aList: TStringList; 3360 aSel, aSelTst : boolean;3578 aSel, aSelTst, aSelComp, aGotTNS : boolean; 3361 3579 begin 3362 3580 inherited; … … 3369 3587 aSel := false; 3370 3588 aSelTst := false; 3589 aSelComp := false; 3590 aGotTNS := false; 3371 3591 ExtractTypeScreen(aList, uVBECList); 3372 3592 if aList.Count > 0 then aTypeScreen := aList[0]; … … 3381 3601 cboAvailComp.ItemIndex := -1; 3382 3602 tQuantity.Text := ''; 3603 tQuantity.Enabled := false; 3604 lblQuantity.Enabled := false; 3383 3605 cboAvailTest.ItemIndex := -1; 3384 3606 uGetTnS := 0; … … 3398 3620 if lvSelectionList.Items[i].SubItems[3] = piece(uSelectedItems[j],'^',2) then 3399 3621 begin 3400 {if (uGetTnS = 1) and (lvSelectionList.Items[i].SubItems[3] = aTypeScreen) then3401 begin3402 uGetTnS := 1;3403 lblTNS.Caption := 'TYPE+SCREEN must be added to order';3404 lblTNS.Visible := true;3405 memMessage.Text := 'TYPE + SCREEN must be added to order';3406 //memMessage.Visible := true;3407 pnlMessage.Visible := true;3408 pnlDiagnosticTests.Caption := 'Diagnostic Tests*';3409 end; }3410 3622 uSelectedItems.Delete(j); 3411 3623 lvSelectionList.Items[i].Delete; … … 3415 3627 end; 3416 3628 end; 3417 for i := uSelectedItems.Count - 1 downto 0 do3418 begin 3419 if (not(piece(uSelectedItems[i],'^',1) = '1')) and (uTNSOrders.Count < 1) then // and (SpecimenNeeded(aList, uVBECList, StrToInt(piece(uSelectedItems[i],'^',9))))then3629 for i := lvSelectionList.Items.Count - 1 downto 0 do 3630 begin 3631 if lvSelectionList.Items[i].SubItems[3] = aTypeScreen then 3420 3632 begin 3421 uGetTnS := 1; 3422 lblTNS.Caption := 'TYPE+SCREEN must be added to order'; 3423 lblTNS.Visible := true; 3424 memMessage.Text := 'TYPE + SCREEN must be added to order'; 3425 //memMessage.Visible := true; 3426 pnlMessage.Visible := true; 3427 pnlDiagnosticTests.Caption := 'Diagnostic Tests*'; 3633 aGotTNS := true; 3428 3634 break; 3429 3635 end; 3430 3636 end; 3431 3637 if aGotTNS = false then 3638 begin 3639 for i := uSelectedItems.Count - 1 downto 0 do 3640 begin 3641 if not(piece(uSelectedItems[i],'^',1) = '1') and (uTNSOrders.Count < 1) and (piece(uSelectedItems[i],'^',5) = '1') then //CQ 17349 3642 begin 3643 uGetTnS := 1; 3644 lblTNS.Caption := 'TYPE + SCREEN must be added to order'; 3645 lblTNS.Visible := true; 3646 memMessage.Text := 'TYPE + SCREEN must be added to order'; 3647 pnlMessage.Visible := true; 3648 pnlDiagnosticTests.Caption := 'Diagnostic Tests*'; 3649 break; 3650 end 3651 else pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 3652 end; 3653 end; 3432 3654 if (aSel = false) and (lvSelectionList.Items.Count > 0) then 3433 3655 begin … … 3436 3658 end; 3437 3659 Responses.Clear; 3660 pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 3661 lblCollTime.Caption := 'Collection Date/Time'; 3662 lblCollType.Caption := 'Collection Type'; 3663 lblQuantity.Caption := 'Quantity'; 3664 lblWanted.Caption := 'Date/Time Wanted'; 3665 lblReason.Caption := 'Reason for Request'; 3438 3666 if lvSelectionList.Items.Count < 1 then 3439 3667 begin 3440 cboReasons.ItemIndex := -1; 3441 memDiagComment.Text := ''; 3442 cboSurgery.ItemIndex := -1; 3443 cboUrgency.ItemIndex := -1; 3668 uGetTnS := 0; 3669 lblTNS.Caption := ''; 3670 lblTNS.Visible := false; 3671 memMessage.Text := ''; 3672 pnlMessage.Visible := false; 3673 FLastItemID := ''; 3674 InitDialog; 3675 cboModifiers.ItemIndex := -1; 3676 cboAvailTest.ItemIndex := -1; 3677 cboAvailComp.ItemIndex := -1; 3444 3678 cboCollType.ItemIndex := -1; 3445 3679 cboCollTime.ItemIndex := -1; 3446 3680 cboQuick.ItemIndex := -1; 3447 calCollTime.Text := ''; 3681 calWantTime.Text := ''; 3682 GroupBox1.Visible := true; 3683 tQuantity.Text := ''; 3684 FLastCollType := ''; 3685 FLastCollTime := ''; 3686 FLastLabCollTime := ''; 3687 txtImmedColl.Text := ''; 3688 calCollTime.text := ''; 3689 lblNoBloodReq.Visible := false; 3448 3690 end; 3449 3691 for i := 0 to uSelectedItems.Count - 1 do … … 3454 3696 begin 3455 3697 if Length(piece(x,'^',2)) > 0 then Responses.Update('ORDERABLE', CurAdd, piece(x,'^',2), aName); 3698 lblCollTime.Caption := 'Collection Date/Time*'; 3699 lblCollType.Caption := 'Collection Type*'; 3456 3700 aSelTst := true; 3457 3701 end … … 3465 3709 cboAvailComp.ItemIndex := -1; 3466 3710 tQuantity.Text := ''; 3711 lblQuantity.Caption := 'Quantity*'; 3712 lblWanted.Caption := 'Date/Time Wanted*'; 3713 lblReason.Caption := 'Reason for Request*'; 3714 //aSelComp := true; 3467 3715 end; 3468 3716 Inc(CurAdd); … … 3474 3722 calCollTime.Text := ''; 3475 3723 end; 3724 {if aSelcomp = false then 3725 lblNoBloodReq.Visible := false 3726 else 3727 lblNoBloodReq.Visible := true; } 3476 3728 if Length(calWantTime.Text) > 0 then Responses.Update('DATETIME',1,ValidCollTime(calWantTime.Text),calWantTime.Text); 3477 3729 if cboCollType.ItemID = 'LC' then … … 3569 3821 memMessage.Text := ''; 3570 3822 pnlMessage.Visible := false; 3823 FLastItemID := ''; 3571 3824 InitDialog; 3572 3825 cboModifiers.ItemIndex := -1; … … 3583 3836 GroupBox1.Visible := true; 3584 3837 tQuantity.Text := ''; 3838 tQuantity.Enabled := false; 3839 lblQuantity.Enabled := false; 3585 3840 FLastCollType := ''; 3586 3841 FLastCollTime := ''; 3587 3842 FLastLabCollTime := ''; 3588 3843 txtImmedColl.Text := ''; 3844 calCollTime.text := ''; 3845 lblNoBloodReq.Visible := false; 3846 pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 3847 lblCollTime.Caption := 'Collection Date/Time'; 3848 lblCollType.Caption := 'Collection Type'; 3849 lblQuantity.Caption := 'Quantity'; 3850 lblWanted.Caption := 'Date/Time Wanted'; 3851 lblReason.Caption := 'Reason for Request'; 3589 3852 end; 3590 3853 … … 3622 3885 3623 3886 procedure TfrmODBBank.calWantTimeChange(Sender: TObject); 3624 begin 3625 inherited; 3887 var 3888 i: integer; 3889 aList: TStringList; 3890 aSpecimen, aSpecimenUID, aSpecimenReq: string; 3891 aChanging: Boolean; 3892 begin 3893 inherited; 3894 aList := TStringList.Create; 3895 aChanging := changing; 3896 try 3897 aSpecimen := ''; 3898 aSpecimenUID := ''; 3899 aSpecimenReq := ''; 3626 3900 if uSelectedItems.Count > 0 then 3627 3901 begin 3628 with calWantTime do if not Changing then3902 with calWantTime do if not changing then 3629 3903 begin 3630 3904 if FMDateTime = 0 then 3631 3905 begin 3632 3906 ShowMsg('Invalid Date/Time entered'); 3633 Changing := true;3907 changing := true; 3634 3908 calWantTime.Text := ''; 3635 Changing := false;3909 changing := aChanging; 3636 3910 Exit; 3637 3911 end … … 3642 3916 begin 3643 3917 ShowMsg('Date/Time Wanted must be a future Date/Time'); 3644 Changing := true;3918 changing := true; 3645 3919 calWantTime.Text := ''; 3646 Changing := false;3920 changing := aChanging; 3647 3921 Exit; 3648 3922 end; … … 3651 3925 if Length(calWantTime.Text) > 0 then Responses.Update('DATETIME',1,ValidCollTime(calWantTime.Text),calWantTime.Text); 3652 3926 memOrder.Text := Responses.OrderText; 3927 aList.Clear; 3928 ExtractSpecimen(aList, uVBECList); 3929 if aList.Count > 0 then 3930 begin 3931 aSpecimen := piece(aList[0], '^', 1); 3932 aSpecimenUID := piece(aList[0], '^', 2); 3933 end; 3934 aList.Clear; 3935 ExtractSpecimens(aList, uVBECList); //Get specimen values to pass back to Server 3936 for i := 0 to aList.Count - 1 do 3937 begin 3938 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) then 3939 begin 3940 aSpecimenReq := piece(aList[i],'^',2); 3941 if (SpecimenNeeded(aList, uVBECList, aLabTest.ItemID)) then 3942 aSpecimenUID := ''; 3943 break; 3944 end; 3945 end; 3946 Responses.Update('SPECSTS', 1, aSpecimenReq + '^' + aSpecimen + '^' + aSpecimenUID, aSpecimenReq); 3947 end; 3948 finally 3949 aList.Free; 3950 end; 3951 end; 3952 3953 procedure TfrmODBBank.calWantTimeEnter(Sender: TObject); 3954 var 3955 j: integer; 3956 begin 3957 inherited; 3958 if Length(cboAvailComp.Text) > 0 then Exit; 3959 for j := uSelectedItems.Count - 1 downto 0 do 3960 begin 3961 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '0') then 3962 begin 3963 lvSelectionList.Items[j].Selected := true; 3964 lvSelectionListClick(self); 3965 Break; 3966 end; 3653 3967 end; 3654 3968 end; … … 3679 3993 else 3680 3994 begin 3681 lblSurgery.Enabled := false; 3682 cboSurgery.Enabled := false; 3683 lblSurgery.Caption := 'Surgery'; 3684 cboSurgery.ItemIndex := -1; 3685 Responses.Update('MISC',1,cboSurgery.Text,cboSurgery.Text); 3995 if Length(cboSurgery.Text) > 0 then 3996 begin 3997 lblSurgery.Enabled := true; 3998 cboSurgery.Enabled := true; 3999 lblSurgery.Caption := 'Surgery*'; 4000 end 4001 else 4002 begin 4003 lblSurgery.Enabled := false; 4004 cboSurgery.Enabled := false; 4005 lblSurgery.Caption := 'Surgery'; 4006 cboSurgery.ItemIndex := -1; 4007 Responses.Update('MISC',1,cboSurgery.Text,cboSurgery.Text); 4008 end; 3686 4009 end; 3687 4010 end … … 3700 4023 procedure TfrmODBBank.cboSurgeryChange(Sender: TObject); 3701 4024 var 3702 aList : TStringList;4025 aList, bList, cList: TStringList; 3703 4026 i,j,aMSBOS,aMSBOSContinue: integer; 3704 x: string; 3705 handled: boolean; 3706 begin 3707 inherited; 4027 x,aTypeScreen: string; 4028 handled,aGotTNS: boolean; 4029 xLabTest: TLabTest; 4030 begin 4031 inherited; 4032 cboSurgery.Text := StringReplace(cboSurgery.Text,CRLF,' ',[rfReplaceAll]); 3708 4033 aList := TStringList.Create; 4034 bList := TStringList.Create; 4035 cList := TStringList.Create; 3709 4036 handled := false; 4037 //uGetTNS := 0; 4038 //aGotTNS := false; 4039 ExtractTypeScreen(aList, uVBECList); 4040 if aList.Count > 0 then aTypeScreen := aList[0]; 4041 aList.Clear; 4042 bList.Clear; 4043 cList.Clear; 3710 4044 try 3711 if (Length(cboSurgery.ItemID) > 0) and (Length(tQuantity.Text) > 0) then 4045 cboSurgery.DroppedDown := false; 4046 if (Length(cboSurgery.ItemID) > 0) then 4047 begin 4048 for j := 0 to uSelectedItems.Count - 1 do 4049 begin 4050 xLabTest := TLabTest.Create(piece(uSelectedItems[j],'^',2), Responses); 4051 if (piece(uSelectedItems[j],'^',1) = '0') and (not(piece(uSelectedItems[j],'^',3)='')) and (StrToInt(piece(uSelectedItems[j],'^',3)) > 0) and (piece(cboSurgery.Items[cboSurgery.ItemIndex],'^',3) = '1') then 4052 begin 4053 cList.Add(xLabTest.TestName + '^' + piece(uSelectedItems[j],'^',3)); 4054 end; 4055 xLabTest.Free; 4056 end; 4057 end; 4058 if (Length(cboSurgery.ItemID) > 0) and (Length(tQuantity.Text) > 0) and (Length(cboAvailComp.Text) > 0) then 3712 4059 begin 3713 4060 aList.Clear; … … 3716 4063 begin 3717 4064 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) 3718 and ( piece(aList[i],'^',3) = cboSurgery.Text) then4065 and (uppercase((piece(aList[i],'^',3))) = uppercase(cboSurgery.Text)) then 3719 4066 begin 3720 4067 aMSBOS := StrToInt(piece(aList[i],'^',4)); 3721 4068 if (aMSBOS > 0) and (StrToInt(tQuantity.Text) > aMSBOS) then 3722 4069 begin 3723 with Application do 3724 begin 3725 NormalizeTopMosts; 3726 aMSBOSContinue := 3727 MessageBox(PChar('The number of unit Quantity selected (' + tQuantity.Text + 3728 ') for ' + aLabTest.TestName + ' exceeds the maximum number of units (' 3729 + IntToStr(aMSBOS) + 3730 ') for the ' + cboSurgery.text + 3731 ' surgical procedure selected.' + CRLF + CRLF + 'Continue to order ' + tQuantity.Text + ' units?'), 3732 PChar('Maximum Number of Units Exceeded'), 3733 MB_YESNO); 3734 RestoreTopMosts; 3735 end; 3736 if aMSBOSContinue = 7 then 3737 begin 3738 ShowMsg('Please enter a new quantity for ' + cboAvailComp.Text); 3739 tQuantity.Text := '0'; 3740 tQuantity.SelLength := 2; 3741 tQuantity.SelectAll; 3742 break; 3743 end; 4070 bList.Add(aLabTest.TestName + '^' + tQuantity.Text + '^' + IntToStr(aMSBOS)); 3744 4071 end; 3745 4072 handled := true; … … 3754 4081 for j := 0 to uSelectedItems.Count - 1 do 3755 4082 begin 3756 ALabTest := TLabTest.Create(piece(uSelectedItems[j],'^',2), Responses);4083 xLabTest := TLabTest.Create(piece(uSelectedItems[j],'^',2), Responses); 3757 4084 for i := 0 to aList.Count - 1 do 3758 4085 begin 3759 4086 if (piece(uSelectedItems[j],'^',1) = '0') 3760 and (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID)3761 and ( piece(aList[i],'^',3) = cboSurgery.Text) then4087 and (StrToInt(piece(aList[i],'^',1)) = xLabTest.ItemID) 4088 and (uppercase((piece(aList[i],'^',3))) = uppercase(cboSurgery.Text)) then 3762 4089 begin 3763 4090 aMSBOS := StrToInt(piece(aList[i],'^',4)); 3764 4091 if (aMSBOS > 0) and (length(piece(uSelectedItems[j],'^',3)) > 0) and (StrToInt(piece(uSelectedItems[j],'^',3)) > aMSBOS) then 3765 4092 begin 3766 with Application do 3767 begin 3768 NormalizeTopMosts; 3769 aMSBOSContinue := 3770 MessageBox(PChar('The number of unit Quantity selected (' + piece(uSelectedItems[j],'^',3) + 3771 ') for ' + lvSelectionList.Items[j].Caption + ' exceeds the maximum number of units (' 3772 + IntToStr(aMSBOS) + 3773 ') for the ' + cboSurgery.text + 3774 ' surgical procedure selected.' + CRLF + CRLF + 'Continue to order ' + piece(uSelectedItems[j],'^',3) + ' units?'), 3775 PChar('Maximum Number of Units Exceeded'), 3776 MB_YESNO); 3777 RestoreTopMosts; 3778 end; 3779 if aMSBOSContinue = 7 then 3780 begin 3781 ShowMsg('Please enter a new quantity for ' + lvSelectionList.Items[j].Caption); 3782 tQuantity.Text := '0'; 3783 tQuantity.SelLength := 2; 3784 tQuantity.SelectAll; 3785 x := uSelectedItems[j]; 3786 SetPiece(x,U,3,''); 3787 uSelectedItems[j] := x; 3788 lvSelectionList.Items[j].SubItems[0] := ''; 3789 RePaint; 3790 break; 3791 end; 4093 bList.Add(xLabTest.TestName + '^' + piece(uSelectedItems[j],'^',3) + '^' + IntToStr(aMSBOS)); 3792 4094 end; 3793 4095 break; 3794 4096 end; 3795 4097 end; 4098 xLabTest.Free; 4099 end; 4100 end; 4101 if (uChangingMSBOS = false) and (cList.Count > 0) then 4102 begin 4103 lblNoBloodReq.Visible := true; 4104 with Application do 4105 begin 4106 NormalizeTopMosts; 4107 aMSBOSContinue := 4108 MessageBox(PChar('No blood is required for the surgical procedure: ' + cboSurgery.text + 4109 '.' + CRLF + 4110 'If you still need to order any components, please enter a justification in the Comment box.' 4111 + CRLF + CRLF + 'Do you want me to remove ALL the component orders you''ve just entered? '), 4112 PChar('No Blood Required'),MB_YESNO); 4113 RestoreTopMosts; 4114 end; 4115 if aMSBOSContinue = 6 then 4116 begin 4117 tQuantity.Text := ''; 4118 bList.Clear; 4119 for j := uSelectedItems.Count - 1 downto 0 do 4120 begin 4121 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '0') then 4122 begin 4123 lvSelectionList.Items[j].Delete; 4124 uSelectedItems.Delete(j); 4125 Responses.Update('ORDERABLE', (j+1) ,'', ''); 4126 Responses.Update('MODIFIER', (j+1), '', ''); 4127 Responses.Update('QTY', (j+1), '', ''); 4128 end; 4129 end; 4130 cboAvailComp.Text := ''; 4131 cboAvailComp.ItemIndex := -1; 4132 cboModifiers.Text := ''; 4133 cboModifiers.ItemIndex := -1; 4134 lblNoBloodReq.Visible := false; 4135 //if fODBBank. Active then cboAvailTest.SetFocus; 4136 lblTNS.Caption := ''; 4137 lblTNS.Visible := false; 4138 uGetTNS := 0; 4139 aGotTNS := false; 4140 DisableComponentControls; 4141 for i := lvSelectionList.Items.Count - 1 downto 0 do 4142 begin 4143 if lvSelectionList.Items[i].SubItems[3] = aTypeScreen then 4144 begin 4145 aGotTNS := true; 4146 break; 4147 end; 4148 end; 4149 for i := uSelectedItems.Count - 1 downto 0 do 4150 begin 4151 if (aGotTNS = false) and not(piece(uSelectedItems[i],'^',1) = '1') and (uTNSOrders.Count < 1) and (piece(uSelectedItems[i],'^',5) = '1') then //CQ 17349 4152 begin 4153 uGetTnS := 1; 4154 lblTNS.Caption := 'TYPE + SCREEN must be added to order'; 4155 lblTNS.Visible := true; 4156 memMessage.Text := 'TYPE + SCREEN must be added to order'; 4157 pnlMessage.Visible := true; 4158 pnlDiagnosticTests.Caption := 'Diagnostic Tests*'; 4159 break; 4160 end 4161 else pnlDiagnosticTests.Caption := 'Diagnostic Tests'; 4162 end; 4163 end; 4164 end 4165 else 4166 begin 4167 lblNoBloodReq.Visible := false; 4168 end; 4169 4170 if (uChangingMSBOS = false) and (bList.Count > 0) then 4171 begin 4172 x := ''; 4173 for i := 0 to bList.Count - 1 do 4174 begin 4175 x := x + CRLF + piece(bList[i],'^',1) + ' (' + piece(bList[i],'^',2) + ') Max allowed: ' + piece(bList[i],'^',3); 4176 end; 4177 with Application do 4178 begin 4179 NormalizeTopMosts; 4180 aMSBOSContinue := 4181 MessageBox(PChar('The number of units ordered' + x + CRLF + 4182 'Exceeds the maximum number recommended for ' 4183 + cboSurgery.text + CRLF + CRLF + 4184 'If you need to order more than the recommended maximum units, please enter a justification in the Comment box.') 4185 ,PChar('Maximum Number of Units Exceeded'), 4186 MB_OK); 4187 RestoreTopMosts; 3796 4188 end; 3797 4189 end; … … 3806 4198 Responses.Update('REASON',1,cboReasons.Text,cboReasons.Text); 3807 4199 end; 3808 memOrder.Text := Responses.OrderText; 4200 memOrder.Text := Responses.OrderText; 3809 4201 finally 3810 4202 aList.Free; 4203 bList.Free; 4204 cList.Free; 3811 4205 end; 3812 4206 end; … … 3844 4238 end; 3845 4239 try 3846 if (Length(cboSurgery.ItemID) > 0) and (Length(tQuantity.Text) > 0) then 3847 begin 4240 if not(aLabTest = nil) and (Length(cboSurgery.ItemID) > 0) and (Length(tQuantity.Text) > 0) then 4241 begin 4242 uChangingMSBOS := true; 4243 cboSurgeryChange(self); 4244 uChangingMSBOS := false; 3848 4245 aList.Clear; 3849 4246 ExtractMSBOS(aList, uVBECList); //Get maximum units for selected Surgery … … 3851 4248 begin 3852 4249 if (StrToInt(piece(aList[i],'^',1)) = aLabTest.ItemID) 3853 and ( piece(aList[i],'^',3) = cboSurgery.Text) then4250 and (uppercase((piece(aList[i],'^',3))) = uppercase(cboSurgery.Text)) and (Length(tQuantity.Text) > 0) then 3854 4251 begin 3855 4252 aMSBOS := StrToInt(piece(aList[i],'^',4)); … … 3861 4258 aMSBOSContinue := 3862 4259 MessageBox(PChar('The number of units ordered (' + tQuantity.Text + 3863 ') for ' + aLabTest.TestName + ' exceeds the maximum number of units (' 3864 + IntToStr(aMSBOS) + 3865 ') for the ' + cboSurgery.text + 3866 ' surgical procedure selected.' + CRLF + CRLF + 'Do you wish to continue?'), 3867 PChar('Maximum Number of Units Exceeded'), 3868 MB_YESNO); 4260 ') for ' + aLabTest.TestName + ' Exceeds the maximum number recommended (' 4261 + IntToStr(aMSBOS) + 4262 ') for the ' + cboSurgery.text + 4263 ' surgical procedure.' + CRLF + 4264 'If you need to order more than the maximum number of units, please enter a justification in the Comment box.' 4265 + CRLF + CRLF + 'Edit the Blood component Quantity?'), 4266 PChar('Maximum Number of Units Exceeded'), 4267 MB_YESNO); 4268 3869 4269 RestoreTopMosts; 3870 4270 end; 3871 if aMSBOSContinue = 7then4271 if aMSBOSContinue = 6 then 3872 4272 begin 3873 4273 ShowMsg('Please enter a new quantity for ' + cboAvailComp.Text); … … 3927 4327 3928 4328 procedure TfrmODBBank.tQuantityEnter(Sender: TObject); 4329 var 4330 j: integer; 3929 4331 begin 3930 4332 inherited; 3931 4333 tQuantity.SelLength := 2; 3932 4334 tQuantity.SelectAll; 4335 if Length(cboAvailComp.Text) > 0 then Exit; 4336 for j := uSelectedItems.Count - 1 downto 0 do 4337 begin 4338 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '0') then 4339 begin 4340 lvSelectionList.Items[j].Selected := true; 4341 lvSelectionListClick(self); 4342 Break; 4343 end; 4344 end; 4345 end; 4346 4347 procedure TfrmODBBank.txtImmedCollEnter(Sender: TObject); 4348 var 4349 j: integer; 4350 begin 4351 inherited; 4352 if Length(cboAvailTest.Text) > 0 then Exit; 4353 for j := uSelectedItems.Count - 1 downto 0 do 4354 begin 4355 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '1') then 4356 begin 4357 lvSelectionList.Items[j].Selected := true; 4358 lvSelectionListClick(self); 4359 Break; 4360 end; 4361 end; 3933 4362 end; 3934 4363 … … 3970 4399 end; 3971 4400 4401 procedure TfrmODBBank.calCollTimeEnter(Sender: TObject); 4402 var 4403 j: integer; 4404 begin 4405 inherited; 4406 if Length(cboAvailTest.Text) > 0 then Exit; 4407 for j := uSelectedItems.Count - 1 downto 0 do 4408 begin 4409 if not(lvSelectionList.Items[j] = nil) and (piece(uSelectedItems[j],'^',1) = '1') then 4410 begin 4411 lvSelectionList.Items[j].Selected := true; 4412 lvSelectionListClick(self); 4413 Break; 4414 end; 4415 end; 4416 end; 4417 3972 4418 end.
Note:
See TracChangeset
for help on using the changeset viewer.