opensrp / fhircore

FHIR Core / OpenSRP 2 is a Kotlin application for delivering offline-capable, mobile-first healthcare project implementations from local community to national and international scale using FHIR and WHO Smart Guidelines on Android.
https://smartregister.org
Apache License 2.0
50 stars 39 forks source link

[FHIR Sample Payload] The practitioner details endpoint. #499

Open dubdabasoduba opened 2 years ago

dubdabasoduba commented 2 years ago
{
  "resourceType": "Bundle",
  "id": "799d03a1-b281-496c-bebf-98b18580f491",
  "meta": {
    "lastUpdated": "2021-08-23T14:49:13.118+05:00"
  },
  "type": "searchset",
  "total": 1,
  "link": [
    {
      "relation": "self",
      "url": "http://localhost:8080/fhir/UserDetails?identifier=93bc9c3d-6321-41b0-9b93-1275d7114e21"
    }
  ],
  "entry": [
    {
      "fullUrl": "http://localhost:8080/fhir/UserDetails/Practitioner:123",
      "resource": {
        "resourceType": "UserDetails",
        "id": "Practitioner:123",
        "meta": {
          "profile": [
            "http://hl7.org/fhir/profiles/custom-resource"
          ]
        },
        "keycloak": {
          "user-bio": {
            "sub": "b87ff3c2-cbc6-43e6-b753-a9620756f9e4",
            "email_verified": false,
            "name": "Demo User",
            "preferred_username": "demo",
            "given_name": "Demo",
            "family_name": "User"
          },
          "user-roles": [
            "ROLE_OPENMRS",
            "ROLE_realm-admin",
            "ROLE_EDIT_KEYCLOAK_USERS",
            "ROLE_offline_access",
            "ROLE_User",
            "ROLE_VIEW_KEYCLOAK_USERS",
            "ROLE_uma_authorization",
            "ROLE_ALL_EVENTS",
            "ROLE_PLANS_FOR_USER"
          ]
        },
        "fhir": {
          "teams": [
            {
              "fullUrl": "http://fhir.labs.smartregister.org/fhir/Organization/212",
              "resource": {
                "resourceType": "Organization",
                "id": "212",
                "meta": {
                  "versionId": "3",
                  "lastUpdated": "2021-06-29T02:17:11.870+00:00",
                  "source": "#4f714be1049b0986"
                },
                "identifier": [
                  {
                    "use": "official",
                    "value": "212"
                  }
                ],
                "active": false,
                "name": "My Team"
              },
              "search": {
                "mode": "match"
              }
            },
            {
              "fullUrl": "http://fhir.labs.smartregister.org/fhir/Organization/205",
              "resource": {
                "resourceType": "Organization",
                "id": "205",
                "meta": {
                  "versionId": "2",
                  "lastUpdated": "2021-06-22T08:43:41.801+00:00",
                  "source": "#e4f4daada5b65d9b"
                },
                "identifier": [
                  {
                    "use": "official",
                    "value": "205"
                  }
                ],
                "active": true,
                "name": "test 345"
              },
              "search": {
                "mode": "match"
              }
            }
          ],
          "location-hierarchy": {
            "fullUrl": "http://localhost:8080/fhir/LocationHierarchy/Location Resource:157",
            "resource": {
              "resourceType": "LocationHierarchy",
              "id": "Location Resource:157",
              "meta": {
                "profile": [
                  "http://hl7.org/fhir/profiles/custom-resource"
                ]
              },
              "LocationHierarchyTree": {
                "locationsHierarchy": {
                  "listOfNodes": {
                    "treeNodeId": "Location/157",
                    "treeNode": [
                      {
                        "nodeId": "Location/157",
                        "label": "Root OpenSRP Location",
                        "node": {
                          "resourceType": "Location",
                          "id": "157",
                          "meta": {
                            "versionId": "1",
                            "lastUpdated": "2021-07-27T13:50:09.011+05:00",
                            "source": "#5xz8nvdG3BY5kOPX"
                          },
                          "identifier": [
                            {
                              "use": "official",
                              "value": "93bc9c3d-6321-41b0-9b93-1275d7114e21"
                            }
                          ],
                          "status": "active",
                          "name": "Root OpenSRP Location",
                          "alias": [
                            "root location"
                          ],
                          "description": "An imaginary root location to which all the literal root locations set as their partOf",
                          "physicalType": {
                            "coding": [
                              {
                                "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                "code": "jdn",
                                "display": "Jurisdiction"
                              }
                            ]
                          }
                        },
                        "children": [
                          {
                            "childId": "Location/402",
                            "treeNode": {
                              "nodeId": "Location/402",
                              "node": {
                                "resourceType": "Location",
                                "id": "402",
                                "meta": {
                                  "versionId": "1",
                                  "lastUpdated": "2021-08-16T13:17:41.021+05:00",
                                  "source": "#dAAZicoPylibnwNA"
                                },
                                "identifier": [
                                  {
                                    "use": "official",
                                    "value": "114444413bc9c3d-6321-41b0-9b93-1275d7114e22"
                                  }
                                ],
                                "status": "active",
                                "name": "Child loc - Ona Office Sub Location with partof",
                                "alias": [
                                  "ona office 1"
                                ],
                                "description": "The Sub location where the ona office is located",
                                "physicalType": {
                                  "coding": [
                                    {
                                      "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                      "code": "jdn",
                                      "display": "Jurisdiction"
                                    }
                                  ]
                                },
                                "partOf": {
                                  "reference": "Location/157"
                                }
                              }
                            }
                          },
                          {
                            "childId": "Location/302",
                            "treeNode": {
                              "nodeId": "Location/302",
                              "node": {
                                "resourceType": "Location",
                                "id": "302",
                                "meta": {
                                  "versionId": "1",
                                  "lastUpdated": "2021-08-11T00:29:40.273+05:00",
                                  "source": "#KWe9L5eEBapQTzMH"
                                },
                                "identifier": [
                                  {
                                    "use": "official",
                                    "value": "1113bc9c3d-6321-41b0-9b93-1275d7114e22"
                                  }
                                ],
                                "status": "active",
                                "name": "Ona Office Sub Location without partof",
                                "alias": [
                                  "ona office 1"
                                ],
                                "description": "The Sub location where the ona office is located",
                                "physicalType": {
                                  "coding": [
                                    {
                                      "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                      "code": "jdn",
                                      "display": "Jurisdiction"
                                    }
                                  ]
                                },
                                "partOf": {
                                  "reference": "Location/157"
                                }
                              },
                              "children": [
                                {
                                  "childId": "Location/403",
                                  "treeNode": {
                                    "nodeId": "Location/403",
                                    "node": {
                                      "resourceType": "Location",
                                      "id": "403",
                                      "meta": {
                                        "versionId": "1",
                                        "lastUpdated": "2021-08-16T13:19:52.132+05:00",
                                        "source": "#uUNuTePwEB5GXgPH"
                                      },
                                      "identifier": [
                                        {
                                          "use": "official",
                                          "value": "2114444413bc9c3d-6321-41b0-9b93-1275d7114e22"
                                        }
                                      ],
                                      "status": "active",
                                      "name": "Child loc of 302 - Ona Office Sub Location with partof",
                                      "alias": [
                                        "ona office 1"
                                      ],
                                      "description": "The Sub location where the ona office is located",
                                      "physicalType": {
                                        "coding": [
                                          {
                                            "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                            "code": "jdn",
                                            "display": "Jurisdiction"
                                          }
                                        ]
                                      },
                                      "partOf": {
                                        "reference": "Location/302"
                                      }
                                    }
                                  }
                                },
                                {
                                  "childId": "Location/353",
                                  "treeNode": {
                                    "nodeId": "Location/353",
                                    "node": {
                                      "resourceType": "Location",
                                      "id": "353",
                                      "meta": {
                                        "versionId": "1",
                                        "lastUpdated": "2021-08-11T17:10:46.478+05:00",
                                        "source": "#AP4IvqiV1mTWmBIR"
                                      },
                                      "identifier": [
                                        {
                                          "use": "official",
                                          "value": "4444413bc9c3d-6321-41b0-9b93-1275d7114e22"
                                        }
                                      ],
                                      "status": "active",
                                      "name": "Ona Office Sub Location without partof",
                                      "alias": [
                                        "ona office 1"
                                      ],
                                      "description": "The Sub location where the ona office is located",
                                      "physicalType": {
                                        "coding": [
                                          {
                                            "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                            "code": "jdn",
                                            "display": "Jurisdiction"
                                          }
                                        ]
                                      },
                                      "partOf": {
                                        "reference": "Location/302"
                                      }
                                    }
                                  }
                                },
                                {
                                  "childId": "Location/352",
                                  "treeNode": {
                                    "nodeId": "Location/352",
                                    "node": {
                                      "resourceType": "Location",
                                      "id": "352",
                                      "meta": {
                                        "versionId": "1",
                                        "lastUpdated": "2021-08-11T17:06:23.324+05:00",
                                        "source": "#Er3xYLR2KmwfBv8m"
                                      },
                                      "identifier": [
                                        {
                                          "use": "official",
                                          "value": "4444413bc9c3d-6321-41b0-9b93-1275d7114e22"
                                        }
                                      ],
                                      "status": "active",
                                      "name": "Ona Office Sub Location without partof",
                                      "alias": [
                                        "ona office 1"
                                      ],
                                      "description": "The Sub location where the ona office is located",
                                      "physicalType": {
                                        "coding": [
                                          {
                                            "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                            "code": "jdn",
                                            "display": "Jurisdiction"
                                          }
                                        ]
                                      },
                                      "partOf": {
                                        "reference": "Location/302"
                                      }
                                    }
                                  }
                                }
                              ]
                            }
                          },
                          {
                            "childId": "Location/159",
                            "treeNode": {
                              "nodeId": "Location/159",
                              "node": {
                                "resourceType": "Location",
                                "id": "159",
                                "meta": {
                                  "versionId": "1",
                                  "lastUpdated": "2021-07-27T13:52:47.186+05:00",
                                  "source": "#UdetF6OZlme5bQty"
                                },
                                "identifier": [
                                  {
                                    "use": "official",
                                    "value": "93bac9cqd-6321-41b0-9b93-1275d7111114e22"
                                  }
                                ],
                                "status": "active",
                                "name": "111aOna Office Sub Location with partof",
                                "alias": [
                                  "ona office 11"
                                ],
                                "description": "The Sub location where the ona office is located",
                                "type": [
                                  {
                                    "coding": [
                                      {
                                        "system": "level",
                                        "code": "root",
                                        "display": "Jurisdiction"
                                      },
                                      {
                                        "system": "type",
                                        "code": "District",
                                        "display": "Jurisdiction"
                                      }
                                    ]
                                  }
                                ],
                                "physicalType": {
                                  "coding": [
                                    {
                                      "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                      "code": "jdn",
                                      "display": "Jurisdiction"
                                    }
                                  ]
                                },
                                "partOf": {
                                  "reference": "Location/157"
                                }
                              }
                            }
                          },
                          {
                            "childId": "Location/158",
                            "treeNode": {
                              "nodeId": "Location/158",
                              "node": {
                                "resourceType": "Location",
                                "id": "158",
                                "meta": {
                                  "versionId": "1",
                                  "lastUpdated": "2021-07-27T13:52:39.299+05:00",
                                  "source": "#9E875nFL4uTN0Jbz"
                                },
                                "identifier": [
                                  {
                                    "use": "official",
                                    "value": "93bc9cqd-6321-41b0-9b93-1275d7111114e22"
                                  }
                                ],
                                "status": "active",
                                "name": "111Ona Office Sub Location with partof",
                                "alias": [
                                  "ona office 11"
                                ],
                                "description": "The Sub location where the ona office is located",
                                "type": [
                                  {
                                    "coding": [
                                      {
                                        "system": "level",
                                        "code": "root",
                                        "display": "Jurisdiction"
                                      },
                                      {
                                        "system": "type",
                                        "code": "District",
                                        "display": "Jurisdiction"
                                      }
                                    ]
                                  }
                                ],
                                "physicalType": {
                                  "coding": [
                                    {
                                      "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                      "code": "jdn",
                                      "display": "Jurisdiction"
                                    }
                                  ]
                                },
                                "partOf": {
                                  "reference": "Location/157"
                                }
                              }
                            }
                          }
                        ]
                      }
                    ]
                  },
                  "parentChildren": [
                    {
                      "identifier": "Location/157",
                      "childIdentifiers": [
                        "Location/158/_history/1"
                      ]
                    },
                    {
                      "identifier": "Location/302",
                      "childIdentifiers": [
                        "Location/403/_history/1",
                        "Location/353/_history/1",
                        "Location/352/_history/1"
                      ]
                    }
                  ]
                }
              },
              "locationId": "157"
            }
          }
        },
        "config": []
      }
    }
  ]
}
rehammuzzamil commented 2 years ago

