My current workaround is to use a PUT API call to apply a hierarchy_root_url to an existing source (which has already been imported via Bulk Import). Example below with the PUT statement and the body as JSON:
PUT https://api.openconceptlab.org/orgs/Regenstrief-Institute/sources/LOINC-3/
{"hierarchy_root_url": "/orgs/Regenstrief-Institute/sources/LOINC-3/concepts/ROOT/"}
{
"names": [
"A concept must have at least one name"
]
}
If using the full import json line of the concept Root as the request body, the missing child_concept_urls also couldn’t be added although the response is 200 OK and returns the updated concept Root.
One potentially helpful tip here: OCL implies the child_concept_urls using the parent_concept_urls. If all of your child concepts have a parent_concept_urls, then OCL will auto-create the child_concept_urls.
Meaning, I only specify parent concept URLs in my bulk import files, not child concept URLs
@jamlung , thanks a lot! Ah…I will check it out tomorrow.
This operation is not working, even leading to more parent-child relationships lost.
In addition, PUT or Patch operations for a Concept are also not able to add the parent-child relationships lost.
@jamlung
It was found that, when a concept id has a value “Root” or “TempRoot” (maybe other strings), it would lose its parent-child relationships, including parent_concept_urls and child_concept_urls. On a whim, the root concept id was tentatively changed from “Root” to “C”, the bulk import successfully completed and didn’t lose the parent-child relationships. Meanwhile, the temporary concept “TempRoot” still lost the expected parent-child relationships. Haha… So it seems that the bulk import process is a bit picky about the id string of the concept. Any rules about concept id value?