Closed julian-r closed 4 years ago
Deserialzing
{ "resourceType": "ClinicalImpression", "status": "completed", "subject": {"reference": ""}, }
Leads to a internal representation of:
resource_type='ClinicalImpression' id=None meta=None implicit_rules=None language=None text=None contained=None extension=None modifier_extension=None identifier=None status=<EventStatus.completed: 'completed'> status_reason=None code=None description=None subject=Reference(id=None, extension=None, reference=None, type=None, identifier=None, display=None) encounter=None effective_date_time=None effective_period=None date=None assessor=None previous=None problem=None investigation=None protocol=None summary=None finding=None prognosis_codeable_concept=None prognosis_reference=None supporting_info=None note=None
Which then leads to a serialization of, which is an invalid ClinicalImpression since subject has a carnality of 1...1:
ClinicalImpression
subject
1...1
{ "resourceType": "ClinicalImpression", "status": "completed" }
This behavior is half correct. The subject should actually be stripped before de-serialization, which then would lead to a ValidationError, because subject is a required field.
ValidationError
Deserialzing
Leads to a internal representation of:
Which then leads to a serialization of, which is an invalid
ClinicalImpression
sincesubject
has a carnality of1...1
:This behavior is half correct. The subject should actually be stripped before de-serialization, which then would lead to a
ValidationError
, becausesubject
is a required field.