Procedure

PutEditedDCSumm

Module

rDCSumm

Last Modified

7/15/2014 3:26:44 PM

Comments

Update the fields and content of the note identified in NoteIEN, returns 1 if successful
  load broker directly since there isn't a good way to set up mutilple subscript arrays 

var
  i: Integer;

Scope

Interfaced

Declaration

procedure PutEditedDCSumm(var UpdatedDoc: TCreatedDoc; const DCSummRec: TDCSummRec; NoteIEN: 
Integer);

Calls Hierarchy


PutEditedDCSumm
 └SetText
   └InitParams

Called-By Hierarchy


                                                       PutEditedDCSumm
                                           TfrmDCSumm.SaveEditedSumm┘ 
                                        TfrmDCSumm.SaveCurrentSumm┘   
                                   TfrmDCSumm.AllowContextChange┤     
                               TfrmFrame.AllowContextChangeAll┘ │     
                                    TfrmFrame.FormCloseQuery┤   │     
                                  TfrmFrame.mnuFileNextClick┤   │     
                                TfrmFrame.mnuFileOpenClick┤ │   │     
                                    TfrmFrame.UMInitiate┤ │ │   │     
                           TfrmFrame.mnuFileNextClick...┤ │ │   │     
                           TfrmFrame.mnuFileRefreshClick┤ │ │   │     
                           TfrmOrders.CheckOrderStatus┤ │ │ │   │     
                       TfrmOrders.mnuActChgEvntClick┤ │ │ │ │   │     
                          TfrmOrders.mnuActHoldClick┤ │ │ │ │   │     
                        TfrmOrders.mnuActUnholdClick┤ │ │ │ │   │     
                         TfrmOrders.mnuActRenewClick┤ │ │ │ │   │     
                        TfrmOrders.mnuActChangeClick┤ │ │ │ │   │     
                          TfrmOrders.mnuActCopyClick┘ │ │ │ │   │     
                                TfrmMeds.mnuActDCClick┤ │ │ │   │     
                               TfrmMeds.CheckMedStatus┘ │ │ │   │     
                            TfrmMeds.mnuActHoldClick┤   │ │ │   │     
                           TfrmMeds.mnuActRenewClick┤   │ │ │   │     
                          TfrmMeds.mnuActUnholdClick┤   │ │ │   │     
                          TfrmMeds.mnuActChangeClick┤   │ │ │   │     
                            TfrmMeds.mnuActCopyClick┤   │ │ │   │     
                          TfrmMeds.mnuActRefillClick┘   │ │ │   │     
                                      TfrmFrame.ViewInfo┘ │ │   │     
                                   TfrmDCSumm.ViewInfo┤   │ │   │     
                                 TfrmConsults.ViewInfo┤   │ │   │     
                         TfrmFrame.pnlRemindersMouseUp┤   │ │   │     
                          TfrmFrame.RemindersChanged┘ │   │ │   │     
                              TfrmFrame.FormCreate┘   │   │ │   │     
                                TfrmFrame.pnlCIRNClick┤   │ │   │     
                          TfrmFrame.pnlVistaWebClick┤ │   │ │   │     
                               TfrmFrame.FormKeyDown┘ │   │ │   │     
                             TfrmFrame.pnlPatientClick┤   │ │   │     
                               TfrmFrame.pnlVisitClick┤   │ │   │     
                         TfrmFrame.pnlPrimaryCareClick┤   │ │   │     
                           TfrmFrame.pnlRemindersClick┤   │ │   │     
                            TfrmFrame.pnlPostingsClick┤   │ │   │     
                                TfrmFrame.pnlFlagClick┤   │ │   │     
                                  TfrmFrame.laMHVClick┤   │ │   │     
                                 TfrmFrame.laVAA2Click┤   │ │   │     
                                   TfrmOrders.ViewInfo┤   │ │   │     
                                     TfrmMeds.ViewInfo┤   │ │   │     
                                  TfrmSurgery.ViewInfo┤   │ │   │     
                                    TfrmNotes.ViewInfo┤   │ │   │     
                                 TfrmProblems.ViewInfo┘   │ │   │     
                         TfrmFrame.mnuFileNotifRemoveClick┤ │   │     
                                 TfrmFrame.NextButtonClick┘ │   │     
                               TfrmFrame.SetUpNextButton┘   │   │     
                         TfrmFrame.mnuFileOpenClick...┤     │   │     
                                  TfrmFrame.FormResize┘     │   │     
                                TfrmFrame.ChangeFont┘       │   │     
                        TfrmFrame.LoadSizesForUser┤         │   │     
                   TfrmFrame.LoadUserPreferences┘ │         │   │     
                          TfrmFrame.UMInitiate┘   │         │   │     
                        TfrmFrame.mnuFontSizeClick┘         │   │     
                               TfrmFrame.mnuFileOpenClick...┤   │     
                               TfrmFrame.ctxContextorPending┤   │     
                              TfrmFrame.StartCCOWContextor┘ │   │     
                                    TfrmFrame.FormCreate┘   │   │     
                             TfrmFrame.ctxContextorCommitted┤   │     
                           TfrmFrame.StartCCOWContextor...┘ │   │     
                      TfrmFrame.mnuFileResumeContextGetClick┤   │     
                      TfrmFrame.mnuFileResumeContextSetClick┘   │     
                                      TfrmDCSumm.LstSummsToPrint┤     
                      TfrmFrame.mnuFilePrintSelectedItemsClick┘ │     
                                         TfrmDCSumm.RequestPrint┤     
                                   TfrmFrame.mnuFilePrintClick┘ │     
                                        TfrmDCSumm.InsertNewSumm┤     
                                     TfrmDCSumm.mnuActNewClick┤ │     
                                  TfrmDCSumm.cmdNewSummClick┘ │ │     
                              TfrmDCSumm.mnuActAddIDEntryClick┘ │     
                                         TfrmDCSumm.mnuViewClick┤     
                                     TfrmDCSumm.SetViewContext┤ │     
                                      TfrmDCSumm.DisplayPage┤ │ │     
                      TfrmDCSumm.mnuViewReturntoDefaultClick┘ │ │     
                          TfrmDCSumm.mnuViewSaveAsDefaultClick┘ │     
                                         TfrmDCSumm.StartNewEdit┤     
                                  TfrmDCSumm.mnuActNewClick...┤ │     
                              TfrmDCSumm.mnuActAddIDEntryClick┤ │     
                                  TfrmDCSumm.mnuActAddendClick┤ │     
                                    TfrmDCSumm.mnuActEditClick┘ │     
                        TfrmDCSumm.mnuActDetachFromIDParentClick┤     
                                    TfrmDCSumm.mnuActDeleteClick┤     
                                  TfrmDCSumm.SaveEditedSumm...┘ │     
                                      TfrmDCSumm.mnuActSaveClick┤     
                                      TfrmDCSumm.mnuActSignClick┤     
                                         TfrmDCSumm.SaveSignItem┤     
                                         TfrmReview.cmdOKClick┘ │     
                                               ReviewChanges┘   │     
                        TfrmFrame.AllowContextChangeAll...┤     │     
                                  TfrmFrame.FormCloseQuery┤     │     
                              TfrmFrame.mnuFileReviewClick┤     │     
                                           UpdateEncounter┘     │     
                         TfrmFrame.mnuFileEncounterClick┤       │     
                                 TfrmFrame.ViewInfo...┤ │       │     
                    TfrmODMedIV.SetValuesFromResponses┤ │       │     
                             TfrmODMedIV.SetupDialog┤ │ │       │     
                   TfrmODMedIV.cboSolutionMouseClick┘ │ │       │     
                       TfrmODMedIV.cboSolutionExit┘   │ │       │     
                  TfrmODMedIV.cboSolutionMouseClick...┤ │       │     
                     TfrmODMedIV.cboAdditiveMouseClick┤ │       │     
                         TfrmODMedIV.cboAdditiveExit┘ │ │       │     
                                TfrmODAuto.SetupDialog┤ │       │     
                                   ActivateOrderDialog┤ │       │     
                           TfrmRemDlg.btnFinishClick┤ │ │       │     
           TfrmConsults.mnuActNewConsultRequestClick┤ │ │       │     
                   TfrmConsults.cmdNewConsultClick┘ │ │ │       │     
                TfrmConsults.mnuActNewProcedureClick┤ │ │       │     
                      TfrmConsults.cmdNewProcClick┘ │ │ │       │     
                                        ChangeOrders┤ │ │       │     
                      TfrmOrders.mnuActChangeClick┤ │ │ │       │     
                        TfrmMeds.mnuActChangeClick┘ │ │ │       │     
                                     ChangeOrdersEvt┤ │ │       │     
                                          CopyOrders┤ │ │       │     
                        TfrmOrders.mnuActCopyClick┤ │ │ │       │     
                          TfrmMeds.mnuActCopyClick┤ │ │ │       │     
                           TfrmODActive.btnOKClick┘ │ │ │       │     
                                      TransferOrders┤ │ │       │     
                        TfrmOrders.mnuActCopyClick┤ │ │ │       │     
                          TfrmMeds.mnuActCopyClick┤ │ │ │       │     
                           TfrmODActive.btnOKClick┘ │ │ │       │     
                            TfrmOrders.lstWriteClick┤ │ │       │     
               TfrmOrders.PlaceOrderForDefaultDialog┤ │ │       │     
                  TfrmOrders.DisplayDefaultDlgList┤ │ │ │       │     
                       TfrmOrders.ResetOrderPage┘ │ │ │ │       │     
               TfrmOrders.btnDelayedOrderClick┘   │ │ │ │       │     
                                 DisplayEvntDialog┤ │ │ │       │     
                             SetDelayEventForMed┘ │ │ │ │       │     
                      TfrmMeds.mnuActCopyClick┘   │ │ │ │       │     
                                 DisplayEvntDialog┤ │ │ │       │     
                                  SetViewForCopy┘ │ │ │ │       │     
                    TfrmOrders.mnuActCopyClick┘   │ │ │ │       │     
                                 DisplayEvntDialog┘ │ │ │       │     
                                ExecuteChangeEvt┘   │ │ │       │     
                 TfrmOrders.mnuActChgEvntClick┘     │ │ │       │     
                             TfrmMeds.mnuActNewClick┤ │ │       │     
                           TfrmOMNavA.ActivateDialog┤ │ │       │     
                         TfrmOMNavA.grdMenuKeyDown┤ │ │ │       │     
                         TfrmOMNavA.grdMenuMouseUp┘ │ │ │       │     
                                TfrmOMSet.DoNextItem┘ │ │       │     
                              TfrmOMSet.InsertList┤   │ │       │     
                               ActivateOrderList┘ │   │ │       │     
                     TfrmRemDlg.btnFinishClick┤   │   │ │       │     
                             ActivateOrderHTML┤   │   │ │       │     
                    TfrmOrders.lstWriteClick┤ │   │   │ │       │     
    TfrmOrders.PlaceOrderForDefaultDialog...┘ │   │   │ │       │     
                              ActivateOrderSet┤   │   │ │       │     
                   TfrmRemDlg.btnFinishClick┤ │   │   │ │       │     
