Scopus API call to provide the list of institutions within an hierarchy - scopus

I am using the Scopus API to extract publications linked to institutions.
The Scopus web interface provides two counts of papers for most institutions, "Documents Affiliation Only" and a larger number for "Documents Whole Institution". There is also a tab which displays a list of affiliations linked to the parent.
I am needing an API call that will list the institutions within that hierarchy
Many thanks

In Scopus, you'll want to click on 'Affiliation Hierarchy' and find the top-level Affiliation ID.
Then, submit this ID through the affiliation profile retrieval API:
https://api.elsevier.com/content/affiliation/affiliation_id/xxxxxxxx?view=FULL
In this response, you'll find an identifier for a document containing the Affiliation Hierarchy:
<hierarchy-document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<eid>xx-xx.x-xxxxxxxx</eid>
</hierarchy-document>
Take that and submit it through the same profile retrieval API, using the 'eid' endpoint:
https://api.elsevier.com/content/affiliation/eid/xx-xx.x-xxxxxxxx?view=FULL
This response contains all the children to the top level hierarchy, which you can use to search, etc:
<institution-hierarchy verified="true">
<institution xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="xxxxxxxx">
<institution-name>xxxxxxxx</institution-name>
<institution id="xxxxxxxx" rel-type="po">
<institution-name>xxxxxxxx</institution-name>
<institution id="xxxxxxxx" rel-type="po">
<institution-name>xxxxxxxx</institution-name>
</institution>
<institution id="xxxxxxxx" rel-type="po">
<institution-name>xxxxxxxx</institution-name>
</institution>
<institution id="xxxxxxxx" rel-type="po">
<institution-name>xxxxxxxx</institution-name>
</institution>
<institution id="xxxxxxxx" rel-type="po">
<institution-name>xxxxxxxx</institution-name>
...etc etc

Related

Google Places Nearby search results - missing detail Data?

