nlpsandbox / nlpsandbox-schemas

OpenAPI specifications of the NLP Sandbox services
https://nlpsandbox.io
Apache License 2.0
2 stars 4 forks source link

Getting clinical notes/patients returns objects that are inconsistent from the rest of the calls #89

Closed thomasyu888 closed 3 years ago

thomasyu888 commented 3 years ago
curl -X GET "http://10.23.55.45:8080/api/v1/datasets/awesome-dataset/fhirStores/awesome-fhir-store/fhir/Note?limit=10" -H  "accept: application/json"
{
  "limit": 10,
  "links": {
    "next": ""
  },
  "notes": [
    {
      "id": "5fb5d438a7c859d8acf9d672",
      "noteType": "",
      "patientId": "5fb5d3eca7c859d8acf9d671",
....

All the other rest calls return name, just like getting annotations:

curl -X GET "http://10.23.55.45:8080/api/v1/datasets/awesome-dataset/annotationStore/awesome-annotation-store/annotations?limit=10" -H  "accept: application/json"

{
  "annotations": [
    {
      "annotationSource": {
        "name": "/datasets/awesome-dataset/fhirStores/awesome-fhir-store/fhir/Note/5fb5d438a7c859d8acf9d672"
      },
      "name": "datasets/awesome-dataset/annotationStores/awesome-annotation-store/annotations/5fb5d570a7c859d8acf9d676",
....

This becomes more complex when I'm writing code to get a clinical note in the client. We would have:

# Example of getting an annotation - we can directly use "name" from above
get_annotation(annotation_name)

# But when getting clinical note, it separates into "fhirstore_name" and "clinical note id"

There seem to be different standards within this API.

tschaffter commented 3 years ago

Yes, I need to have another pass at how objects reference other objects. Thanks for highlighting this.

tschaffter commented 3 years ago

The PR mentioned above is actually not linked to this issue.

tschaffter commented 3 years ago

There seem to be different standards within this API.

It's actually the case: there is the design adopted for the general API that is inspired from Google API, and the FHIR standard used to store resources in FHIR stores. For example, schemas freely defined as part of the Google API have often a property name. However, the FHIR Patient schema already have a property name that conflicts with Google's property name.

FHIR Patient schema found in Google's doc:

{
  "birthDate": "1970-01-01",
  "gender": "female",
  "id": "PATIENT_ID",
  "meta": {
    "lastUpdated": "2020-01-01T00:00:00+00:00",
    "versionId": "VERSION_ID"
  },
  "name": [
    {
      "family": "Smith",
      "given": [
        "Darcy"
      ],
      "use": "official"
    }
  ],
  "resourceType": "Patient"
}
github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.