Procedure

TfrmDiagnoses.UpdateProblem

Module

fDiagnoses

Last Modified

3/11/2015 8:41:48 AM

Visibility

Private

Owner

TfrmDiagnoses

Declaration

procedure UpdateProblem(AplIEN: String; AICDCode: String; ASCTCode: String = '');

Calls Hierarchy


TfrmDiagnoses.UpdateProblem
 ├EditLoad
 ├TProbRec.Create
 │ ├TProbRec.CreateFields
 │ ├TProbRec.LoadField
 │ │ └GetOrigVal
 │ └TProbRec.LoadComments
 │   └TComment.Create
 ├TKeyVal.DHCPtoKeyVal
 ├TEncounter.GetProviderName
 │ └TEncounter.UpdateText
 │   └GetEncounterText
 ├TProbRec.SetCodeDateStr
 │ └TProbRec.SetDateString
 │   └StrToFMDateTime
 ├EditSave
 └TProbRec.GetFilerObject
   ├TComment.TComtoDHCPCom
   │ └FixQuotes
   ├FixQuotes
   └TKeyVal.GetDHCPField

Called-By Hierarchy


         TfrmDiagnoses.UpdateProblem
TfrmDiagnoses.lbxSectionClickCheck┘ 

Calls

Name Declaration Comments
TProbRec.Create constructor Create(AList:TstringList); -
TKeyVal.DHCPtoKeyVal procedure DHCPtoKeyVal(DHCPFld:String); -
EditLoad function EditLoad(ProblemIFN: string; ProviderID: int64; ptVAMC: string): TStrings ; -
EditSave function EditSave(ProblemIFN: string; ProviderID: int64; ptVAMC, PrimUser: string; ProbFile: TStringList; SearchString: String): TStrings ; -
TProbRec.GetFilerObject function GetFilerObject:TstringList; -
TEncounter.GetProviderName function GetProviderName: string; -
TProbRec.SetCodeDateStr procedure SetCodeDateStr(value: String); -

Called-By

Name Declaration Comments
TfrmDiagnoses.lbxSectionClickCheck procedure lbxSectionClickCheck(Sender: TObject; Index: Integer); -


Source

213   procedure TfrmDiagnoses.UpdateProblem(AplIEN: String; AICDCode: String; ASCTCode: String = '');
214   var
215     AList: TStringList;
216     ProbRec: TProbRec;
217     CodeSysStr: String;
218   begin
219     // Update problem list entry with new ICD (& SCT) code(s) (& narrative).
220     AList := TStringList.create;
221     try
222       FastAssign(EditLoad(AplIEN, Encounter.Provider, User.StationNumber), AList) ;
223       ProbRec := TProbRec.Create(AList);
224       ProbRec.PIFN := AplIEN;
225   
226       if AICDCode <> '' then
227       begin
228         ProbRec.Diagnosis.DHCPtoKeyVal(Pieces(AICDCode, U, 1, 2));
229         CodeSysStr := Piece(AICDCode, U, 4);
230         if (Pos('10', CodeSysStr) > 0) then
231           CodeSysStr := '10D^ICD-10-CM'
232         else
233           CodeSysStr := 'ICD^ICD-9-CM';
234         ProbRec.CodeSystem.DHCPtoKeyVal(CodeSysStr);
235       end;
236   
237       if ASCTCode <> '' then
238       begin
239         ProbRec.SCTConcept.DHCPtoKeyVal(Pieces(ASCTCode, U, 1, 2));
240         //TODO: need to accommodate changes to Designation Code
241         ProbRec.Narrative.DHCPtoKeyVal(U + Piece(ASCTCode, U, 3));
242       end;
243   
244       ProbRec.RespProvider.DHCPtoKeyVal(IntToStr(Encounter.Provider) + u + Encounter.ProviderName);
245       ProbRec.CodeDateStr := FormatFMDateTime('mm/dd/yy', Encounter.DateTime);
246       AList.Clear;
247       FastAssign(EditSave(ProbRec.PIFN, User.DUZ, User.StationNumber, '1', ProbRec.FilerObject, ''), AList);
248     finally
249       AList.clear;
250     end;
251   end;