Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0A9B8F5FE for ; Mon, 1 Apr 2013 09:58:23 +0000 (UTC) Received: (qmail 67512 invoked by uid 500); 1 Apr 2013 09:58:21 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 67473 invoked by uid 500); 1 Apr 2013 09:58:21 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 67464 invoked by uid 99); 1 Apr 2013 09:58:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Apr 2013 09:58:21 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of manokaran@gmail.com designates 74.125.82.179 as permitted sender) Received: from [74.125.82.179] (HELO mail-we0-f179.google.com) (74.125.82.179) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Apr 2013 09:58:15 +0000 Received: by mail-we0-f179.google.com with SMTP id p43so1650332wea.24 for ; Mon, 01 Apr 2013 02:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=sh1ZPRdbuBF4W8tfPuPLDQqr0nofzkejqGl1G/+MLNQ=; b=vEIQUuaOIOqbr+ITW4dFPT8D59tPu4n2LtOTV61EveX5DzmnNpgQ8ycUzp/+GHijnR IvBgqobtUtG3+/aS56uyvgPjZD7QLaBx5ljR62WA6zINhauMsL8kn+SnluxHSpzhA3ce lPx14ZaimqjD87MfMdUTboQar/ZJe7xGmIFhflhAOubEDS+Owj31iExkDLRqgbPBoKdJ ERyuQhbJf3Y6QqV1OV71uk7yblK18wYsL9hwKepGIJ+naNMKnlrf9+dMZwjGJzfDBltP 4fvuxRplEv9QaDXd5p12bv7S2MNcdftZNNIqbDjybtwhy3gRnGKW29DtWsUwK0qi03sw 7twg== MIME-Version: 1.0 X-Received: by 10.195.12.133 with SMTP id eq5mr14680612wjd.52.1364810275550; Mon, 01 Apr 2013 02:57:55 -0700 (PDT) Sender: manokaran@gmail.com Received: by 10.194.89.169 with HTTP; Mon, 1 Apr 2013 02:57:55 -0700 (PDT) In-Reply-To: References: Date: Mon, 1 Apr 2013 15:27:55 +0530 X-Google-Sender-Auth: pw69Iipcmn3j746vFsd5jSnpGeo Message-ID: Subject: Re: getting list of items spanning a time period From: Manokaran K To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=047d7bb04c90a8fd0e04d949a7a8 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bb04c90a8fd0e04d949a7a8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This is the query am using: 'admission_date:[' + fromDate + '%20TO%20' + tillDate + ']' + '%20OR%20' + 'discharge_date:[' + fromDate + '%20TO%20' + tillDate + ']' + '%20OR%20' + '\(' + 'admission_date:[' + beforeFromDate + '%20TO%20' + fromDate + ']' + '%20AND%20' + 'discharge_date:[' + tillDate + '%20TO%20' + afterTillDate + ']' + '\)' + '%20OR%20' + '\(' + 'admission_date:[' + beforeFromDate + '%20TO%20' + fromDate + ']' + '%20AND%20' + 'status:under_treatment' + '\)' thanks, mano On Mon, Apr 1, 2013 at 3:26 PM, Manokaran K wrote: > Sorry about the prev resp. The new gmail interface tripped me :-) > > > > On Mon, Apr 1, 2013 at 3:26 PM, Manokaran K wrote: > >> 'admission_date:[' + fromDate + '%20TO%20' + tillDate + ']' + >> '%20OR%20' + >> 'discharge_date:[' + fromDate + '%20TO%20' + tillDate + ']' + >> '%20OR%20' + >> '\(' + >> admission_date:[' + beforeFromDate + '%20TO%20' + fromDate + ']' + >> '%20AND%20' + >> 'discharge_date:[' + tillDate + '%20TO%20' + afterTillDate + ']' = + >> '\)' + >> '%20OR%20\(' + >> 'admission_date:[' + beforeFromDate + '%20TO%20' + fromDate + ']' = + >> '%20AND%20' + >> 'status:under_treatment' + >> '\)' + >> >> >> >> On Mon, Apr 1, 2013 at 3:18 PM, Robert Newson 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, =D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4= =D1=80 =D0=9E=D0=BF=D0=B0=D0=BA wrote: >>> > Use Cron(http://en.wikipedia.org/wiki/Cron) for this =3D) >>> > >>> > >>> > 2013/4/1 Manokaran K >>> > >>> >> 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 discharge= d >>> 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 ju= st >>> >> 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' do= c >>> 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 > --=20 K Manokaran Chief Executive Officer MindPlough Analytics Pvt Ltd (SmartGrader is the flagship service of MindPlough) Mobile: +91 98400 88688 --047d7bb04c90a8fd0e04d949a7a8--