Function

TRemPrompt.NoteText

Module

uReminders

Last Modified

10/8/2014 2:49:30 PM

Visibility

Public

Owner

TRemPrompt

Declaration

function NoteText: string;

Calls Hierarchy


TRemPrompt.NoteText
 ├TRemPrompt.Add2PN
 │ ├TRemPrompt.Forced
 │ └TRemPrompt.PromptOK
 │   ├TRemPrompt.PromptType
 │   │ └Code2PromptType
 │   ├TRemDlgElement.Historical
 │   ├TRemPrompt.RemDataActive
 │   │ └TRemPrompt.CompareActiveDate
 │   └TRemPrompt.CompareActiveDate
 ├TRemPrompt.PromptType...
 ├TRemPrompt.GetValue
 │ ├TRemDlgElement.Historical
 │ ├TPCEData.VisitDateTime
 │ │ └TPCEData.IsSecondaryVisit
 │ ├TRemPrompt.RemDataActive...
 │ └TRemPrompt.RemDataChoiceActive
 ├GetPCEDisplayText
 │ ├LoadHistLocations
 │ ├LoadImmSeriesItems
 │ ├LoadImmReactionItems
 │ ├LoadSkResultsItems
 │ ├LoadPEDLevelItems
 │ ├LoadHFLevelItems
 │ └LoadXAMResultsItems
 ├TRemPrompt.Forced
 ├TRemDlgElement.Historical
 ├TPCEData.VisitDateTime...
 ├TRemPrompt.VitalValue
 │ └TRemPrompt.GetValue...
 ├ConvertVitalData
 ├TRemPrompt.VitalType
 │ ├Code2VitalType
 │ └TRemData.InternalValue
 ├TRemPrompt.VitalUnitValue
 │ ├TRemPrompt.VitalType...
 │ └TRemPrompt.GetValue...
 ├MHDLLFound
 │ └CheckforMHDll
 │   ├LoadMHDLL
 │   └UnloadMHDLL
 └TRemPrompt.Caption
   └AssignFieldIDs
     └GetNewFieldID

Calls

Name Declaration Comments
TRemPrompt.Add2PN function Add2PN: boolean; -
TRemPrompt.Caption function Caption: string; -
ConvertVitalData function ConvertVitalData(const Value: string; VitalType: TVitalType; UnitType: string = ''): string; -
TRemPrompt.Forced function Forced: boolean; -
GetPCEDisplayText function GetPCEDisplayText(ID: string; Tag: integer): string; -
TRemPrompt.GetValue function GetValue: string; -
TRemDlgElement.Historical function Historical: boolean; -
MHDLLFound function MHDLLFound: boolean; -
TRemPrompt.PromptType function PromptType: TRemPromptType; -
TPCEData.VisitDateTime function VisitDateTime: TFMDateTime; -
TRemPrompt.VitalType function VitalType: TVitalType; -
TRemPrompt.VitalUnitValue function VitalUnitValue: string; -
TRemPrompt.VitalValue function VitalValue: string; -


Source

