Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ihe-iti

The IHE IT Infrastructure (ITI) identity profiles in Rust: one crate for the technical framework, with a feature per profile. The API reference is on docs.rs/ihe-iti; this page says what each feature does and what it checks. The version on main is 0.38.0.

Features

FeatureProfileTransactionsActor
pixmPatient Identifier Cross-reference for Mobile, PIXmITI-83Patient Identifier Cross-reference Consumer
pdqmPatient Demographics Query for Mobile, PDQmITI-78, ITI-119Patient Demographics Consumer
pmirPatient Master Identity Registry, PMIRITI-93, ITI-94Patient Identity Subscriber and Consumer
mcsdMobile Care Services Discovery, mCSDITI-90, ITI-91Query Client and Update Client
xcpdCross-Community Patient Discovery, XCPDITI-55Initiating Gateway, and the Responding Gateway’s messages with no HTTP server
soapThe SOAP 1.2 envelope of ITI TF-2 Appendix V, with no profile: its reader, which hands every element to a visitor the transaction supplies, its writer, its fault codes, and the HTTP post it travels on with the answer read to a boundAppendix Vwhat xcpd and the Mitz question of nl-generic-functions send, read and write through
balpThe BALP AuditEvent of each FHIR profile aboveITI-83, ITI-104, ITI-78, ITI-119, ITI-90, ITI-91, ITI-93, ITI-94the audit record of the client side, the PIXm Patient Identity Source included, and of the PIXm Manager and the PDQm Supplier
atnaThe DICOM audit message of xcpd, with no FHIR modelITI-55the audit record of either gateway
restThe JSON media types of an answer, with no FHIR model, and the family’s FHIR R4 search value grammar, fhir-searchFHIR R4 search, HTTPwhat the FHIR clients and the NVI client of nl-generic-functions read their answers’ media types with; every search value and token is escaped and read through fhir-search, the one grammar the FerroHEALTH FHIR servers share
outboundThe send every client goes through, over the OutboundClient of ferrohealth-smart that an endpoint table builds, with no FHIR modelITI-72what the clients here and the NVI and Mitz clients of nl-generic-functions send through, with the table’s TLS, retry and credential
pixm-sourceThe feed client of PIXmITI-104Patient Identity Source
pixm-serverThe server side of PIXm, with no store and no HTTP serverITI-83, ITI-104Patient Identifier Cross-reference Manager
pdqm-serverThe server side of PDQm, with no store and no HTTP serverITI-78, ITI-119Patient Demographics Supplier
pmir-serverThe server side of PMIR, with no store and no HTTP serverITI-93, ITI-94Patient Identity Registry

Only soap and xcpd carry the SOAP 1.2 stack, and only xcpd HL7 v3 and SAML XUA; a build without them compiles none of it. The FHIR features decode FHIR R4 through fhir-types 0.9.0, the model FerroBRIDGE generates from the HL7 packages, and turn on only its R4 features (r4 with terminology, or r4-resources), so a product that enables another FHIR release for itself compiles no other release’s resources through this crate.

PIXm (pixm)

ihe_iti::pixm::PixmClient asks a PIX Manager for the identifiers other domains hold for a patient (ITI-83, PIXm 3.1.0): GET [base]/Patient/$ihe-pix with one sourceIdentifier and any number of targetSystem domains. Built with .invoked_by(Invocation::Post), it posts the same parameters in a Parameters body to [base]/Patient/$ihe-pix instead (FHIR R4 Operations §3.2.0.1), so the source identifier is in no request URL.

Lookups by a patient identifier use POST

ITI-83 prescribes the GET, which puts the patient identifier, a BSN for a Dutch patient, in the query string. FerroHEALTH therefore settles it this way:

  • The FerroPIX PIXm Manager accepts $ihe-pix by GET (ITI-83) and by POST with a Parameters body (FHIR R4 Operations §3.2.0.1), with the same answers, and its request log records no URL query (The PIXm Manager).
  • FerroHEALTH clients call it by POST (ihe_iti::pixm::Invocation::Post), so a BSN never appears in a URL. Against another Manager, post only when it accepts the POST form.
  • A proxy in front of a Manager must not log query strings, since a client that uses the GET puts the identifier there.

