Ignore:
Timestamp:
Jul 7, 2010, 4:51:54 PM (14 years ago)
Author:
Kevin Toppenberg
Message:

Upgrading to version 27

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/trunk/CPRS-Chart/rReminders.pas

    r456 r830  
    33interface
    44uses
    5   Windows,Classes, SysUtils, TRPCB, ORNet, ORFn;
     5  Windows,Classes, SysUtils, TRPCB, ORNet, ORFn, fMHTest, StrUtils;
     6
     7type
     8  TMHdllFound = record
     9  DllCheck: boolean;
     10  DllFound: boolean;
     11end;
    612
    713procedure GetCurrentReminders;
     
    2127function GetProgressNoteHeader: string;
    2228function LoadMentalHealthTest(TestName: string): TStrings;
    23 procedure MentalHealthTestResults(var AText: string; const DlgIEN: integer; const TestName:
     29procedure MentalHealthTestResults(var AText: string; const DlgIEN: string; const TestName:
    2430                                  string; const AProvider: Int64; const Answers: string);
    2531procedure SaveMentalHealthTest(const TestName: string; ADate: TFMDateTime;
     
    4147function GetAllRemindersAndCategories: TStrings;
    4248function VerifyMentalHealthTestComplete(TestName, Answers: string): String;
     49function MHDLLFound: boolean;
     50function UsedMHDllRPC: boolean;
     51procedure PopulateMHdll;
     52procedure GetMHResultText(var AText: string; ResultsGroups, Scores: TStringList);
    4353
    4454
     
    5464  uNewCoverSheetListActive: integer = -1;
    5565  uCanEditAllCoverSheetLists: integer = -1;
     66  MHDLL: TMHDllFound;
    5667
    5768procedure GetCurrentReminders;
     
    6374begin
    6475  CallV('ORQQPXRM REMINDER CATEGORIES', [Patient.DFN, Encounter.Location]);
    65   Dest.Assign(RPCBrokerV.Results);
     76  FastAssign(RPCBrokerV.Results, Dest);
    6677end;
    6778
     
    170181      Param[0].Mult[AList[i]] := '';
    171182    CallBroker;
    172     AList.Assign(Results);
     183    FastAssign(Results, AList);
    173184  end;
    174185end;
     
    191202end;
    192203
    193 procedure MentalHealthTestResults(var AText: string; const DlgIEN: integer; const TestName:
     204procedure MentalHealthTestResults(var AText: string; const DlgIEN: string; const TestName:
    194205                                  string; const AProvider: Int64; const Answers: string);
    195206var
     
    203214    RemoteProcedure := 'ORQQPXRM MENTAL HEALTH RESULTS';
    204215    Param[0].PType := literal;
    205     Param[0].Value := IntToStr(DlgIEN);
     216    Param[0].Value := DlgIEN;
    206217    Param[1].PType := list;
    207218    Param[1].Mult['"DFN"'] := Patient.DFN;
     
    430441end;
    431442
     443function MHDLLFound: boolean;
     444begin
     445  if MHDll.DllCheck = false then
     446     begin
     447       MHDll.DllCheck := True;
     448       MHDLL.DllFound := CheckforMHDll;
     449     end;
     450  Result := MHDLL.DllFound;
     451end;
     452
     453function UsedMHDllRPC: boolean;
     454begin
     455  Result := sCallV('ORQQPXRM MHDLLDMS',[]) = '1';
     456end;
     457
     458procedure PopulateMHdll;
     459begin
     460  if MHDll.DllCheck = false then
     461    begin
     462      MHDll.DllCheck := True;
     463      MHDll.DllFound := CheckforMHDll;
     464    end;
     465end;
     466
     467procedure GetMHResultText(var AText: string; ResultsGroups, Scores: TStringList);
     468var
     469i, j: integer;
     470tmp, info: string;
     471tempInfo: TStringList;
     472begin
     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;
     533end;
    432534initialization
    433535
Note: See TracChangeset for help on using the changeset viewer.