diff --git a/src/export/ValueSetExporter.ts b/src/export/ValueSetExporter.ts index 947eebec..ef7c08d2 100644 --- a/src/export/ValueSetExporter.ts +++ b/src/export/ValueSetExporter.ts @@ -76,8 +76,10 @@ export class ValueSetExporter { .replace(/^([^|]+)/, csMetadata?.url ?? '$1') .split('|'); composeElement.system = foundSystem[0]; - // if the code system is also a contained resource, add the special extension - // if it's not a contained resource, and the system we found is an inline instance, that's a problem + // if the code system is also a contained resource, add the valueset-system extension + // this zulip thread contains a discussion of the issue and an example using this extension: + // https://chat.fhir.org/#narrow/stream/215610-shorthand/topic/Contained.20code.20system.20in.20the.20value.20set/near/424938537 + // additionally, if it's not a contained resource, and the system we found is an inline instance, that's a problem const containedSystem = valueSet.contained?.find((resource: any) => { return resource?.id === csMetadata.id && resource.resourceType === 'CodeSystem'; }); diff --git a/src/fhirtypes/ValueSet.ts b/src/fhirtypes/ValueSet.ts index db7fe71b..555b7d9e 100644 --- a/src/fhirtypes/ValueSet.ts +++ b/src/fhirtypes/ValueSet.ts @@ -1,6 +1,14 @@ import sanitize from 'sanitize-filename'; import { Meta } from './specialTypes'; -import { Narrative, Resource, Identifier, CodeableConcept, Coding, Extension } from './dataTypes'; +import { + Narrative, + Resource, + Identifier, + CodeableConcept, + Coding, + Extension, + Element +} from './dataTypes'; import { ContactDetail, UsageContext } from './metaDataTypes'; import { HasName, HasId } from './mixins'; import { applyMixins } from '../utils/Mixin'; @@ -82,9 +90,7 @@ export type ValueSetCompose = { export type ValueSetComposeIncludeOrExclude = { system?: string; - _system?: { - extension?: Extension[]; - }; + _system?: Element; version?: string; valueSet?: string[]; concept?: ValueSetComposeConcept[];