Skip to content

Commit

Permalink
rdrf #2458 use supplied umrn
Browse files Browse the repository at this point in the history
  • Loading branch information
id2359 committed Apr 26, 2023
1 parent 67ad1c3 commit 63404da
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions rdrf/intframework/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def handle(self) -> Optional[dict]:
logger.info("updating or creating patient from hl7 message data")
registry = Registry.objects.get()
patient = None
umrn = None
umrn = self.umrn
new_patient = None
try:
logger.info("creating message model and field dict ...")
Expand All @@ -259,10 +259,17 @@ def handle(self) -> Optional[dict]:
"where": "getting field_dict",
}

logger.info("getting patient attributes...")
self.patient_attributes = self._parse_demographics_fields(field_dict)
logger.info("getting patient cdes...")
self.patient_cdes = self._parse_cde_fields(field_dict)
# we know the umrn already so no need to do the below?
umrn = self.patient_attributes["umrn"]
if not umrn:
logger.info("no umrn from task - getting from attributes")
umrn = self.patient_attributes.get("umrn", None)
if umrn is None:
logger.info(
f"patient attributes doesn't have umrn: {self.patient_attributes}"
)
logger.info(f"umrn = {umrn}")
if not umrn:
logger.error("UMRN missing or not parsed from patient attributes")
Expand Down

0 comments on commit 63404da

Please sign in to comment.