Skip to content

Commit

Permalink
fix element name output
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiagoTrabach committed Sep 6, 2023
1 parent bc9004f commit ac94601
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions fhir_utils/fhir/patient/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import logging


@dataclass
@dataclass()
class Patient:
source : str
name : str
Expand Down Expand Up @@ -316,7 +316,7 @@ def merge(self, new_resource, force_invalid_merge: False):

def to_fhir(self):

# BUILD MORE COMPLEX STRUCTURES
# BUILD MORE COMPLEX DATA STRUCTURES
# Identifier
identifier = []

Expand All @@ -340,8 +340,8 @@ def to_fhir(self):
identifier.append(cns)

# Name
name = {"use": "official",
"text": self.name}
name = [{"use": "official",
"text": self.name}]

# Extensions
extension = []
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/fhir/resource/test_data/patient_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
}
],
"active": true,
"name": {
"name": [
{
"use": "official",
"text": "John Doe"
},
}
],
"telecom": [
{
"system": "phone",
Expand Down

0 comments on commit ac94601

Please sign in to comment.