Code Monkey home page Code Monkey logo

Comments (5)

jeffeastman avatar jeffeastman commented on June 25, 2024

Here's another test that has 7 existing Oxycontin 15mg Rx in the database for Jared Baldwin but still returns ok with the 8th Rx:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "hook": "medication-prescribe",
  "hookInstance": "5bacb720-f493-4fe7-8750-c02595cbb72b",
  "fhirServer": "http://54.165.182.195:8080/cqf-ruler/baseDstu3",
  "user": "Practitioner-2516",
  "patient": "Patient-6513",
  "context": [
{
  "resourceType": "MedicationRequest",
  "status": "active",
  "medicationCodeableConcept": {
    "coding": [
      {
        "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
        "code": "1049545",
        "display": "oxyCODONE Hydrochloride 15 MG [OxyCONTIN]"
      }
    ]
  },
  "subject": {
    "reference": "Patient/Patient-6513",
    "display": "Jared Gentry Baldwin [23]"
  },
  "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": "Take 15mg three times daily",
      "timing": {
        "repeat": {
          "count": 1,
          "durationUnit": "d",
          "frequency": 3,
          "frequencyMax": 3,
          "period": 1
        }
      },
      "asNeededBoolean": false,
      "doseQuantity": {
        "value": 15,
        "unit": "mg",
        "system": "http://unitsofmeasure.org",
        "code": "mg"
      }
    }
  ],
  "dispenseRequest": {
    "quantity": {
      "value": 30,
      "unit": "day",
      "system": "http://unitsofmeasure.org",
      "code": "d"
    }
  }
}]
}

Response = 200
{
  "cards": [
    {}
  ]
}

from cqf-ruler.

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

Hmm. I wonder if it is being ignored because they are duplicate prescriptions, which would be an odd real-world scenario. I will try to test with several different prescriptions to see if it makes a difference.

from cqf-ruler.

jeffeastman avatar jeffeastman commented on June 25, 2024

If you want to test with some richer data you can try. In particular testNewJaredBaldwinOxycodoneRx is ignoring all the 7 identical Oxy Rx with different dates and ids. Maybe the logic is using a set rather than a list? That might explain it.

testJerryFentaNYLPrefetchFentaNYL:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "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 504.000mg/d. Taper to less than 50."
    }
  ]
}


testJerryOxyCODONE15mgPrefetchFentaNYL:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "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 526.500mg/d. Taper to less than 50."
    }
  ]
}


testJerryFentaNYLNoPrefetch:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "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 504.000mg/d. Taper to less than 50."
    }
  ]
}


testJerryOxyCODONE80mgPrefetchFentaNYL:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "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 624.000mg/d. Taper to less than 50."
    }
  ]
}


testJerryCODONE15mgPrefix3RxOxyCODONE15mg:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "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"
        }
      ]
    }
  ]
}


testJerryOxyCODONE80mgNoPrefix:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "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 120.00mg/d. Taper to less than 50."
    }
  ]
}


testNewJaredBaldwinFlexerilRx:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "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"
        }
      ]
    }
  ]
}


testNewJaredBaldwinOxycodoneRx:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "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"
        }
      ]
    }
  ]
}


testNewTerryZavalaXanaxTripleThreatRx:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "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 120.00mg/d. Taper to less than 50."
    }
  ]
}

from cqf-ruler.

jeffeastman avatar jeffeastman commented on June 25, 2024

The prefetch component still seems to be missing in the MME, which is the same as that calculated with no prefetch.

{
	"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,
							"periodUnit": "d"
						}
					},
					"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"
				}
			}
		}
	],
	"prefetch": {
		"medication": {
			"resource": {
				"resourceType": "Bundle",
				"entry": [
					{
						"resource": {
							"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,
											"periodUnit": "d"
										}
									},
									"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"
								}
							}
						}
					}
				]
			}
		}
	}
}

produces:

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 179.99999820mg/d. Taper to less than 50."
    }
  ]
}

from cqf-ruler.

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

@jeffeastman is this still an issue? If not, please close. Thanks!

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.