From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id GNjxLKFmX2OwKAEAbAwnHQ (envelope-from ) for ; Mon, 31 Oct 2022 07:09:37 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id MIYELKFmX2P/xwAAG6o9tA (envelope-from ) for ; Mon, 31 Oct 2022 07:09:37 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 81CC010EB1 for ; Mon, 31 Oct 2022 07:09:37 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opNys-0002Gv-KJ; Mon, 31 Oct 2022 02:09:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opNyp-0002GU-Ne for emacs-orgmode@gnu.org; Mon, 31 Oct 2022 02:09:03 -0400 Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opNyo-00043l-0i for emacs-orgmode@gnu.org; Mon, 31 Oct 2022 02:09:03 -0400 Received: from localhost ([::ffff:197.239.4.235]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000081D8D.00000000635F6679.00004F43; Sun, 30 Oct 2022 23:08:56 -0700 Date: Mon, 31 Oct 2022 09:08:45 +0300 From: Jean Louis To: Ihor Radchenko Cc: Renato Pontefice , emacs-orgmode@gnu.org Subject: Re: One thing each 3 days but maximum 10 Message-ID: Mail-Followup-To: Ihor Radchenko , Renato Pontefice , emacs-orgmode@gnu.org References: <878rkwlgj3.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline In-Reply-To: <878rkwlgj3.fsf@localhost> User-Agent: Mutt/2.2.7+37 (a90f69b) (2022-09-02) Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SBL=0.141, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667196577; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=d29eCFHPvQtfL3adR19KT3eGbjn31ARDZOZrL5AhIyU=; b=UllDCZbx/lY+wqTpNcSh3yv2OV2qbK3Ye0onXNPtz8a4Hi8aSQVGDiFRiGM1r5CSHzT4Im aeeyWoVZ+QxDAk8v4UBIKVP5Ks2mdcn2PvsjPK0F++lXjb5t3u0lNvJUFBYM9zEfI7M6Ea EZyJl85fRnJcFhJ0LfC/GhPdBgJCSqIaJ5zT0xrnEhZTf4rnzMHW7lcjSyBTjg5piwL2pu P1qWR+pqIbP9oT0itQNr+Vuo5xvBDTNDtnoHy75TUIqTaAV3sSTt98wij+1lSGN4rgDYTU Tx8Xn0X6J3kWlXlKugaGu+zW+M0+qhnUyZC8k3WYetijKb5gywsZrryhblwIYg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667196577; a=rsa-sha256; cv=none; b=XdsRzymfZZFuwLJPlCX4MKOyfDbu0rnB7gNmSyrCAFsbbqXNlEVB0yKuo2Rkr+IcjB2yJO MHMtfscAQ6aAiFer/UhnmbZuPhHSA4z30wuMqWdwRPSQjjnzrsoBIIZTZbxwAvdu7k1OnZ ySO9GZZjRC69npDd58KjiveaSbHSYyJJj7IkVGIDKNmIAabWj2FTU8zISQl8QVkR35RYYW XmbPm4Yh9nhB8Ipu/gmK+2P4SBNeSJ14kQJz4mSV6zWhiy//QE/9ujMerlKGFkVKXcUyS2 Bk9nWZqdtoCwUxbV/64hQZVP+FcfEjgy2lyFyjP8m9YJV8GyE6YFpBQxvIGWTw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.56 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 81CC010EB1 X-Spam-Score: -3.56 X-Migadu-Scanner: scn0.migadu.com X-TUID: WI9ZU4YyiMWD * Ihor Radchenko [2022-10-31 08:15]: > Jean Louis writes: > > > * Renato Pontefice [2022-10-30 19:11]: > >> I have to take a pill each 3 days, but for max 10 times. > >> So I set a TODO pill >2022-10-28 +3d> and each 3 days my calendar tell me that I have to take the pill. But is possible to say 1/10; 2/10; 3/10 etc? > >> I nean to show how many pill I have already take? > > > > Use PostgreSQL to give you schedule: > > > > #+BEGIN_SRC sql :engine postgresql :results value raw > > SELECT '** TODO Take pill again > > SCHEDULED: <' || generate_series('2022-10-28', '2022-11-26', '3 day'::interval)::date || E'>\n' > > AS "* My treatement"; > > #+END_SRC > > > > #+RESULTS: > > * My treatement > > ** TODO Take pill again > > SCHEDULED: <2022-10-28> > > > > ** TODO Take pill again > > SCHEDULED: <2022-10-31> > > This is not a good idea for pills. I am afraid you forgot the fact that prescriptions have variable time periods. It is rather unusual to take pills every 3 days, and rather common for many diseases to take pills every 8 or 12 hours. > Without SQL, one could also use org-clone-subtree-with-time-shift, but > AFAIK, the whole idea behind schedule of taking pills is to retain > certain concentration of medicine in the blood flow. Hence .+3d repeater > (3d from the last time taking the pill) is more suitable. If we ask Org documentation what is "repeater", then I get this information: Timestamp with repeater interval A timestamp may contain a _repeater interval_, indicating that it applies not only on the given date, but again and again after a certain interval of N days (d), weeks (w), months (m), or years (y). The following shows up in the agenda every Wednesday: * Pick up Sam at school <2007-05-16 Wed 12:30 +1w> And that excludes hours, unspoken of other intervals. That renders the function `org-clone-subtree-with-time-shift' not suitable for prescription notification. In fact it is great health risk to recommend to people to use Org to track one's medical treatment due to too many "bugs" involved. And here is hours "repeater" by using external tool PostgreSQL: #+BEGIN_SRC sql :engine postgresql :results value raw SELECT '** TODO Take pill again SCHEDULED: <' || generate_series('2022-10-28', '2022-11-04', '8 hours'::interval)::timestamptz || E'>\n' AS "* My treatement"; #+END_SRC #+RESULTS: * My treatement ** TODO Take pill again SCHEDULED: <2022-10-28 00:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-28 08:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-28 16:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-29 00:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-29 08:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-29 16:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-30 00:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-30 08:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-30 16:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-31 00:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-31 08:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-31 16:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-01 00:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-01 08:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-01 16:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-02 00:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-02 08:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-02 16:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-03 00:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-03 08:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-03 16:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-04 00:00:00+03> -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/