Skip to content

Conversation

@karlnaden
Copy link
Contributor

@karlnaden karlnaden commented Dec 18, 2025

Summary

Adjust CDS request validation after a review of CDS Hooks request requirements, including:

  • make optional fields test required (if optional fields are present, they must meet the requirements)
  • hook elements cannot be defined but blank (cds-hooks_2.0@3)
  • the Hook id must be a guid (cds-hooks_2.0@19)

Testing Guidance

Run the CRD Client Suite against the CRD Server suite to demonstrate the new failures:

  1. Create a client suite session (SMART version doesn't matter)
  2. Select the "Inferno CRD Server Suite" preset
  3. Run Group 1.1 Client Registration
  4. Run Group 1.2.6 order-sign, which will cause the tests to wait for an order sign hook invocation
  5. Create a server suite session
  6. Select the "Inferno CRD Client Suite" preset
  7. Run Group 1 Discovery
  8. Run Group 3.6 order-sign, updating the "Request body or bodies for invoking the order-sign hook" input so that (or use example below
  • hookInstance is not a guid (e.g., "hookInstance": "not-a-guid")
  • fhirAuthorization is empty (e.g., "fhirAuthorization": null)
  1. Once the server run is complete, return to the client session and click the link in the wait dialog to continue the tests.
  2. Verify the following errors
  • 1.2.6.07: fails because hookInstance is not a guid
  • 1.2.6.08: fails because fhirAuthorization is defined but empty
  1. Repeat steps 1-10, but leave the "Request body or bodies for invoking the order-sign hook" input as is in step 8 and verify in step 10 that the two indicated tests pass.

Example order-sign request body to use for the failure case.

[
  {
    "hookInstance": "not-a-guid",
    "fhirServer": "https://inferno.healthit.gov/reference-server/r4",
    "hook": "order-sign",
    "fhirAuthorization": null,
    "context": {
      "userId": "Practitioner/pra1234",
      "patientId": "pat015",
      "encounterId": "enc-pat014",
      "draftOrders": {
        "resourceType": "Bundle",
        "entry": [
          {
            "resource": {
              "resourceType": "DeviceRequest",
              "id": "devreq-015-e0250",
              "meta": {
                "versionId": "1",
                "lastUpdated": "2024-05-08T09:47:16.992-04:00",
                "source": "#Odh5ejWjud85tvNJ",
                "profile": [
                  "http://hl7.org/fhir/us/davinci-crd/R4/StructureDefinition/profile-devicerequest-r4"
                ]
              },
              "identifier": [
                {
                  "type": {
                    "coding": [
                      {
                        "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                        "code": "PLAC"
                      }
                    ]
                  },
                  "value": "f105372f-bbef-442c-ad7a-708fee7f8c93"
                }
              ],
              "status": "draft",
              "intent": "original-order",
              "codeCodeableConcept": {
                "coding": [
                  {
                    "system": "https://bluebutton.cms.gov/resources/codesystem/hcpcs",
                    "code": "E0250",
                    "display": "Hospital bed fixed height with any type of side rails, mattress"
                  }
                ]
              },
              "subject": {
                "reference": "Patient/pat015"
              },
              "authoredOn": "2023-01-01T00:00:00Z",
              "requester": {
                "reference": "Practitioner/pra-hfairchild"
              },
              "performer": {
                "reference": "Practitioner/pra1234"
              },
              "insurance": [
                {
                  "reference": "Coverage/cov015"
                }
              ]
            }
          }
        ]
      }
    }
  }
]

@karlnaden karlnaden marked this pull request as ready for review December 19, 2025 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants