Skip to content

Directory: probe .well-known/udap for NDH STU2 - #44

Merged
JoeShook merged 13 commits into
mainfrom
ndh-udap-probe
Nov 30, 2026
Merged

JoeShook merged 13 commits into
mainfrom
ndh-udap-probe

Conversation

@JoeShook

@JoeShook JoeShook commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Two commits. The Discovery work that was here went in with #45.

Directory: find UDAP endpoints by probing .well-known/udap

NDH STU2 removed base-ext-dynamicRegistration and the dynamic-registration-trust-profile search parameter, so nothing on an Endpoint marks it as UDAP. Every Endpoint with an http(s) address now gets a UDAP node, which the page resolves by fetching {address}/.well-known/udap.

  • Probes run six at a time with a 20 s timeout each. An address shared by several Endpoints is fetched once, and the tree updates as each probe finishes.
  • A response counts as UDAP only if it lists a UDAP version or carries signed_metadata. Endpoints without UDAP show "No UDAP metadata at …".
  • Probing now walks the whole tree. Before, Endpoints under an Organization stayed on their spinner.
  • A duplicate Endpoint no longer stops the remaining Endpoints from being added.
  • The default Endpoint search is now status=active.
  • The page still reads the STU1 SMART and mTLS extensions.

Directory probe: don't make each probed Endpoint the session's FHIR server

GET /Metadata stores the URL it validates as the session's FHIR server, which Patient Search and the access token follow. Probing every Endpoint through it left the session pointing at the last Endpoint probed. The probe now calls the new IDiscoveryService.ProbeUdapMetadata, which passes probe=true so the server leaves the session alone.

Testing

  • UdapEd.Server builds.
  • Not tested end to end: Directory search sends no access token, and both known directories (HL7 NDH reference server, fhirlabs.net) return 401 to anonymous searches.

🤖 Generated with Claude Code

JoeShook and others added 2 commits November 29, 2026 07:40
NDH STU2 removed the Endpoint extensions the Directory page used to spot UDAP
(base-ext-dynamicRegistration) and the dynamic-registration-trust-profile
search parameter. Nothing in the IG marks an Endpoint as UDAP any more, so
every Endpoint with an http(s) address now gets a UDAP node, resolved by
fetching {address}/.well-known/udap.

- Probes run in the background, six at a time with a 20 s timeout each; an
  address shared by several Endpoints is fetched once. The tree updates as
  each probe finishes.
- A response counts as UDAP only when it lists a UDAP version or carries
  signed_metadata, so an HTML page or OperationOutcome served with 200 does
  not. Endpoints without UDAP show "No UDAP metadata at ...".
- Probing walks the whole tree. Before, only the first level was checked, so
  Endpoints under an Organization stayed on their spinner.
- A duplicate Endpoint no longer stops the rest from being added.
- The default Endpoint search is status=active instead of the removed
  dynamic-registration-trust-profile=udap.
- The STU1 SMART and mTLS extensions are still read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…erver

The validated metadata call (GET /Metadata) stores the URL it checks as the
session's FHIR server, which Patient Search and the access token follow. The
Directory page probes every Endpoint it lists through that call, so after a
search the session pointed at whichever Endpoint was probed last, and Patient
Search would send the token there.

IDiscoveryService.ProbeUdapMetadata validates the same way with probe=true,
and the server leaves the session alone. MAUI, which has no server session,
uses the interface's default (the usual call).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JoeShook JoeShook changed the title Directory: probe .well-known/udap for NDH STU2; Discovery layout and Query buttons Directory: probe .well-known/udap for NDH STU2 Nov 29, 2026
JoeShook and others added 11 commits November 29, 2026 08:15
…s search

ndh-server.fast.hl7.org/fhir is the NDH RI used at Connectathon 43 and
answers searches without a token. national-directory.fast.hl7.org/fhir
returns 401 Bearer, so it needs a UDAP token first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rganization names

- The Base Url field offers the CMS National Provider Directory (default),
  the HL7 NDH reference server and the HL7 FAST directory, with a note on
  each; any other URL can still be typed.
- The result list showed each Organization's id twice: the name and id were
  passed to TreeItemData(id, name) in the wrong order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ys, page results

Searches that worked against the CMS NPD directly failed or showed the wrong
endpoints in UdapEd:
- Parameters and includes came from the bundled NDH IG CapabilityStatement only.
  They now come from the directory's /metadata, topped up with the IG's (CMS
  honors _include=Organization:endpoint without advertising it). Parameter
  names accept free text.
- Endpoints were attached only through Endpoint.managingOrganization, which CMS
  never sets, so they landed under the wrong Organization or none. The tree
  now resolves Organization.endpoint (and PractitionerRole.endpoint, ...)
  forward and managingOrganization backward, shows a shared endpoint under
  every Organization that names it, and lists included Practitioners and
  Organizations under each match.
- The GET box accepts a pasted example: a query, Resource?query or a full URL.
- Values are percent-encoded; _count is set; Next/Previous follow Bundle links.
- POST search splits form pairs on the first '=' only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…FHIR view

- Includes offer Resource:* and reverse includes offer *. When a directory
  rejects an _include (HAPI-2018 for a bare "PractitionerRole"), the error says
  what the value should look like.
- Related resources are found through references inside extensions too, so a
  PractitionerRole shows its NDH network (base-ext-network-reference).
- The FHIR tab pretty-prints the Bundle, and the Monaco editor tracks its
  container instead of a fixed 200px layout taken while the tab was hidden;
  it is read only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sent

- The Base Url suggestions listed the current URL even when it did not match
  what was typed, so Enter put the old directory back (CMS) and searches meant
  for the HL7 reference server went to CMS. Suggestions now only match the text.
- The results card shows the exact GET/POST that was sent.
- An OperationOutcome holding only warnings (a directory ignoring an unknown
  parameter) shows as a warning, with its diagnostics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The autocomplete selects the first suggestion on Enter or blur. With every known
directory listed, CMS came first and replaced a typed HL7 reference server URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ories

MudAutocomplete re-selected its first suggestion when the field lost focus,
replacing a typed URL with the CMS NPD. A text field keeps exactly what was
typed; the menu beside it fills in a known directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ers start blank

- Parameters, includes and reverse includes known only from the NDH IG show
  greyed with "(NDH IG)": the directory's CapabilityStatement does not list them
  and it may ignore them. Advertised parameters sort first, alphabetically.
- Adding a parameter no longer fills in the directory's first listed parameter
  (PractitionerRole got "practitioner" on CMS, "date" on the HL7 RI). Only
  resources with an obvious first parameter get one (name; Endpoint
  connection-type).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ectory

- Directory searches (GetSearch, PostSearch, Get) now run through the request
  capture handler and return the wire headers on success, not only on errors.
  The results card shows the HTTP status, the time the directory took, the
  entry count, compressed and decompressed bytes, and the outgoing request
  with its headers, as the Patient pages do.
- RequestCaptureHandler times the call to the FHIR server (X-Fhir-Elapsed-Ms);
  the web client reads it into FhirResultModel.FhirElapsedMs.
- https://national-directory.fast.hl7.org/fhir is gone from the known
  directories and from udap_urls.json; it is no longer used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Names in the results tree (matches, related resources, endpoints, references
not in the page) open FhirResourceDialog: the resource as readable rows (names,
identifiers, contacts, addresses, codes, periods, NDH extensions by name) with
its JSON on a second tab. References inside it are links; one already in the
search Bundle opens at once, anything else is read from the directory. Back
walks the trail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JoeShook
JoeShook merged commit b8ce3c6 into main Nov 30, 2026
2 checks passed
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.

1 participant