Fixup FHIR compliance; add missing resource
nesting
#1045
Annotations
2 errors and 1 warning
/home/runner/work/cosri-patientsearch/cosri-patientsearch/patientsearch/models/sync.py#L164
raise ValueError(f"Expected bundle; can't process {bundle.get('resourceType')}")
for entry in bundle.get("entry"):
# Restrict to what is expected for now
if entry["resource"]["resourceType"] != "Patient":
- raise ValueError(f"Can't sync resourceType {entry['resource']['resourceType']}")
+ raise ValueError(
+ f"Can't sync resourceType {entry['resource']['resourceType']}"
+ )
patient = sync_patient(token, entry["resource"], consider_active)
# TODO handle multiple external matches (if it ever happens!)
# currently returning first
return patient
|
/home/runner/work/cosri-patientsearch/cosri-patientsearch/patientsearch/api.py#L627
# TODO: handle multiple patient results
if external_match_count > 1:
audit_entry("multiple patients returned from PDMP", extra=extra, level="warn")
if external_match_count:
- external_search_bundle["entry"][0]["resource"].setdefault("id", local_fhir_patient["id"])
+ external_search_bundle["entry"][0]["resource"].setdefault(
+ "id", local_fhir_patient["id"]
+ )
message = "PDMP found match" if external_match_count else "fEMR found match"
audit_entry(message, extra=extra)
return jsonify(external_search_bundle)
|
build
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|