TfrmConsults.mnuActNewConsultRequestClick...┤ │   │   │ │       │     
     TfrmConsults.mnuActNewProcedureClick...┤ │   │   │ │       │     
                    TfrmOrders.lstWriteClick┤ │   │   │ │       │     
    TfrmOrders.PlaceOrderForDefaultDialog...┤ │   │   │ │       │     
                     TfrmMeds.mnuActNewClick┤ │   │   │ │       │     
                TfrmOMNavA.ActivateDialog...┤ │   │   │ │       │     
                     TfrmOMSet.DoNextItem...┘ │   │   │ │       │     
                       TfrmOMNavA.DoSelectList┘   │   │ │       │     
                     TfrmOMNavA.grdMenuKeyUp┤     │   │ │       │     
                   TfrmOMNavA.grdMenuMouseUp┘     │   │ │       │     
                                        SkipToNext┤   │ │       │     
                         TfrmOMSet.DoNextItem...┘ │   │ │       │     
                            TfrmOMSet.UMDelayEvent┘   │ │       │     
                               TfrmOMSet.InsertList...┤ │       │     
                                TfrmODMeds.SetupDialog┤ │       │     
                             TfrmODMeds.btnSelectClick┤ │       │     
                             TfrmODMeds.UMDelayClick┘ │ │       │     
                                    ExecuteRenewOrders┘ │       │     
                         TfrmOrders.mnuActRenewClick┤   │       │     
                           TfrmMeds.mnuActRenewClick┘   │       │     
                                        EncounterPresent┤       │     
                                      ReadyForNewOrder┤ │       │     
                           TfrmRemDlg.btnFinishClick┤ │ │       │     
        TfrmConsults.mnuActNewConsultRequestClick...┤ │ │       │     
             TfrmConsults.mnuActNewProcedureClick...┤ │ │       │     
                                     ChangeOrders...┤ │ │       │     
                                     ChangeOrdersEvt┤ │ │       │     
                                       CopyOrders...┤ │ │       │     
                                   TransferOrders...┤ │ │       │     
                            TfrmOrders.lstWriteClick┤ │ │       │     
                             TfrmMeds.mnuActNewClick┘ │ │       │     
                                     ReadyForNewOrder1┤ │       │     
            TfrmOrders.PlaceOrderForDefaultDialog...┘ │ │       │     
                              TfrmOrders.mnuActDCClick┤ │       │     
                             TfrmOrders.mnuActRelClick┤ │       │     
                            TfrmOrders.mnuActHoldClick┤ │       │     
                          TfrmOrders.mnuActUnholdClick┤ │       │     
                           TfrmOrders.mnuActRenewClick┤ │       │     
                         TfrmOrders.mnuActReleaseClick┤ │       │     
                         TfrmOrders.mnuActOnChartClick┤ │       │     
                            TfrmOrders.mnuActSignClick┤ │       │     
                                TfrmMeds.mnuActDCClick┤ │       │     
                              TfrmMeds.mnuActHoldClick┤ │       │     
                             TfrmMeds.mnuActRenewClick┤ │       │     
                            TfrmMeds.mnuActUnholdClick┤ │       │     
                              TfrmMeds.mnuActCopyClick┤ │       │     
                            TfrmMeds.mnuActRefillClick┘ │       │     
                                     EncounterPresentEDO┤       │     
                                   ReadyForNewOrder...┤ │       │     
                         TfrmOrders.mnuActChgEvntClick┤ │       │     
                          TfrmOrders.mnuActChangeClick┤ │       │     
                            TfrmOrders.mnuActCopyClick┤ │       │     
                       TfrmOrders.btnDelayedOrderClick┤ │       │     
                            TfrmMeds.mnuActChangeClick┤ │       │     
                              TfrmMeds.mnuActCopyClick┘ │       │     
                                             UpdateVisit┤       │     
                                           EditPCEData┤ │       │     
                             TfrmSurgery.cmdPCEClick┤ │ │       │     
                                 UpdateEncounterInfo┘ │ │       │     
                             TfrmNotes.cmdPCEClick┘   │ │       │     
                        TfrmVitals.btnEnterVitalsClick┘ │       │     
                                             UpdateVisit┤       │     
                                        EncounterPresent┘       │     
                         TfrmProblems.lstProbActsClick┘         │     
                     TfrmProblems.wgProbDataDblClick┤           │     
                           TfrmProblems.lstViewClick┘           │     
                   TfrmProblems.HighlightDuplicate┘             │     
                         TfrmProblems.AddProblem┤               │     
              TfrmProblems.lstProbActsClick...┤ │               │     
                 TfrmProblems.lstProbPickClick┤ │               │     
              TfrmProblems.lstProbPickDblClick┤ │               │     
              TfrmProblems.edProbEntKeyPress┘ │ │               │     
                      TfrmProblems.UMPLLexicon┘ │               │     
                   TfrmdlgProb.bbChangeProbClick┘               │     
                                            TfrmDCSumm.FormClose┤     
                       TfrmDCSumm.mnuActIdentifyAddlSignersClick┤     
                           TfrmDCSumm.popSummMemoAddlSignClick┘ │     
                                 TfrmDCSumm.ProcessNotifications┤     
                                        TfrmDCSumm.DisplayPage┘ │     
                                    TfrmDCSumm.SetViewContext...┤     
                                      TfrmDCSumm.tvSummsDragDrop┤     
                                     TfrmDCSumm.tvSummsStartDrag┤     
                          TfrmDCSumm.mnuActAttachtoIDParentClick┘     