Every answer is held to the $ihe-pix OperationDefinition: the two out parameters, an assigning authority on each identifier, identifiers only from the domains asked about, and never the source identifier itself. A 404 is “patient unknown” only when its OperationOutcome carries a not-found issue.

PixmClient::capabilities reads the Manager’s CapabilityStatement with GET [base]/metadata (FHIR R4 http.html §capabilities), through the same transport and credential as ITI-83. A consumer calls it at boot to learn that the configured base is a FHIR server that answers. Every other outcome is a typed error: Refused with the status, NotAFhirServer for a 200 that is no FHIR R4 CapabilityStatement, and Timeout, Transport or Unauthenticated when no answer was had.

PIXm Patient Identity Source (pixm-source)

ihe_iti::pixm::source::PixmSourceClient feeds a PIX Manager the patient identities of its own domain (ITI-104, PIXm 3.1.0), so the Manager can cross-reference them before a consumer asks ITI-83:

  • feed adds or revises a patient: PUT [base]/Patient?identifier=system|value with the Patient as it now stands.
  • resolve_duplicate tells the Manager the Source merged two patients: the same update on the subsumed identifier, the Patient carrying a replaced-by link to the survivor.
  • remove removes a patient: the conditional DELETE on the identifier.

A 201 is Fed::Created and a 200 Fed::Updated, each with the Location the Manager named; a delete answered 200 or 204 is Removed::Deleted and 202 Removed::Accepted. A 412 (the identifier matched more than one resource) and every other answer are typed errors with the status and the issue types of the OperationOutcome. A Patient that does not carry the identifier the message names is refused before anything is sent. With balp, each message is recorded as the PIXm Feed Update or Delete Source audit profile fixes it.

PDQm (pdqm)

ihe_iti::pdqm::PdqmClient is the Patient Demographics Consumer:

  • ITI-78, the demographics query: a POST [base]/Patient/_search with the criteria of a PatientQuery (every Patient search parameter ITI-78 names), read into a page of matching Patients with the total, each match’s score and grade, and the next link, which next_page follows on the Supplier’s own origin only.
  • ITI-119, the demographics match: match_patient posts a MatchInput to [base]/Patient/$match and reads the matched Patients, most likely first, each with its score between 0 and 1 and its match-grade. The input Patient carries identifiers, a name, a birth date, a gender, a place of birth (the patient-birthPlace extension) and nationalities (patient-nationality, ISO 3166-1 codes), in any combination with at least one of them; Debug shows none of them. The audit record names the patient by identifier only when the input carries exactly one.

The criteria travel in the request body, never the URL, so a PDQm search needs no choice of invocation: like a PIXm lookup from a FerroHEALTH client, it keeps every identifier and demographic out of the URL. The PDQm Supplier of FerroPIX answers the same POST (The PDQm Supplier). An answer that departs from the profile, such as a match entry without its score or grade, is refused.

PMIR (pmir)

The Patient Identity Subscriber and Consumer sides of PMIR 1.6.0:

  • ITI-94, Subscribe to Patient Updates: ihe_iti::pmir::PmirSubscriber creates a Subscription at the Patient Identity Registry, reads its status and deletes it. find searches the subscriptions on the channel endpoint, and reads a 400, 404 or 405 as a Registry that does not search them. Subscribed::at rebuilds the handle from a stored Location, refusing one off the Registry’s base.
  • ITI-93, Mobile Patient Identity Feed: ihe_iti::pmir::feed::Feed::read reads a message the Registry sends to the subscription’s channel into typed creates, updates, deletes and merges, and acknowledgement writes the response. The feed keeps the resource ids, the identifiers, active and every link (its type and the other reference) and drops every demographic as it reads. It refuses a created, updated or merged Patient that omits active, so an update that reinstates a merged patient reads as the unmerge it is.

The specification leaves the authentication of the Registry to your channel to the two parties, so your code authenticates each message before it reads it.

The server sides (pixm-server, pdqm-server, pmir-server)

