Show Bid Request
VB6 code to sort a list of items from a text box
Bid Request Id: 55344
|
|
|
Description:
I have a list of codes in my database for this client that tells me the clients diagnoses. The list has all diagnoses this person has had and might be something like this:
250.9 777.5 780.2 778.4 401.9 454.3
Next, I have a textbox that some or all these codes may appear. Here is an example of the data in text1:
# SYNCOPE AND COLLAPSE (780.2): doing well. on aspirin. sugar getting controlled. Taking sugars and "has finally learned". Feeling watching diet correlates well with sugar values she has been getting. # HYPERTENSION NOS (401.9): bp stable to day. Cont off ccb due to junctional breadycardia and syncope. # Diabetes mellitus, II, with complications (250.9): seems to be controlled. She prefers not to change regimen at this time, and I concur. Had flu shot this year.
As you can see, only some of the codes in the text are in the list, and they do not necessarily appear in the same order.
What I need, is some simple code to allow me to figure out the order of codes as they appear in the textbox called txtASS. In other words, I want to be able to put:
780.2 into a new textbox called txtICD(0) 401.9 into txtICD(1) 250.9 INTO txtICD(2)
see the deliverables section for more details...
Deliverables:
and if there were more codes in the text, I would want to continue adding them (there is a max of 8 text boxes). In the end, I need my txtICD array to contain the codes IN THE ORDER IN WHICH THEY APPEAR IN THE TEXT BOX. I can get them listed, just not in the right order.
In otherwords, my current code searches for the code in parenthesis and sees if it matches the list. If it does, it needs to save the code. The trouble I'm having is sorting the data into the correct txtICD Array order.
This is what I've got so far...
'collect the diagnoses from the database for the client in question Dim cnnProb As ADODB.Connection Dim sqlDx As String Dim rsProb As ADODB.Recordset Dim IsPresent As Integer sqlDx = "SELECT ListPROBLEM.ProblemName, listPROBLEM.ProblemICD From ListPROBLEM Where patientID= " & lblPatID & "" Set cnnProb = New ADODB.Connection cnnProb.ConnectionString = g_ADOstrCnn cnnProb.Open Set rsProb = GetRecordSet(cnnProb, sqlDx) With rsProb While Not rsProb.EOF 'loop through all of the records returned in data1 'look for the number and include it if present If Not IsNull(!ProblemICD) Then ' txtselecteditem = !ProblemICD IsPresent = InStr(txtAss, !ProblemICD) If IsPresent > 0 Then 'add to problem text box and to hidden txticd array
txtICDsDiscussed = txtICDsDiscussed & !ProblemName & " (" & !ProblemICD & ")" & vbCrLf txtICD(i) = !ProblemICD i = i + 1 'to avoid writing over this box next time around End If End If .MoveNext Wend End With Set cnnProb = Nothing Set rsProb = Nothing
I'm looking for a quick solution, well commented, and inexpensive. I only will consider a demo that shows this in action, since I've been burned a number of times wasting time on folks who tell me how good they are, then can't do the job right.
Thanks!
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Complete ownership and distribution copyrights to all work purchased.
Platform:
windows
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation please help out the site and report it. Thanks for your help.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
This bid was accepted by the buyer!
|
$4 (USD)
|
Mar 29, 2003 11:12:29 PM EDT
|
10
(Excellent)
|
|
|
Attached is a DEMO of the Sorting routine using the same example data you gave in the Bid. Its simple and can be adapted for any number of textboxes (not just 8)
You can enter your own data into the textbox in this demo and it will sort them as long as they are in the database, to prove its not just hard coded!
Its all finished, so if you care to accept the bid I can send you the fully documented source.
|
|
Attached File
|
|
|
|
N/A
|
Mar 29, 2003 11:13:09 PM EDT
|
10
(Excellent)
|
|
|
Opps as a side note please put the Database into the 'C:\' Directory.
|
|
|
|
|
|