Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mappings not included as expected when requesting a concept from API v2 #555

Closed
bmamlin opened this issue Jan 27, 2021 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@bmamlin
Copy link

bmamlin commented Jan 27, 2021

While testing the OCL for OpenMRS Client, I noticed mappings are not showing as expected when viewing a concept. The client is performing a GET for a specific concept like this:

https://api.qa.aws.openconceptlab.org/orgs/CIEL/sources/CIEL/concepts/1226/47091/?verbose=true&includeMappings=true
Click for response from API v2
{
    "concept_class": "Diagnosis",
    "created_on": "2021-01-17T03:23:19.138271Z",
    "datatype": "N/A",
    "descriptions": [
        {
            "description": "Anemia, due to nutritional deficiencies in iron uptake.",
            "description_type": null,
            "external_id": "1228FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
            "locale": "en",
            "locale_preferred": false,
            "type": "ConceptDescription",
            "uuid": "104954"
        }
    ],
    "display_locale": "en",
    "display_name": "Anemia, iron deficiency",
    "external_id": "1226AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
    "extras": {},
    "id": "1226",
    "is_latest_version": true,
    "locale": null,
    "mappings": [],
    "names": [
        {
            "external_id": "93415BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "locale": "en",
            "locale_preferred": false,
            "name": "Iron deficiency anemia",
            "name_type": null,
            "type": "ConceptName",
            "uuid": "104946"
        },
        {
            "external_id": "126260BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "locale": "fr",
            "locale_preferred": true,
            "name": "Anemie, carence en fer",
            "name_type": "FULLY_SPECIFIED",
            "type": "ConceptName",
            "uuid": "104947"
        },
        {
            "external_id": "134430BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "locale": "fr",
            "locale_preferred": false,
            "name": "Anemie, deficience en fer",
            "name_type": null,
            "type": "ConceptName",
            "uuid": "104948"
        },
        {
            "external_id": "134431BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "locale": "ht",
            "locale_preferred": true,
            "name": "Anemi, Defisi Fè",
            "name_type": "FULLY_SPECIFIED",
            "type": "ConceptName",
            "uuid": "104950"
        },
        {
            "external_id": "1303BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "locale": "en",
            "locale_preferred": true,
            "name": "Anemia, iron deficiency",
            "name_type": "FULLY_SPECIFIED",
            "type": "ConceptName",
            "uuid": "104951"
        },
        {
            "external_id": "83710BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "locale": "es",
            "locale_preferred": true,
            "name": "anemia ferropénica",
            "name_type": "FULLY_SPECIFIED",
            "type": "ConceptName",
            "uuid": "104952"
        },
        {
            "external_id": "93215BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "locale": "en",
            "locale_preferred": false,
            "name": "IDA",
            "name_type": null,
            "type": "ConceptName",
            "uuid": "104953"
        }
    ],
    "owner": "CIEL",
    "owner_name": "CIEL",
    "owner_type": "Organization",
    "owner_url": "/orgs/CIEL/",
    "previous_version_url": null,
    "retired": false,
    "source": "CIEL",
    "source_url": "/orgs/CIEL/sources/CIEL/",
    "type": "Concept",
    "updated_on": "2021-01-27T22:28:22.598830Z",
    "url": "/orgs/CIEL/sources/CIEL/concepts/1226/",
    "uuid": "47091",
    "version": "47091",
    "version_created_by": "ocladmin",
    "version_created_on": "2021-01-17T03:23:19.138271Z",
    "version_url": "/orgs/CIEL/sources/CIEL/concepts/1226/47091/"
}

The response returns the concept as expected; however, the mappings property is empty ("mappings": []).

The equivalent call on production includes the 6 mappings not provided by API v2.

