Changeset 830 for cprs/trunk/CPRS-Chart/rMeds.pas
- Timestamp:
- Jul 7, 2010, 4:51:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/rMeds.pas
r456 r830 23 23 LastFill: TFMDateTime; 24 24 Location: String; 25 Drug: String; 25 26 //Action: Integer; 26 27 end; … … 30 31 function MedAdminHistory(OrderID: string): TStrings; 31 32 function MedStatusGroup(const s: string): Integer; 32 procedure LoadActiveMedLists(InPtMeds, OutPtMeds, NonVAMeds: TList );33 procedure LoadActiveMedLists(InPtMeds, OutPtMeds, NonVAMeds: TList; var view: integer); 33 34 function GetNewDialog: string; 34 35 function PickUpDefault: string; … … 129 130 end; 130 131 131 procedure LoadActiveMedLists(InPtMeds, OutPtMeds, NonVAMeds: TList); 132 function ByStatusThenLocation(Item1, Item2: Pointer): Integer; 133 { < 0 if Item1 is less and Item2, 0 if they are equal and > 0 if Item1 is greater than Item2 } 134 var 135 //Status1, Status2: Integer; 136 loc1, loc2: string; 137 Med1, Med2: TMedListRec; 138 begin 139 Med1 := TMedListRec(Item1); 140 Med2 := TMedListRec(Item2); 141 loc1 := Med1.Location; 142 loc2 := Med2.Location; 143 //Status1 := MedStatusGroup(Med1.Status); 144 //Status2 := MedStatusGroup(Med2.Status); 145 if (compareText(Med1.Status,Med2.Status) >0) then Result := 1 146 else if (compareText(Med1.Status,Med2.Status) <0) then Result := -1 147 else if ( compareText(loc1,loc2)>0 ) then Result := -1 148 else if ( compareText(loc1,loc2)<0 ) then Result := 1 149 else if (compareText(Med1.Drug,Med2.Drug) >0) then Result := 1 150 else if (compareText(Med1.Drug,Med2.Drug) <0) then Result := -1 151 //else if Med1.StopDate > Med2.StopDate then Result := -1 152 //else if Med1.StopDate < Med2.StopDate then Result := 1 153 //else if Med1.SrvSeq < Med2.SrvSeq then Result := -1 154 //else if Med1.SrvSeq > Med2.SrvSeq then Result := 1 155 else Result := 0; 156 end; 157 158 procedure LoadActiveMedLists(InPtMeds, OutPtMeds, NonVAMeds: TList; var view: integer); 132 159 var 133 160 idx, ASeq: Integer; 134 161 x, y: string; 135 ClinMeds, tmpInPtMeds: TList;162 ClinMeds, tmpInPtMeds: TList; 136 163 AMed: TMedListRec; 137 164 begin … … 144 171 ClearMedList(OutPtMeds); 145 172 ClearMedList(NonVAMeds); 146 CallV('ORWPS ACTIVE', [Patient.DFN ]);173 CallV('ORWPS ACTIVE', [Patient.DFN, User.DUZ, view, True]); 147 174 ASeq := 0; 175 if (view = 0) and (RPCBrokerV.Results.Count > 0) then 176 view := StrToIntDef(RPCBrokerV.Results.Strings[0],0); 148 177 with RPCBrokerV do while Results.Count > 0 do 149 178 begin … … 162 191 Inc(ASeq); 163 192 AMed.SrvSeq := ASeq; 164 if AMed.Inpatientthen193 if (AMed.Inpatient) then 165 194 begin 166 if Copy(x,2,2)='CP' then ClinMeds.Add(AMed) 167 else tmpInPtMeds.Add(AMed); 195 tmpInPtMeds.Add(AMed); 196 //if (Copy(x,2,2)='CP') then tmpInPtMeds.Add(AMed); 197 // if (Copy(x,2,2)='CP') and ((view = 2) or (view = 0)) then ClinMeds.Add(AMed) 198 // else tmpInPtMeds.Add(AMed); 168 199 end 169 200 else … … 173 204 OutPtMeds.Add(AMed); 174 205 end; 175 ClinMeds.Sort(ByStatusThenStop); 176 tmpInPtMeds.Sort(ByStatusThenStop); //IMO 177 InPtMeds.Assign(ClinMeds); 206 // 12-4 if view <> 1 then ClinMeds.Sort(ByStatusThenStop); 207 // 12-4 if view = 1 then tmpInPtMeds.Sort(ByStatusThenLocation) 208 // 12-4 else tmpInPtMeds.Sort(ByStatusThenStop); 209 //tmpInPtMeds.Sort(ByStatusThenStop); //IMO 210 //12-4 if view <> 1 then InPtMeds.Assign(ClinMeds); 178 211 for idx := 0 to tmpInPtMeds.Count - 1 do 179 212 InPtMeds.Add(TMedListRec(tmpInPtMeds.Items[idx])); 180 OutPtMeds.Sort(ByStatusThenStop); 181 NonVAMeds.Sort(ByStatusThenStop); 213 //if view <> 1 then OutPtMeds.Sort(ByStatusThenStop) 214 //else OutPtMeds.Sort(ByStatusThenLocation); 215 //12-4 if view <> 1 then NonVAMeds.Sort(ByStatusThenStop) 216 //12-4 else NonVAMeds.Sort(ByStatusThenLocation); 182 217 if Assigned(ClinMeds) then FreeAndNil(ClinMeds); 183 218 if Assigned(tmpInPtMeds) then FreeAndNil(tmpInPtMeds);
Note:
See TracChangeset
for help on using the changeset viewer.