Calls

Name Declaration Comments
SetText procedure SetText(var ErrMsg: string; NoteText: TStrings; NoteIEN: Int64; Suppress: Integer); -

Called-By

Name Declaration Comments
TfrmDCSumm.SaveEditedSumm procedure SaveEditedSumm(var Saved: Boolean); -


Source

492   procedure PutEditedDCSumm(var UpdatedDoc: TCreatedDoc; const DCSummRec: TDCSummRec; NoteIEN:
493   Integer);
494   { update the fields and content of the note identified in NoteIEN, returns 1 if successful
495     load broker directly since there isn't a good way to set up mutilple subscript arrays }
496   (*var
497     i: Integer;*)
498   var
499     ErrMsg: string;
500   begin
501     // First, file field data
502     with RPCBrokerV do
503     begin
504       ClearParameters := True;
505       RemoteProcedure := 'TIU UPDATE RECORD';
506       Param[0].PType := literal;
507       Param[0].Value := IntToStr(NoteIEN);
508       Param[1].PType := list;
509       with Param[1] do
510       begin
511         if DCSummRec.Addend = 0 then
512           begin
513             Mult['.01']  := IntToStr(DCSummRec.Title);
514             //Mult['.11']  := BOOLCHAR[DCSummRec.NeedCPT];  //  **** removed in v19.1  {RV} ****
515           end;
516         if (DCSummRec.Status in [TIU_ST_UNREL(*, TIU_ST_UNVER*)]) then Mult['.05'] := IntToStr(DCSummRec.Status);
517         Mult['1202']   := IntToStr(DCSummRec.Dictator);
518         Mult['1209']   := IntToStr(DCSummRec.Attending);
519         Mult['1301']   := FloatToStr(DCSummRec.DischargeDateTime);  
520         if DCSummRec.Cosigner > 0 then
521           begin
522             Mult['1208'] := IntToStr(DCSummRec.Cosigner);
523             Mult['1506'] := '1';
524           end
525         else
526           begin
527             Mult['1208'] := '';
528             Mult['1506'] := '0';
529           end  ;
530   (*      for i := 0 to DCSummRec.Lines.Count - 1 do
531           Mult['"TEXT",' + IntToStr(i+1) + ',0'] := FilteredString(DCSummRec.Lines[i]);*)
532       end;
533       CallBroker;
534       UpdatedDoc.IEN := StrToIntDef(Piece(Results[0], U, 1), 0);
535       UpdatedDoc.ErrorText := Piece(Results[0], U, 2);
536     end;
537   
538     if UpdatedDoc.IEN <= 0 then              //v22.12 - RV
539     //if UpdatedDoc.ErrorText <> '' then    //v22.5 - RV
540       begin
541         UpdatedDoc.ErrorText := UpdatedDoc.ErrorText + #13#10 + #13#10 + 'Document #:  ' + IntToStr(NoteIEN);
542         exit;  
543       end;
544   
545       // next, if no error, file document body
546     SetText(ErrMsg, DCSummRec.Lines, NoteIEN, 0);
547     if ErrMsg <> '' then
548     begin
549       UpdatedDoc.IEN := 0;
550       UpdatedDoc.ErrorText := ErrMsg;
551     end;
552   end;