kids-first / kf-model-fhir

🔥 FHIR Data Model for Kids First
https://kids-first.github.io/kf-model-fhir/ig/
Apache License 2.0
1 stars 1 forks source link

Implement safe identifier creation for resource ID #199

Open liberaliscomputing opened 4 years ago

liberaliscomputing commented 4 years ago

When building a unique key from a record, the load stage of the ingest library accesses a target API builder's target_id_concept to pull a KF ID from data under this concept: https://github.com/kids-first/kf-lib-data-ingest/blob/master/kf_lib_data_ingest/etl/load/load.py#L207

An id is one of the primitive types of data where the following rule is only allowed: [A-Za-z0-9\-\.]{1,64}. When ingesting KF data into a FHIR server, if we have KF IDs, we would end up having an error because the KF ID format [A-Z]{2}_[A-Z0-9]{8} (e.g. SD_ME0WME0W) violates the above rule.

It doesn't have to be a ingest library spec since the above rule is FHIR-specific. Thus, in the ingest plugin, implement safe identifier creation for a resource ID.