https://api.openconceptlab.org/orgs/CIEL/sources/CIEL/concepts/1226/5e9851103247e20001aa2f92/?verbose=true&includeMappings=true
Click for response from API v1
{
    "concept_class": "Diagnosis",
    "created_on": "2020-04-16T08:35:28.115",
    "datatype": "N/A",
    "descriptions": [
        {
            "description": "Anemia, due to nutritional deficiencies in iron uptake.",
            "description_type": null,
            "external_id": "1228FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
            "locale": "en",
            "locale_preferred": false,
            "type": "ConceptDescription",
            "uuid": "343e27070ce047dfa76aac65f007ac03"
        }
    ],
    "display_locale": "en",
    "display_name": "ANEMIA, IRON DEFICIENCY",
    "external_id": "1226AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
    "extras": {},
    "id": "1226",
    "is_latest_version": false,
    "locale": null,
    "mappings": [
        {
            "created_at": "2016-11-28T12:38:03.581",
            "created_by": "root",
            "external_id": "73323ABBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "extras": null,
            "from_concept_code": "1226",
            "from_concept_name": "Anemia, iron deficiency",
            "from_concept_url": "/orgs/CIEL/sources/CIEL/concepts/1226/",
            "from_source_name": "CIEL",
            "from_source_owner": "CIEL",
            "from_source_owner_type": "Organization",
            "from_source_url": null,
            "id": "583c6b7b65baaa00076d30c2",
            "map_type": "SAME-AS",
            "owner": "CIEL",
            "owner_type": "Organization",
            "retired": false,
            "source": "CIEL",
            "to_concept_code": "87522002",
            "to_concept_name": null,
            "to_concept_url": null,
            "to_source_name": "SNOMED-CT",
            "to_source_owner": "IHTSDO",
            "to_source_owner_type": "Organization",
            "to_source_url": "/orgs/IHTSDO/sources/SNOMED-CT/",
            "type": "Mapping",
            "updated_at": "2016-11-28T12:38:03.592",
            "updated_by": "root",
            "url": "/orgs/CIEL/sources/CIEL/mappings/583c6b7b65baaa00076d30c2/",
            "uuid": "583c6b7b65baaa00076d30c2"
        },
        {
            "created_at": "2016-11-28T12:38:04.103",
            "created_by": "root",
            "external_id": "275397ABBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "extras": null,
            "from_concept_code": "1226",
            "from_concept_name": "Anemia, iron deficiency",
            "from_concept_url": "/orgs/CIEL/sources/CIEL/concepts/1226/",
            "from_source_name": "CIEL",
            "from_source_owner": "CIEL",
            "from_source_owner_type": "Organization",
            "from_source_url": null,
            "id": "583c6b7c65baaa00076d30c4",
            "map_type": "NARROWER-THAN",
            "owner": "CIEL",
            "owner_type": "Organization",
            "retired": false,
            "source": "CIEL",
            "to_concept_code": "D50.9",
            "to_concept_name": null,
            "to_concept_url": null,
            "to_source_name": "ICD-10-WHO",
            "to_source_owner": "WHO",
            "to_source_owner_type": "Organization",
            "to_source_url": "/orgs/WHO/sources/ICD-10-WHO/",
            "type": "Mapping",
            "updated_at": "2016-11-28T12:38:04.113",
            "updated_by": "root",
            "url": "/orgs/CIEL/sources/CIEL/mappings/583c6b7c65baaa00076d30c4/",
            "uuid": "583c6b7c65baaa00076d30c4"
        },
        {
            "created_at": "2016-11-28T12:38:04.584",
            "created_by": "root",
            "external_id": "275660ABBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "extras": null,
            "from_concept_code": "1226",
            "from_concept_name": "Anemia, iron deficiency",
            "from_concept_url": "/orgs/CIEL/sources/CIEL/concepts/1226/",
            "from_source_name": "CIEL",
            "from_source_owner": "CIEL",
            "from_source_owner_type": "Organization",
            "from_source_url": null,
            "id": "583c6b7c65baaa00076d30c6",
            "map_type": "SAME-AS",
            "owner": "CIEL",
            "owner_type": "Organization",
            "retired": false,
            "source": "CIEL",
            "to_concept_code": "1226",
            "to_concept_name": null,
            "to_concept_url": null,
            "to_source_name": "AMPATH",
            "to_source_owner": "AMPATH",
            "to_source_owner_type": "Organization",
            "to_source_url": "/orgs/AMPATH/sources/AMPATH/",
            "type": "Mapping",
            "updated_at": "2016-11-28T12:38:04.593",
            "updated_by": "root",
            "url": "/orgs/CIEL/sources/CIEL/mappings/583c6b7c65baaa00076d30c6/",
            "uuid": "583c6b7c65baaa00076d30c6"
        },
        {
            "created_at": "2016-11-28T12:38:05.064",
            "created_by": "root",
            "external_id": "275724ABBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "extras": null,
            "from_concept_code": "1226",
            "from_concept_name": "Anemia, iron deficiency",
            "from_concept_url": "/orgs/CIEL/sources/CIEL/concepts/1226/",
            "from_source_name": "CIEL",
            "from_source_owner": "CIEL",
            "from_source_owner_type": "Organization",
            "from_source_url": null,
            "id": "583c6b7d65baaa00076d30c8",
            "map_type": "SAME-AS",
            "owner": "CIEL",
            "owner_type": "Organization",
            "retired": false,
            "source": "CIEL",
            "to_concept_code": "1226",
            "to_concept_name": null,
            "to_concept_url": null,
            "to_source_name": "PIH",
            "to_source_owner": "PIH",
            "to_source_owner_type": "Organization",
            "to_source_url": "/orgs/PIH/sources/PIH/",
            "type": "Mapping",
            "updated_at": "2016-11-28T12:38:05.073",
            "updated_by": "root",
            "url": "/orgs/CIEL/sources/CIEL/mappings/583c6b7d65baaa00076d30c8/",
            "uuid": "583c6b7d65baaa00076d30c8"
        },
        {
            "created_at": "2016-11-28T12:38:05.545",
            "created_by": "root",
            "external_id": "276495ABBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "extras": null,
            "from_concept_code": "1226",
            "from_concept_name": "Anemia, iron deficiency",
            "from_concept_url": "/orgs/CIEL/sources/CIEL/concepts/1226/",
            "from_source_name": "CIEL",
            "from_source_owner": "CIEL",
            "from_source_owner_type": "Organization",
            "from_source_url": null,
            "id": "583c6b7d65baaa00076d30ca",
            "map_type": "SAME-AS",
            "owner": "CIEL",
            "owner_type": "Organization",
            "retired": false,
            "source": "CIEL",
            "to_concept_code": "66205",
            "to_concept_name": null,
            "to_concept_url": null,
            "to_source_name": "IMO-ProblemIT",
            "to_source_owner": "IMO",
            "to_source_owner_type": "Organization",
            "to_source_url": "/orgs/IMO/sources/IMO-ProblemIT/",
            "type": "Mapping",
            "updated_at": "2016-11-28T12:38:05.554",
            "updated_by": "root",
            "url": "/orgs/CIEL/sources/CIEL/mappings/583c6b7d65baaa00076d30ca/",
            "uuid": "583c6b7d65baaa00076d30ca"
        },
        {
            "created_at": "2020-05-12T08:38:54.893",
            "created_by": "root",
            "external_id": "285761ABBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "extras": null,
            "from_concept_code": "1226",
            "from_concept_name": "Anemia, iron deficiency",
            "from_concept_url": "/orgs/CIEL/sources/CIEL/concepts/1226/",
            "from_source_name": "CIEL",
            "from_source_owner": "CIEL",
            "from_source_owner_type": "Organization",
            "from_source_url": null,
            "id": "5eba98de7fe8bc0001bc9d77",
            "map_type": "SAME-AS",
            "owner": "CIEL",
            "owner_type": "Organization",
            "retired": false,
            "source": "CIEL",
            "to_concept_code": "B80",
            "to_concept_name": null,
            "to_concept_url": null,
            "to_source_name": "ICPC2",
            "to_source_owner": "WICC",
            "to_source_owner_type": "Organization",
            "to_source_url": "/orgs/WICC/sources/ICPC2/",
            "type": "Mapping",
            "updated_at": "2020-05-12T08:38:54.903",
            "updated_by": "root",
            "url": "/orgs/CIEL/sources/CIEL/mappings/5eba98de7fe8bc0001bc9d77/",
            "uuid": "5eba98de7fe8bc0001bc9d77"
        }
    ],
    "names": [
        {
            "external_id": "1303BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "locale": "en",
            "locale_preferred": true,
            "name": "ANEMIA, IRON DEFICIENCY",
            "name_type": "FULLY_SPECIFIED",
            "type": "ConceptName",
            "uuid": "4f933502e00d4859be8abc28c9c0a8d6"
        },
        {
            "external_id": "83710BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "locale": "es",
            "locale_preferred": true,
            "name": "anemia ferropénica",
            "name_type": "FULLY_SPECIFIED",
            "type": "ConceptName",
            "uuid": "46ad4e0090374d0eae1041d2be43b68b"
        },
        {
            "external_id": "93215BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "locale": "en",
            "locale_preferred": false,
            "name": "IDA",
            "name_type": "",
            "type": "ConceptName",
            "uuid": "14c99787349f41dfacefdef958a0e0e5"
        },
        {
            "external_id": "93415BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "locale": "en",
            "locale_preferred": false,
            "name": "IRON DEFICIENCY ANEMIA",
            "name_type": "",
            "type": "ConceptName",
            "uuid": "4e7bb457603b4dffa2e158cfd4d2b2dd"
        },
        {
            "external_id": "126260BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "locale": "fr",
            "locale_preferred": true,
            "name": "Anemie, carence en fer",
            "name_type": "FULLY_SPECIFIED",
            "type": "ConceptName",
            "uuid": "5d9b18c9550b41229e6f9e87964bd003"
        },
        {
            "external_id": "134430BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "locale": "fr",
            "locale_preferred": false,
            "name": "Anemie, deficience en fer",
            "name_type": "",
            "type": "ConceptName",
            "uuid": "d71db87a450c455695f7e1f7e7d39aee"
        },
        {
            "external_id": "134431BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
            "locale": "ht",
            "locale_preferred": true,
            "name": "Anemi, Defisi Fè",
            "name_type": "FULLY_SPECIFIED",
            "type": "ConceptName",
            "uuid": "00d22336dc674e6abc0c43edf490686b"
        }
    ],
    "owner": "CIEL",
    "owner_type": "Organization",
    "owner_url": "/orgs/CIEL/",
    "retired": false,
    "source": "CIEL",
    "source_url": "/orgs/CIEL/sources/CIEL/",
    "type": "Concept",
    "updated_on": "2020-05-12T08:13:00.796",
    "url": "/orgs/CIEL/sources/CIEL/concepts/1226/",
    "uuid": "5e9851103247e20001aa2f92",
    "version": "5e9851103247e20001aa2f92",
    "version_created_by": "root",
    "version_created_on": "2020-04-16T08:35:28.115",
    "version_url": "/orgs/CIEL/sources/CIEL/concepts/1226/5e9851103247e20001aa2f92/"
}
@bmamlin bmamlin added the bug Something isn't working label Jan 27, 2021
@snyaggarwal
Copy link
Contributor

Fixed the query.
Will be available after next deployment.

@bmamlin
Copy link
Author

bmamlin commented Jan 29, 2021

Tested and appears to be working now. Thanks!

@bmamlin bmamlin closed this as completed Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants