source: cprs/branches/tmg-cprs/CPRS-Chart/uTIU.pas@ 893

Last change on this file since 893 was 453, checked in by Kevin Toppenberg, 16 years ago

Initial upload of TMG-CPRS 1.0.26.69

File size: 5.8 KB
Line 
1//kt -- Modified with SourceScanner on 8/15/2007
2unit uTIU;
3
4interface
5
6uses SysUtils, Classes, ORNet, ORFn, rCore, uCore, uConst, ORCtrls, ComCtrls, Controls;
7
8type
9
10 TEditNoteRec = record
11 DocType: Integer;
12 IsNewNote: boolean;
13 Title: Integer;
14 TitleName: string;
15 DateTime: TFMDateTime;
16 Author: Int64;
17 AuthorName: string;
18 Cosigner: Int64;
19 CosignerName: string;
20 Subject: string;
21 Location: Integer;
22 LocationName: string;
23 VisitDate: TFMDateTime;
24 PkgRef: string; // 'IEN;GMR(123,' or 'IEN;SRF('
25 PkgIEN: integer; // file IEN
26 PkgPtr: string; // 'GMR(123,' or 'SRF('
27 NeedCPT: Boolean;
28 Addend: Integer;
29 LastCosigner: Int64;
30 LastCosignerName: string;
31 IDParent: integer;
32 ClinProcSummCode: integer;
33 ClinProcDateTime: TFMDateTime;
34 Lines: TStrings;
35 PRF_IEN: integer;
36 ActionIEN: string;
37 end;
38
39 TNoteRec = TEditNoteRec;
40
41 TActionRec = record
42 Success: Boolean;
43 Reason: string;
44 end;
45
46 TCreatedDoc = record
47 IEN: Integer;
48 ErrorText: string;
49 end;
50
51 TTIUContext = record
52 Changed: Boolean;
53 BeginDate: string;
54 EndDate: string;
55 FMBeginDate: TFMDateTime;
56 FMEndDate: TFMDateTime;
57 Status: string;
58 Author: int64;
59 MaxDocs: integer;
60 ShowSubject: Boolean;
61 SortBy: string;
62 ListAscending: Boolean;
63 GroupBy: string;
64 TreeAscending: Boolean;
65 SearchField: string;
66 KeyWord: string;
67 Filtered: Boolean;
68 SearchString: String; // Text Search CQ: HDS00002856
69 end ;
70
71 TNoteTitles = class
72 DfltTitle: Integer;
73 DfltTitleName: string;
74 ShortList: TStringList;
75 //TX_SAVE_ERROR1 : string; //kt
76 //TX_SAVE_ERROR2 : string; //kt
77 //TC_SAVE_ERROR : string; //kt
78 constructor Create;
79 destructor Destroy; override;
80 end;
81
82 TTIUPrefs = class
83 DfltLoc: Integer;
84 DfltLocName: string;
85 SortAscending: Boolean;
86 SortBy: string; // D,R,S,A
87 AskNoteSubject: Boolean;
88 AskCosigner: Boolean;
89 DfltCosigner: Int64;
90 DfltCosignerName: string;
91 MaxNotes: Integer;
92 end;
93
94// notes tab specific procedures
95function MakeNoteDisplayText(RawText: string): string;
96function MakeConsultDisplayText(RawText:string): string;
97function SetLinesTo74ForSave(AStrings: TStrings; AParent: TWinControl): TStrings;
98
99//const
100//TX_SAVE_ERROR1 = 'An error was encountered while trying to save the note you are editing.' + CRLF + CRLF + ' Error: '; <-- original line. //kt 8/15/2007
101//TX_SAVE_ERROR2 = CRLF + CRLF + 'Please try again now using CTRL-SHIFT-S, or ''Save without signature''.' + CRLF + <-- original line. //kt 8/15/2007
102// 'These actions will improve the likelihood that no text will be lost.' + CRLF + CRLF + <-- original line. //kt 8/15/2007
103// 'If problems continue, or network connectivity is lost, please copy all of your text to' + CRLF + <-- original line. //kt 8/15/2007
104// 'the clipboard and paste it into Microsoft Word before continuing or before closing CPRS.'; <-- original line. //kt 8/15/2007
105//TC_SAVE_ERROR = 'Error saving note text'; <-- original line. //kt 8/15/2007
106
107function TX_SAVE_ERROR1 : string; //kt
108function TX_SAVE_ERROR2 : string; //kt
109function TC_SAVE_ERROR : string; //kt
110
111implementation
112
113uses
114 DKLang; //kt
115
116function TX_SAVE_ERROR1 : string;
117begin Result := DKLangConstW('uTIU_An_error_was_encountered_while_trying_to_save_the_note_you_are_editingx') + CRLF + CRLF + DKLangConstW('uTIU_Errorx');
118end;
119
120function TX_SAVE_ERROR2 : string;
121begin Result := CRLF + CRLF + DKLangConstW('uTIU_Please_try_again_now_using_CTRLxSHIFTxSx_or_xxSave_without_signaturexxx') + CRLF +
122 DKLangConstW('uTIU_These_actions_will_improve_the_likelihood_that_no_text_will_be_lostx') + CRLF + CRLF +
123 DKLangConstW('uTIU_If_problems_continuex_or_network_connectivity_is_lostx_please_copy_all_of_your_text_to') + CRLF +
124 DKLangConstW('uTIU_the_clipboard_and_paste_it_into_Microsoft_Word_before_continuing_or_before_closing_CPRSx');
125end;
126
127function TC_SAVE_ERROR : string;
128begin Result := DKLangConstW('uTIU_Error_saving_note_text');
129end;
130
131
132function MakeConsultDisplayText(RawText:string): string;
133var
134 x: string;
135begin
136 x := RawText;
137 Result := Piece(x, U, 2) + ',' + Piece(x, U, 3) + ',' +
138 Piece(x, U, 4) + ', '+ Piece(x, U, 5);
139
140end;
141
142function MakeNoteDisplayText(RawText: string): string;
143var
144 x: string;
145begin
146 x := RawText;
147 if Piece(x, U, 1) = '' then
148 Result := FormatFMDateTime('mmm dd,yy', MakeFMDateTime(Piece(x, U, 3))) + ' ' +
149 Piece(x, U, 2) + ', ' + Piece(x, U, 6) + ', ' + Piece(Piece(x, U, 5), ';', 2)
150 else if Piece(x, U, 1)[1] in ['A', 'N', 'E'] then
151 Result := Piece(x, U, 2)
152 else
153 Result := FormatFMDateTime('mmm dd,yy', MakeFMDateTime(Piece(x, U, 3))) + ' ' +
154 Piece(x, U, 2) + ', ' + Piece(x, U, 6) + ', ' + Piece(Piece(x, U, 5), ';', 2);
155end;
156
157
158{ Progress Note Titles -------------------------------------------------------------------- }
159constructor TNoteTitles.Create;
160{ creates an object to store progress note titles so only obtained from server once }
161begin
162 inherited Create;
163 ShortList := TStringList.Create;
164end;
165
166destructor TNoteTitles.Destroy;
167{ frees the lists that were used to store the progress note titles }
168begin
169 ShortList.Free;
170 inherited Destroy;
171end;
172
173function SetLinesTo74ForSave(AStrings: TStrings; AParent: TWinControl): TStrings;
174var
175 ARichEdit74: TRichEdit;
176begin
177 Result := AStrings;
178 ARichEdit74 := TRichEdit.Create(AParent);
179 try
180 with ARichEdit74 do
181 begin
182 Parent := AParent;
183 Lines.Text := AStrings.Text;
184 Width := 525;
185 Result.Assign(Lines);
186 end;
187 finally
188 ARichEdit74.Free;
189 end;
190end;
191
192end.
Note: See TracBrowser for help on using the repository browser.