今日已更新 412 条资讯 | 累计 19972 条内容
关于我们

标签:#fhir

找到 1 篇相关文章

AI 资讯

I Almost Hand-Wrote a FHIR Schema. Then I Found Out I Didn't Have To.

A hospital-network client wanted our system to output patient data in actual FHIR format - the standard interoperability format healthcare systems use to talk to each other - instead of whatever shape we felt like inventing. Made total sense from their side, their EHR software only accepts FHIR resources, not our custom JSON. From my side, it meant I now had to get an LLM to produce a Patient resource that was FHIR R4 compliant, field for field. I opened the FHIR R4 spec page for Patient to see what I was dealing with. Closed the tab about four minutes later. It's not one flat object - names have their own nested structure with use / family / given arrays, telecom is a list of typed contact points, addresses have their own multi-field shape, and half the fields have specific allowed value sets straight out of a separate FHIR terminology spec. This was not going to be a quick z.object({...}) . Two days into hand-writing it, and I wasn't even done I started anyway, because what else was I going to do: const PatientSchema = z . object ({ resourceType : z . literal ( " Patient " ), identifier : z . array ( z . object ({ system : z . string (), value : z . string (), }) ), name : z . array ( z . object ({ use : z . enum ([ " official " , " usual " , " nickname " , " maiden " ]), family : z . string (), given : z . array ( z . string ()), }) ), telecom : z . array ( z . object ({ system : z . enum ([ " phone " , " email " , " fax " ]), value : z . string (), use : z . enum ([ " home " , " work " , " mobile " ]). optional (), }) ), gender : z . enum ([ " male " , " female " , " other " , " unknown " ]), birthDate : z . string (), address : z . array ( z . object ({ use : z . enum ([ " home " , " work " , " temp " ]). optional (), line : z . array ( z . string ()), city : z . string (), state : z . string (), postalCode : z . string (), country : z . string (), }) ), // ...and I still hadn't gotten to maritalStatus, communication, // contact, generalPractitioner, managingOr

2026-07-15 原文 →