Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text field is lost when the Hapi object is converted to Avro #1014

Open
chandrashekar-s opened this issue Apr 4, 2024 · 6 comments
Open
Assignees
Labels
bug Something isn't working P2:should An issue to be addressed in a quarter or so.

Comments

@chandrashekar-s
Copy link
Collaborator

During conversion from HAPI to Avro, the text field is lost in the converted Avro object. This needs to be debugged. In general, all the fields should be copied to Avro object, so that when the Avro object is converted back to Hapi, it is equavalient to the original HAPI object.

@chandrashekar-s chandrashekar-s added P2:should An issue to be addressed in a quarter or so. bug Something isn't working labels Apr 4, 2024
@chandrashekar-s
Copy link
Collaborator Author

chandrashekar-s commented Apr 4, 2024

Original Hapi object

{
  "resourceType": "Patient",
  "id": "example",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"
    ]
  },
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative</b></p><p><b>id</b>: example</p><p><b>meta</b>: </p><p><b>identifier</b>: Medical Record Number: 1032702 (USUAL)</p><p><b>active</b>: true</p><p><b>name</b>: Amy V. Shaw , Amy V. Baxter </p><p><b>telecom</b>: ph: 555-555-5555(HOME), amy.shaw@example.com</p><p><b>gender</b>: female</p><p><b>birthDate</b>: 1987-02-20</p><p><b>address</b>: </p><ul><li>49 Meadow St Mounds OK 74047 US </li><li>183 Mountain View St Mounds OK 74048 US </li></ul></div>"
  }
}  

when the above hapi object is converted to Avro and then reconverted back to HAPI again, the div field under the text is lost.

Reconverted HAPI object from Avro

{
  "resourceType": "Patient",
  "id": "example",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"
    ]
  },
  "text": {
    "status": "generated"
  }
}  

@bashir2
Copy link
Collaborator

bashir2 commented Jul 5, 2024

I debugged this and the root cause seems to be in the core HAPI code. I have filed this issue to follow-up with that team.

@bashir2
Copy link
Collaborator

bashir2 commented Sep 17, 2024

The filed issue is fixed and a new release has been done; we should probably just update a dependency.

@bashir2
Copy link
Collaborator

bashir2 commented Sep 18, 2024

The filed issue is fixed and a new release has been done; we should probably just update a dependency.

We get the updated artifacts (e.g., ca.uhn.hapi.fhir:org.hl7.fhir.r4) through hapi-fhir-structures-* artifact dependencies. The core issues seems to be fixed on org.hl7.fhir.r4:6.3.19 (and later) according to release notes. The current latest hapi-fhir-structures-* releases (7.4.0) are not caught up to 6.3.19 yet.

@bashir2
Copy link
Collaborator

bashir2 commented Nov 4, 2024

Update: The latest HAPI release includes the fix but when trying to integrate them, I get a new error for xhtml fields. I debugged this and reported the root cause here. Note this prevents us from advancing HAPI version (e.g., #1225) so it is important to be fixed (in the meantime we can exclude xhtml fields if the upstream issue takes too long to be fixed).

@bashir2
Copy link
Collaborator

bashir2 commented Nov 7, 2024

I filed this new bug: hapifhir/org.hl7.fhir.core#1800
Also in #1240 I added a temporary check to skip xhtml fields to be able to advance library versions (until the above issue is fixed and released).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2:should An issue to be addressed in a quarter or so.
Projects
None yet
Development

No branches or pull requests

2 participants