Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- 'locationId': 'location1',
- 'name': 'Name',
- 'type': 'Ward',
- 'patientId': None,
- 'children': [{
- 'locationId': 'Child_location2',
- 'name': 'Name',
- 'type': 'Bed',
- 'patientId': None,
- 'children': [{
- 'locationId': 'Child_Child_location3',
- 'name': 'Name',
- 'type': 'HospitalGroup',
- 'patientId': None,
- 'children': None
- }]
- }, {
- 'locationId': 'location4',
- 'name': 'Name',
- 'type': 'Hospital',
- 'patientId': None,
- 'children': None
- }, {
- 'locationId': 'location5',
- 'name': 'Name',
- 'type': 'Bed',
- 'patientId': None,
- 'children': None
- }, {
- 'locationId': 'location6',
- 'name': 'Name',
- 'type': 'Bed',
- 'patientId': None,
- 'children': None
- }, {
- 'locationId': 'location27',
- 'name': 'Name',
- 'type': 'Bed',
- 'patientId': None,
- 'children': None
- }]
- }
- import requests
- def Get_Child(URL, Name):
- headers = {
- 'accept': 'text/plain',
- }
- response = requests.get(
- URL + Name,
- headers=headers)
- json_data = response.json()
- print (json_data)
- list = []
- for locationId in json['locationId']:
- list.append(locationId)
- for children in locationId['children']:
- list.append(children)
Add Comment
Please, Sign In to add comment