Skip to main content

IndicPy4Health is a Lightweight, Fast, and Intuitive Indicator Calculations Python Library from Health data.

Project description

IndicPy4Health

GitHub version Codecov test coverage Lifecycle: stable

IndicPy4Health is a Lightweight, Fast, and Intuitive Indicator Calculations Python Library from Health data.

Example

import pandas as pd
from indicpy4health import RuleEngine, MatchAnyWhere, run_indicators

hosp_dataframe = pd.DataFrame({
  "episode_id": [1, 2, 3],
  "age": [45, 60, 32],
  "diagnosis1": ["F10.10", "I20", "I60"],
  "diagnosis2": ["E11", "J45", "I25"],
  "diagnosis3": ["I60", "K35", "F10.120"],
  "present_on_admission_d1": [False, False, False],
  "present_on_admission_d2": [False, True, False],
  "present_on_admission_d3": [False, True, True],
})

reng = RuleEngine(hosp_dataframe, "episode_id")

target_columns = ["diagnosis2", "diagnosis3"]

definition_codes = ["F10.10", "F10.11", "F10.120", "F10.121"]

filter_columns = ["present_on_admission_d2", "present_on_admission_d3"]

lookup_values = ["true"]

alcohol_indicator_poa = MatchAnyWhere(
  reng,
  "alcohol_i_poa",
  target_columns,
  definition_codes,
  filter_columns,
  lookup_values
)

alcohol_i_regex_poa = MatchAnyWhere(
  reng,
  "alcohol_i_regex_poa",
  target_columns,
  ["F10"],
  filter_columns,
  lookup_values,
  regex_prefix_search=True
)

# Include the indicators in a list and apply them
indicators_list = [alcohol_indicator_poa, alcohol_i_regex_poa]

run_indicators(self.reng,
  indicators_list,
  append_results=False,
  csv_path="./results.csv"
)

IndicatorBuilder

Effortlessly generate indicator calculation script templates using 'IndicatorBuilder'. This web tool reads a CSV file, where each column represents an indicator by including its respective definition codes, and outputs a script template ready to be copied and used in R or Python. You can streamline your data analysis workflow with 'IndicatorBuilder'.

The use of 'IndicatorBuilder' complements the Python library IndicPy4Health and the R package IndicR, providing an easy-to-use tool scripting the definition of any indicator within your preferred programming environment.

📜 Disclaimer

This software is provided "as is," without any warranties of any kind, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, and non-infringement.

In no event shall the authors, contributors, or maintainers be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including but not limited to loss of use, data, or profits), regardless of the cause and under any liability theory, whether in contract, strict liability, or tort (including negligence or any other cause), arising in any way from the use of this software, even if advised of the possibility of such damages.

The user assumes full responsibility for the use of this library, including evaluating its suitability and safety in the context of their application.

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

indicpy4health-0.1.2.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

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

indicpy4health-0.1.2-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file indicpy4health-0.1.2.tar.gz.

File metadata

  • Download URL: indicpy4health-0.1.2.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.0 Linux/6.11.0-1012-azure

File hashes

Hashes for indicpy4health-0.1.2.tar.gz
Algorithm Hash digest
SHA256 58a91397b2b758fda806ab7cd990f76e044f0363284a08a4fb4c1e1927011d45
MD5 1ceadc9c10b89bec0f71ce966bfcc92e
BLAKE2b-256 c456f31225ebd07b05a5d1ad3bd7b7d8881ab5e7a3c84cfacd039eee69560835

See more details on using hashes here.

File details

Details for the file indicpy4health-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: indicpy4health-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.0 Linux/6.11.0-1012-azure

File hashes

Hashes for indicpy4health-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 48b52319b96e3d5d26ca68c47e88d8953f120d9b6f73f7aae4b3fcca70e51bee
MD5 4267e8378922370f0c5b7cea82930c24
BLAKE2b-256 b0b3736b102539a8d3cf6da5d6487949dc63005f170b44ef35d9902412273945

See more details on using hashes here.

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