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

    r459 r460  
    44
    55uses SysUtils, Classes, ORNet, ORFn, rCore, uCore, uConst, TRPCB, uTIU;
     6
     7type
     8  TPatchInstalled = record
     9    PatchInstalled: boolean;
     10    PatchChecked: boolean;
     11  end;
    612
    713{ Progress Note Titles }
     
    1016procedure ResetNoteTitles;
    1117function IsConsultTitle(TitleIEN: Integer): Boolean;
     18function IsPRFTitle(TitleIEN: Integer): Boolean;
    1219function IsClinProcTitle(TitleIEN: Integer): Boolean;
    1320procedure ListNoteTitlesShort(Dest: TStrings);
     
    2027function AskCosignerForNotes: Boolean;
    2128function AskCosignerForDocument(ADocument: Integer; AnAuthor: Int64): Boolean;
    22 function AskCosignerForTitle(ATitle: integer; AnAuthor: Int64): Boolean;
     29function AskCosignerForTitle(ATitle: integer; AnAuthor: Int64; ADate: TFMDateTime): Boolean;
    2330function AskSubjectForNotes: Boolean;
    24 function CanCosign(ATitle, ADocType: integer; AUser: Int64): Boolean;
     31function CanCosign(ATitle, ADocType: integer; AUser: Int64; ADate: TFMDateTime): Boolean;
    2532function CanChangeCosigner(IEN: integer): boolean;
    2633procedure DefaultCosigner(var IEN: Int64; var Name: string);
     
    93100function UserInactive(EIN: String): boolean;
    94101
     102//Miscellaneous
     103function TIUPatch175Installed: boolean;
     104
    95105const
    96106  CLS_PROGRESS_NOTES = 3;
    97107
    98108implementation
     109
     110uses rMisc;
    99111
    100112var
     
    103115  uNoteTitles: TNoteTitles;
    104116  uTIUPrefs: TTIUPrefs;
     117  uPatch175Installed: TPatchInstalled;
    105118
    106119
     
    153166  if TitleIEN <= 0 then Exit;
    154167  Result := sCallV('TIU IS THIS A CONSULT?', [TitleIEN]) = '1';
     168end;
     169
     170function IsPRFTitle(TitleIEN: Integer): Boolean;
     171begin
     172  Result := False;
     173  if TitleIEN <= 0 then Exit;
     174  Result := sCallV('TIU ISPRF', [TitleIEN]) = '1';
    155175end;
    156176
     
    238258end;
    239259
    240 function AskCosignerForTitle(ATitle: integer; AnAuthor: Int64): Boolean;
     260function AskCosignerForTitle(ATitle: integer; AnAuthor: Int64; ADate: TFMDateTime): Boolean;
    241261{ returns TRUE if a cosignature is required for a document title and author }
    242262begin
    243   Result := Piece(sCallV('TIU REQUIRES COSIGNATURE', [ATitle, 0, AnAuthor]), U, 1) = '1';
     263  if TIUPatch175Installed then
     264    Result := Piece(sCallV('TIU REQUIRES COSIGNATURE', [ATitle, 0, AnAuthor, ADate]), U, 1) = '1'
     265  else
     266    Result := Piece(sCallV('TIU REQUIRES COSIGNATURE', [ATitle, 0, AnAuthor]), U, 1) = '1';
    244267end;
    245268
     
    258281end;
    259282
    260 function CanCosign(ATitle, ADocType: integer; AUser: Int64): Boolean;
     283function CanCosign(ATitle, ADocType: integer; AUser: Int64; ADate: TFMDateTime): Boolean;
    261284begin
    262285  if ATitle > 0 then ADocType := 0;
    263   Result := Piece(sCallV('TIU REQUIRES COSIGNATURE', [ATitle, ADocType, AUser]), U, 1) <> '1';
     286  if TIUPatch175Installed and (ADocType = 0) then
     287    Result := Piece(sCallV('TIU REQUIRES COSIGNATURE', [ATitle, ADocType, AUser, ADate]), U, 1) <> '1'
     288  else
     289    Result := Piece(sCallV('TIU REQUIRES COSIGNATURE', [ATitle, ADocType, AUser]), U, 1) <> '1';
    264290end;
    265291
     
    10161042function IDNotesInstalled: boolean;
    10171043begin
    1018   Result := True;
     1044  Result := True;   // old patch check no longer called
    10191045end;
    10201046
     
    11231149end;
    11241150
     1151function TIUPatch175Installed: boolean;
     1152begin
     1153  with uPatch175Installed do
     1154    if not PatchChecked then
     1155      begin
     1156        PatchInstalled := ServerHasPatch('TIU*1.0*175');
     1157        PatchChecked := True;
     1158      end;
     1159  Result := uPatch175Installed.PatchInstalled;
     1160end;
     1161
    11251162function NoteHasText(NoteIEN: integer): boolean;
    11261163begin
    11271164  Result := (StrToIntDef(sCallV('ORWTIU CHKTXT', [NoteIEN]), 0) > 0);
    11281165end;
     1166
    11291167
    11301168initialization
Note: See TracChangeset for help on using the changeset viewer.