gdc-common-utils-ts 2.9.16 → 2.9.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -162,7 +162,10 @@ export declare function toClinicalResourceCardView(entry: ClinicalResourceEntryL
162
162
  * Short claims take precedence over their expanded
163
163
  * `org.hl7.fhir.api.<ResourceType>.<search-param>` equivalent. Versioned
164
164
  * `org.hl7.fhir.<version>.*` namespaces are rejected because they are native
165
- * FHIR representation namespaces, never claims vocabularies.
165
+ * FHIR representation namespaces, never claims vocabularies. Native
166
+ * structural projections such as `<ResourceType>.meta.versionId` or array
167
+ * paths are ignored: they remain part of the FHIR resource, but are not API
168
+ * SearchParameters and must never become editable clinical fields.
166
169
  */
167
170
  export declare function toClinicalResourceClaimFieldViews(claims: ClinicalViewClaims): ClinicalResourceClaimFieldView[];
168
171
  /**
@@ -113,7 +113,10 @@ export function toClinicalResourceCardView(entry, options = {}) {
113
113
  * Short claims take precedence over their expanded
114
114
  * `org.hl7.fhir.api.<ResourceType>.<search-param>` equivalent. Versioned
115
115
  * `org.hl7.fhir.<version>.*` namespaces are rejected because they are native
116
- * FHIR representation namespaces, never claims vocabularies.
116
+ * FHIR representation namespaces, never claims vocabularies. Native
117
+ * structural projections such as `<ResourceType>.meta.versionId` or array
118
+ * paths are ignored: they remain part of the FHIR resource, but are not API
119
+ * SearchParameters and must never become editable clinical fields.
117
120
  */
118
121
  export function toClinicalResourceClaimFieldViews(claims) {
119
122
  const fields = new Map();
@@ -126,7 +129,9 @@ export function toClinicalResourceClaimFieldViews(claims) {
126
129
  }
127
130
  if (!rawClaim.startsWith('org.hl7.fhir.api.') && !/^[A-Z][A-Za-z0-9]+\./.test(rawClaim))
128
131
  continue;
129
- const claim = normalizeFhirApiClaimKey(rawClaim);
132
+ const claim = normalizeViewClaim(rawClaim);
133
+ if (!claim)
134
+ continue;
130
135
  const separator = claim.indexOf('.');
131
136
  if (separator <= 0 || separator === claim.length - 1)
132
137
  continue;
@@ -145,17 +150,28 @@ export function toClinicalResourceClaimFieldViews(claims) {
145
150
  continue;
146
151
  if (!/^[A-Z][A-Za-z0-9]+\./.test(claim))
147
152
  continue;
148
- const separator = claim.indexOf('.');
149
- if (separator <= 0 || separator === claim.length - 1)
153
+ const normalizedClaim = normalizeViewClaim(claim);
154
+ if (!normalizedClaim)
155
+ continue;
156
+ const separator = normalizedClaim.indexOf('.');
157
+ if (separator <= 0 || separator === normalizedClaim.length - 1)
150
158
  continue;
151
- fields.set(claim, {
152
- claim,
153
- parameter: claim.slice(separator + 1),
159
+ fields.set(normalizedClaim, {
160
+ claim: normalizedClaim,
161
+ parameter: normalizedClaim.slice(separator + 1),
154
162
  value,
155
163
  });
156
164
  }
157
165
  return [...fields.values()].sort((left, right) => left.claim.localeCompare(right.claim));
158
166
  }
167
+ function normalizeViewClaim(rawClaim) {
168
+ try {
169
+ return normalizeFhirApiClaimKey(rawClaim);
170
+ }
171
+ catch {
172
+ return undefined;
173
+ }
174
+ }
159
175
  /**
160
176
  * Maps all entries from a Bundle into minimal card views.
161
177
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-common-utils-ts",
3
- "version": "2.9.16",
3
+ "version": "2.9.17",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },