{"openapi":"3.1.0","info":{"title":"OmniHealth API","version":"1.0","description":"FHIR R4 API plus platform extensions (webhooks, patient notifications). Auth is OAuth2 client_credentials. See https://omnihealth.solutions/developer-docs."},"servers":[{"url":"https://omnihealth.solutions/fhir","description":"Production"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token from /token"},"oauth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://omnihealth.solutions/fhir/token","scopes":{"system/Observation.read":"system/Observation.read","system/Observation.write":"system/Observation.write","system/Patient.read":"system/Patient.read","system/*.read":"system/*.read","system/Notification.write":"system/Notification.write"}}}}},"schemas":{"Observation":{"type":"object","properties":{"resourceType":{"type":"string","example":"Observation"},"status":{"type":"string","example":"final"},"code":{"type":"object"},"subject":{"type":"object"},"effectiveDateTime":{"type":"string","format":"date-time"},"component":{"type":"array","items":{"type":"object"}}}}}},"paths":{"/token":{"post":{"summary":"OAuth2 token (client_credentials)","security":[],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["grant_type","client_id","client_secret"],"properties":{"grant_type":{"type":"string","example":"client_credentials"},"client_id":{"type":"string"},"client_secret":{"type":"string"},"scope":{"type":"string","example":"system/Observation.read"}}}}}},"responses":{"200":{"description":"Access token"}}}},"/metadata":{"get":{"summary":"CapabilityStatement","security":[],"responses":{"200":{"description":"CapabilityStatement"}}}},"/Observation":{"get":{"summary":"Search observations","parameters":[{"name":"patient","in":"query","schema":{"type":"integer"}},{"name":"code","in":"query","schema":{"type":"string"}},{"name":"_count","in":"query","schema":{"type":"integer","default":50}}],"responses":{"200":{"description":"searchset Bundle"},"403":{"description":"Missing scope"}}},"post":{"summary":"Ingest an observation (consent-gated)","requestBody":{"required":true,"content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/Observation"}}}},"responses":{"201":{"description":"Created"},"403":{"description":"Not your service, or patient has not enabled it"}}}},"/Observation/{id}":{"get":{"summary":"Read an observation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"psd-42"}],"responses":{"200":{"description":"Observation"},"404":{"description":"Not found or not visible"}}}},"/Patient/{id}":{"get":{"summary":"Read a patient (de-identified unless elevated)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Patient"},"404":{"description":"Not found or not visible"}}}},"/$notify-patient":{"post":{"summary":"Notify a patient (platform operation)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["service_id","patient_id","title"],"properties":{"service_id":{"type":"string"},"patient_id":{"type":"integer"},"title":{"type":"string"},"body":{"type":"string"},"link":{"type":"string"}}}}}},"responses":{"200":{"description":"Parameters (delivered count)"},"403":{"description":"Consent gate"}}}}}}