Function

LoadConsultForEdit

Module

rConsults

Last Modified

7/15/2014 3:26:36 PM

Scope

Interfaced

Declaration

function LoadConsultForEdit(ConsultIEN: integer): TEditResubmitRec;

Called-By Hierarchy


                         LoadConsultForEdit
                      EditResubmitConsult┤ 
   TfrmConsults.mnuActEditResubmitClick┘ │ 
    TfrmConsults.cmdEditResubmitClick┘   │ 
                    EditResubmitProcedure┘ 
TfrmConsults.mnuActEditResubmitClick...┘   

Called-By

Name Declaration Comments
EditResubmitConsult function EditResubmitConsult(FontSize: Integer; ConsultIEN: integer): boolean; -
EditResubmitProcedure function EditResubmitProcedure(FontSize: Integer; ConsultIEN: integer): boolean; -


Source

654   function LoadConsultForEdit(ConsultIEN: integer): TEditResubmitRec;
655   var
656     Dest: TStringList;
657     EditRec: TEditResubmitRec;
658   begin
659     Dest := TStringList.Create;
660     try
661       tCallV(Dest, 'ORQQCN LOAD FOR EDIT',[ConsultIEN]) ;
662       with EditRec do
663         begin
664            Changed         := False;
665            IEN             := ConsultIEN;
666            ToService       := StrToIntDef(Piece(ExtractDefault(Dest, 'SERVICE'), U, 2), 0);
667            RequestType     := Piece(ExtractDefault(Dest, 'TYPE'), U, 3);
668            OrderableItem   := StrToIntDef(Piece(ExtractDefault(Dest, 'PROCEDURE'), U, 1), 0);
669            ConsultProc     := Piece(ExtractDefault(Dest, 'PROCEDURE'), U, 3);
670            ConsultProcName := Piece(ExtractDefault(Dest, 'PROCEDURE'), U, 2);
671            Urgency         := StrToIntDef(Piece(ExtractDefault(Dest, 'URGENCY'), U, 3), 0);
672            UrgencyName     := Piece(ExtractDefault(Dest, 'URGENCY'), U, 2);
673            EarliestDate    := StrToFloatDef(Piece(ExtractDefault(Dest, 'EARLIEST'), U, 2), 0);
674            //LatestDate      := StrToFloatDef(Piece(ExtractDefault(Dest, 'LATEST'), U, 2), 0); //dropped requirement WAT
675            Place           := Piece(ExtractDefault(Dest, 'PLACE'), U, 1);
676            PlaceName       := Piece(ExtractDefault(Dest, 'PLACE'), U, 2);
677            Attention       := StrToInt64Def(Piece(ExtractDefault(Dest, 'ATTENTION'), U, 1), 0);
678            AttnName        := Piece(ExtractDefault(Dest, 'ATTENTION'), U, 2);
679            InpOutp         := Piece(ExtractDefault(Dest, 'CATEGORY'), U, 1);
680            ProvDiagnosis      := Piece(ExtractDefault(Dest, 'DIAGNOSIS'), U, 1);
681            ProvDxCode         := Piece(ExtractDefault(Dest, 'DIAGNOSIS'), U, 2);
682            ProvDxCodeInactive := (Piece(ExtractDefault(Dest, 'DIAGNOSIS'), U, 3) = '1');
683            RequestReason   := TStringList.Create;
684            ExtractText(RequestReason, Dest, 'REASON');
685            LimitStringLength(RequestReason, 74);
686            DenyComments    := TStringList.Create;
687            ExtractText(DenyComments, Dest, 'DENY COMMENT');
688            OtherComments   := TStringList.Create;
689            ExtractText(OtherComments, Dest, 'ADDED COMMENT');
690            NewComments     := TStringList.Create;
691         end;
692       Result := EditRec;
693     finally
694       Dest.Free;
695     end;
696   end;