Changeset 830 for cprs/trunk/CPRS-Chart/rReminders.pas
- Timestamp:
- Jul 7, 2010, 4:51:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/rReminders.pas
r456 r830 3 3 interface 4 4 uses 5 Windows,Classes, SysUtils, TRPCB, ORNet, ORFn; 5 Windows,Classes, SysUtils, TRPCB, ORNet, ORFn, fMHTest, StrUtils; 6 7 type 8 TMHdllFound = record 9 DllCheck: boolean; 10 DllFound: boolean; 11 end; 6 12 7 13 procedure GetCurrentReminders; … … 21 27 function GetProgressNoteHeader: string; 22 28 function LoadMentalHealthTest(TestName: string): TStrings; 23 procedure MentalHealthTestResults(var AText: string; const DlgIEN: integer; const TestName:29 procedure MentalHealthTestResults(var AText: string; const DlgIEN: string; const TestName: 24 30 string; const AProvider: Int64; const Answers: string); 25 31 procedure SaveMentalHealthTest(const TestName: string; ADate: TFMDateTime; … … 41 47 function GetAllRemindersAndCategories: TStrings; 42 48 function VerifyMentalHealthTestComplete(TestName, Answers: string): String; 49 function MHDLLFound: boolean; 50 function UsedMHDllRPC: boolean; 51 procedure PopulateMHdll; 52 procedure GetMHResultText(var AText: string; ResultsGroups, Scores: TStringList); 43 53 44 54 … … 54 64 uNewCoverSheetListActive: integer = -1; 55 65 uCanEditAllCoverSheetLists: integer = -1; 66 MHDLL: TMHDllFound; 56 67 57 68 procedure GetCurrentReminders; … … 63 74 begin 64 75 CallV('ORQQPXRM REMINDER CATEGORIES', [Patient.DFN, Encounter.Location]); 65 Dest.Assign(RPCBrokerV.Results);76 FastAssign(RPCBrokerV.Results, Dest); 66 77 end; 67 78 … … 170 181 Param[0].Mult[AList[i]] := ''; 171 182 CallBroker; 172 AList.Assign(Results);183 FastAssign(Results, AList); 173 184 end; 174 185 end; … … 191 202 end; 192 203 193 procedure MentalHealthTestResults(var AText: string; const DlgIEN: integer; const TestName:204 procedure MentalHealthTestResults(var AText: string; const DlgIEN: string; const TestName: 194 205 string; const AProvider: Int64; const Answers: string); 195 206 var … … 203 214 RemoteProcedure := 'ORQQPXRM MENTAL HEALTH RESULTS'; 204 215 Param[0].PType := literal; 205 Param[0].Value := IntToStr(DlgIEN);216 Param[0].Value := DlgIEN; 206 217 Param[1].PType := list; 207 218 Param[1].Mult['"DFN"'] := Patient.DFN; … … 430 441 end; 431 442 443 function MHDLLFound: boolean; 444 begin 445 if MHDll.DllCheck = false then 446 begin 447 MHDll.DllCheck := True; 448 MHDLL.DllFound := CheckforMHDll; 449 end; 450 Result := MHDLL.DllFound; 451 end; 452 453 function UsedMHDllRPC: boolean; 454 begin 455 Result := sCallV('ORQQPXRM MHDLLDMS',[]) = '1'; 456 end; 457 458 procedure PopulateMHdll; 459 begin 460 if MHDll.DllCheck = false then 461 begin 462 MHDll.DllCheck := True; 463 MHDll.DllFound := CheckforMHDll; 464 end; 465 end; 466 467 procedure GetMHResultText(var AText: string; ResultsGroups, Scores: TStringList); 468 var 469 i, j: integer; 470 tmp, info: string; 471 tempInfo: TStringList; 472 begin 473 //AGP for some reason in some account passing two arrays in the RPC was 474 //not working had to convert back to the old method for the RPC for now 475 with RPCBrokerV do 476 begin 477 ClearParameters := True; 478 RemoteProcedure := 'ORQQPXRM MHDLL'; 479 Param[0].PType := literal; 480 Param[0].Value := PATIENT.DFN; //*DFN* 481 Param[1].PType := list; 482 j := 0; 483 for i := 0 to ResultsGroups.Count-1 do 484 begin 485 j := j + 1; 486 Param[1].Mult['"RESULTS",'+ InttoStr(j)]:=ResultsGroups.Strings[i]; 487 end; 488 j := 0; 489 for i := 0 to Scores.Count-1 do 490 begin 491 j := j + 1; 492 Param[1].Mult['"SCORES",'+ InttoStr(j)]:=Scores.Strings[i]; 493 end; 494 end; 495 CallBroker; 496 //CallV('ORQQPXRM MHDLL',[ResultsGroups, Scores, Patient.DFN]); 497 AText := ''; 498 info := ''; 499 for i := 0 to RPCBrokerV.Results.Count - 1 do 500 begin 501 tmp := RPCBrokerV.Results[i]; 502 if pos('[INFOTEXT]',tmp)>0 then 503 begin 504 if info <> '' then info := info + ' ' + Copy(tmp,11,(Length(tmp)-1)) 505 else info := Copy(tmp,11,(Length(tmp)-1)); 506 end 507 else 508 begin 509 if(AText <> '') then 510 begin 511 if(copy(AText, length(AText), 1) = '.') then 512 AText := AText; 513 AText := AText + ' '; 514 end; 515 AText := AText + Trim(tmp); 516 end; 517 end; 518 if info <> '' then 519 begin 520 if pos(U, info) > 0 then 521 begin 522 tempInfo := TStringList.Create; 523 PiecestoList(info,'^',tempInfo); 524 info := ''; 525 for i := 0 to tempInfo.Count -1 do 526 begin 527 if info = '' then info := tempInfo.Strings[i] 528 else info := info + CRLF + tempInfo.Strings[i]; 529 end; 530 end; 531 InfoBox(info,'Attention Needed',MB_OK); 532 end; 533 end; 432 534 initialization 433 535
Note:
See TracChangeset
for help on using the changeset viewer.