- ส่งแล้ว
- 25 สิงหาคม 2569 เวลา 21:33 UTC
- ผู้เขียน
- Kamo
- ตั้งค่า
- 2890a57
The JSON builder is hand-rolled rather than a Jackson ObjectMapper, and that is a scar rather than a preference. This platform ships a global Long->String serializer on some mappers and not others; adding one to SecurityService's mapper produced 401s across the entire platform, and ids leaving quoted broke a bare-digit regex somewhere else entirely. A FHIR payload has exactly one correct shape, and it must not change because somebody registered a module for an unrelated reason three services away. Nulls are omitted, not emitted. FHIR has no element present-and-null: "birthDate": null is invalid against the specification, and a strict receiver rejects the whole resource over it. Control characters are escaped rather than dropped, because clinical free text arrives from scanners and faxes and silently deleting a byte from a clinician's note is worse than transmitting it awkwardly. Statuses carry their system. A receiver matches on the (system, code) pair, and "active" alone could be a condition's clinical status, an allergy's or a coverage's — three different value sets. A bare code is not partially useful: the receiver drops it or guesses. Three renderings encode facts that are easy to lose and impossible to recover on the far side: - "No known allergies" is a POSITIVE statement with its own SNOMED concept (716186003). Sending an empty allergy list instead says "nobody asked", which is a completely different clinical fact, and the receiver must then prescribe as if the question is open. - MedicationRequest.intent distinguishes a proposal from an order, and reportedBoolean says this practice did not write it — without which a receiver attributes every drug on the list to us, including the ones the patient merely told us about. - Immunization statusReason on a not-done dose is what distinguishes a patient who decoderd from a patient nobody asked. Only the second is a care gap, on their side as much as ours. Race and ethnicity render as repeating US Core extensions rather than one value, because a person can be more than one race and a single-string model erases exactly the multiracial patients the reporting requirement exists to count. An out-of-range administrative gender renders as "other" rather than as itself: an invalid code fails validation at the receiver and takes the WHOLE resource with it, so one unexpected value would cost the patient's entire record instead of one field. A merged patient still renders, with link.type = replaced-by — answering a legitimate holder of an old identifier that the record never existed turns a merge into data loss on their side. value[x] emits exactly one element. Emitting two makes the resource invalid and a strict receiver rejects all of it, so "send both and let them pick" costs the observation entirely. Errors are OperationOutcomes, and their diagnostics carry no PHI: an outcome is frequently logged by the receiver, and a patient's name in an error message is a disclosure to whoever reads their logs. 1890 tests green.