Giter Club home page Giter Club logo

Comments (9)

jeffeastman avatar jeffeastman commented on June 7, 2024

When I substitute the 25 mcg/day patch in the hook request, it returns MME=144. This is not 1/3 of the 75 mcg/day calculated Mme and is 2.4 times higher than the CDC value above. Looks like the calculation is not taking the 2.4 multiplier into account, since 144 = 2.4 * 60.

from cqf-ruler.

c-schuler avatar c-schuler commented on June 7, 2024

Please provide the request JSON

from cqf-ruler.

jeffeastman avatar jeffeastman commented on June 7, 2024
{
  "hook": "medication-prescribe",
  "hookInstance": "5bacb720-f493-4fe7-8750-c02595cbb72b",
  "fhirServer": "http://localhost:8080/cqf-ruler/baseDstu3",
  "user": "Practitioner-2516",
  "patient": "Patient-1121",
  "context": [
{
  "resourceType": "MedicationRequest",
  "status": "active",
  "medicationCodeableConcept": {
    "coding": [
      {
        "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
        "code": "197696",
        "display": "Fentanyl 75 MCG/HR 3 Day Transdermal Patch"
      }
    ]
  },
  "subject": {
    "reference": "Patient/Patient-1121",
    "display": "Jerry Phillip Goodwall [80]"
  },
  "authoredOn": "2017-01-01T00:00:00-05:00",
  "reasonCode": [
    {
      "coding": [
        {
          "system": "http://snomed.info/sct",
          "code": "82423001",
          "display": "Chronic pain"
        }
      ],
      "text": "Chronic pain"
    }
  ],
  "dosageInstruction": [
    {
      "text": "Apply once every three days for pain.",
      "timing": {
        "repeat": {
          "count": 1,
          "durationUnit": "d",
          "frequency": 1,
          "period": 3
        }
      },
      "asNeededBoolean": false,
      "doseQuantity": {
        "value": 1,
        "unit": "tbl",
        "system": "http://unitsofmeasure.org",
        "code": "tbl"
      }
    }
  ],
  "dispenseRequest": {
    "quantity": {
      "value": 30,
      "unit": "day",
      "system": "http://unitsofmeasure.org",
      "code": "d"
    }
  }
}]
}

from cqf-ruler.

c-schuler avatar c-schuler commented on June 7, 2024

There were a couple factors contributing to this issue:

  1. When I converted the Access db to SQLite, the decimal precision defaulted to 2 places. So 0.075 changed to 0.07 during the conversion.
  2. The GetDailyDosage function in the OMTK library wasn’t taking doses per day into account.

These two factors led to the following (incorrect) calculation:
MME = 70*1*7.2 = 504

I have updated the db and the OMTK library (sent to you via email) and am now getting the following calculation:
MME = 75*0.33333333*7.2 = 179.9999982

Let me know if you are getting the same results with the updates I sent.

from cqf-ruler.

jeffeastman avatar jeffeastman commented on June 7, 2024

I'm not getting that result with those updates in the latest cqf-ruler. I verified the .db and the OMTK libraries are the ones you sent:

Sending 'POST' request to URL: http://localhost:8081/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "hook": "medication-prescribe",
  "hookInstance": "5bacb720-f493-4fe7-8750-c02595cbb72b",
  "fhirServer": "http://localhost:8081/cqf-ruler/baseDstu3/",
  "user": "Practitioner-2516",
  "patient": "Patient-1121",
  "context": [
{
  "resourceType": "MedicationRequest",
  "status": "active",
  "medicationCodeableConcept": {
    "coding": [
      {
        "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
        "code": "197696",
        "display": "Fentanyl 75 MCG/HR 3 Day Transdermal Patch"
      }
    ]
  },
  "subject": {
    "reference": "Patient/Patient-1121",
    "display": "Jerry Phillip Goodwall [80]"
  },
  "authoredOn": "2017-01-01T00:00:00-05:00",
  "reasonCode": [
    {
      "coding": [
        {
          "system": "http://snomed.info/sct",
          "code": "82423001",
          "display": "Chronic pain"
        }
      ],
      "text": "Chronic pain"
    }
  ],
  "dosageInstruction": [
    {
      "text": "Apply once every three days for pain.",
      "timing": {
        "repeat": {
          "count": 1,
          "durationUnit": "d",
          "frequency": 1,
          "period": 3
        }
      },
      "asNeededBoolean": false,
      "doseQuantity": {
        "value": 1,
        "unit": "tbl",
        "system": "http://unitsofmeasure.org",
        "code": "tbl"
      }
    }
  ],
  "dispenseRequest": {
    "quantity": {
      "value": 30,
      "unit": "day",
      "system": "http://unitsofmeasure.org",
      "code": "d"
    }
  }
}]
}

