Ignore:
Timestamp:
Jul 6, 2008, 8:20:14 PM (16 years ago)
Author:
Kevin Toppenberg
Message:

Uploading from OR_30_258

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/foia-cprs/CPRS-Chart/Orders/rODAllergy.pas

    r459 r460  
    4949  end;
    5050
     51  TARTClinUser = record
     52    IsClinUser: boolean;
     53    ReasonFailed: string;
     54    AccessChecked: boolean;
     55  end;
     56
    5157function SearchForAllergies(StringToMatch: string): TStrings;
    5258function SubsetofSymptoms(const StartFrom: string; Direction: Integer): TStrings;
     
    6470function RequireOriginatorComments: boolean;
    6571function EnableErrorComments: boolean;
     72function IsARTClinicalUser(var AMessage: string): boolean;
    6673
    6774implementation
     
    7380  uARTPatchInstalled: TARTPatchInstalled;
    7481  uGMRASiteParams: TGMRASiteParams;
     82  uARTClinUser: TARTClinUser;
    7583
    7684function ODForAllergies: TStrings;
     
    326334end;
    327335
     336(*function IsARTClinicalUser(var AMessage: string): boolean;
     337const
     338  TX_NO_AUTH = 'You are not authorized to perform this action.' + CRLF +
     339               'Either the ORES or ORELSE key is required.';
     340begin
     341  Result := (User.UserClass > UC_CLERK);     // User has ORES or ORELSE key
     342  if not Result then AMessage := TX_NO_AUTH else AMessage := '';
     343end;*)
     344
     345function IsARTClinicalUser(var AMessage: string): boolean;
     346const
     347  TX_NO_AUTH = 'You are not authorized to perform this action.' + CRLF;
     348var
     349  x: string;
     350begin
     351  with uARTClinUser do
     352  begin
     353    if not AccessChecked then
     354      begin
     355        x := sCallV('ORWDAL32 CLINUSER',[nil]);
     356        IsClinUser := (Piece(x, U, 1) = '1');
     357        if not IsClinUser then ReasonFailed := TX_NO_AUTH + Piece(x, U, 2) else ReasonFailed := '';
     358        AccessChecked := True;
     359      end;
     360    Result   := IsClinUser;
     361    AMessage := ReasonFailed ;
     362  end;
     363end;
     364
    328365end.
Note: See TracChangeset for help on using the changeset viewer.