I'm currently working on a project in which we perform "Nearby" queries for places using keywords, and then we make follow-up "Detail" requests to obtain more information about specific places of interest.
With Google's new pricing model in the works, the documentation warns about the cost of the Nearby search, but the warning seems to imply that the follow-up detail request will no longer be necessary because our original search should give us everything we need:
By default, when a user selects a place, Nearby Search returns all of
the available data fields for the selected place, and you will be
billed accordingly. There is no way to constrain Nearby Search
requests to only return specific fields. To keep from requesting (and
paying for) data that you don't need, use a Find Place request
instead.
However, I'm not seeing this. When I run a sample request, the results from my Nearby request contains only minimal data related to the places Google finds. To get details, I still have to do a follow-up detail request.
Does anyone know if there's something I may be overlooking? I'm including my request URL (sans API key).
https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=xxxxxxxxxx&location=30.7329,-88.081987&radius=5000&keyword=insurance
And this is an example of one of the results I received:
{
"geometry": {
"location": {
"lat": 30.69254,
"lng": -88.0443999
},
"viewport": {
"northeast": {
"lat": 30.69387672989272,
"lng": -88.04309162010728
},
"southwest": {
"lat": 30.69117707010728,
"lng": -88.04579127989273
}
}
},
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"id": "53744cdc03f8a9726593a767424b14f7f8f86049",
"name": "Ann M Hartwell - Aflac Insurance Agent",
"place_id": "ChIJj29KxNZPmogRJovoXjMDpQI",
"plus_code": {
"compound_code": "MXV4+26 Mobile, Alabama",
"global_code": "862HMXV4+26"
},
"reference": "CmRbAAAAcHM1P7KgNiZgVOm1pWojLto9Bqx96h2BkA-IyfN5oAz1-OICsRXiZOgwmwHb-eX7z679eFjpzPzey0brgect1UMsAiyawKpb5NLlgr_Pk8wBJpagRcKQF1VSvEm7Nq6CEhCfR0pM5wiiwpqAE1eE6eCRGhQPJfQWcWllOVQ5e1yVpZYbCsD01w",
"scope": "GOOGLE",
"types": [
"insurance_agency",
"point_of_interest",
"establishment"
],
"vicinity": "70 N Joachim St, Mobile"
}
I thought about deleting this question, but I guess I'll leave it up in case anyone else is confused like I was.
It turns out the extra detail fields I was looking for in the Nearby Search results were there...sort of.
Google's new pricing model categorizes place data fields into three tiers: Basic, Contact, and Atmosphere (Basic data is free, but the other two add to the cost).
As part of these changes, Place API calls have been expanded to allow users to specify the data fields they want so that they don't have to pay for that extra data if they don't need it.
The Nearby Search query, as per the note in the question, includes all the data fields available, and doesn't support a parameter for controlling the data -- it's always going return data that falls into the [Basic + Contact + Atmosphere] bucket.
So far, that's all well and good.
Where things became confusing to me, though, is the specifics of what is included in the different data tiers. I skimmed through these notes several times before I noticed the contents were different.
This is how the fields break down with the Places details request:
Basic
The Basic category includes the following fields: address_component,
adr_address, alt_id, formatted_address, geometry, icon, id, name,
permanently_closed, photo, place_id, plus_code, scope, type, url,
utc_offset, vicinity
Contact
The Contact category includes the following fields:
formatted_phone_number, international_phone_number, opening_hours,
website
Atmosphere
The Atmosphere category includes the following fields: price_level,
rating, review
And this is how it looks for the Places search request:
Basic
The Basic category includes the following fields: formatted_address,
geometry, icon, id, name, permanently_closed, photos, place_id,
plus_code, scope, types
Contact
The Contact category includes the following field: opening_hours
(Place Search returns only open_now; use a Place Details request to
get the full opening_hours results). Atmosphere
The Atmosphere category includes the following fields: price_level,
rating
I haven't found documentation for it, specifically, but the results from a Nearby Search request seems close (but not identical) to the Place search (including Contact and Atmosphere).
I had originally thought the fact that Nearby Search results now include Contact and Atmosphere data (when available), that meant it would contain all the fields itemized as Contact and Atmosphere data in the Place details documentation, but that's not the case.

Using XPath can ID/IDREF use be checked?