5967  function TRemPrompt.NoteText: string;
5968  var
5969    pt: TRemPromptType;
5970    dateStr, fmt, tmp, WHValue: string;
5971    cnt, i, j, k: integer;
5972    ActDt, InActDt: Double;
5973    EncDt: TFMDateTime;
5974  
5975  begin
5976    Result := '';
5977    if Add2PN then
5978    begin
5979      pt := PromptType;
5980      tmp := GetValue;
5981      case pt of
5982        ptComment: Result := tmp;
5983  
5984        ptQuantity: if(StrToIntDef(tmp,1) <> 1) then
5985                      Result := tmp;
5986  
5987       (* ptSkinReading: if(StrToIntDef(tmp,0) <> 0) then
5988                         Result := tmp;  *)
5989  
5990       ptSkinReading:   // (AGP Change 26.1)
5991         begin
5992           Result := tmp;
5993         end;
5994  
5995        ptVisitDate:
5996          begin
5997            try
5998              if(tmp <> '') and (tmp <> '0') and (length(Tmp) = 7) then
5999              begin
6000                dateStr := '';
6001                if FMonthReq and (copy(tmp,4,2) = '00') then
6002                  Result := ''
6003                else
6004                begin
6005                  if(copy(tmp,4,4) = '0000') then
6006                    begin
6007                      fmt := 'YYYY';
6008                      dateStr := '  Exact date is unknown';
6009                    end
6010                  else
6011                  if(copy(tmp,6,2) = '00') then
6012                    begin
6013                      fmt := 'MMMM, YYYY';
6014                      dateStr := '  Exact date is unknown';
6015                    end
6016                  else
6017                    fmt := 'MMMM D, YYYY';
6018                  if dateStr = '' then Result := FormatFMDateTimeStr(fmt, tmp)
6019                  else Result := FormatFMDateTimeStr(fmt, tmp) + ' ' + dateStr;
6020                end;
6021              end;
6022            except
6023              on EConvertError do
6024                Result := tmp
6025              else
6026                raise;
6027            end;
6028          end;
6029  
6030        ptPrimaryDiag, ptAdd2PL, ptContraindicated:
6031          if(tmp = '1') then
6032            Result := ' ';
6033  
6034        ptVisitLocation:
6035          if(StrToIntDef(tmp, 0) = 0) then
6036          begin
6037            if(tmp <> '0') then
6038              Result := tmp;
6039          end
6040          else
6041            begin
6042            Result := GetPCEDisplayText(tmp, ComboPromptTags[pt]);
6043          end;
6044  
6045        ptWHPapResult:
6046          begin
6047           if Fparent.WHResultChk='N' then Result := 'NEM (No Evidence of Malignancy)';
6048           if Fparent.WHResultChk='A' then Result := 'Abnormal';
6049           if Fparent.WHResultChk='U' then Result := 'Unsatisfactory for Diagnosis';
6050           if FParent.WHResultChk='' then Result := '';
6051          end;
6052  
6053        ptWHNotPurp:
6054        begin
6055        if FParent.WHResultNot <> '' then
6056        begin
6057        WHValue := FParent.WHResultNot;
6058        //IF Forced = false then
6059        //begin
6060        if WHValue <> 'CPRS' then
6061        begin
6062        for cnt := 1 to Length(WHValue) do
6063            begin
6064            if Result ='' then
6065               begin
6066                if WHValue[cnt]='L' then Result := 'Letter';
6067                if WHValue[cnt]='I' then Result := 'In-Person';
6068                if WHValue[cnt]='P' then Result := 'Phone Call';
6069                end
6070            else
6071                begin
6072                if (WHValue[cnt]='L')and(Pos('Letter',Result)=0) then Result := Result+'; Letter';
6073                if (WHValue[cnt]='I')and(Pos('In-Person',Result)=0) then Result := Result+'; In-Person';
6074                if (WHValue[cnt]='P')and(Pos('Phone Call',Result)=0) then Result := Result+'; Phone Call';
6075                end;
6076            end;
6077         end;
6078        end
6079        else
6080        if Forced = true then
6081           begin
6082           if pos(':',Piece(FRec4,U,6))=0 then
6083             begin
6084             if Piece(FRec4,U,6)='L' then
6085               begin
6086               Result := 'Letter';
6087               FParent.WHResultNot :='L';
6088               end;
6089             if Piece(FRec4,U,6)='I' then
6090                begin
6091                Result := 'In-Person';
6092                FParent.WHResultNot := 'I';
6093                end;
6094             if Piece(FRec4,U,6)='P' then
6095                begin
6096                Result := 'Phone Call';
6097                FParent.WHResultNot := 'P';
6098                end;
6099             if Piece(FRec4,U,6)='CPRS' then
6100                begin
6101                Result := '';
6102                FParent.WHResultNot := 'CPRS';
6103                end;
6104             end
6105             else
6106             begin
6107             WHValue := Piece(FRec4,U,6);
6108             for cnt := 0 to Length(WHValue) do
6109            begin
6110            if Result ='' then
6111               begin
6112                if WHValue[cnt]='L' then
6113                  begin
6114                  Result := 'Letter';
6115                  FParent.WHResultNot := WHValue[cnt];
6116                  end;
6117                if WHValue[cnt]='I' then
6118                  begin
6119                  Result := 'In-Person';
6120                  FParent.WHResultNot := WHValue[cnt];
6121                  end;
6122                if WHValue[cnt]='P' then
6123                  begin
6124                  Result := 'Phone Call';
6125                  FParent.WHResultNot := WHValue[cnt];
6126                  end;
6127                end
6128            else
6129                begin
6130                if (WHValue[cnt]='L')and(Pos('Letter',Result)=0) then
6131                   begin
6132                   Result := Result +'; Letter';
6133                   FParent.WHResultNot := FParent.WHResultNot + ':' + WHValue[cnt];
6134                   end;
6135                if (WHValue[cnt]='I')and(Pos('In-Person',Result)=0) then
6136                   begin
6137                   Result := Result +'; In-Person';
6138                   FParent.WHResultNot := FParent.WHResultNot + ':' + WHValue[cnt];
6139                   end;
6140                if (WHValue[cnt]='P')and(Pos('Phone Call',Result)=0) then
6141                   begin
6142                   Result := Result +'; Phone Call';
6143                   FParent.WHResultNot := FParent.WHResultNot + ':' + WHValue[cnt];
6144                   end;
6145                end;
6146            end;
6147  
6148           end;
6149        end
6150        else
6151        Result := '';
6152      end;
6153  
6154        ptExamResults, ptSkinResults, ptLevelSeverity,
6155        ptSeries, ptReaction, ptLevelUnderstanding:
6156          begin
6157            Result := tmp;
6158            if(Piece(Result,U,1) = '@') then
6159              Result := ''
6160            else
6161              Result := GetPCEDisplayText(tmp, ComboPromptTags[pt]);
6162          end;
6163  
6164        else
6165        begin
6166          if pt = ptDataList then
6167          begin
6168            if(assigned(FData) and assigned(FData.FChoices)) then
6169            begin
6170              if not(assigned(FData.FChoicesActiveDates)) then
6171                for i := 0 to FData.FChoices.Count - 1 do
6172                  begin
6173                    if(copy(tmp,i+1,1) = '1') then
6174                      begin
6175                        if (Result <> '') then
6176                          Result := Result + ', ';
6177                        Result := Result + Piece(FData.FChoices[i],U,12);
6178                      end;
6179                  end
6180              else   {if there are active dates for each choice then check them}
6181                begin
6182                  if Self.FParent.Historical then
6183                    EncDt := DateTimeToFMDateTime(Date)
6184                  else
6185                    EncDt := RemForm.PCEObj.VisitDateTime;
6186                  k := 0;
6187                  for i := 0 to FData.FChoices.Count - 1 do
6188                  begin
6189                    for j := 0 to (TStringList(FData.FChoicesActiveDates[i]).Count - 1) do
6190                    begin
6191                      ActDt := StrToIntDef((Piece(TStringList(FData.FChoicesActiveDates[i]).Strings[j], ':', 1)),0);
6192                      InActDt := StrToIntDef((Piece(TStringList(FData.FChoicesActiveDates[i]).Strings[j], ':', 2)),9999999);
6193                      if (EncDt >= ActDt) and (EncDt <= InActDt) then
6194                      begin
6195                        if(copy(tmp,k+1,1) = '1') then
6196                        begin
6197                          if(Result <> '') then
6198                            Result := Result + ', ';
6199                          Result := Result + Piece(FData.FChoices[i],U,12);
6200                        end;
6201                        inc(k);
6202                      end;  {ActiveDate check}
6203                    end;  {FChoicesActiveDates.Items[i] loop}
6204                  end;  {FChoices loop}
6205              end;
6206            end;
6207          end
6208          else
6209          if pt = ptVitalEntry then
6210          begin
6211            Result := VitalValue;
6212            if(Result <> '') then
6213              Result := ConvertVitalData(Result, VitalType, VitalUnitValue);
6214          end
6215          else
6216          if pt = ptMHTest then
6217            Result := FMiscText
6218          else
6219          if (pt = ptGAF) and (MHDLLFound = false) then
6220          begin
6221            if(StrToIntDef(Piece(tmp, U, 1),0) <> 0) then
6222            begin
6223              Result := tmp;
6224            end
6225          end
6226          else
6227          if pt = ptMHTest then
6228            Result := FMiscText;
6229  
6230              (*
6231              GafDate := Trunc(FParent.FReminder.PCEDataObj.VisitDateTime);
6232              ValidateGAFDate(GafDate);
6233              Result := tmp + CRCode + 'Date Determined: ' + FormatFMDateTime('mm/dd/yyyy', GafDate) +
6234                              CRCode + 'Determined By: ' + FParent.FReminder.PCEDataObj.Providers.PCEProviderName;
6235              *)
6236            //end;
6237          end;
6238        end;
6239      end;
6240      if(Result <> '') and (Caption <> '') then
6241        Result := Trim(Caption + ' ' + Trim(Result));
6242    //end;
6243  end;