Ignore:
Timestamp:
Jul 6, 2008, 8:20:14 PM (16 years ago)
Author:
Kevin Toppenberg
Message:

Uploading from OR_30_258

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/foia-cprs/CPRS-Chart/uReminders.pas

    r459 r460  
    2020    FNoResolve: boolean;
    2121    FWHReviewIEN: string;  // AGP CHANGE 23.13 Allow for multiple processing of WH Review of Result Reminders
     22    FRemWipe: integer;
    2223  protected
    2324    function GetIEN: string; virtual;
     
    4849    property DlgData: string read FDlgData; //AGP Change 24.8
    4950    property WHReviewIEN: string read FWHReviewIEN write FWHReviewIEN;  //AGP CHANGE 23.13
     51    property RemWipe: integer read FRemWipe write FRemWipe;
    5052  end;
    5153
     
    99101    FMSTPrompt: TRemPrompt;
    100102    FWHPrintDevice, FWHResultChk, FWHResultNot: String;
    101     //FRemWHNotPurpose: TStrings;
     103    FVitalDateTime: TFMDateTime;  //AGP Changes 26.1
    102104  protected
    103105    procedure Check4ChildrenSharedPrompts;
     
    156158    property WHResultChk: String read FWHResultChk write FWHResultChk;
    157159    property WHResultNot: String read FWHResultNot write FWHResultNot;
    158     //property RemWHNotPurpose: TStrings read FRemWHNotPurpose write FRemWHNotPurpose;
     160    property VitalDateTime: TFMDateTime read FVitalDateTime write FVitalDateTime;
    159161  end;
    160162
     
    170172    FPCERoot: TRemPCERoot;
    171173    FParent: TRemDlgElement;
    172     FRec3: string; 
     174    FRec3: string;
    173175    FActiveDates: TStringList; //Active dates for finding items. (rectype 3)
    174176//    FRoot: string;
     
    219221    FMonthReq: boolean;
    220222    FPrintNow: String;
     223    FMHTestComplete: integer;
    221224  protected
    222225    function RemDataActive(RData: TRemData; EncDt: TFMDateTime):Boolean;
     
    292295  NotPurposeValue: string;
    293296  WHRemPrint: string;
     297  InitialRemindersLoaded: boolean = FALSE;
    294298
    295299const
     
    298302  RemPriorityText: array[1..3] of string = ('High','','Low');
    299303  ClinMaintText = 'Clinical Maintenance';
    300   InitialRemindersLoaded: boolean = FALSE;
    301304
    302305  dtUnknown = TRemDataType(-1);
     
    432435
    433436uses rCore, uCore, rReminders, fRptBox, uConst, fReminderDialog, fNotes, rMisc,
    434      fMHTest, rPCE, rTemplates, dShared, uTemplateFields, fIconLegend, fReminderTree;
     437     fMHTest, rPCE, rTemplates, dShared, uTemplateFields, fIconLegend, fReminderTree, uInit;
    435438
    436439type
     
    896899        begin
    897900          Sts := Piece(Data, U, 6);
    898           if(Sts = '0') or (Sts = '1') then
     901          //if(Sts = '0') or (Sts = '1') then
     902          if(Sts = '0') or (Sts = '1') or (Sts = '3') or (Sts = '4') then     //AGP Error change 26.8
    899903          begin
    900904            Result := TRUE;
     
    10861090    begin
    10871091      Tmp := Piece(Data, U, 6);
    1088       if(Tmp = '1') then iidx := 2
     1092      //if(Tmp = '1') then iidx := 2
     1093      if (Tmp = '3') or (Tmp = '4') or (Tmp = '1') then iidx :=2     //AGP ERROR CHANGE 26.8
    10891094      else if(Tmp = '0') then iidx := 3
    10901095      else
     
    13341339         if(NewStatus = '1') then Msg := 'Due'
    13351340    else if(NewStatus = '0') then Msg := 'Applicable'
     1341    else if(NewStatus = '3') then Msg := 'Error'    //AGP Error code change 26.8
     1342    else if (NewStatus = '4') then Msg := 'CNBD'    //AGP Error code change 26.8
    13361343    else                          Msg := 'Not Applicable';
    13371344    Msg := RName + ' is ' + Msg + '.';
     
    18291836      Data := RemCode + EvaluatedReminders[i];
    18301837      Tmp := Piece(Data,U,6);
    1831            if(Tmp = '1') then Add2Tree(rfDue, DueCatID)
     1838      //     if(Tmp = '1') then Add2Tree(rfDue, DueCatID)
     1839      if(Tmp = '1') or (Tmp = '3') or (Tmp = '4') then Add2Tree(rfDue, DueCatID) //AGP Error code change 26.8
    18321840      else if(Tmp = '0') then Add2Tree(rfApplicable, ApplCatID)
    18331841      else                    Add2Tree(rfNotApplicable, NotApplCatID);
     
    23902398begin
    23912399  TempSL := GetDlgSL;
     2400  if Piece(TempSL[0],U,2)='1' then
     2401    begin
     2402      Self.RemWipe := 1;
     2403    end;
    23922404  idx := -1;
    23932405  repeat
     
    29192931
    29202932begin
    2921   Tmp := Piece(FRec1, U, 4);
    2922   if(Tmp = 'D') then Result := etDisplayOnly
    2923   else if(Tmp = 'T') then Result := etTaxonomy
    2924   else Result := etCheckBox;
     2933      Tmp := Piece(FRec1, U, 4);
     2934      if(Tmp = 'D') then Result := etDisplayOnly
     2935      else if(Tmp = 'T') then Result := etTaxonomy
     2936      else Result := etCheckBox;
    29252937end;
    29262938
     
    30133025        dt := Code2DataType(piece(TempSL[idx], U, r3Type));
    30143026        if(dt <> dtUnknown) and ((dt <> dtOrder) or
    3015           (CharAt(piece(TempSL[idx], U, 11),1) in ['D', 'Q', 'M', 'O'])) and
     3027          (CharAt(piece(TempSL[idx], U, 11),1) in ['D', 'Q', 'M', 'O', 'A'])) and   //AGP change 26.10 for allergy orders
    30163028          ((dt <> dtMentalHealthTest) or MHTestsOK) then
    30173029        begin
     
    35423554          DoLbl := Prompt.Required;
    35433555          case pt of
    3544             ptComment, ptQuantity, ptSkinReading:
     3556            ptComment, ptQuantity:
    35453557              begin
    35463558                Ctrl.edt := TEdit.Create(AOwner);
     
    35783590            ptVisitLocation, ptLevelUnderstanding,
    35793591            ptSeries, ptReaction, ptExamResults,
    3580             ptLevelSeverity, ptSkinResults:
     3592            ptLevelSeverity, ptSkinResults, ptSkinReading:
    35813593              begin
    35823594                Ctrl.cbo := TORComboBox.Create(AOwner);
     
    35853597                Ctrl.cbo.Style := orcsDropDown;
    35863598                Ctrl.cbo.Pieces := '2';
    3587                 Ctrl.cbo.Tag := ComboPromptTags[pt];
    3588                 PCELoadORCombo(Ctrl.cbo, MinX, MaxX);
     3599                if pt = ptSkinReading then
     3600                  begin
     3601                     Ctrl.cbo.Pieces := '1';
     3602                     Ctrl.cbo.Items.Add('');
     3603                     for j := 0 to 50 do Ctrl.cbo.Items.Add(inttostr(j));
     3604                     GetComboBoxMinMax(Ctrl.cbo,MinX, MaxX);
     3605                  end;
     3606                if pt <> ptSkinReading then
     3607                  begin
     3608                     Ctrl.cbo.Tag := ComboPromptTags[pt];
     3609                     PCELoadORCombo(Ctrl.cbo, MinX, MaxX);
     3610                  end;
    35893611                if pt = ptVisitLocation then
    35903612                begin
     
    41844206    end;
    41854207  end;
    4186 
     4208 
    41874209begin
    41884210  Result := nil;
     
    43984420end;
    43994421
    4400 { TODO -oLori -cNext : TRemDlgElement.AddText }
    44014422procedure TRemDlgElement.AddText(Lst: TStrings);
    44024423var
     
    46554676                (not Prompt.Forced) then
    46564677        begin
    4657           if (Pt = ptMHTest) and ((Prompt.FValue = '') or (pos('X',Prompt.FValue)>0)) then
     4678          if (Pt = ptMHTest) and (Prompt.FMHTestComplete = 2) then
    46584679            begin
    4659                if Prompt.FValue = '' then
    4660                   WordWrap('MH test '+ Piece(Prompt.FData.FRec3,U,8) + ' not done',List,65,6);
    4661                if pos('X',Prompt.FValue)>0 then
    4662                   WordWrap('You are missing one or more responses in the MH test '+
    4663                            Piece(Prompt.FData.FRec3,U,8),List,65,6);
    4664                WordWrap(' ',List,65,6);
     4680               if ((Prompt.FValue = '') or (pos('X',Prompt.FValue)>0)) then
     4681                  begin
     4682                    if Prompt.FValue = '' then
     4683                        WordWrap('MH test '+ Piece(Prompt.FData.FRec3,U,8) + ' not done',List,65,6);
     4684                    if pos('X',Prompt.FValue)>0 then
     4685                        WordWrap('You are missing one or more responses in the MH test '+
     4686                               Piece(Prompt.FData.FRec3,U,8),List,65,6);
     4687                   WordWrap(' ',List,65,6);
     4688                  end;
    46654689            end;
     4690          if (Pt = ptMHTest) and (Prompt.FMHTestComplete = 0) or (Prompt.FValue = '') then
     4691                  begin
     4692                    if Prompt.FValue = '' then
     4693                        WordWrap('MH test '+ Piece(Prompt.FData.FRec3,U,8) + ' not done',List,65,6);
     4694                    if pos('X',Prompt.FValue)>0 then
     4695                        WordWrap('You are missing one or more responses in the MH test '+
     4696                               Piece(Prompt.FData.FRec3,U,8),List,65,6);
     4697                   WordWrap(' ',List,65,6);
     4698                  end;
    46664699          if (Pt = ptGAF) and ((Prompt.FValue = '0') or (Prompt.FValue = '')) then
    46674700            begin
     
    49524985          unt := Prompt.VitalUnitValue;
    49534986          ConvertVital(v, rte, unt);
    4954           txt := U + VitalCodes[v] + U + rte + U + FloatToStr(RemForm.PCEObj.VisitDateTime);
     4987          //txt := U + VitalCodes[v] + U + rte + U + FloatToStr(RemForm.PCEObj.VisitDateTime);  AGP Change 26.1 commented out
     4988          txt := U + VitalCodes[v] + U + rte + U + '0'; //AGP Change 26.1 Use for Vital date/time
    49554989          if(not Finishing) then
    49564990            txt := Char(ord('A')+ord(v)) + FormatVitalForNote(txt);  // Add vital sort char
     
    53095343      NeedRedraw := FALSE;
    53105344      case pt of
    5311         ptComment, ptQuantity, ptSkinReading:
     5345        ptComment, ptQuantity:
    53125346          TmpValue := (Sender as TEdit).Text;
    53135347
     
    54805514                       end;
    54815515        end;
    5482        
     5516
    54835517        ptExamResults, ptSkinResults, ptLevelSeverity,
    5484         ptSeries, ptReaction, ptLevelUnderstanding:
     5518        ptSeries, ptReaction, ptLevelUnderstanding, ptSkinReading: //(AGP Change 26.1)
    54855519          TmpValue := (Sender as TORComboBox).ItemID;
    54865520        else
     
    54925526                             idx := -1;
    54935527                             TmpValue := (Sender as TORComboBox).ItemID;
     5528                             if FParent.VitalDateTime = 0 then
     5529                                  FParent.VitalDateTime := FMNow;
    54945530                           end;
    54955531              else
     
    54975533            end;
    54985534            if(idx > 0) then
    5499               SetPiece(TmpValue, ';', idx, TORExposedControl(Sender).Text);
     5535              begin
     5536                 //AGP Change 26.1 change Vital time/date to Now instead of encounter date/time
     5537                 SetPiece(TmpValue, ';', idx, TORExposedControl(Sender).Text);
     5538                 if (FParent.VitalDateTime > 0) and (TORExposedControl(Sender).Text = '') then
     5539                       FParent.VitalDateTime := 0;
     5540                 if (FParent.VitalDateTime = 0) and (TORExposedControl(Sender).Text <> '') then
     5541                       FParent.VitalDateTime := FMNow;
     5542              end;
    55005543          end
    55015544          else
     
    56345677                    Result := tmp;
    56355678
    5636       ptSkinReading: if(StrToIntDef(tmp,0) <> 0) then
    5637                        Result := tmp;
     5679     (* ptSkinReading: if(StrToIntDef(tmp,0) <> 0) then
     5680                       Result := tmp;  *)
     5681
     5682     ptSkinReading:   // (AGP Change 26.1)
     5683       begin
     5684         Result := tmp;
     5685       end;
    56385686
    56395687      ptVisitDate:
     
    61516199        (FCurrentControl as TUpDown).Position := StrToIntDef(GetValue,1);
    61526200
    6153       ptSkinReading:
    6154         (FCurrentControl as TUpDown).Position := StrToIntDef(GetValue,0);
     6201     (* ptSkinReading:
     6202        (FCurrentControl as TUpDown).Position := StrToIntDef(GetValue,0); *)
    61556203
    61566204      ptVisitDate:
     
    61916239
    61926240      ptExamResults, ptSkinResults, ptLevelSeverity,
    6193       ptSeries, ptReaction, ptLevelUnderstanding:
     6241      ptSeries, ptReaction, ptLevelUnderstanding, ptSkinReading: //(AGP Change 26.1)
    61946242        (FCurrentControl as TORComboBox).SelectByID(GetValue);
    61956243
     
    64266474var
    64276475  TmpSL: TStringList;
    6428   i: integer;
     6476  i, TestComp: integer;
    64296477  Before, After: string;
    64306478
    64316479begin
     6480  TestComp := 0;
    64326481  if(MHTestAuthorized(FData.Narrative)) then
    64336482  begin
     
    64406489      Before := GetValue;
    64416490      After := PerformMHTest(Before, FData.Narrative, TmpSL);
    6442       if(Before <> After) then
     6491      if uinit.TimedOut then After := '';
     6492      if pos(U,After)>0 then
     6493        begin
     6494          TestComp := StrtoInt(Piece(After,U,2));
     6495          self.FMHTestComplete := TestComp;
     6496          After := Piece(After,U,1);
     6497        end;
     6498      if(Before <> After) and (not uInit.TimedOut) then
    64436499      begin
    64446500        if(After = '') or (FParent.ResultDlgID = 0) then
    64456501          FMiscText := ''
    64466502        else
     6503        if TestComp > 0 then
    64476504        begin
    64486505          MentalHealthTestResults(FMiscText, FParent.ResultDlgID, FData.Narrative,
     
    64646521      end;
    64656522    finally
    6466       FParent.FReminder.EndTextChanged(Sender);
    6467     end;
    6468     if(FParent.ElemType = etDisplayOnly) and (not assigned(FParent.FParent)) then
    6469       RemindersInProcess.Notifier.Notify;
    6470   end
    6471   else
    6472     InfoBox('Not Authorized to score the ' + FData.Narrative + ' test.',
    6473             'Insufficient Authorization', MB_OK + MB_ICONERROR);
     6523      if not uInit.TimedOut then
     6524         FParent.FReminder.EndTextChanged(Sender);
     6525    end;
     6526    if not uInit.TimedOut then
     6527         if(FParent.ElemType = etDisplayOnly) and (not assigned(FParent.FParent)) then
     6528            RemindersInProcess.Notifier.Notify;
     6529          end
     6530    else
     6531                InfoBox('Not Authorized to score the ' + FData.Narrative + ' test.',
     6532                   'Insufficient Authorization', MB_OK + MB_ICONERROR);
    64746533end;
    64756534
Note: See TracChangeset for help on using the changeset viewer.