With XML Schema we can define ID/IDREF links between components in an XML document. I'm looking for a way, using XPath, to ensure that only certain IDs can be used as IDREFs - i.e. only those values which logically make senses in the context of the schema design.
Using the example below, how do I ensure that a book's library_id is actually one of the available library_ids and not some other id which could appear in the message and be used for some entirely different purpose (but still be schema valid).
<books>
<book library_id="lib1">
<author>A</author>
<title>B</title>
</book>
<book library_id="lib2">
<author>C</author>
<title>D</title>
</book>
<library id="lib1">
<name>X</name>
<city>Y</city>
</library>
<library id="lib2">
<name>X</name>
<city>Y</city>
</library>
</books>
The closest I've come to getting this to work is to use the XPath contains function e.g.
contains(//library/#id,//book/#library_id)
but this throws an error because a sequence of more than one item is not allowed as the first argument of contains() ("lib1","lib2").
Thanks
I hope that understood correctly what you want
Books with library_id present in library list
//book[#library_id = //library/#id]
Books with incorrect library_id
//book[not(#library_id = //library/#id)]
Why not use XSD's key/keyref constraints instead of ID/IDREF? These are much more flexible: they can be scoped to any element rather than the whole document; you can have different kinds of IDs within a document and the refs must match up to the same kind; the values can be composite (e.g. first name + last name); the values can be of any data type.

Mapping existing resource to hl7-fhir response

Trying to understand the concept of the code datatype in hl7-fhir. Looking at the appointment (https://www.hl7.org/fhir/appointment.html) resource as an example it has a status parameter with suggested values of "proposed | pending | booked" etc.
Given an existing database with it's own custom status' (Attended, Confirmed, Attended but late) what is the correct way to handle a hl7-fhir response to a consumer?
If the "code" data type is used, then the FHIR binding strength is always "required" - which means you are required to use the FHIR-defined list of codes and no others.
It appears that two of your statuses - "Attended" and "Attended but late" aren't actually statuses of the appointment - the booking, but are instead commentary about the resulting encounter. So I would capture those as extensions. "confirmed" sounds similar to "booked", though I'd need to know the definition to know for sure. Do you have any appointment statuses for appointments that are not yet confirmed (let alone attended)?
To extend on Lloyds notes, you will want to put the extension under the status property, and map your existing values to the provided FHIR values, and put your local actual value in the extension underneath.
This way when other systems read the resource and don't know about your extension status values, they will still be able to act sensibly based on the core values.
<status value="fulfilled">
<extension url="http://yourorg.com/fhir/.../ExtendedAppointmentStatuses">
<valueCoding>
<code value="abl" />
<display value="Attended but late" />
</valueCoding>
</extension>
</status>

Retrieve data from Dynamics CRM Online custom report through API

I am trying to read data from a custom report in CRM Online through the API.
I have no problem fetching data like competitors, accounts using
OrganizationService.RetrieveMultiple()
But when it comes to custom reports, I can't find a way. The report I would like to read is found in the CRM web interface under Dashboard -> (My organization) -> Reports.
I hope someone can point me in the right direction. Thanks!
I am also interested in this. Did you ever figure it out?
Sorry about not leaving this as comment, but apparently I don't have permissions.
Actually, I may have stumbled on the solution.
I noticed that when you download the report definition it has a field called d:CustomReportXml. In my custom reports this field contains XML code.
<d:CustomReportXml><CustomReport><Language>1033</Language><Query><fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"><entity name="appointment"><attribute name="createdby" alias="createdby" /><attribute name="createdon" alias="createdon" /></entity></fetch></Query><Groupings /><Columns><Column ID="createdby0" Field="createdby" Width="100" /><Column ID="createdon0" Field="createdon" Width="100" AddRawValueColumn="true" /></Columns><TableLayout Display="Normal" /></CustomReport></d:CustomReportXml>
inside the XML is a fetch tag
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"><entity name="appointment"><attribute name="createdby" alias="createdby" /><attribute name="createdon" alias="createdon" /></entity></fetch>
I have been able to parse this out and pass it back to dynamics via the api and get back results. I am using http://www.xrmtoolbox.com/ to test the results and so far things look promising.
I can also add a filter to the fetchXML so I don't end up with too much data.
I hope it helps you.

How to detect "for internal use only" entities from Dynamics CRM metadata

I am trying to read (FetchXml) the content of all the readable attributes of all the entities based on the list I get using the metadata webservice.
This works fine except for 3 entities ("resourcegroupexpansion", "workflowwaitsubscription" and "interprocesslock") for which I systematically get the following error:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Server was unable to process request.</faultstring>
<detail>
<error>
<code>0x80040216</code>
<description>An unexpected error occurred.</description>
<type>Platform</type>
</error>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
According to this http://msdn.microsoft.com/en-us/library/gg328086.aspx those 3 entities are for internal use only which might explain why I get an error (having said that I’m able to read other “internal use only” entities).
So my question is this: how can I detect from the metadata which entities are “for internal use only” and which are not ?
Of course, I could hard-code the list of entities based on the documentation but I don’t find it very satisfying.
Unfortunately there is No flag to identify the "for Internal use only" entities.
But one thing I noticed from XrmToolbox Metadata browser - the description column of entity is having "for Internal use only" text for ~15 entities.
We can leverage the same by identifying & updating this field with unique values for internal system entities (thru some unsupported way like export solution, modify & reimport). Then description field text can be used to filter out these internal entities.
I never tried this. Will try & update my answer soon.

Resources