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
| Feature | Profile | Transactions | Actor |
|---|---|---|---|
pixm | Patient Identifier Cross-reference for Mobile, PIXm | ITI-83 | Patient Identifier Cross-reference Consumer |
pdqm | Patient Demographics Query for Mobile, PDQm | ITI-78, ITI-119 | Patient Demographics Consumer |
pmir | Patient Master Identity Registry, PMIR | ITI-93, ITI-94 | Patient Identity Subscriber and Consumer |
mcsd | Mobile Care Services Discovery, mCSD | ITI-90, ITI-91 | Query Client and Update Client |
xcpd | Cross-Community Patient Discovery, XCPD | ITI-55 | Initiating Gateway, and the Responding Gateway’s messages with no HTTP server |
soap | The 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 bound | Appendix V | what xcpd and the Mitz question of nl-generic-functions send, read and write through |
balp | The BALP AuditEvent of each FHIR profile above | ITI-83, ITI-104, ITI-78, ITI-119, ITI-90, ITI-91, ITI-93, ITI-94 | the audit record of the client side, the PIXm Patient Identity Source included, and of the PIXm Manager and the PDQm Supplier |
atna | The DICOM audit message of xcpd, with no FHIR model | ITI-55 | the audit record of either gateway |
rest | The JSON media types of an answer, with no FHIR model, and the family’s FHIR R4 search value grammar, fhir-search | FHIR R4 search, HTTP | what 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 |
outbound | The send every client goes through, over the OutboundClient of ferrohealth-smart that an endpoint table builds, with no FHIR model | ITI-72 | what the clients here and the NVI and Mitz clients of nl-generic-functions send through, with the table’s TLS, retry and credential |
pixm-source | The feed client of PIXm | ITI-104 | Patient Identity Source |
pixm-server | The server side of PIXm, with no store and no HTTP server | ITI-83, ITI-104 | Patient Identifier Cross-reference Manager |
pdqm-server | The server side of PDQm, with no store and no HTTP server | ITI-78, ITI-119 | Patient Demographics Supplier |
pmir-server | The server side of PMIR, with no store and no HTTP server | ITI-93, ITI-94 | Patient 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-pixbyGET(ITI-83) and byPOSTwith aParametersbody (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 thePOSTform. - A proxy in front of a Manager must not log query strings, since a
client that uses the
GETputs 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:
feedadds or revises a patient:PUT [base]/Patient?identifier=system|valuewith the Patient as it now stands.resolve_duplicatetells the Manager the Source merged two patients: the same update on the subsumed identifier, the Patient carrying areplaced-bylink to the survivor.removeremoves a patient: the conditionalDELETEon 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/_searchwith the criteria of aPatientQuery(every Patient search parameter ITI-78 names), read into a page of matching Patients with thetotal, each match’s score and grade, and thenextlink, whichnext_pagefollows on the Supplier’s own origin only. - ITI-119, the demographics match:
match_patientposts aMatchInputto[base]/Patient/$matchand reads the matched Patients, most likely first, each with its score between 0 and 1 and itsmatch-grade. The input Patient carries identifiers, a name, a birth date, a gender, a place of birth (thepatient-birthPlaceextension) and nationalities (patient-nationality, ISO 3166-1 codes), in any combination with at least one of them;Debugshows 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::PmirSubscribercreates aSubscriptionat the Patient Identity Registry, reads its status and deletes it.findsearches the subscriptions on the channel endpoint, and reads a400,404or405as a Registry that does not search them.Subscribed::atrebuilds the handle from a storedLocation, refusing one off the Registry’s base. - ITI-93, Mobile Patient Identity Feed:
ihe_iti::pmir::feed::Feed::readreads a message the Registry sends to the subscription’s channel into typed creates, updates, deletes and merges, andacknowledgementwrites the response. The feed keeps the resource ids, the identifiers,activeand every link (its type and the other reference) and drops every demographic as it reads. It refuses a created, updated or mergedPatientthat omitsactive, 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-serverreads$ihe-pixfrom theGETquery ITI-83 prescribes or from a postedParametersbody into one request, and refuses a secondsourceIdentifier, a token without a system, a query value no FHIRstringholds and a parameter the operation does not define. It writes theParametersanswer, 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 onPatient?identifier=system|value, refusing a Patient that does not carry that identifier, and tells an add or revise from a duplicate resolved by areplaced-bylink; it reads the conditional delete of a removal.pdqm-serverreads every ITI-78 search parameter, with:exact, AND, OR and theidentifier=system|domain filter. A parameter or modifier it does not support is dropped, reported, and left out of theselflink, as PDQm allows; following theselflink reads the same search. It writes thesearchsetBundle with itstotaland paging links, each Patient’s identifiers pruned to the domains asked for. It reads the$matchinput asParametersor as a barePatient, refusing a barePatientposted withonlyCertainMatchesorcount, and writes the Match Output Bundle, most likely first, each entry with its score andmatch-grade.pmir-serverreads 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 noMessageHeaderand 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 the405of an unmerge. It reads an ITI-94Subscriptionwith 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::Directoryreads theOrganizationandEndpointresources 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::McsdClientasks a directory over HTTP:findis ITI-90 andupdatesis 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::Replicakeeps 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.