oops, the second query should read; ?startkey=["discharged", <start of time period>]&endkey=["discharged", <end of time period>]&reduce=true
On 1 April 2013 10:57, Manokaran K <[email protected]> wrote: > This is the query am using: > > 'admission_date<date>:[' + fromDate + '%20TO%20' + tillDate + ']' + > '%20OR%20' + > 'discharge_date<date>:[' + fromDate + '%20TO%20' + tillDate + ']' + > '%20OR%20' + > '\(' + > 'admission_date<date>:[' + beforeFromDate + '%20TO%20' + fromDate + ']' + > '%20AND%20' + > 'discharge_date<date>:[' + tillDate + '%20TO%20' + afterTillDate + ']' + > '\)' + > '%20OR%20' + > '\(' + > 'admission_date<date>:[' + beforeFromDate + '%20TO%20' + fromDate + ']' + > '%20AND%20' + > 'status:under_treatment' + > '\)' > > thanks, > mano > > > > On Mon, Apr 1, 2013 at 3:26 PM, Manokaran K <[email protected]> wrote: > >> Sorry about the prev resp. The new gmail interface tripped me :-) >> >> >> >> On Mon, Apr 1, 2013 at 3:26 PM, Manokaran K <[email protected]> wrote: >> >>> 'admission_date<date>:[' + fromDate + '%20TO%20' + tillDate + ']' + >>> '%20OR%20' + >>> 'discharge_date<date>:[' + fromDate + '%20TO%20' + tillDate + ']' + >>> '%20OR%20' + >>> '\(' + >>> admission_date<date>:[' + beforeFromDate + '%20TO%20' + fromDate + ']' + >>> '%20AND%20' + >>> 'discharge_date<date>:[' + tillDate + '%20TO%20' + afterTillDate + ']' + >>> '\)' + >>> '%20OR%20\(' + >>> 'admission_date<date>:[' + beforeFromDate + '%20TO%20' + fromDate + ']' + >>> '%20AND%20' + >>> 'status:under_treatment' + >>> '\)' + >>> >>> >>> >>> On Mon, Apr 1, 2013 at 3:18 PM, Robert Newson <[email protected]> wrote: >>> >>>> I'm not sure it's possible in a couchdb view, at least not a single >>>> call or view. The best I can think of a view keyed on admission_time >>>> and another on discharge_time. You'd have to do the set subtraction >>>> yourself, though. couchdb-lucene obviously does this for you. I assume >>>> you're doing boolean queries using admission_time and discharge_time >>>> fields? >>>> >>>> >>>> B. >>>> >>>> On 1 April 2013 10:38, Александр Опак <[email protected]> wrote: >>>> > Use Cron(http://en.wikipedia.org/wiki/Cron) for this =) >>>> > >>>> > >>>> > 2013/4/1 Manokaran K <[email protected]> >>>> > >>>> >> Hi, >>>> >> >>>> >> Am working on an hospital information system using couchdb and >>>> node.js. For >>>> >> this I need to get the list and number of patients in a given time >>>> period - >>>> >> usually a day. I can get the patients who were admitted or discharged >>>> in >>>> >> that time period. How to get the list of patients who were admitted >>>> earlier >>>> >> than the start of the period but who got discharged after the time >>>> period >>>> >> or who are not discharged yet? >>>> >> >>>> >> Am currently using couchdb-lucene to get this list but would like to >>>> know >>>> >> if there is a way where I can get it from a view - that way I can just >>>> >> reduce and get the number of patients in a given period. I was >>>> wondering if >>>> >> I should use a scheduler that will create a new 'under_treatment' doc >>>> for >>>> >> every day till the patient is discharged! Or is there a simpler way? >>>> >> >>>> >> Thanks in advance, >>>> >> mano >>>> >> >>>> >> -- >>>> >> Lord, give us the wisdom to utter words that are gentle and tender, >>>> for >>>> >> tomorrow we may have to eat them. >>>> >> -Sen. Morris Udall >>>> >> >>>> >>> >>> >>> >>> -- >>> K Manokaran >>> Chief Executive Officer >>> MindPlough Analytics Pvt Ltd >>> (SmartGrader is the flagship service of MindPlough) >>> Mobile: +91 98400 88688 >>> >> >> >> >> -- >> K Manokaran >> Chief Executive Officer >> MindPlough Analytics Pvt Ltd >> (SmartGrader is the flagship service of MindPlough) >> Mobile: +91 98400 88688 >> > > > > -- > K Manokaran > Chief Executive Officer > MindPlough Analytics Pvt Ltd > (SmartGrader is the flagship service of MindPlough) > Mobile: +91 98400 88688
