Skip to content

Commit

Permalink
Update conversion for person_id (#765)
Browse files Browse the repository at this point in the history
update conversion for more gen person_id
  • Loading branch information
m-goggins authored Aug 10, 2023
1 parent 33da3fb commit b67a00e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions phdi/linkage/seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

def convert_to_patient_fhir_resources(data: Dict) -> Tuple:
"""
Converts and returns a row of patient data into patient resource in a FHIR bundle
with a newly generated id as well as the `iris_id`.
Converts and returns a row of patient data into patient resource in a FHIR-formatted
patient resouce with a newly generated patient id as well as the `iris_id`.
:param data: Dictionary of patient data that optionionally includes the following
fields: mrn, ssn, first_name, middle_name, last_name, home_phone, cell-phone, sex,
birthdate, address, city, state, zip.
:return: Tuple of the `iris_id` and FHIR bundle.
:return: Tuple of the `iris_id` and FHIR-formatted patient resource.
"""

patient_id = str(uuid.uuid4())
Expand Down Expand Up @@ -90,5 +90,5 @@ def convert_to_patient_fhir_resources(data: Dict) -> Tuple:
],
}

iris_id = data.get("iris_id", None)
iris_id = data.get("person_id", None)
return (iris_id, fhir_bundle)
Binary file modified tests/assets/linkage/synthetic_patient_mpi_seed_data.parquet
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/linkage/test_seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_convert_to_patient_fhir_resources():
assert returned_fhir_bundle["resourceType"] == "Bundle"
assert returned_fhir_bundle["entry"][0]["resource"]["resourceType"] == "Patient"
assert returned_fhir_bundle["id"] != ""
assert iris_id == data["iris_id"]
assert iris_id == data["person_id"]
assert type(returned_fhir_bundle["entry"][0]["resource"]["name"]) is list
assert (
"urn:uuid:" + returned_fhir_bundle["entry"][0]["resource"]["id"]
Expand Down

0 comments on commit b67a00e

Please # to comment.