microsoft-healthcare-madison / learning-spike-erp

Internal exploration re: tracking resource counts, beds, etc
MIT License
2 stars 2 forks source link

Resource entries missing IDs in some cases #6

Closed barabo closed 4 years ago

barabo commented 4 years ago

For the generated file: Org-1067-groups.json - when I attempt to load it, it seems that the id member of the resource entry is not populated (although my naive code expects it).

LOADING FILE: ./groups.json...
annotating bundle:
Traceback (most recent call last):
  File "./server-loader.py", line 239, in <module>
    main()
  File "/Users/can/Library/Python/3.7/lib/python/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/can/Library/Python/3.7/lib/python/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/can/Library/Python/3.7/lib/python/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/can/Library/Python/3.7/lib/python/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "./server-loader.py", line 235, in main
    server.receive(filename)
  File "./server-loader.py", line 202, in receive
    self.annotate_bundle_entries(resource)
  File "./server-loader.py", line 185, in annotate_bundle_entries
    e['resource']['id']
KeyError: 'id'

From the sample file:

{
  "resourceType": "Bundle",
  "id": "FHIR-1369",
  "identifier": {
    "system": "https://github.com/microsoft-healthcare-madison/learning-spike-erp/",
    "value": "FHIR-1369"
  },
  "type": "collection",
  "timestamp": "2020-03-25T21:04:14.8708261-05:00",
  "entry": [
    {
      "fullUrl": "https://github.com/microsoft-healthcare-madison/learning-spike-erp/Group/",
      "resource": {
        "resourceType": "Group",
        ^^^^ id goes here, maybe?
        "text": {
          "div": "HEALTHSOUTH REHABILITATION HOSPITAL OF ALEXANDRIA Beds of type: ICU (NEGISO) Flagged active & O"
        },
        "type": "device",
GinoCanessa commented 4 years ago

Fixed in 24818e43