Changeset 541 for cprs/branches/tmg-cprs/CPRS-Chart/fReminderDialog.pas
- Timestamp:
- Aug 12, 2009, 7:14:16 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/tmg-cprs/CPRS-Chart/fReminderDialog.pas
r496 r541 991 991 WHArray: TStringlist; 992 992 GecRemIen, GecRemStr, RemWipe: String; 993 HTMLEditing : boolean; //kt 8/09 993 994 994 995 procedure Add(PCEItemClass: TPCEItemClass); … … 1073 1074 repeat 1074 1075 //AGP Added RemWipe section this section will determine if the Dialog is a patient specific 1075 if FProcessingTemplate or (i < RemindersInProcess.Count) then 1076 begin 1077 if FProcessingTemplate then 1078 begin 1079 Rem := FReminder; 1080 if Rem.RemWipe = 1 then 1081 RemWipe := Piece(Rem.DlgData,U,1); 1082 end 1083 else 1084 begin 1085 Rem := TReminder(RemindersInProcess.Objects[i]); 1086 if TReminderDialog(TReminder(RemindersInProcess.Objects[i])).RemWipe = 1 then 1087 begin 1088 if RemWipe ='' then RemWipe := TReminder(RemindersInProcess.Objects[i]).IEN 1089 else RemWipe := RemWipe + U + TReminder(RemindersInProcess.Objects[i]).IEN; 1090 end; 1091 end; 1076 if FProcessingTemplate or (i < RemindersInProcess.Count) then begin 1077 if FProcessingTemplate then begin 1078 Rem := FReminder; 1079 if Rem.RemWipe = 1 then 1080 RemWipe := Piece(Rem.DlgData,U,1); 1081 end else begin 1082 Rem := TReminder(RemindersInProcess.Objects[i]); 1083 if TReminderDialog(TReminder(RemindersInProcess.Objects[i])).RemWipe = 1 then begin 1084 if RemWipe ='' then RemWipe := TReminder(RemindersInProcess.Objects[i]).IEN 1085 else RemWipe := RemWipe + U + TReminder(RemindersInProcess.Objects[i]).IEN; 1086 end; 1087 end; 1092 1088 1093 1089 Flds := FALSE; 1094 1090 OldCount := TmpList.Count; 1095 1091 Rem.FinishProblems(TmpList, Flds); 1096 if(OldCount <> TmpList.Count) or Flds then 1097 begin 1092 if(OldCount <> TmpList.Count) or Flds then begin 1098 1093 TmpList.Insert(OldCount, ''); 1099 1094 if not FProcessingTemplate then … … 1113 1108 1114 1109 Process := TRUE; 1115 if(TmpList.Count > 0) then 1116 begin 1110 if(TmpList.Count > 0) then begin 1117 1111 Msg := REQ_TXT + TmpList.Text; 1118 1112 InfoBox(Msg, REQ_HDR, MB_OK); 1119 1113 Process := FALSE; 1120 end 1121 else 1122 begin 1114 end else begin 1123 1115 TmpText := TStringList.Create; 1124 1116 try 1125 if (not FProcessingTemplate) and (not InsertRemTextAtCursor) then 1126 RemForm.NewNoteRE.SelStart := MaxInt; // Move to bottom of note 1127 AddLine := FALSE; 1128 BeforeLine := SendMessage(RemForm.NewNoteRE.Handle, EM_EXLINEFROMCHAR, 0, RemForm.NewNoteRE.SelStart); 1129 if (SendMessage(RemForm.NewNoteRE.Handle, EM_LINEINDEX, BeforeLine, 0) <> RemForm.NewNoteRE.SelStart) then 1130 begin 1131 RemForm.NewNoteRE.SelStart := SendMessage(RemForm.NewNoteRE.Handle, EM_LINEINDEX, BeforeLine+1, 0); 1132 inc(BeforeLine); 1133 end; 1134 if(RemForm.NewNoteRE.SelStart > 0) then 1135 begin 1136 if(RemForm.NewNoteRE.SelStart = 1) then 1137 AddLine := TRUE 1138 else 1139 begin 1140 TR.chrg.cpMin := RemForm.NewNoteRE.SelStart-2; 1141 TR.chrg.cpMax := TR.chrg.cpMin+2; 1142 TR.lpstrText := @buf; 1143 SendMessage(RemForm.NewNoteRE.Handle, EM_GETTEXTRANGE, 0, LPARAM(@TR)); 1144 if(buf[0] <> #13) or (buf[1] <> #10) then 1145 AddLine := TRUE; 1117 if (RemForm.Form is TfrmNotes) and Assigned(RemForm.NewNoteHTMLE) then begin //kt 1118 HTMLEditing := (vmHTML in TfrmNotes(RemForm.Form).ViewMode); //kt 1119 end else HTMLEditing := false; //kt 1120 if HTMLEditing then begin //kt added this entire block //kt 1121 if (not FProcessingTemplate) and (not InsertRemTextAtCursor) then begin //kt 1122 RemForm.NewNoteHTMLE.MoveCaretToEnd; //kt 1123 end; //kt 1124 AddLine := TRUE; //kt 1125 end else begin //kt (original code below) 1126 if (not FProcessingTemplate) and (not InsertRemTextAtCursor) then 1127 RemForm.NewNoteRE.SelStart := MaxInt; // Move to bottom of note 1128 AddLine := FALSE; 1129 BeforeLine := SendMessage(RemForm.NewNoteRE.Handle, EM_EXLINEFROMCHAR, 0, RemForm.NewNoteRE.SelStart); 1130 if (SendMessage(RemForm.NewNoteRE.Handle, EM_LINEINDEX, BeforeLine, 0) <> RemForm.NewNoteRE.SelStart) then begin 1131 RemForm.NewNoteRE.SelStart := SendMessage(RemForm.NewNoteRE.Handle, EM_LINEINDEX, BeforeLine+1, 0); 1132 inc(BeforeLine); 1146 1133 end; 1147 end; 1134 if(RemForm.NewNoteRE.SelStart > 0) then begin 1135 if(RemForm.NewNoteRE.SelStart = 1) then 1136 AddLine := TRUE 1137 else begin 1138 TR.chrg.cpMin := RemForm.NewNoteRE.SelStart-2; 1139 TR.chrg.cpMax := TR.chrg.cpMin+2; 1140 TR.lpstrText := @buf; 1141 SendMessage(RemForm.NewNoteRE.Handle, EM_GETTEXTRANGE, 0, LPARAM(@TR)); 1142 if(buf[0] <> #13) or (buf[1] <> #10) then 1143 AddLine := TRUE; 1144 end; 1145 end; 1146 end; //kt 8/09 1148 1147 if FProcessingTemplate then 1149 1148 FReminder.AddText(TmpText) 1150 else 1151 begin 1149 else begin 1152 1150 for i := 0 to RemindersInProcess.Count-1 do 1153 1151 TReminder(RemindersInProcess.Objects[i]).AddText(TmpText); 1154 1152 end; 1155 if(TmpText.Count > 0) then 1156 begin 1157 if not FProcessingTemplate then 1158 begin 1153 if(TmpText.Count > 0) then begin 1154 if not FProcessingTemplate then begin 1159 1155 tmp := ClinRemText; 1160 if(tmp <> '') then1161 begin1156 //kt if(tmp <> '') then begin 1157 if(tmp <> '') and (not HTMLEditing) then begin //kt 8/09 1162 1158 i := RemForm.NewNoteRE.Lines.IndexOf(tmp); 1163 if(i < 0) or (i > BeforeLine) then 1164 begin 1159 if(i < 0) or (i > BeforeLine) then begin 1165 1160 TmpText.Insert(0, tmp); 1166 1161 if(RemForm.NewNoteRE.SelStart > 0) then … … 1177 1172 if TmpText.Count = 0 then 1178 1173 Process := FALSE 1179 else 1180 begin 1174 else begin 1181 1175 if RemForm.PCEObj.NeedProviderInfo and MissingProviderInfo(RemForm.PCEObj, PCEType) then 1182 1176 Process := FALSE 1183 else 1184 RemForm.NewNoteRE.SelText := TmpText.Text; 1177 else begin 1178 If HTMLEditing then begin //kt 8/09 1179 for i := 0 to TmpText.count-1 do begin //kt 8/09 1180 RemForm.NewNoteHTMLE.InsertTextAtCaret(TmpText.Strings[i]+'<BR>'); //kt 8/09 1181 end; //kt 8/09 1182 end else begin //kt 8/09 1183 RemForm.NewNoteRE.SelText := TmpText.Text; 1184 end; //kt 8/09 1185 end; 1185 1186 end; 1186 1187 end; 1187 if(Process) then1188 begin1188 //kt if(Process) then begin 1189 if(Process) and (not HTMLEditing) then begin //kt 1189 1190 SendMessage(RemForm.NewNoteRE.Handle, EM_SCROLLCARET, 0, 0); 1190 1191 AfterTop := SendMessage(RemForm.NewNoteRE.Handle, EM_GETFIRSTVISIBLELINE, 0, 0);
Note:
See TracChangeset
for help on using the changeset viewer.