Code Monkey home page Code Monkey logo

Comments (10)

jeffeastman avatar jeffeastman commented on September 26, 2024

I also get the same error with:

{
	"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": "1791566",
						"display": "Abuse-Deterrent 12 HR oxyCODONE 18 MG Extended Release Oral Capsule"
					}
				]
			},
			"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": "Take one capsule twice daily",
					"timing": {
						"repeat": {
							"count": 1,
							"durationUnit": "d",
							"frequency": 2,
							"period": 1
						}
					},
					"asNeededBoolean": false,
					"doseQuantity": {
						"value": 18,
						"unit": "mg",
						"system": "http://unitsofmeasure.org",
						"code": "mg"
					}
				}
			],
			"dispenseRequest": {
				"quantity": {
					"value": 30,
					"unit": "day",
					"system": "http://unitsofmeasure.org",
					"code": "d"
				}
			}
		}
	]
}

from cqf-ruler.

jeffeastman avatar jeffeastman commented on September 26, 2024

These are with the latest cqf-ruler built today

from cqf-ruler.

jeffeastman avatar jeffeastman commented on September 26, 2024

Offhand, it looks like the prefetch is required for some reason, because all the tests with them like this work:

{
	"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"
				}
			}
		}
	],
	"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
										}
									},
									"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.

jeffeastman avatar jeffeastman commented on September 26, 2024

And patient Jerry Goodwall has only 1 non-opioid Rx in the database (histories 15, I think). And that Rx doesn't have a dosageInstruction. So perhaps this is the issue?

{
  "resourceType": "Bundle",
  "id": "4ef72cd1-3466-4b19-97b5-98aa84657a54",
  "meta": {
    "lastUpdated": "2018-01-17T13:32:48.972-05:00"
  },
  "type": "searchset",
  "total": 1,
  "link": [
    {
      "relation": "self",
      "url": "http://localhost:8081/cqf-ruler/baseDstu3/MedicationRequest?_pretty=true&patient=Patient%2FPatient-1121"
    }
  ],
  "entry": [
    {
      "fullUrl": "http://localhost:8081/cqf-ruler/baseDstu3/MedicationRequest/MedicationRequest-667190",
      "resource": {
        "resourceType": "MedicationRequest",
        "id": "MedicationRequest-667190",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2018-01-17T12:28:45.877-05:00",
          "profile": [
            "http://hl7.org/fhir/us/hedis/StructureDefinition/hedis-medicationrequest"
          ]
        },
        "extension": [
          {
            "url": "http://mihin.org/extension/copyright",
            "valueString": "Copyright 2014-2017 Michigan Health Information Network Shared Services. Licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0.  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License."
          }
        ],
        "status": "active",
        "intent": "order",
        "medicationCodeableConcept": {
          "coding": [
            {
              "system": "http://test",
              "code": "Antidepressant.Medication",
              "display": "Antidepressant Medication"
            }
          ]
        },
        "subject": {
          "reference": "Patient/Patient-1121",
          "display": "Jerry Phillip Goodwall"
        },
        "context": {
          "reference": "Encounter/Encounter-3607",
          "display": "DMS_Followup_Encounter"
        },
        "authoredOn": "2017-03-20T01:00:00-04:00",
        "reasonCode": [
          {
            "coding": [
              {
                "system": "http://snomed.info/sct",
                "code": "310495003",
                "display": "Mild depression (disorder)"
              }
            ]
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    }
  ]
}

from cqf-ruler.

jeffeastman avatar jeffeastman commented on September 26, 2024

Once I modified the above MedicationRequest with proper coding and with a dosageInstruction, all of the Hook tests for Jerry passed. Seems like the code might be a little more forgiving because dosageInstruction is an optional field in the resource.

So leaving this open.

from cqf-ruler.

c-schuler avatar c-schuler commented on September 26, 2024

Although dosageInstruction is an optional field in the base FHIR MedicationRequest resource, it is required when using the opioidcds MedicationRequest profile, which is what the Ruler is expecting. So there is a limitation when not including the prefetch data in the response: all other active medications in the FHIR server for the patient must conform to the opioidcds profile. An optional approach would be for the Ruler to ensure that the fetched medications reference the opioidcds profile before including them for evaluation. While that is probably a more desirable approach, it gets a little sticky when DSTU2 MedicationOrders, which is still the standard for most EHR's, are used as the opioidcds profiles are STU3.

from cqf-ruler.

jeffeastman avatar jeffeastman commented on September 26, 2024

For curated test data, the limitation can be worked around. For a practical database, however, the optional approach would be the only way forward since the dosageInstruction is optional.

DosageInstructions are optional in DSTU2 as well.

from cqf-ruler.

c-schuler avatar c-schuler commented on September 26, 2024

Agreed. I will add a check that only includes medications with a reference to the opioidcds profile for evaluation. I will try to resolve this issue before the connectathon this weekend. Thanks Jeff.

from cqf-ruler.

jeffeastman avatar jeffeastman commented on September 26, 2024

Let me know when the fix is in. I can easily test it.

from cqf-ruler.

JPercival avatar JPercival commented on September 26, 2024

Closing as wontfix, due to us only supporting >=DSTU3

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.