Procedure

TfrmBALocalDiagnoses.AddProbsToDiagnosis

Module

fBALocalDiagnoses

Last Modified

7/15/2014 3:26:34 PM

Comments

**  Add problem-list enteries to Diagnosis selection list

Visibility

Private

Owner

TfrmBALocalDiagnoses

Declaration

procedure AddProbsToDiagnosis;

Calls Hierarchy


TfrmBALocalDiagnoses.AddProbsToDiagnosis
 ├FMToday
 │ └FMNow
 └AttachPLTFactorsToDx
   └ProcessProblemTFactors

Called-By Hierarchy


                          TfrmBALocalDiagnoses.AddProbsToDiagnosis
                          TfrmBALocalDiagnoses.LoadEncounterForm┘ 
                               TfrmBALocalDiagnoses.MainDriver┤   
                             TfrmBALocalDiagnoses.FormCreate┘ │   
TfrmBALocalDiagnoses.AddDiagnosistoPersonalDiagnosesList1Click┤   
TfrmBALocalDiagnoses.AddDiagnosistoPersonalDiagnosesList2Click┘   

Calls

Name Declaration Comments
AttachPLTFactorsToDx procedure AttachPLTFactorsToDx(var Dest:String;ProblemRec:string); -
FMToday function FMToday: TFMDateTime; -

Called-By

Name Declaration Comments
TfrmBALocalDiagnoses.LoadEncounterForm procedure LoadEncounterForm; -


Source

361   procedure TfrmBALocalDiagnoses.AddProbsToDiagnosis;
362   var
363     i : integer;
364     EncDt: TFMDateTime;
365     ProblemListTFactors: string;
366   begin
367      // ** Get problem list
368      EncDt := Trunc(FMToday);
369      uLastDFN := Patient.DFN;
370      tCallV(UProblems, 'ORWPCE ACTPROB', [Patient.DFN, EncDT]);
371   
372      if uProblems.Count > 0 then
373      begin
374         BADiagnosis.add('^Problem List Items');
375         for i := 1 to (uProblems.count-1) do
376         begin
377           // ** add PL Treatment Factors to Dx Display List.
378      //HDS00006194     if (Piece(uproblems.Strings[i],U,3) = '799.9') then continue;
379      //HDS00006194     if (Piece(uproblems.Strings[i],U,2) = '799.9') then continue;
380                 // change made to allow 799.9 into selection list
381           AttachPLTFactorsToDx(ProblemListTFactors,uProblems.Strings[i]);
382   
383           if (Piece(uproblems.Strings[i], U, 11) =  '#') then
384           begin
385              BADiagnosis.add(Piece(uProblems.Strings[i],U,3) + U +                   // PL code inactive
386                              Piece(uProblems.Strings[i],U,2) + U + '#');
387              inc(inactiveCodes);
388           end
389           else if (Piece(uproblems.Strings[i], U, 10) =  '') then                  // no inactive date for code
390              BADiagnosis.add(ProblemListTFactors)
391           else if (Trunc(StrToFloat(Piece(uProblems.Strings[i], U, 10))) > EncDT) then     // code active as of EncDt
392              BADiagnosis.add(Piece(uProblems.Strings[i],U,3) + U +
393                              ProblemListTFactors )
394           else
395              BADiagnosis.add(Piece(uProblems.Strings[i],U,3) + U +                   // PL code inactive
396                              Piece(uProblems.Strings[i],U,2) + U + '#');
397       end;
398     end;
399   end;