Skip to content

Commit

Permalink
add test to_flat_no_filename
Browse files Browse the repository at this point in the history
  • Loading branch information
pipliggins committed Aug 2, 2024
1 parent 721fd72 commit 226d1c6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_base.py
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
import pandas as pd
import pytest
from pydantic.v1 import ValidationError
from pathlib import Path


def test_flat_fields():
@@ -24,6 +25,23 @@ def test_flat_fields():
]


def test_to_flat_no_filename():
PATIENT_DICT_INPUT = {
"id": "f001",
"active": True,
"name": [{"text": "Micky Mouse"}],
"gender": "male",
"deceasedBoolean": False,
"address": [{"country": "Switzerland"}],
"birthDate": "1996-05-30",
}

p = fhirflat.Patient(**PATIENT_DICT_INPUT)
flat_p = p.to_flat()

assert isinstance(flat_p, pd.Series)


def test_validate_fhirflat_single_resource_errors():
df = pd.DataFrame(
{

0 comments on commit 226d1c6

Please sign in to comment.