Giter VIP home page Giter VIP logo

Comments (5)

caufieldjh avatar caufieldjh commented on June 11, 2024

Hi @yingxuepanyaleedu - I was able to reproduce this error.
It looks like grounding happens part of the way (e.g., with your input, I saw that Elevated liver function tests gets grounded to SNOMEDCT:75540009, which just corresponds to the elevated part and not the rest of that phrase) but then uses an incorrect normalizer.
Looking into it.

from ontogpt.

caufieldjh avatar caufieldjh commented on June 11, 2024

Here's a workaround for now: comment out or remove the slot_usage section from ConditionProblemDiagnosis. The problem is caused by OntoGPT trying to expand the range of potential values defined in ConditionProblemDiagnosisIdentifier, but right now it doesn't know how to do that for ontologies from Bioportal.
This likely isn't ideal as I see you just want SNOMEDCT terms from clinical finding, and I suspect there's still another way to get this result (it may involve a bugfix in the oaklib package).

You may also want to capture multiple conditions for a note - with the current schema, the extracted object will only include one.
Modified example schema in the next comment:

from ontogpt.

caufieldjh avatar caufieldjh commented on June 11, 2024
id: http://w3id.org/ontogpt/condition
name: condition
title: condition FHIR Template
description: >-
  A FHIR-compliant template for conditions mentioned in a clinical note
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
  linkml: https://w3id.org/linkml/
  condition: http://w3id.org/ontogpt/condition/
  SNOMEDCT: http://purl.bioontology.org/ontology/SNOMEDCT


default_prefix: UNKNOWN

imports:
  - linkml:types
  - core

classes:
  ConditionSet:
    tree_root: true
    attributes:
      conditions:
        range: Condition
        multivalued: true
        inlined_as_list: true

  Condition:
    #is_a: NamedEntity
    attributes:
      label:
        description: The concise name of the condition, problem, or diagnosis.
      clinical_status:
        description: The clinical status of the condition.
        range: ConditionClinicalStatus
        ifabsent: string("unknown")  
      severity:
        description: Subjective severity of condition.
        range: ConditionDiagnosisSeverity
        ifabsent: string("unknown")
      code:
        description: The condition, problem, or diagnosis found in this note.
        range: ConditionProblemDiagnosis
        ifabsent: string("unknown")

  ConditionProblemDiagnosis:
    is_a: NamedEntity
    id_prefixes:
      - SNOMEDCT
    annotations:
      annotators: bioportal:SNOMEDCT
#    slot_usage:
#      id:
#        values_from: 
#          - ConditionProblemDiagnosisIdentifier



enums:
  ConditionClinicalStatus:
    permissible_values:
      active:
        description: The subject is currently experiencing the condition or situation, there is evidence of the condition or situation, or considered to be a significant risk.
      recurrence:
        description: The subject is experiencing a reoccurence or repeating of a previously resolved condition or situation, e.g. urinary tract infection, food insecurity.
      relapse:
        description: The subject is experiencing a return of a condition or situation after a period of improvement or remission, e.g. relapse of cancer, alcoholism.
      inactive:
        description: The subject is no longer experiencing the condition or situation and there is no longer evidence or appreciable risk of the condition or situation.
      remission:
        description: The subject is not presently experiencing the condition or situation, but there is a risk of the condition or situation returning.
      resolved:
        description: The subject is not presently experiencing the condition or situation and there is a negligible perceived risk of the condition or situation returning.
      unknown:
        description: The authoring/source system does not know which of the status values currently applies for this condition.
  
  ConditionDiagnosisSeverity:
    permissible_values:
      severe:
        meaning: SNOMEDCT:24484000
      moderate:
        meaning: SNOMEDCT:6736007
      mild:
        meaning: SNOMEDCT:255604002

  ConditionProblemDiagnosisIdentifier:
    reachable_from:
      source_ontology: bioportal:SNOMEDCT
      source_nodes:
        - SNOMEDCT:404684003 ## clinical finding

from ontogpt.

caufieldjh avatar caufieldjh commented on June 11, 2024

With your input in discharge.txt and this command:

ontogpt -vvv extract -i discharge1.txt -t condition -m MODEL_GPT_4_0125_PREVIEW

I get:

extracted_object:
  conditions:
    - label: Left malignant pleural effusion
      clinical_status: unknown
      severity: severe
      code: SNOMEDCT:7771000
    - label: Respiratory Failure
      clinical_status: unknown
      code: SNOMEDCT:409622000
    - label: Postobstructive Pneumonia
      clinical_status: unknown
      code: SNOMEDCT:371072008
    - label: Gastrointestinal bleed
      clinical_status: unknown
      code: AUTO:Gastrointestinal%20bleed
    - label: Thrombocytopenia
      clinical_status: unknown
      code: SNOMEDCT:302215000
    - label: Acute Renal Failure
      clinical_status: unknown
      code: AUTO:Acute%20Renal%20Failure
    - label: Hyponatremia
      clinical_status: unknown
      code: SNOMEDCT:89627008
    - label: Non-small cell lung CA
      clinical_status: active
      code: SNOMEDCT:264885008
    - label: Leukemoid Reaction
      clinical_status: unknown
      code: SNOMEDCT:56478004
    - label: Elevated Liver Function Tests
      clinical_status: unknown
      code: SNOMEDCT:75540009
named_entities:
  - id: SNOMEDCT:7771000
    label: Left malignant pleural effusion
  - id: SNOMEDCT:409622000
    label: Respiratory failure secondary to above
  - id: SNOMEDCT:371072008
    label: Likely postobstructive pneumonia
  - id: AUTO:Gastrointestinal%20bleed
    label: Gastrointestinal bleed
  - id: SNOMEDCT:302215000
    label: Thrombocytopenia
  - id: AUTO:Acute%20Renal%20Failure
    label: Acute Renal Failure
  - id: SNOMEDCT:89627008
    label: Hyponatremia
  - id: SNOMEDCT:264885008
    label: Non-small cell lung CA, possible metastases to the bones
  - id: SNOMEDCT:56478004
    label: Leukemoid reaction, likely secondary to malignancy
  - id: SNOMEDCT:75540009
    label: Elevated liver function tests

Some of the codes assignments, like SNOMEDCT:7771000 are not quite right and the clinical statuses may not quite align with what you're looking for, but the extraction is more comprehensive.
Great use of ifabsent in the schema, by the way!

from ontogpt.

caufieldjh avatar caufieldjh commented on June 11, 2024

I've narrowed this down to a specific bug and will close this issue in favor of a new one.

from ontogpt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.