1

Base Patient resource has identifier with cardinality 0 -> many. We have profile based on Patient where we have identifier 1 -> 1.

So how the output json should look like ?

"identifier": {
    "system" : "some-system.url",
    "code"   : "code121"
}

as json object or

 "identifier": [
 {
     "system" : "some-system.url",
     "code"   : "code121"
 }
]

as array

Yaroslav Kovbas
  • 430
  • 4
  • 7
  • when we encode it using HAPI parser from original patient(it contains profile and all extensions) we have as array, but when we use our profile class directly we have like object – Yaroslav Kovbas Dec 27 '19 at 11:43

1 Answers1

2

Look to https://www.hl7.org/fhir/profiling.html#cardinality "Note that though a profile can constrain an element from x..* to x..1, this doesn't make any difference to the representation in the JSON format - the element will still be represented in an array."