Response = 200
{
  "cards": [
    {
      "links": [
        {
          "label": "CDC guideline for prescribing opioids for chronic pain",
          "url": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420"
        },
        {
          "label": "MME Conversion Tables",
          "url": "https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf"
        }
      ]
    },
    {
      "summary": "High risk for opioid overdose - taper now",
      "indicator": "warning",
      "detail": "Total morphine milligram equivalent (MME) is 540.00000mg/d. Taper to less than 50."
    }
  ]
}

from cqf-ruler.

c-schuler avatar c-schuler commented on June 7, 2024

It appears like the OMTK library I sent you wasn't updated with the new logic. Sorry about that! Please load the OMTKLogic library from this bundle and try again.

from cqf-ruler.

jeffeastman avatar jeffeastman commented on June 7, 2024

I'm still getting the same result with this. Can you take a look at the hook request? Might be the dosageInstruction??

testJerryFentaNYLNoPrefetch:
2018-01-22 12:58:45 INFO  FhirContext:162 - Creating new FHIR context for FHIR version [DSTU3]

Sending 'POST' request to URL: http://localhost:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "hook": "medication-prescribe",
  "hookInstance": "5bacb720-f493-4fe7-8750-c02595cbb72b",
  "fhirServer": "http://localhost:8080/cqf-ruler/baseDstu3/",
  "user": "Practitioner-2516",
  "patient": "Patient-1121",
  "context": [
{
  "resourceType": "MedicationRequest",
  "status": "active",
  "medicationCodeableConcept": {
    "coding": [
      {
        "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
        "code": "197696",
        "display": "Fentanyl 75 MCG/HR 3 Day Transdermal Patch"
      }
    ]
  },
  "subject": {
    "reference": "Patient/Patient-1121",
    "display": "Jerry Phillip Goodwall [80]"
  },
  "authoredOn": "2017-01-01T00:00:00-05:00",
  "reasonCode": [
    {
      "coding": [
        {
          "system": "http://snomed.info/sct",
          "code": "82423001",
          "display": "Chronic pain"
        }
      ],
      "text": "Chronic pain"
    }
  ],
  "dosageInstruction": [
    {
      "text": "Apply once every three days for pain.",
      "timing": {
        "repeat": {
          "count": 1,
          "durationUnit": "d",
          "frequency": 1,
          "period": 3
        }
      },
      "asNeededBoolean": false,
      "doseQuantity": {
        "value": 1,
        "unit": "tbl",
        "system": "http://unitsofmeasure.org",
        "code": "tbl"
      }
    }
  ],
  "dispenseRequest": {
    "quantity": {
      "value": 30,
      "unit": "day",
      "system": "http://unitsofmeasure.org",
      "code": "d"
    }
  }
}]
}

Response = 200
{
  "cards": [
    {
      "links": [
        {
          "label": "CDC guideline for prescribing opioids for chronic pain",
          "url": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420"
        },
        {
          "label": "MME Conversion Tables",
          "url": "https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf"
        }
      ]
    },
    {
      "summary": "High risk for opioid overdose - taper now",
      "indicator": "warning",
      "detail": "Total morphine milligram equivalent (MME) is 540.00000mg/d. Taper to less than 50."
    }
  ]
}

from cqf-ruler.

c-schuler avatar c-schuler commented on June 7, 2024

The periodUnit needs to be specified:

"repeat": {
  "count": 1,
  "durationUnit": "d",
  "frequency": 1,
  "period": 3,
  "periodUnit": "d" 
}

That is necessary to get the correct daily frequency.

from cqf-ruler.

jeffeastman avatar jeffeastman commented on June 7, 2024

Yup, that fixed it. Updating my tests and closing this issue.

from cqf-ruler.

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.