![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
Craig, Not entirely sure I follow what you want to do, but you certainly don't need several copies of the table. Instead you can open several tCursor against the same table but use different indexes and ranges. If you have a secondary index that includes HospitalID, PatiendID and DateOfVisit you could do something 1) Open a tcursor against the table. 2) Open another tCursor against the same table but with the secondary index. 3) Scan the first tCursor, for each record in that one do a setRange with the secondary tcursor, using exact match for HospitalID, PatientID and a range form DateOfVisit. 4) Check out the the records in the range and see how many returning visits and add them to a temporary result table for a report. Not sure my explanation is clear enough but I hope it will point you in the right direction. I think it's essential that you create the correct secondary indexes as setRange often is MUCH quicker than setGenFilter and queries and if you have many records it will make a huge difference in performance. Anders |
#12
| |||
| |||
|
|
In the following code snippet, the TCursor dosen't move to the next record which is record lio+1 The code steps through the line with the errorshow, but it doesn't show the error.. This is part of a Scan Loop with a different TCursor (P10) Thanks in advance. Craig snip dyn["HospitalNumber"] = stNewMR tcBounce1.setGenFilter(dyn) licount = TCBounce1.nrecords() If licount <2 then;// if less than 2 records nothing to compare..move on to next patient Loop ENDIF For lio from 1 to liCount-1 TCBounce1.movetoRecord(lio) dtDCDatetime = TCBounce1."DCdateTime" If not TCBounce1.movetoRecord(lio+1) then ;// <---this does not happen!!!! errorshow("Could not move to record "+STrval(lio +1));// <-- the errorshow show doesn't show return Else dtAdmitDateTime = TCBounce1."AdmitDateTime" ENDIF snip |
![]() |
| Thread Tools | |
| Display Modes | |
| |