Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

search and count

Status
Not open for further replies.

kokiri

Technical User
Feb 18, 2003
51
US
Please help!

These are samples of medications for one patient and I want to be able to count how many times 'qd' are used.

meds
-----
Thiamine 100mg qd Gabapentin 1200mg qAM Gabapentin 1800mg qPM Zantac 300mg qd Lopressor 50mg bid Finasteride 5mg qd
Niacin 1000mg qd Ferrous Gluconate 325mg qd Vicodin 5/500 1 Tab q 4hrs prn Cyclobenzaprine 10mg TID Diclofenac 75mg prn
Citalopram 40mg qd Terazosin 5mg qd Aspirin 81mg qd Folic acid 1mg qd Digoxin 0.125mg qd Lisinopril 2.5mg qd

Thanks.

Kokiri
 
This can be done with PL/SQL function stored on either DB or report side. The function would loop through the symbols of the string to see if the current and the next symbol make up 'qd'. Whenever this happens, the function would increment a counter which is returned by the function upon the completion of the loop.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top