@RaaziaTarique Please note care teams will also be a part of the response payload. The response will be altered now to include CareTeams as well. cc: @dubdabasoduba @f-odhiambo

rehammuzzamil commented 2 years ago

Here is the updated response payload @RaaziaTarique


{
    "resourceType": "Bundle",
    "id": "c9a9547b-8fc9-45ea-a023-3c55ca9a1c66",
    "meta": {
        "lastUpdated": "2022-01-04T14:59:36.734+05:00"
    },
    "type": "searchset",
    "total": 1,
    "link": [
        {
            "relation": "self",
            "url": "http://localhost:8080/fhir/practitioner-details?keycloak-uuid=de9ad01f-c485-4da4-9a81-284518e103c1"
        }
    ],
    "entry": [
        {
            "fullUrl": "http://localhost:8080/fhir/practitioner-details/de9ad01f-c485-4da4-9a81-284518e103c1",
            "resource": {
                "resourceType": "practitioner-details",
                "id": "de9ad01f-c485-4da4-9a81-284518e103c1",
                "meta": {
                    "profile": [
                        "http://hl7.org/fhir/profiles/custom-resource"
                    ]
                },
                "KeycloakUserDetails": {
                    "id": "de9ad01f-c485-4da4-9a81-284518e103c1",
                    "user-bio": [
                        {
                            "identifier": "de9ad01f-c485-4da4-9a81-284518e103c1",
                            "preferredName": "practitionera",
                            "familyName": "Tester",
                            "givenName": "Practitioner A",
                            "emailVerified": "false"
                        }
                    ],
                    "user-roles": [
                        "ROLE_offline_access",
                        "ROLE_default-roles-fhir-core",
                        "ROLE_uma_authorization"
                    ]
                },
                "fhir": {
                    "id": "152",
                    "careteams": [
                        {
                            "resourceType": "CareTeam",
                            "id": "208",
                            "meta": {
                                "versionId": "1",
                                "profile": [
                                    "http://hl7.org/fhir/StructureDefinition/CareTeam"
                                ]
                            },
                            "identifier": [
                                {
                                    "use": "official",
                                    "value": "a2788d06-fdad-4a74-90ac-3ac4e243eee5"
                                }
                            ],
                            "status": "active",
                            "name": "Care team test",
                            "subject": {
                                "reference": "Group/206",
                                "display": "Demo FHIR Groups"
                            },
                            "participant": [
                                {
                                    "member": {
                                        "reference": "Practitioner/152",
                                        "display": "Practitioner A Tester"
                                    }
                                }
                            ]
                        }
                    ],
                    "teams": [
                        {
                            "resourceType": "Organization",
                            "id": "202",
                            "meta": {
                                "versionId": "1",
                                "profile": [
                                    "http://hl7.org/fhir/StructureDefinition/Organization"
                                ]
                            },
                            "identifier": [
                                {
                                    "use": "official",
                                    "value": "26a37c67-6e91-4457-b8e2-a23b4a52198b"
                                }
                            ],
                            "active": true,
                            "name": "Test Team"
                        }
                    ],
                    "locationHierarchyList": [
                        {
                            "resourceType": "LocationHierarchy",
                            "id": "Location Resource : 53",
                            "meta": {
                                "profile": [
                                    "http://hl7.org/fhir/profiles/custom-resource"
                                ]
                            },
                            "LocationHierarchyTree": {
                                "locationsHierarchy": {
                                    "listOfNodes": {
                                        "treeNodeId": "Location/53",
                                        "treeNode": [
                                            {
                                                "nodeId": "Location/53",
                                                "label": "MOH LOCATION",
                                                "node": {
                                                    "resourceType": "Location",
                                                    "id": "53",
                                                    "meta": {
                                                        "versionId": "1",
                                                        "lastUpdated": "2021-10-26T17:22:31.920+05:00",
                                                        "source": "#DjDPQjLcLwi7XJEi"
                                                    },
                                                    "identifier": [
                                                        {
                                                            "use": "official",
                                                            "value": "1815f774-c85b-4bb1-825d-f6af11753d08"
                                                        }
                                                    ],
                                                    "status": "active",
                                                    "name": "MOH LOCATION",
                                                    "alias": [
                                                        "MOH LOCATION"
                                                    ],
                                                    "description": "MOH LOCATION",
                                                    "physicalType": {
                                                        "coding": [
                                                            {
                                                                "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                "code": "jdn",
                                                                "display": "Jurisdiction"
                                                            }
                                                        ]
                                                    },
                                                    "partOf": {
                                                        "reference": "Location/52",
                                                        "display": "MOH LOCATION"
                                                    }
                                                },
                                                "parent": "Location/52",
                                                "children": [
                                                    {
                                                        "childId": "Location/54",
                                                        "treeNode": {
                                                            "nodeId": "Location/54",
                                                            "label": "MOH LOCATION A",
                                                            "node": {
                                                                "resourceType": "Location",
                                                                "id": "54",
                                                                "meta": {
                                                                    "versionId": "1",
                                                                    "lastUpdated": "2021-10-26T17:27:13.123+05:00",
                                                                    "source": "#VOXtERDYSQ8Uderw"
                                                                },
                                                                "identifier": [
                                                                    {
                                                                        "use": "official",
                                                                        "value": "11815f774-c85b-4bb1-825d-f6af11753d08"
                                                                    }
                                                                ],
                                                                "status": "active",
                                                                "name": "MOH LOCATION A",
                                                                "alias": [
                                                                    "MOH LOCATION A"
                                                                ],
                                                                "description": "MOH LOCATION A",
                                                                "physicalType": {
                                                                    "coding": [
                                                                        {
                                                                            "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                            "code": "jdn",
                                                                            "display": "Jurisdiction"
                                                                        }
                                                                    ]
                                                                },
                                                                "partOf": {
                                                                    "reference": "Location/53",
                                                                    "display": "MOH LOCATION A"
                                                                }
                                                            },
                                                            "parent": "Location/53",
                                                            "children": [
                                                                {
                                                                    "childId": "Location/56",
                                                                    "treeNode": {
                                                                        "nodeId": "Location/56",
                                                                        "label": "MOH SUB LOCATION A",
                                                                        "node": {
                                                                            "resourceType": "Location",
                                                                            "id": "56",
                                                                            "meta": {
                                                                                "versionId": "1",
                                                                                "lastUpdated": "2021-10-26T17:31:40.281+05:00",
                                                                                "source": "#1H0BbzEsy5sxLORq"
                                                                            },
                                                                            "identifier": [
                                                                                {
                                                                                    "use": "official",
                                                                                    "value": "31815f774-c85b-4bb1-825d-f6af11753d08"
                                                                                }
                                                                            ],
                                                                            "status": "active",
                                                                            "name": "MOH SUB LOCATION A",
                                                                            "alias": [
                                                                                "MOH SUB LOCATION A"
                                                                            ],
                                                                            "description": "MOH SUB LOCATION A",
                                                                            "physicalType": {
                                                                                "coding": [
                                                                                    {
                                                                                        "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                                        "code": "jdn",
                                                                                        "display": "Jurisdiction"
                                                                                    }
                                                                                ]
                                                                            },
                                                                            "partOf": {
                                                                                "reference": "Location/54",
                                                                                "display": "MOH SUB LOCATION A"
                                                                            }
                                                                        },
                                                                        "parent": "Location/54",
                                                                        "children": [
                                                                            {
                                                                                "childId": "Location/103",
                                                                                "treeNode": {
                                                                                    "nodeId": "Location/103",
                                                                                    "label": "MOH SUB SUB LOCATION A 576",
                                                                                    "node": {
                                                                                        "resourceType": "Location",
                                                                                        "id": "103",
                                                                                        "meta": {
                                                                                            "versionId": "1",
                                                                                            "lastUpdated": "2021-11-01T15:38:36.308+05:00",
                                                                                            "source": "#rnsIaXrtIZx3gqYv"
                                                                                        },
                                                                                        "identifier": [
                                                                                            {
                                                                                                "use": "official",
                                                                                                "value": "61815f774-c85b-4bb1-825d-f6af11753d08"
                                                                                            }
                                                                                        ],
                                                                                        "status": "active",
                                                                                        "name": "MOH SUB SUB LOCATION A 576",
                                                                                        "alias": [
                                                                                            "MOH SUB SUB LOCATION A"
                                                                                        ],
                                                                                        "description": "MOH SUB SUB LOCATION A",
                                                                                        "physicalType": {
                                                                                            "coding": [
                                                                                                {
                                                                                                    "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                                                    "code": "jdn",
                                                                                                    "display": "Jurisdiction"
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        "partOf": {
                                                                                            "reference": "Location/56",
                                                                                            "display": "MOH SUB SUB LOCATION A"
                                                                                        }
                                                                                    },
                                                                                    "parent": "Location/56"
                                                                                }
                                                                            },
                                                                            {
                                                                                "childId": "Location/104",
                                                                                "treeNode": {
                                                                                    "nodeId": "Location/104",
                                                                                    "label": "MOH SUB SUB LOCATION A2 576",
                                                                                    "node": {
                                                                                        "resourceType": "Location",
                                                                                        "id": "104",
                                                                                        "meta": {
                                                                                            "versionId": "1",
                                                                                            "lastUpdated": "2021-11-01T15:43:46.797+05:00",
                                                                                            "source": "#Px2mwp7dsHSU2NW8"
                                                                                        },
                                                                                        "identifier": [
                                                                                            {
                                                                                                "use": "official",
                                                                                                "value": "71815f774-c85b-4bb1-825d-f6af11753d08"
                                                                                            }
                                                                                        ],
                                                                                        "status": "active",
                                                                                        "name": "MOH SUB SUB LOCATION A2 576",
                                                                                        "alias": [
                                                                                            "MOH SUB SUB LOCATION A2"
                                                                                        ],
                                                                                        "description": "MOH SUB SUB LOCATION A2",
                                                                                        "physicalType": {
                                                                                            "coding": [
                                                                                                {
                                                                                                    "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                                                    "code": "jdn",
                                                                                                    "display": "Jurisdiction"
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        "partOf": {
                                                                                            "reference": "Location/56",
                                                                                            "display": "MOH SUB SUB LOCATION A2"
                                                                                        }
                                                                                    },
                                                                                    "parent": "Location/56"
                                                                                }
                                                                            }
                                                                        ]
                                                                    }
                                                                },
                                                                {
                                                                    "childId": "Location/105",
                                                                    "treeNode": {
                                                                        "nodeId": "Location/105",
                                                                        "label": "MOH SUB LOCATION A2",
                                                                        "node": {
                                                                            "resourceType": "Location",
                                                                            "id": "105",
                                                                            "meta": {
                                                                                "versionId": "1",
                                                                                "lastUpdated": "2021-11-01T15:45:22.527+05:00",
                                                                                "source": "#mIYatqaJ12D8WhCg"
                                                                            },
                                                                            "identifier": [
                                                                                {
                                                                                    "use": "official",
                                                                                    "value": "131815f774-c85b-4bb1-825d-f6af11753d08"
                                                                                }
                                                                            ],
                                                                            "status": "active",
                                                                            "name": "MOH SUB LOCATION A2",
                                                                            "alias": [
                                                                                "MOH SUB LOCATION A2"
                                                                            ],
                                                                            "description": "MOH SUB LOCATION A2",
                                                                            "physicalType": {
                                                                                "coding": [
                                                                                    {
                                                                                        "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                                        "code": "jdn",
                                                                                        "display": "Jurisdiction"
                                                                                    }
                                                                                ]
                                                                            },
                                                                            "partOf": {
                                                                                "reference": "Location/54",
                                                                                "display": "MOH SUB LOCATION A2"
                                                                            }
                                                                        },
                                                                        "parent": "Location/54",
                                                                        "children": [
                                                                            {
                                                                                "childId": "Location/106",
                                                                                "treeNode": {
                                                                                    "nodeId": "Location/106",
                                                                                    "label": "105 sub loc",
                                                                                    "node": {
                                                                                        "resourceType": "Location",
                                                                                        "id": "106",
                                                                                        "meta": {
                                                                                            "versionId": "1",
                                                                                            "lastUpdated": "2021-11-01T15:46:06.234+05:00",
                                                                                            "source": "#GLCR9UZXpvhGFOhj"
                                                                                        },
                                                                                        "identifier": [
                                                                                            {
                                                                                                "use": "official",
                                                                                                "value": "171815f774-c85b-4bb1-825d-f6af11753d08"
                                                                                            }
                                                                                        ],
                                                                                        "status": "active",
                                                                                        "name": "105 sub loc",
                                                                                        "alias": [
                                                                                            "105 sub loc"
                                                                                        ],
                                                                                        "description": "105 sub loc",
                                                                                        "physicalType": {
                                                                                            "coding": [
                                                                                                {
                                                                                                    "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                                                    "code": "jdn",
                                                                                                    "display": "Jurisdiction"
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        "partOf": {
                                                                                            "reference": "Location/105",
                                                                                            "display": "105 sub loc"
                                                                                        }
                                                                                    },
                                                                                    "parent": "Location/105"
                                                                                }
                                                                            }
                                                                        ]
                                                                    }
                                                                }
                                                            ]
                                                        }
                                                    },
                                                    {
                                                        "childId": "Location/55",
                                                        "treeNode": {
                                                            "nodeId": "Location/55",
                                                            "label": "MOH LOCATION B",
                                                            "node": {
                                                                "resourceType": "Location",
                                                                "id": "55",
                                                                "meta": {
                                                                    "versionId": "1",
                                                                    "lastUpdated": "2021-10-26T17:27:18.601+05:00",
                                                                    "source": "#l5GFpmt8940pQMuP"
                                                                },
                                                                "identifier": [
                                                                    {
                                                                        "use": "official",
                                                                        "value": "21815f774-c85b-4bb1-825d-f6af11753d08"
                                                                    }
                                                                ],
                                                                "status": "active",
                                                                "name": "MOH LOCATION B",
                                                                "alias": [
                                                                    "MOH LOCATION B"
                                                                ],
                                                                "description": "MOH LOCATION B",
                                                                "physicalType": {
                                                                    "coding": [
                                                                        {
                                                                            "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                            "code": "jdn",
                                                                            "display": "Jurisdiction"
                                                                        }
                                                                    ]
                                                                },
                                                                "partOf": {
                                                                    "reference": "Location/53",
                                                                    "display": "MOH LOCATION B"
                                                                }
                                                            },
                                                            "parent": "Location/53",
                                                            "children": [
                                                                {
                                                                    "childId": "Location/57",
                                                                    "treeNode": {
                                                                        "nodeId": "Location/57",
                                                                        "label": "MOH SUB LOCATION B",
                                                                        "node": {
                                                                            "resourceType": "Location",
                                                                            "id": "57",
                                                                            "meta": {
                                                                                "versionId": "1",
                                                                                "lastUpdated": "2021-10-26T17:31:49.553+05:00",
                                                                                "source": "#rE7hvl7dXtLX9bwC"
                                                                            },
                                                                            "identifier": [
                                                                                {
                                                                                    "use": "official",
                                                                                    "value": "41815f774-c85b-4bb1-825d-f6af11753d08"
                                                                                }
                                                                            ],
                                                                            "status": "active",
                                                                            "name": "MOH SUB LOCATION B",
                                                                            "alias": [
                                                                                "MOH SUB LOCATION B"
                                                                            ],
                                                                            "description": "MOH SUB LOCATION B",
                                                                            "physicalType": {
                                                                                "coding": [
                                                                                    {
                                                                                        "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                                        "code": "jdn",
                                                                                        "display": "Jurisdiction"
                                                                                    }
                                                                                ]
                                                                            },
                                                                            "partOf": {
                                                                                "reference": "Location/55",
                                                                                "display": "MOH SUB LOCATION B"
                                                                            }
                                                                        },
                                                                        "parent": "Location/55",
                                                                        "children": [
                                                                            {
                                                                                "childId": "Location/102",
                                                                                "treeNode": {
                                                                                    "nodeId": "Location/102",
                                                                                    "label": "MOH SUB SUB LOCATION B 577",
                                                                                    "node": {
                                                                                        "resourceType": "Location",
                                                                                        "id": "102",
                                                                                        "meta": {
                                                                                            "versionId": "1",
                                                                                            "lastUpdated": "2021-11-01T15:37:42.517+05:00",
                                                                                            "source": "#IAdRmL0t29wpNHUK"
                                                                                        },
                                                                                        "identifier": [
                                                                                            {
                                                                                                "use": "official",
                                                                                                "value": "51815f774-c85b-4bb1-825d-f6af11753d08"
                                                                                            }
                                                                                        ],
                                                                                        "status": "active",
                                                                                        "name": "MOH SUB SUB LOCATION B 577",
                                                                                        "alias": [
                                                                                            "MOH SUB SUB LOCATION B"
                                                                                        ],
                                                                                        "description": "MOH SUB SUB LOCATION B",
                                                                                        "physicalType": {
                                                                                            "coding": [
                                                                                                {
                                                                                                    "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                                                    "code": "jdn",
                                                                                                    "display": "Jurisdiction"
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        "partOf": {
                                                                                            "reference": "Location/57",
                                                                                            "display": "MOH SUB SUB LOCATION B"
                                                                                        }
                                                                                    },
                                                                                    "parent": "Location/57"
                                                                                }
                                                                            }
                                                                        ]
                                                                    }
                                                                }
                                                            ]
                                                        }
                                                    }
                                                ]
                                            }
                                        ]
                                    },
                                    "parentChildren": [
                                        {
                                            "identifier": "Location/52",
                                            "childIdentifiers": [
                                                "Location/53"
                                            ]
                                        },
                                        {
                                            "identifier": "Location/53",
                                            "childIdentifiers": [
                                                "Location/54",
                                                "Location/55"
                                            ]
                                        },
                                        {
                                            "identifier": "Location/54",
                                            "childIdentifiers": [
                                                "Location/56",
                                                "Location/105"
                                            ]
                                        },
                                        {
                                            "identifier": "Location/56",
                                            "childIdentifiers": [
                                                "Location/103",
                                                "Location/104"
                                            ]
                                        },
                                        {
                                            "identifier": "Location/105",
                                            "childIdentifiers": [
                                                "Location/106"
                                            ]
                                        },
                                        {
                                            "identifier": "Location/55",
                                            "childIdentifiers": [
                                                "Location/57"
                                            ]
                                        },
                                        {
                                            "identifier": "Location/57",
                                            "childIdentifiers": [
                                                "Location/102"
                                            ]
                                        }
                                    ]
                                }
                            },
                            "locationId": "53"
                        }
                    ],
                    "practitionerId": [
                        "152"
                    ]
                }
            }
        }
    ]
}

cc : @f-odhiambo @dubdabasoduba @maimoonak

pld commented 2 years ago

is the fhir key something we use elsewhere? is there a standard that is based on? Sorry for the delayed follow up, I'm sure I'm missing some context here

rehammuzzamil commented 2 years ago

is the fhir key something we use elsewhere? is there a standard that is based on? Sorry for the delayed follow up, I'm sure I'm missing some context here

I believe the idea of using the fhir key is to denote all the resources fetched from the HAPI FHIR Server. Because the response payload includes both keycloak and HAPI FHIR server responses.

dubdabasoduba commented 2 years ago

@rehammuzzamil Are we pulling careteams too? we also need to show the careteams the practitioner is assigned to.

rehammuzzamil commented 2 years ago

Yes, @dubdabasoduba We are including care teams too in the response payload. Here is the updated response payload structure https://github.com/opensrp/fhircore/issues/499#issuecomment-1004757919 .

dubdabasoduba commented 2 years ago

Awesome.

rehammuzzamil commented 2 years ago
{
    "resourceType": "Bundle",
    "id": "c8d44022-6a03-430b-8a9a-c27506a9fe56",
    "meta": {
        "lastUpdated": "2022-02-08T17:03:42.434+05:00"
    },
    "type": "searchset",
    "total": 1,
    "link": [
        {
            "relation": "self",
            "url": "http://localhost:8080/fhir/practitioner-details?keycloak-uuid=de9ad01f-c485-4da4-9a81-284518e103c1"
        }
    ],
    "entry": [
        {
            "fullUrl": "http://localhost:8080/fhir/practitioner-details/de9ad01f-c485-4da4-9a81-284518e103c1",
            "resource": {
                "resourceType": "practitioner-details",
                "id": "de9ad01f-c485-4da4-9a81-284518e103c1",
                "meta": {
                    "profile": [
                        "http://hl7.org/fhir/profiles/custom-resource"
                    ]
                },
                "KeycloakUserDetails": {
                    "id": "de9ad01f-c485-4da4-9a81-284518e103c1",
                    "user-bio": [
                        {
                            "identifier": "de9ad01f-c485-4da4-9a81-284518e103c1",
                            "userName": "practitionera",
                            "preferredName": "practitionera",
                            "familyName": "Tester",
                            "givenName": "Practitioner A",
                            "emailVerified": "false"
                        }
                    ],
                    "user-roles": [
                        "ROLE_offline_access",
                        "ROLE_default-roles-fhir-core",
                        "ROLE_uma_authorization"
                    ]
                },
                "fhir": {
                    "id": "152",
                    "careteams": [
                        {
                            "resourceType": "CareTeam",
                            "id": "208",
                            "meta": {
                                "versionId": "1",
                                "lastUpdated": "2021-12-23T20:22:25.335+05:00",
                                "source": "#67aCvwkaE7B37IZf"
                            },
                            "identifier": [
                                {
                                    "use": "official",
                                    "value": "a2788d06-fdad-4a74-90ac-3ac4e243eee5"
                                }
                            ],
                            "status": "active",
                            "name": "Care team test",
                            "subject": {
                                "reference": "Group/206",
                                "display": "Demo FHIR Groups"
                            },
                            "participant": [
                                {
                                    "member": {
                                        "reference": "Practitioner/152",
                                        "display": "Practitioner A Tester"
                                    }
                                }
                            ]
                        }
                    ],
                    "teams": [
                        {
                            "resourceType": "Organization",
                            "id": "202",
                            "meta": {
                                "versionId": "1",
                                "lastUpdated": "2021-12-23T20:11:43.789+05:00",
                                "source": "#JnVDNQcKeXLllwrN"
                            },
                            "identifier": [
                                {
                                    "use": "official",
                                    "value": "26a37c67-6e91-4457-b8e2-a23b4a52198b"
                                }
                            ],
                            "active": true,
                            "name": "Test Team"
                        }
                    ],
                    "locations": [
                        {
                            "resourceType": "Location",
                            "id": "53",
                            "meta": {
                                "versionId": "1",
                                "lastUpdated": "2021-10-26T17:22:31.920+05:00",
                                "source": "#DjDPQjLcLwi7XJEi"
                            },
                            "identifier": [
                                {
                                    "use": "official",
                                    "value": "1815f774-c85b-4bb1-825d-f6af11753d08"
                                }
                            ],
                            "status": "active",
                            "name": "MOH LOCATION",
                            "alias": [
                                "MOH LOCATION"
                            ],
                            "description": "MOH LOCATION",
                            "physicalType": {
                                "coding": [
                                    {
                                        "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                        "code": "jdn",
                                        "display": "Jurisdiction"
                                    }
                                ]
                            },
                            "partOf": {
                                "reference": "Location/52",
                                "display": "MOH LOCATION"
                            }
                        }
                    ],
                    "locationHierarchyList": [
                        {
                            "resourceType": "LocationHierarchy",
                            "id": "Location Resource : 53",
                            "meta": {
                                "profile": [
                                    "http://hl7.org/fhir/profiles/custom-resource"
                                ]
                            },
                            "LocationHierarchyTree": {
                                "locationsHierarchy": {
                                    "listOfNodes": {
                                        "treeNodeId": "Location/53",
                                        "treeNode": [
                                            {
                                                "nodeId": "Location/53",
                                                "label": "MOH LOCATION",
                                                "node": {
                                                    "resourceType": "Location",
                                                    "id": "53",
                                                    "meta": {
                                                        "versionId": "1",
                                                        "lastUpdated": "2021-10-26T17:22:31.920+05:00",
                                                        "source": "#DjDPQjLcLwi7XJEi"
                                                    },
                                                    "identifier": [
                                                        {
                                                            "use": "official",
                                                            "value": "1815f774-c85b-4bb1-825d-f6af11753d08"
                                                        }
                                                    ],
                                                    "status": "active",
                                                    "name": "MOH LOCATION",
                                                    "alias": [
                                                        "MOH LOCATION"
                                                    ],
                                                    "description": "MOH LOCATION",
                                                    "physicalType": {
                                                        "coding": [
                                                            {
                                                                "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                "code": "jdn",
                                                                "display": "Jurisdiction"
                                                            }
                                                        ]
                                                    },
                                                    "partOf": {
                                                        "reference": "Location/52",
                                                        "display": "MOH LOCATION"
                                                    }
                                                },
                                                "parent": "Location/52",
                                                "children": [
                                                    {
                                                        "childId": "Location/54",
                                                        "treeNode": {
                                                            "nodeId": "Location/54",
                                                            "label": "MOH LOCATION A",
                                                            "node": {
                                                                "resourceType": "Location",
                                                                "id": "54",
                                                                "meta": {
                                                                    "versionId": "1",
                                                                    "lastUpdated": "2021-10-26T17:27:13.123+05:00",
                                                                    "source": "#VOXtERDYSQ8Uderw"
                                                                },
                                                                "identifier": [
                                                                    {
                                                                        "use": "official",
                                                                        "value": "11815f774-c85b-4bb1-825d-f6af11753d08"
                                                                    }
                                                                ],
                                                                "status": "active",
                                                                "name": "MOH LOCATION A",
                                                                "alias": [
                                                                    "MOH LOCATION A"
                                                                ],
                                                                "description": "MOH LOCATION A",
                                                                "physicalType": {
                                                                    "coding": [
                                                                        {
                                                                            "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                            "code": "jdn",
                                                                            "display": "Jurisdiction"
                                                                        }
                                                                    ]
                                                                },
                                                                "partOf": {
                                                                    "reference": "Location/53",
                                                                    "display": "MOH LOCATION A"
                                                                }
                                                            },
                                                            "parent": "Location/53",
                                                            "children": [
                                                                {
                                                                    "childId": "Location/56",
                                                                    "treeNode": {
                                                                        "nodeId": "Location/56",
                                                                        "label": "MOH SUB LOCATION A",
                                                                        "node": {
                                                                            "resourceType": "Location",
                                                                            "id": "56",
                                                                            "meta": {
                                                                                "versionId": "1",
                                                                                "lastUpdated": "2021-10-26T17:31:40.281+05:00",
                                                                                "source": "#1H0BbzEsy5sxLORq"
                                                                            },
                                                                            "identifier": [
                                                                                {
                                                                                    "use": "official",
                                                                                    "value": "31815f774-c85b-4bb1-825d-f6af11753d08"
                                                                                }
                                                                            ],
                                                                            "status": "active",
                                                                            "name": "MOH SUB LOCATION A",
                                                                            "alias": [
                                                                                "MOH SUB LOCATION A"
                                                                            ],
                                                                            "description": "MOH SUB LOCATION A",
                                                                            "physicalType": {
                                                                                "coding": [
                                                                                    {
                                                                                        "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                                        "code": "jdn",
                                                                                        "display": "Jurisdiction"
                                                                                    }
                                                                                ]
                                                                            },
                                                                            "partOf": {
                                                                                "reference": "Location/54",
                                                                                "display": "MOH SUB LOCATION A"
                                                                            }
                                                                        },
                                                                        "parent": "Location/54",
                                                                        "children": [
                                                                            {
                                                                                "childId": "Location/103",
                                                                                "treeNode": {
                                                                                    "nodeId": "Location/103",
                                                                                    "label": "MOH SUB SUB LOCATION A 576",
                                                                                    "node": {
                                                                                        "resourceType": "Location",
                                                                                        "id": "103",
                                                                                        "meta": {
                                                                                            "versionId": "1",
                                                                                            "lastUpdated": "2021-11-01T15:38:36.308+05:00",
                                                                                            "source": "#rnsIaXrtIZx3gqYv"
                                                                                        },
                                                                                        "identifier": [
                                                                                            {
                                                                                                "use": "official",
                                                                                                "value": "61815f774-c85b-4bb1-825d-f6af11753d08"
                                                                                            }
                                                                                        ],
                                                                                        "status": "active",
                                                                                        "name": "MOH SUB SUB LOCATION A 576",
                                                                                        "alias": [
                                                                                            "MOH SUB SUB LOCATION A"
                                                                                        ],
                                                                                        "description": "MOH SUB SUB LOCATION A",
                                                                                        "physicalType": {
                                                                                            "coding": [
                                                                                                {
                                                                                                    "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                                                    "code": "jdn",
                                                                                                    "display": "Jurisdiction"
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        "partOf": {
                                                                                            "reference": "Location/56",
                                                                                            "display": "MOH SUB SUB LOCATION A"
                                                                                        }
                                                                                    },
                                                                                    "parent": "Location/56"
                                                                                }
                                                                            },
                                                                            {
                                                                                "childId": "Location/104",
                                                                                "treeNode": {
                                                                                    "nodeId": "Location/104",
                                                                                    "label": "MOH SUB SUB LOCATION A2 576",
                                                                                    "node": {
                                                                                        "resourceType": "Location",
                                                                                        "id": "104",
                                                                                        "meta": {
                                                                                            "versionId": "1",
                                                                                            "lastUpdated": "2021-11-01T15:43:46.797+05:00",
                                                                                            "source": "#Px2mwp7dsHSU2NW8"
                                                                                        },
                                                                                        "identifier": [
                                                                                            {
                                                                                                "use": "official",
                                                                                                "value": "71815f774-c85b-4bb1-825d-f6af11753d08"
                                                                                            }
                                                                                        ],
                                                                                        "status": "active",
                                                                                        "name": "MOH SUB SUB LOCATION A2 576",
                                                                                        "alias": [
                                                                                            "MOH SUB SUB LOCATION A2"
                                                                                        ],
                                                                                        "description": "MOH SUB SUB LOCATION A2",
                                                                                        "physicalType": {
                                                                                            "coding": [
                                                                                                {
                                                                                                    "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                                                    "code": "jdn",
                                                                                                    "display": "Jurisdiction"
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        "partOf": {
                                                                                            "reference": "Location/56",
                                                                                            "display": "MOH SUB SUB LOCATION A2"
                                                                                        }
                                                                                    },
                                                                                    "parent": "Location/56"
                                                                                }
                                                                            }
                                                                        ]
                                                                    }
                                                                },
                                                                {
                                                                    "childId": "Location/105",
                                                                    "treeNode": {
                                                                        "nodeId": "Location/105",
                                                                        "label": "MOH SUB LOCATION A2",
                                                                        "node": {
                                                                            "resourceType": "Location",
                                                                            "id": "105",
                                                                            "meta": {
                                                                                "versionId": "1",
                                                                                "lastUpdated": "2021-11-01T15:45:22.527+05:00",
                                                                                "source": "#mIYatqaJ12D8WhCg"
                                                                            },
                                                                            "identifier": [
                                                                                {
                                                                                    "use": "official",
                                                                                    "value": "131815f774-c85b-4bb1-825d-f6af11753d08"
                                                                                }
                                                                            ],
                                                                            "status": "active",
                                                                            "name": "MOH SUB LOCATION A2",
                                                                            "alias": [
                                                                                "MOH SUB LOCATION A2"
                                                                            ],
                                                                            "description": "MOH SUB LOCATION A2",
                                                                            "physicalType": {
                                                                                "coding": [
                                                                                    {
                                                                                        "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                                        "code": "jdn",
                                                                                        "display": "Jurisdiction"
                                                                                    }
                                                                                ]
                                                                            },
                                                                            "partOf": {
                                                                                "reference": "Location/54",
                                                                                "display": "MOH SUB LOCATION A2"
                                                                            }
                                                                        },
                                                                        "parent": "Location/54",
                                                                        "children": [
                                                                            {
                                                                                "childId": "Location/106",
                                                                                "treeNode": {
                                                                                    "nodeId": "Location/106",
                                                                                    "label": "105 sub loc",
                                                                                    "node": {
                                                                                        "resourceType": "Location",
                                                                                        "id": "106",
                                                                                        "meta": {
                                                                                            "versionId": "1",
                                                                                            "lastUpdated": "2021-11-01T15:46:06.234+05:00",
                                                                                            "source": "#GLCR9UZXpvhGFOhj"
                                                                                        },
                                                                                        "identifier": [
                                                                                            {
                                                                                                "use": "official",
                                                                                                "value": "171815f774-c85b-4bb1-825d-f6af11753d08"
                                                                                            }
                                                                                        ],
                                                                                        "status": "active",
                                                                                        "name": "105 sub loc",
                                                                                        "alias": [
                                                                                            "105 sub loc"
                                                                                        ],
                                                                                        "description": "105 sub loc",
                                                                                        "physicalType": {
                                                                                            "coding": [
                                                                                                {
                                                                                                    "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                                                    "code": "jdn",
                                                                                                    "display": "Jurisdiction"
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        "partOf": {
                                                                                            "reference": "Location/105",
                                                                                            "display": "105 sub loc"
                                                                                        }
                                                                                    },
                                                                                    "parent": "Location/105"
                                                                                }
                                                                            }
                                                                        ]
                                                                    }
                                                                }
                                                            ]
                                                        }
                                                    },
                                                    {
                                                        "childId": "Location/55",
                                                        "treeNode": {
                                                            "nodeId": "Location/55",
                                                            "label": "MOH LOCATION B",
                                                            "node": {
                                                                "resourceType": "Location",
                                                                "id": "55",
                                                                "meta": {
                                                                    "versionId": "1",
                                                                    "lastUpdated": "2021-10-26T17:27:18.601+05:00",
                                                                    "source": "#l5GFpmt8940pQMuP"
                                                                },
                                                                "identifier": [
                                                                    {
                                                                        "use": "official",
                                                                        "value": "21815f774-c85b-4bb1-825d-f6af11753d08"
                                                                    }
                                                                ],
                                                                "status": "active",
                                                                "name": "MOH LOCATION B",
                                                                "alias": [
                                                                    "MOH LOCATION B"
                                                                ],
                                                                "description": "MOH LOCATION B",
                                                                "physicalType": {
                                                                    "coding": [
                                                                        {
                                                                            "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                            "code": "jdn",
                                                                            "display": "Jurisdiction"
                                                                        }
                                                                    ]
                                                                },
                                                                "partOf": {
                                                                    "reference": "Location/53",
                                                                    "display": "MOH LOCATION B"
                                                                }
                                                            },
                                                            "parent": "Location/53",
                                                            "children": [
                                                                {
                                                                    "childId": "Location/57",
                                                                    "treeNode": {
                                                                        "nodeId": "Location/57",
                                                                        "label": "MOH SUB LOCATION B",
                                                                        "node": {
                                                                            "resourceType": "Location",
                                                                            "id": "57",
                                                                            "meta": {
                                                                                "versionId": "1",
                                                                                "lastUpdated": "2021-10-26T17:31:49.553+05:00",
                                                                                "source": "#rE7hvl7dXtLX9bwC"
                                                                            },
                                                                            "identifier": [
                                                                                {
                                                                                    "use": "official",
                                                                                    "value": "41815f774-c85b-4bb1-825d-f6af11753d08"
                                                                                }
                                                                            ],
                                                                            "status": "active",
                                                                            "name": "MOH SUB LOCATION B",
                                                                            "alias": [
                                                                                "MOH SUB LOCATION B"
                                                                            ],
                                                                            "description": "MOH SUB LOCATION B",
                                                                            "physicalType": {
                                                                                "coding": [
                                                                                    {
                                                                                        "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                                        "code": "jdn",
                                                                                        "display": "Jurisdiction"
                                                                                    }
                                                                                ]
                                                                            },
                                                                            "partOf": {
                                                                                "reference": "Location/55",
                                                                                "display": "MOH SUB LOCATION B"
                                                                            }
                                                                        },
                                                                        "parent": "Location/55",
                                                                        "children": [
                                                                            {
                                                                                "childId": "Location/102",
                                                                                "treeNode": {
                                                                                    "nodeId": "Location/102",
                                                                                    "label": "MOH SUB SUB LOCATION B 577",
                                                                                    "node": {
                                                                                        "resourceType": "Location",
                                                                                        "id": "102",
                                                                                        "meta": {
                                                                                            "versionId": "1",
                                                                                            "lastUpdated": "2021-11-01T15:37:42.517+05:00",
                                                                                            "source": "#IAdRmL0t29wpNHUK"
                                                                                        },
                                                                                        "identifier": [
                                                                                            {
                                                                                                "use": "official",
                                                                                                "value": "51815f774-c85b-4bb1-825d-f6af11753d08"
                                                                                            }
                                                                                        ],
                                                                                        "status": "active",
                                                                                        "name": "MOH SUB SUB LOCATION B 577",
                                                                                        "alias": [
                                                                                            "MOH SUB SUB LOCATION B"
                                                                                        ],
                                                                                        "description": "MOH SUB SUB LOCATION B",
                                                                                        "physicalType": {
                                                                                            "coding": [
                                                                                                {
                                                                                                    "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                                                                    "code": "jdn",
                                                                                                    "display": "Jurisdiction"
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        "partOf": {
                                                                                            "reference": "Location/57",
                                                                                            "display": "MOH SUB SUB LOCATION B"
                                                                                        }
                                                                                    },
                                                                                    "parent": "Location/57"
                                                                                }
                                                                            }
                                                                        ]
                                                                    }
                                                                }
                                                            ]
                                                        }
                                                    }
                                                ]
                                            }
                                        ]
                                    },
                                    "parentChildren": [
                                        {
                                            "identifier": "Location/52",
                                            "childIdentifiers": [
                                                "Location/53"
                                            ]
                                        },
                                        {
                                            "identifier": "Location/53",
                                            "childIdentifiers": [
                                                "Location/54",
                                                "Location/55"
                                            ]
                                        },
                                        {
                                            "identifier": "Location/54",
                                            "childIdentifiers": [
                                                "Location/56",
                                                "Location/105"
                                            ]
                                        },
                                        {
                                            "identifier": "Location/56",
                                            "childIdentifiers": [
                                                "Location/103",
                                                "Location/104"
                                            ]
                                        },
                                        {
                                            "identifier": "Location/105",
                                            "childIdentifiers": [
                                                "Location/106"
                                            ]
                                        },
                                        {
                                            "identifier": "Location/55",
                                            "childIdentifiers": [
                                                "Location/57"
                                            ]
                                        },
                                        {
                                            "identifier": "Location/57",
                                            "childIdentifiers": [
                                                "Location/102"
                                            ]
                                        }
                                    ]
                                }
                            },
                            "locationId": "53"
                        }
                    ],
                    "practitionerId": [
                        "152"
                    ]
                }
            }
        }
    ]
}

^^ @RaaziaTarique Here is the updated response payload. As per discussion with @dubdabasoduba , we are also returned the associated list of locations with the practitioner.

cc : @f-odhiambo @maimoonak

rehammuzzamil commented 1 year ago

Sample Response Payload remains the same as above, For tracking purposes, pasting the response payload after performance issues fix here:


    "resourceType": "Bundle",
    "id": "1c3e2cfe-cea0-470e-a032-1ccf39431fd8",
    "meta": {
        "lastUpdated": "2022-08-06T12:48:22.920+00:00"
    },
    "type": "searchset",
    "total": 1,
    "link": [{
        "relation": "self",
        "url": "https://fhir.labs.smartregister.org:443/fhir/practitioner-details?keycloak-uuid=34f0d616-afc8-4446-ae87-bb60be4bdbc9"
    }],
    "entry": [{
        "fullUrl": "https://fhir.labs.smartregister.org:443/fhir/practitioner-details/34f0d616-afc8-4446-ae87-bb60be4bdbc9",
        "resource": {
            "resourceType": "practitioner-details",
            "id": "34f0d616-afc8-4446-ae87-bb60be4bdbc9",
            "meta": {
                "profile": ["http://hl7.org/fhir/profiles/custom-resource"]
            },
            "KeycloakUserDetails": {
                "id": "34f0d616-afc8-4446-ae87-bb60be4bdbc9",
                "user-bio": [{
                    "identifier": "b87ff3c2-cbc6-43e6-b753-a9620756f9e4",
                    "userName": "demo",
                    "preferredName": "demo",
                    "familyName": "16909",
                    "givenName": "Demo",
                    "emailVerified": "false"
                }],
                "user-roles": ["ROLE_realm-admin", "ROLE_OPENMRS", "ROLE_EDIT_KEYCLOAK_USERS", "ROLE_offline_access", "ROLE_VIEW_KEYCLOAK_USERS", "ROLE_uma_authorization", "ROLE_ALL_EVENTS", "ROLE_PLANS_FOR_USER"]
            },
            "fhir": {
                "id": "136252",
                "careteams": [{
                    "resourceType": "CareTeam",
                    "id": "136253",
                    "meta": {
                        "versionId": "1",
                        "lastUpdated": "2022-07-25T16:41:45.221+00:00",
                        "source": "#98d1c5ca256d7e8b"
                    },
                    "identifier": [{
                        "use": "official",
                        "value": "46384571-ad31-4c20-8aa0-266f80ef6582"
                    }],
                    "status": "active",
                    "name": "Nala Team",
                    "participant": [{
                        "member": {
                            "reference": "Practitioner/136252"
                        }
                    }]
                }],
                "teams": [{
                    "resourceType": "Organization",
                    "id": "136254",
                    "meta": {
                        "versionId": "2",
                        "lastUpdated": "2022-07-25T16:42:51.523+00:00",
                        "source": "#dad854aca8ea9fcd"
                    },
                    "identifier": [{
                        "use": "official",
                        "value": "e58c9509-8ff2-4664-b805-e9dd5bf0cf8a"
                    }],
                    "active": true,
                    "type": [{
                        "coding": [{
                            "system": "http://terminology.hl7.org/CodeSystem/organization-type",
                            "code": "prov"
                        }]
                    }],
                    "name": "Nala Team",
                    "alias": ["nala"]
                }],
                "locations": [{
                    "resourceType": "Location",
                    "id": "136256",
                    "meta": {
                        "versionId": "1",
                        "lastUpdated": "2022-07-25T16:44:38.620+00:00",
                        "source": "#b46640c1adfc6d38"
                    },
                    "identifier": [{
                        "use": "official",
                        "value": "c3bd4bcc-889e-4e3d-a72b-a0b611b8fb64"
                    }],
                    "status": "active",
                    "name": "Nala Location ",
                    "physicalType": {
                        "coding": [{
                            "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                            "code": "jdn",
                            "display": "Jurisdiction"
                        }]
                    },
                    "partOf": {
                        "reference": "Location/109211",
                        "display": "Charlie Clinic"
                    }
                }],
                "locationHierarchyList": [{
                    "resourceType": "LocationHierarchy",
                    "id": "Location Resource : 136256",
                    "meta": {
                        "profile": ["http://hl7.org/fhir/profiles/custom-resource"]
                    },
                    "LocationHierarchyTree": {
                        "locationsHierarchy": {
                            "listOfNodes": {
                                "treeNodeId": "Location/136256",
                                "treeNode": [{
                                    "nodeId": "Location/136256",
                                    "label": "Nala Location ",
                                    "node": {
                                        "resourceType": "Location",
                                        "id": "136256",
                                        "meta": {
                                            "versionId": "1",
                                            "lastUpdated": "2022-07-25T16:44:38.620+00:00",
                                            "source": "#b46640c1adfc6d38"
                                        },
                                        "identifier": [{
                                            "use": "official",
                                            "value": "c3bd4bcc-889e-4e3d-a72b-a0b611b8fb64"
                                        }],
                                        "status": "active",
                                        "name": "Nala Location ",
                                        "physicalType": {
                                            "coding": [{
                                                "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                "code": "jdn",
                                                "display": "Jurisdiction"
                                            }]
                                        },
                                        "partOf": {
                                            "reference": "Location/109211",
                                            "display": "Charlie Clinic"
                                        }
                                    },
                                    "parent": "Location/109211",
                                    "children": [{
                                        "childId": "Location/137151",
                                        "treeNode": {
                                            "nodeId": "Location/137151",
                                            "label": "Test Village",
                                            "node": {
                                                "resourceType": "Location",
                                                "id": "137151",
                                                "meta": {
                                                    "versionId": "1",
                                                    "lastUpdated": "2022-08-04T11:41:32.683+00:00",
                                                    "source": "#1bb63352eef7cefc"
                                                },
                                                "identifier": [{
                                                    "use": "official",
                                                    "value": "f7f4c729-fd05-40aa-bdc3-fccd74589264"
                                                }],
                                                "status": "active",
                                                "name": "Test Village",
                                                "description": "Test",
                                                "physicalType": {
                                                    "coding": [{
                                                        "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                                        "code": "jdn",
                                                        "display": "Jurisdiction"
                                                    }]
                                                },
                                                "partOf": {
                                                    "reference": "Location/136256",
                                                    "display": "Nala Location "
                                                }
                                            },
                                            "parent": "Location/136256"
                                        }
                                    }]
                                }]
                            },
                            "parentChildren": [{
                                "identifier": "Location/109211",
                                "childIdentifiers": ["Location/136256"]
                            }, {
                                "identifier": "Location/136256",
                                "childIdentifiers": ["Location/137151"]
                            }]
                        }
                    },
                    "locationId": "136256"
                }],
                "practitionerId": ["136252"]
            }
        }
    }]
}`

API implementation issue/details: https://github.com/opensrp/fhircore/issues/857

cc: @f-odhiambo  @dubdabasoduba 
pld commented 1 year ago

Doe sit make sense to move this into a PR, and put this content into the markdown docs?