Skip to content

Commit

Permalink
chore pretty print
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiagoTrabach committed Sep 1, 2023
1 parent a7f0702 commit 61abf9c
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions run.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
from fhir_utils.utils import json_to_dict
from fhir_utils.fhir.patient.parsers import fhir_to_dict
from fhir_utils.fhir.patient.resource import Patient
from fhir_utils.fhir.merge import compare_resources, merge_resource
from fhir_utils.fhir.merge import compare_resources
from dataclasses import replace, is_dataclass
import pprint


pp = pprint.PrettyPrinter(indent=4)

patient_json = json_to_dict("/home/thiagotrabach/tmp/patient_sample.json")
patient_json2 = json_to_dict("/home/thiagotrabach/tmp/patient_sample2.json")
Expand All @@ -15,22 +19,28 @@
gabriela = Patient(name = patient["name"],
cpf = patient["identifiers"]["tax"],
birth_date = patient["birth_date"],
birth_country = "B",
source ="vitai",
mother = patient["mother"],
father = patient["father"],
gender = "macho")
gender = patient["gender"])

gabriela2 = Patient(name = patient2["name"],
cpf = patient2["identifiers"]["tax"],
birth_date = patient2["birth_date"],
birth_country = "B",
father = "Deus",
source ="vitai" ,
gender = patient2["gender"])
gender = patient2["gender"],
deceased = True,
active = False)


print(compare_resources(gabriela, gabriela2))
#print(compare_resources(gabriela, gabriela2))
pp.pprint(gabriela.compare(gabriela2))
print()
print(gabriela)
abc = gabriela.merge(gabriela2, force_invalid_merge=True)
pp.pprint(abc)
#print(gabriela)
#print(replace(gabriela2, name = "Thiago", birth_date = "1988-01-18"))
#print(is_dataclass(gabriela))

0 comments on commit 61abf9c

Please sign in to comment.