You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was the scratch code I had worked on as part of the initial ticket:
def_build_recordTarget(
self,
**kwargs,
# id: str,# root: str = None,# assigningAuthorityName: str = None,# telecom_data: str = None,# addr_data: str = None,# patient_data: str = None,
):
""" Builds a `recordTarget` XML element for recordTarget data, which refers to the medical record of the patient. :param id: recordTarget identifier :param root: recordTarget root :param assigningAuthorityName: recordTarget assigningAuthorityName :param telecom_data: XML data from _build_telecom :param addr_data: XML data from _build_addr :param patient_data: XML data from _build_patient :raises ValueError: recordTarget needs ID to be defined. :return recordTarget_data: XML element of the recordTarget """if"id"notinkwargsorkwargs["id"] isNone:
raiseValueError("The recordTarget id parameter must be a defined.")
# create recordTarget elementrecordTarget_data=ET.Element("recordTarget")
# Create and append 'patientRole' elementpatientRole=ET.Element("patientRole")
recordTarget_data.append(patientRole)
# initialize id data, add data, then append to patientRoleid_element=ET.Element("id")
id_element.set("extension", kwargs["id"])
element_list= ["root", "assigningAuthorityName"]
forid_eleminelement_list:
ifid_eleminkwargs:
id_element.set(id_elem, kwargs[id_elem])
patientRole.append(id_element)
# add address, telecom, patientelement_methods= {
"addr_data": self._build_addr,
"telecom_data": self._build_telecom,
"patient_data": self._build_patient,
}
forelem_key, methodinelement_methods.items():
ifelem_keyinkwargs:
element=method(**kwargs[elem_key])
patientRole.append(element)
The primary benefits to this are that it is a bit more compact and also allows more methods and extensions to be added to recordTarget more seamlessly and without initializing more variables, bringing it more in line with the other methods in the file.
The text was updated successfully, but these errors were encountered:
This would switch the https://github.com/CDCgov/phdi/blob/main/containers/message-parser/app/phdc/phdc.py#L255 logic with two changes in mind:
This was the scratch code I had worked on as part of the initial ticket:
The primary benefits to this are that it is a bit more compact and also allows more methods and extensions to be added to recordTarget more seamlessly and without initializing more variables, bringing it more in line with the other methods in the file.
The text was updated successfully, but these errors were encountered: