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/rGraphs.pas

    r456 r830  
    88function rpcReportParams(ien: integer): String;
    99
    10 procedure FastAdd(source: TStrings; destination: TStrings);  // not used
    11 procedure FastAssign(source: TStrings; destination: TStrings);
    12   // example: FastAssign(rpcDrugClass, lstDrugClass.Items)
    13 
     10procedure onoff(x: integer);
     11
     12function rpcTestGroups(user: int64): TStrings;
     13function rpcATest(test: integer): TStrings;
     14function rpcATestGroup(testgroup: Integer; user: int64): TStrings;
    1415function rpcClass(itemtype: string): TStrings;
    1516function rpcTaxonomy(alltax: boolean; taxonomies: TStrings): TStrings;
     
    1718  ATypeItem: string; complete: boolean);  //*DFN*
    1819function rpcDetailSelected(const PatientDFN: string; ADate1, ADate2: TFMDateTime;
    19   tests: TStrings; complete: boolean): TStrings;  //*DFN*
     20  tests: TStringList; complete: boolean): TStrings;  //*DFN*
     21procedure rpcFastData(const PatientDFN: string; alldata: TStrings; var ok: boolean);
     22procedure rpcFastItems(const PatientDFN: string; allitems: TStrings; var ok: boolean);
     23procedure rpcFastLabs(const PatientDFN: string; alllabs: TStrings; var ok: boolean);
     24function rpcFastTask(const PatientDFN, oldDFN: string): string;
    2025function rpcGetAllItems(const PatientDFN: string): TStrings;
    2126function rpcGetItems(typeitem: string; const PatientDFN: string): TStrings;
     
    2328function rpcGetTypes(const PatientDFN: string; subtypes: boolean): TStrings;
    2429function rpcGetTestSpec: TStrings;
     30function rpcTesting: TStrings;
     31function rpcGetViews(vtype: string; user: int64): TStrings;
    2532
    2633function rpcGetGraphDateRange(reportid: string): TStrings;
     
    3037procedure rpcSetGraphSizing(values: TStrings);
    3138
    32 function rpcGetGraphProfiles(profiles, permission: string; ext: integer): TStrings;
     39function rpcGetGraphProfiles(profiles, permission: string; ext: integer; userx: int64): TStrings;
    3340procedure rpcSetGraphProfile(paramname, permission: string; paramvalues: TStrings);
    3441procedure rpcDeleteGraphProfile(paramname, permission: string);
     
    3643function rpcLookupItems(const filename, startfrom: string; direction: integer): TStrings;
    3744function rpcDateItem(oldestdate, newestdate: double; filenum: string; const PatientDFN: string): TStrings;
    38 procedure onoff(x: integer);
    3945
    4046implementation
     47
     48//-------- RPCs copied from rLabs -------------
     49function rpcTestGroups(user: int64): TStrings;
     50begin
     51  CallV('ORWLRR TG', [user]);
     52  MixedCaseList(RPCBrokerV.Results);
     53  Result := RPCBrokerV.Results;
     54end;
     55
     56function rpcATest(test: integer): TStrings;
     57begin
     58  CallV('ORWLRR ATESTS', [test]);
     59  MixedCaseList(RPCBrokerV.Results);
     60  Result := RPCBrokerV.Results;
     61end;
     62
     63function rpcATestGroup(testgroup: Integer; user: int64): TStrings;
     64begin
     65  CallV('ORWLRR ATG', [testgroup, user]);
     66  MixedCaseList(RPCBrokerV.Results);
     67  Result := RPCBrokerV.Results;
     68end;
     69//------------------------------------------
    4170
    4271function rpcPublicEdit: Boolean;
     
    5382  Result := sCallV('ORWGRPC RPTPARAM', [ien]);
    5483  onoff(0);
    55 end;
    56 
    57 procedure FastAssign(source: TStrings; destination: TStrings);
    58 var
    59   ms: TMemoryStream;
    60 begin
    61   destination.Clear;
    62   ms := TMemoryStream.Create;
    63   try
    64     source.SaveToStream(ms);
    65     ms.Seek(0, soFromBeginning);
    66     destination.LoadFromStream(ms);
    67   finally
    68     ms.Free;
    69   end;
    70 end;
    71 
    72 procedure FastAdd(source: TStrings; destination: TStrings);
    73 var
    74   ms: TMemoryStream;
    75 begin
    76   destination.Clear;
    77   ms := TMemoryStream.Create;
    78   try
    79     destination.SaveToStream(ms);
    80     ms.Seek(soFromEnd, 0);
    81     source.SaveToStream(ms);
    82     ms.Seek(0, soFromBeginning);
    83     destination.LoadFromStream(ms);
    84   finally
    85     ms.Free;
    86   end;
    8784end;
    8885
     
    9693  CallV('ORWGRPC DETAILS', [PatientDFN, ADate1, ADate2, ATypeItem, includecomplete]);
    9794  onoff(0);
    98   QuickCopy(RPCBrokerV.Results, Dest);
     95  FastAssign(RPCBrokerV.Results, Dest);
    9996end;
    10097
    10198function rpcDetailSelected(const PatientDFN: string; ADate1, ADate2: TFMDateTime;
    102   tests: TStrings; complete: boolean): TStrings;  //*DFN*
     99  tests: TStringList; complete: boolean): TStrings;  //*DFN*
    103100var
    104101  includecomplete: string;
     
    109106  onoff(0);
    110107  Result := RPCBrokerV.Results;
     108end;
     109
     110procedure rpcFastData(const PatientDFN: string; alldata: TStrings; var ok: boolean);
     111begin
     112  onoff(1);
     113  CallV('ORWGRPC FASTDATA', [PatientDFN]);
     114  onoff(0);
     115  FastAssign(RPCBrokerV.Results, alldata);
     116  ok := alldata.Count > 0;
     117end;
     118
     119procedure rpcFastItems(const PatientDFN: string; allitems: TStrings; var ok: boolean);
     120begin
     121  onoff(1);
     122  CallV('ORWGRPC FASTITEM', [PatientDFN]);
     123  onoff(0);
     124  MixedCaseList(RPCBrokerV.Results);
     125  FastAssign(RPCBrokerV.Results, allitems);
     126  ok := allitems.Count > 0;
     127end;
     128
     129procedure rpcFastLabs(const PatientDFN: string; alllabs: TStrings; var ok: boolean);
     130begin
     131  onoff(1);
     132  CallV('ORWGRPC FASTLABS', [PatientDFN]);
     133  onoff(0);
     134  FastAssign(RPCBrokerV.Results, alllabs);
     135  ok := alllabs.Count > 0;
     136end;
     137
     138function rpcFastTask(const PatientDFN, oldDFN: string): string;
     139begin
     140  onoff(1);
     141  Result := sCallV('ORWGRPC FASTTASK', [PatientDFN, oldDFN]);
     142  onoff(0);
    111143end;
    112144
     
    207239end;
    208240
    209 function rpcGetGraphProfiles(profiles, permission: string; ext: integer): TStrings;
    210 begin
    211   onoff(1);
    212   CallV('ORWGRPC GETVIEWS', [profiles, permission, ext]);
    213   onoff(0);
    214   if (profiles = '1') or (ext = 1) then MixedCaseList(RPCBrokerV.Results);
     241function rpcGetGraphProfiles(profiles, permission: string; ext: integer; userx: int64): TStrings;
     242begin
     243  onoff(1);
     244  CallV('ORWGRPC GETVIEWS', [profiles, permission, ext, userx]);
     245  onoff(0);
     246  if (profiles = '1') or (ext = 1) then
     247    MixedCaseList(RPCBrokerV.Results);
    215248  Result := RPCBrokerV.Results;
    216249end;
     
    235268  CallV('ORWGRPC TESTSPEC', []);
    236269  onoff(0);
     270  Result := RPCBrokerV.Results;
     271end;
     272
     273function rpcTesting: TStrings;
     274begin
     275  onoff(1);
     276  CallV('ORWGRPC TESTING', []);
     277  onoff(0);
     278  Result := RPCBrokerV.Results;
     279end;
     280
     281function rpcGetViews(vtype: string; user: int64): TStrings;
     282begin
     283  onoff(1);
     284  CallV('ORWGRPC ALLVIEWS', [vtype, user]);
     285  onoff(0);
     286  MixedCaseList(RPCBrokerV.Results);
    237287  Result := RPCBrokerV.Results;
    238288end;
     
    259309  if x = 1 then
    260310  begin
     311    //beep;
    261312    //Screen.Cursor := crHourGlass;
    262313  end
    263314  else
    264315  begin
     316    //sleep(3000);
    265317    //Screen.Cursor := crDefault;
     318    //sleep(1000);
    266319  end;
    267320end;
Note: See TracChangeset for help on using the changeset viewer.