Skip to main content

Open Compute - utilities by Jori Health

Project description

open-compute

Utilities by Jori Health. Provides:

  • jori_health.ai: simple AI facade
  • open_compute: conversion agents between FHIR and patient journey

Requirements

  • Python 3.9+

Install

Option A: Install directly from GitHub

pip install git+https://github.com/jori-health/open-compute.git

Option B: Install from a local clone (editable)

git clone https://github.com/jori-health/open-compute.git
cd open-compute
python -m venv .venv
. .venv/bin/activate
python -m pip install -U pip
python -m pip install -e .

Once published to PyPI you will be able to run:

pip install open-compute

Quickstart

AI facade: default instance

from jori_health.ai import joriai

print(joriai.ask("hello"))            # -> "world"
print(joriai.ask("How are you?"))     # -> "Echo: How are you?"

Or create your own instance

Open Compute: FHIR <-> Patient Journey

from open_compute import (
    FHIRPatientData,
    PatientJourney,
    JourneyStage,
    fhir_to_journey,
    journey_to_fhir,
)

# FHIR -> Journey
bundle = FHIRPatientData(entries=[
    {"resource": {"resourceType": "Patient", "id": "pat-123"}},
    {"resource": {"resourceType": "Encounter", "status": "finished", "reasonCode": [{"text": "Annual physical"}]}},
    {"resource": {"resourceType": "Observation", "code": {"text": "Blood Pressure"}, "valueString": "120/80"}},
])

journey = fhir_to_journey(bundle)
print(journey.patient_id)  # "pat-123"
print([s.name for s in journey.stages])  # ["Registration", "Encounter", "Observation"]

# Journey -> FHIR
journey2 = PatientJourney(
    patient_id="pat-123",
    stages=[
        JourneyStage(name="Encounter", description="Follow-up", metadata={"status": "in-progress"}),
        JourneyStage(name="Observation", description="Heart Rate", metadata={"value": "72 bpm"}),
    ],
)

bundle2 = journey_to_fhir(journey2)
print(len(bundle2.entries))  # 3
from jori_health.ai import JoriAI

ai = JoriAI()
print(ai.ask("hello"))  # -> "world"

Testing locally (optional)

pytest -q

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open_compute-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_compute-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file open_compute-0.1.0.tar.gz.

File metadata

  • Download URL: open_compute-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for open_compute-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1f81346c5df6ea982bfb93aed5a0560af937924088062b8f09c8a59e3d305411
MD5 077734d91e7468fd4478cf7b31cfef73
BLAKE2b-256 790156855cfd90246c2be437b54db65a2b5ae71ce84ed9facb9202e64392a55f

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_compute-0.1.0.tar.gz:

Publisher: publish.yml on Jori-Health/Open-Compute

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file open_compute-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: open_compute-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for open_compute-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e38a9f1d604605ec20f24704d4bc2f4c8b86a953e5b8c13cfd3c2ebf5781d8e
MD5 ee056586df0b73b053af42c9476fda6c
BLAKE2b-256 bf8d147b5e7b0fcd62a4a08ef321e09867c0eb0308177378ced2375757658020

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_compute-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Jori-Health/Open-Compute

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page