-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
351 additions
and
131 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Message Formatting | ||
|
||
Application offers non-interactive functionality which would modify the way of formatting information piped to `stdout`, | ||
meaning you can use application's data that you would normally see in a table by other software programs. | ||
|
||
Non-interactive mode would activate automatically when the environment in which the application is running is not | ||
interactive (with use of a cargo library `atty` which contains complete specification on which conditions shell are | ||
considered interactive or not). | ||
|
||
Non-interactive mode is de-facto modifying underlying logic for stdout formatting, application expose `--format` | ||
argument which forces usage of specified formatter for every of the following commands that is run by the application. | ||
|
||
```bash | ||
neuronek -f json ingestion list | ||
``` | ||
|
||
```json | ||
[ | ||
{ | ||
"id": 1, | ||
"substance_name": "caffeine", | ||
"route": "Oral", | ||
"dosage": "10.0 mg", | ||
"ingested_at": "2025-01-06 04:40:27.253301" | ||
} | ||
] | ||
``` | ||
|
||
## Examples | ||
|
||
### Pipe command output to another program | ||
|
||
Non-interactive mode would automatically activate when you are piping output, which allows you to use any program that | ||
can ingest JSON and make use of it. Example shows how the application is used to list ingestion's and then use Nushell's | ||
JSON parser to build a pretty table, which is the default way nushell shows information. | ||
|
||
```nu | ||
> neuronek ingestion list | from json | ||
╭───┬────┬────────────────┬───────┬─────────┬────────────────────────────╮ | ||
│ # │ id │ substance_name │ route │ dosage │ ingested_at │ | ||
├───┼────┼────────────────┼───────┼─────────┼────────────────────────────┤ | ||
│ 0 │ 1 │ caffeine │ Oral │ 10.0 mg │ 2025-01-06 04:40:27.253301 │ | ||
╰───┴────┴────────────────┴───────┴─────────┴────────────────────────────╯ | ||
``` | ||
|
||
## References | ||
|
||
- [clig.dev](https://clig.dev/#output) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
# Composite | ||
# Composite | ||
|
||
Composite is a collection of various dosages of substances typically ingested through same route of administration, | ||
think about it as pills that you might have which contain few supplement. This entity would represent a container with | ||
multiple things inside, could be actually useful to avoid necessary scripting for making a set of ingestions. | ||
|
||
- `Composite` | ||
- id | ||
- name | ||
- description | ||
- route_of_administration | ||
- form | ||
- items (`CompositeItems`) | ||
- id | ||
- substance_name | ||
- substance_dosage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Dosage | ||
|
||
**Dosage** is treated as a core concept for capturing the mass (or amount) of a substance ingested. This dosage is | ||
stored in the database for each ingestion record, along with other relevant data such as substance name, route of | ||
administration, and ingestion timestamps. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Ingestion Analyzer | ||
|
||
Ingestion Analyzer is a internal engine to use set of predefined rules and user's ingestion data to disadvise or provide | ||
additional insight for ingestion that one is trying to ingest or actually ingested. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Ingestion | ||
|
||
The **Ingestion** entity represents a single record of consuming a specific [substance](./substance.md). It captures | ||
details such as the substance name, dosage, route of administration, and the date/time at which the ingestion occurred. | ||
The entity also supports optional classification of the dosage and calculation of various time-based phases (e.g., | ||
onset, peak) related to the ingestion experience. | ||
|
||
## Data Model | ||
|
||
- Is uniuqely identified. | ||
- Must contain minimal amount of data to identify substance. | ||
- Must contain minimal amount of data about dosage. | ||
- Might support dosage ranges and unknown dosages. | ||
- Must contain time when was ingested | ||
- Could support ranges and unknowns probably. | ||
- Can contain dosage classification | ||
- Can contain reference to substance in database | ||
- Can contain multiple `IngestionPhase` entities which define calendar entries of specific phases of ingestion, it's | ||
created when ingestion analysis was possible and application had enough infomration. | ||
|
||
## Flow | ||
|
||
1. **Create/Update** | ||
When a new ingestion is recorded, the application stores the substance details, dosage, and route. If dosage | ||
information matches known reference ranges, a dosage_classification can be assigned. Any known phases for this | ||
ingestion are also stored. | ||
2. **Retrieval** | ||
When retrieving an ingestion, relevant ingestion-phase records are also fetched, providing a comprehensive view of | ||
both the ingestion event and its associated timeline of effects. | ||
3. **Analysis** | ||
Systems or modules that analyze ingestion data (e.g., generating reports, running calculations) can use the dosage, | ||
route, and phase data to present meaningful insights to end users. | ||
4. **Intended Usage** | ||
This data structure is intended to help track ingestions reliably while linking them to known durations and | ||
intensities, and to assist in historical lookups or analytics across ingestion events. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.