A server side is the profile’s request readers and answer writers. It holds no store and no HTTP framework: your server hands a reader the query string, the media type and the body, and sends the Answer it or a writer returns, a status and a resource encoded as FHIR JSON or FHIR XML, both of which the profiles require of a server. Every refusal is an OperationOutcome whose text is fixed, so it never quotes the request. A FHIR JSON body whose XML form does not read back, such as a Patient whose narrative is no XHTML, is refused, so your server never stores a resource it could not answer with in XML.

  • pixm-server reads $ihe-pix from the GET query ITI-83 prescribes or from a posted Parameters body into one request, and refuses a second sourceIdentifier, a token without a system, a query value no FHIR string holds and a parameter the operation does not define. It writes the Parameters answer, without the source identifier and without the domains not asked for, and the three failures of ITI-83. It reads the ITI-104 conditional update on Patient?identifier=system|value, refusing a Patient that does not carry that identifier, and tells an add or revise from a duplicate resolved by a replaced-by link; it reads the conditional delete of a removal.
  • pdqm-server reads every ITI-78 search parameter, with :exact, AND, OR and the identifier=system| domain filter. A parameter or modifier it does not support is dropped, reported, and left out of the self link, as PDQm allows; following the self link reads the same search. It writes the searchset Bundle with its total and paging links, each Patient’s identifiers pruned to the domains asked for. It reads the $match input as Parameters or as a bare Patient, refusing a bare Patient posted with onlyCertainMatches or count, and writes the Match Output Bundle, most likely first, each entry with its score and match-grade.
  • pmir-server reads an ITI-93 feed message in FHIR JSON or XML into creates, updates, deletes and merges that keep their Patients, refusing a message whose first entry is no MessageHeader and a merge that departs from the merged Patient profile. It writes the response message, with a correlated refusal for each entry the Registry did not apply, such as the 405 of an unmerge. It reads an ITI-94 Subscription with one of the four criteria, refusing any other, says whether a Patient falls under the criteria, and builds the ITI-93 message a subscriber receives.

The FerroPIX server answers with them as the PIXm Manager, the PDQm Supplier and the PMIR Registry (The PIXm Manager, The PDQm Supplier, The PMIR Registry).

mCSD (mcsd)

  • ihe_iti::mcsd::directory::Directory reads the Organization and Endpoint resources of one directory Bundle and resolves the references between them as FHIR R4 does. A reference it cannot resolve is reported, never guessed.
  • ihe_iti::mcsd::client::McsdClient asks a directory over HTTP: find is ITI-90 and updates is ITI-91. Every walk over the pages draws on one budget of time, pages, bytes and entries, and running out of any of them is an error, never a shorter answer.
  • ihe_iti::mcsd::replica::Replica keeps a copy of a directory in step with ITI-90 and ITI-91.

XCPD (xcpd)

ihe_iti::xcpd::XcpdClient is the Initiating Gateway of ITI-55 (ITI TF-2 §3.55, Revision 20.1): a PRPA_IN201305UV02 in a SOAP 1.2 envelope, posted to one Responding Gateway, asking by the shared patient identifier alone. The answer reads into a Discovery for Cases 1 to 4 of the transaction, each match with the community that holds it, or a typed error. A Responding Gateway is https only; the endpoint table of the OutboundClient you build the client from carries the mutual TLS of the ATNA Secure Node, and a gateway off the origin of its url is refused before anything is sent.

The crate signs nothing. You supply a SAML 2.0 assertion your identity provider signed, and the client sends it unchanged in a WS-Security header.

Whom an exchange is made for

PixmClient::cross_reference, the PdqmClient searches and matches, and XcpdClient::discover each take an ihe_atna::user::OnBehalfOf: the User an OAuth 2.0 access token names, or System for an exchange the client’s own system makes. An audited exchange’s record names that user. The mCSD and PMIR exchanges are always the system’s own.

Access tokens and audit

Each client is built from the OutboundClient of ferrohealth-smart that its endpoint table builds, and sends the table’s credential on every request (IUA ITI-72); with balp or atna it records the audit record its profile defines. A client credentials grant puts a bearer token on each request, or a DPoP token with a proof of the request for a grant bound to a DPoP key (RFC 9449 §7.1); after a 401 that demands a DPoP nonce the token is kept and the request sent once more with a proof carrying the nonce (§9), and after any other 401 the refused token is dropped and the request sent once more with a new one. Security describes both.