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

Missing properties in json after unmarshalling #270

Open
barczykartur7 opened this issue Aug 8, 2023 · 0 comments
Open

Missing properties in json after unmarshalling #270

barczykartur7 opened this issue Aug 8, 2023 · 0 comments

Comments

@barczykartur7
Copy link

Hello, I came across a problem with unmarshalling process. I am attaching my xsd files and my xml file that marshalling was done upon. I am also attaching jsonschema and generated mappings. I would be grateful if you could help me, because I don't understand why unmarshalled json is (in my opinion) missing some props. XSD file that was given for jsonix to do mappings was extPL_r3.xsd.
In my xml a root element is <ClinicalDocument>. I am having a problem with its three child props. I will start from the less deep problem.

Problem 1:
The ClinicalDocument has the <title> child tag. And the problem with this child is that in original xml it looks like this:
<title>Skierowanie do szpitala</title>
And the unmarshalled equivalent in json file is:

  "title": {
        "TYPE_NAME": "referral.ST"
  },

And marshalled version:
</title>
In my opinion there should be value. I tried to pass it as string, in object etc. And nothing helped. I did find an solution by changing xsd type from "ST" to "xs:string", but I would like to avoid such an editing. Am I missing some files or something? I tried to look at referenced type of "ST" in json schema but I couldn't get a proper result.

Problem 2:
The ClinicalDocument has the <code> child tag. That tag should have a child tag: . But it does not appear in unmarshalled version.
Original xml tag looks like this:

...
<code code="57832-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Prescription for diagnostic or specialist care Document">
    <translation code="02.10" displayName="Skierowanie na badanie lub leczenie" codeSystem="2.16.840.1.113883.3.4424.11.1.32" codeSystemName="KLAS_DOK_P1"/>
</code>

Genarated json looks like this:

...
"code": {
      "TYPE_NAME": "referral.CE",
      "code": "57832-8",
      "codeSystem": "2.16.840.1.113883.6.1",
      "codeSystemName": "LOINC",
      "displayName": "Prescription for diagnostic or specialist care Document"
    },

There is no within.
Marshalled xml looks like this:

<code code="57832-8" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Prescription for diagnostic or specialist care Document"/>

I think that the cause can be recursive type. But I am not sure. I tried to edit json and mapping and I didn't get proper form. Have you got any idea on that?

Problem 3:
My last problem relates to <reference> tag This tag is placed deeply in <component> tag in <ClinicalDocument>. Tag should be placed in <text>
The original xml looks like this:

<text>
  <reference value="#PROC_1"/>
</text>

Unmarshalled (generated) Json looks like this:

"text": {
  "TYPE_NAME": "referral.ED"
}

There is no trace of <reference> tag.
It took me some hours to try to solve above problems. I am asking for your help. If there will be a need for more information I will pass it to you ASAP.

files: attachments.zip

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant