module
halaxy
Halaxy (practice management) through its FHIR R4 API. Credentials are a practice's API client id and secret, so requests go through a server route (generated by weft add halaxy) that holds the secret, caches the access token and only passes on reads of the resources you allow — by default directory and availability data, never patient records.
// Browser: list practitioners and free slots through your route.
let api = HalaxyProxy::new("/api/halaxy");
let docs = halaxy::parse_bundle(&weft::web::fetch(api.search("Practitioner", &[("active", "true")])).await?)?;Structs
- Halaxy
Server-side client: builds authorised requests.
- HalaxyProxy
Browser side: requests to your Halaxy route.
- ProxyPolicy
What the route passes on.
- Token
An access token and when it expires (seconds on your clock).
Enums
- Region
Halaxy's data regions.
Functions
human_name
pub fn human_name(names: &Value) -> String{"given": ["Ada"], "family": "Lovelace", "prefix": ["Dr"]} → "Dr Ada Lovelace".
next_link
pub fn next_link(res: &Response) -> Option<String>The address of a FHIR bundle's next page, if it has one.
parse_bundle
pub fn parse_bundle(res: &Response) -> Result<Value, Error>Resources in a search bundle as records (summarised for the common types), plus next (the next page's URL) via next_link.
summarize
pub fn summarize(r: &Value) -> ValueA FHIR resource as a flat record: id, type, and for Practitioner, HealthcareService, Location, Organization, Slot, Schedule and Appointment the useful fields by name; resource keeps the original.