Procedure

TfrmProblems.RestoreProblem

Module

fProbs

Last Modified

7/15/2014 3:26:38 PM

Visibility

Public

Owner

TfrmProblems

Declaration

procedure RestoreProblem;

Calls Hierarchy


TfrmProblems.RestoreProblem
 ├TfrmProblems.MString
 ├EditLoad
 ├TProbRec.Create
 │ ├TProbRec.CreateFields
 │ ├TProbRec.LoadField
 │ │ └GetOrigVal
 │ └TProbRec.LoadComments
 │   └TComment.Create
 ├TEncounter.GetVisitCategory
 ├FMNow
 ├IsActiveICDCode
 │ └IsActiveCode
 ├TProbRec.SetStatus
 ├TfrmProblems.EditProblem
 │ ├TfrmProblems.MString
 │ └TfrmdlgProb.Create
 ├ProblemReplace
 ├TfrmProblems.LoadPatientProblems
 │ ├TPLFilters.create
 │ ├TfrmProblems.ClearGrid
 │ ├FMNow
 │ ├ProblemList
 │ ├TfrmProblems.SetGridPieces
 │ │ └ForChars
 │ ├ReverseList
 │ ├TfrmProblems.RefreshList
 │ │ └TfrmProblems.PlainText
 │ ├TfrmProblems.NoRowSelected
 │ ├GetProblemComments
 │ ├SetViewFilters
 │ │ ├LoadFilterList
 │ │ └ShowFilterStatus
 │ ├InitViewFilters
 │ │ └SetViewFilters...
 │ ├TfrmProblems.ApplyViewFilters
 │ ├TfrmProblems.MString
 │ ├TfrmProblems.wgProbDataClick
 │ │ ├TfrmProblems.MString
 │ │ ├TfrmProblems.NoRowSelected
 │ │ └TfrmProblems.RowSelected
 │ │   └TfrmProblems.MString
 │ ├TfrmProblems.RowSelected...
 │ └TfrmProblems.pnlRightResize
 │   ├TfrmProblems.SetGridPieces...
 │   ├TfrmProblems.ApplyViewFilters
 │   ├TfrmProblems.RefreshList...
 │   └TfrmProblems.GetRowCount
 └TfrmProblems.GetRowCount

Called-By Hierarchy


               TfrmProblems.RestoreProblem
           TfrmProblems.lstProbActsClick┘ 
       TfrmProblems.wgProbDataDblClick┤   
             TfrmProblems.lstViewClick┘   
     TfrmProblems.HighlightDuplicate┘     
           TfrmProblems.AddProblem┤       
TfrmProblems.lstProbActsClick...┤ │       
   TfrmProblems.lstProbPickClick┤ │       
TfrmProblems.lstProbPickDblClick┤ │       
TfrmProblems.edProbEntKeyPress┘ │ │       
        TfrmProblems.UMPLLexicon┘ │       
     TfrmdlgProb.bbChangeProbClick┘       

Calls

Name Declaration Comments
TProbRec.Create constructor Create(AList:TstringList); -
EditLoad function EditLoad(ProblemIFN: string; ProviderID: int64; ptVAMC: string): TStrings ; -
TfrmProblems.EditProblem procedure EditProblem(const why:char); -
FMNow function FMNow: TFMDateTime; -
TfrmProblems.GetRowCount procedure GetRowCount; -
TEncounter.GetVisitCategory function GetVisitCategory: Char; -
IsActiveICDCode function IsActiveICDCode(ACode: string; ADate: TFMDateTime = 0): boolean; -
TfrmProblems.LoadPatientProblems procedure LoadPatientProblems(AList:TstringList;const status:char;init:boolean); -
TfrmProblems.MString function MString( index: integer): string; -
ProblemReplace function ProblemReplace(ProblemIFN: string): TStrings ; -
TProbRec.SetStatus procedure SetStatus(value:String); -

Called-By

Name Declaration Comments
TfrmProblems.lstProbActsClick procedure lstProbActsClick(Sender: TObject); -


Source

1527  procedure TfrmProblems.RestoreProblem;
1528  const
1529    TC_RESTORE_EDIT = 'Unable to restore';
1530    TX_RESTORE_EDIT = 'This problem references an inactive ICD code,' + #13#10 +
1531                      'and must be updated using the ''Change'' option' + #13#10 +
1532                      'before it can be restored.' + #13#10 + #13#10 +
1533                      'Would you like to edit this problem?';
1534  var
1535    Alist:TstringList;
1536    AProbRec: TProbRec;
1537    ProblemIFN: string;
1538    DateOfInterest: TFMDateTime;
1539    SvcCat: Char;
1540  begin
1541    Alist := TStringList.create;
1542    ProblemIFN := Piece(MString(wgProbData.ItemIndex), U, 1);
1543    FastAssign(EditLoad(ProblemIFN, pProviderID, PLPt.ptVAMC), AList) ;
1544    AProbRec:=TProbRec.Create(Alist); {create a problem object}
1545    SvcCat := Encounter.VisitCategory;
1546    if (SvcCat = 'E') or (SvcCat = 'H') then
1547      DateOfInterest := FMNow
1548    else
1549      DateOfInterest := Encounter.DateTime;
1550    try
1551      if not IsActiveICDCode(AProbRec.Diagnosis.extern, DateOfInterest) then
1552        begin
1553          if InfoBox(TX_RESTORE_EDIT, TC_RESTORE_EDIT, MB_YESNO or MB_ICONWARNING) = IDYES then
1554          begin
1555            AProbRec.Status := 'A';
1556            EditProblem('C');
1557          end
1558          else
1559            Exit;
1560        end
1561      else
1562        begin
1563          FastAssign(ProblemReplace(ProblemIFN), Alist) ;
1564          if Alist[0] <> '1' then
1565            InfoBox('Unable to restore the problem record: ' + #13#10 + ' (' + AProbrec.PIFN + ')',
1566              'Information', MB_OK or MB_ICONINFORMATION)
1567          else
1568            LoadPatientProblems(AList, 'R', False);
1569          GetRowCount;
1570        end;
1571    finally
1572      Changes.RefreshCoverPL := True;
1573      AList.free;
1574      AProbRec.Free;
1575    end;
1576  end;