diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index b23bdf50..47529e4a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v3 with: repository: wso2/open-healthcare-codegen-tool-framework - ref: v1.2.3 + ref: v2.0.0 path: './open-healthcare-codegen-tool-framework' - name: Setup Java and Maven diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe54f3fa..01492801 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v3 with: repository: wso2/open-healthcare-codegen-tool-framework - ref: v1.2.3 + ref: v2.0.0 path: './open-healthcare-codegen-tool-framework' - name: Setup Maven diff --git a/native/cds-bal-template/src/main/java/org/wso2/healthcare/cds/codegen/ballerina/tool/BallerinaCDSProjectConstants.java b/native/cds-bal-template/src/main/java/org/wso2/healthcare/cds/codegen/ballerina/tool/BallerinaCDSProjectConstants.java index 3325bf3a..731e2464 100644 --- a/native/cds-bal-template/src/main/java/org/wso2/healthcare/cds/codegen/ballerina/tool/BallerinaCDSProjectConstants.java +++ b/native/cds-bal-template/src/main/java/org/wso2/healthcare/cds/codegen/ballerina/tool/BallerinaCDSProjectConstants.java @@ -30,12 +30,14 @@ public class BallerinaCDSProjectConstants { public static final String CONFIG = "config"; public static final String PACKAGE = "package"; public static final String DEPENDENCIES = "dependencies"; + public static final String BASE_PACKAGE = "basePackage"; public static final String DEPENDENT_PACKAGE = "dependentPackage"; public static final String HOOKS = "hooks"; public static final String CDS_SERVICES = "cds_services"; public static final String META_CONFIG = "metaConfig"; public static final String PROJECT_PACKAGE_ORG = "project.package.org"; public static final String PROJECT_PACKAGE_VERSION = "project.package.version"; + public static final String PROJECT_PACKAGE_BASE_PACKAGE = "project.package.basePackage"; public static final String PROJECT_PACKAGE_DEPENDENT_PACKAGE = "project.package.dependentPackage"; public static final String PROJECT_PACKAGE_NAME_PREFIX = "project.package.namePrefix"; public static final String CMD_MESSAGE_OVERRIDE_OUTPUT_DIRECTORY = "Generated templates already exists. Do you want to overwrite? (y/n): "; diff --git a/native/cds-bal-template/src/main/java/org/wso2/healthcare/cds/codegen/ballerina/tool/config/BallerinaCDSProjectToolConfig.java b/native/cds-bal-template/src/main/java/org/wso2/healthcare/cds/codegen/ballerina/tool/config/BallerinaCDSProjectToolConfig.java index 0cc46925..0b1f1e5d 100644 --- a/native/cds-bal-template/src/main/java/org/wso2/healthcare/cds/codegen/ballerina/tool/config/BallerinaCDSProjectToolConfig.java +++ b/native/cds-bal-template/src/main/java/org/wso2/healthcare/cds/codegen/ballerina/tool/config/BallerinaCDSProjectToolConfig.java @@ -43,7 +43,8 @@ import static org.wso2.healthcare.cds.codegen.ballerina.tool.BallerinaCDSProjectConstants.PROJECT_PACKAGE_NAME_PREFIX; import static org.wso2.healthcare.cds.codegen.ballerina.tool.BallerinaCDSProjectConstants.PROJECT_PACKAGE_ORG; import static org.wso2.healthcare.cds.codegen.ballerina.tool.BallerinaCDSProjectConstants.PROJECT_PACKAGE_VERSION; - +import static org.wso2.healthcare.cds.codegen.ballerina.tool.BallerinaCDSProjectConstants.PROJECT_PACKAGE_BASE_PACKAGE; +import static org.wso2.healthcare.cds.codegen.ballerina.tool.BallerinaCDSProjectConstants.BASE_PACKAGE; /** * Main config class to hold all the config objects. @@ -53,6 +54,7 @@ public class BallerinaCDSProjectToolConfig extends AbstractToolConfig { private static final Log LOG = LogFactory.getLog(BallerinaCDSProjectToolConfig.class); private MetadataConfig metadataConfig; private final List dependencyConfigs = new ArrayList<>(); + private String basePackage; private String dependentPackage; private final List cdsHooks = new ArrayList<>(); @@ -61,9 +63,16 @@ public void configure(ConfigType configObj) throws CodeGenException { if (Constants.JSON_CONFIG_TYPE.equals(configObj.getType())) { JsonObject jsonConfigObj = ((JsonConfigType) configObj).getConfigObj(); jsonConfigObj = jsonConfigObj.getAsJsonObject(CONFIG); + this.metadataConfig = new MetadataConfig(jsonConfigObj.getAsJsonObject(PACKAGE)); populateDependencyConfigs(jsonConfigObj. getAsJsonArray(DEPENDENCIES)); + + if(jsonConfigObj.getAsJsonPrimitive((BASE_PACKAGE)) != null){ + this.basePackage = jsonConfigObj + .getAsJsonPrimitive(BASE_PACKAGE).getAsString(); + } + if (jsonConfigObj.getAsJsonPrimitive(DEPENDENT_PACKAGE) != null) { this.dependentPackage = jsonConfigObj .getAsJsonPrimitive(DEPENDENT_PACKAGE).getAsString(); @@ -95,6 +104,9 @@ public void overrideConfig(String jsonPath, JsonElement value) { case PROJECT_PACKAGE_NAME_PREFIX: this.metadataConfig.setNamePrefix(value.getAsString()); break; + case PROJECT_PACKAGE_BASE_PACKAGE: + this.basePackage = value.getAsString(); + break; case PROJECT_PACKAGE_DEPENDENT_PACKAGE: this.dependentPackage = value.getAsString(); break; @@ -121,6 +133,10 @@ public List getDependencyConfigs() { return dependencyConfigs; } + public String getBasePackage() { + return basePackage; + } + public String getDependentPackage() { return dependentPackage; } diff --git a/native/cds-bal-template/src/main/java/org/wso2/healthcare/cds/codegen/ballerina/tool/generator/BallerinaCDSProjectGenerator.java b/native/cds-bal-template/src/main/java/org/wso2/healthcare/cds/codegen/ballerina/tool/generator/BallerinaCDSProjectGenerator.java index 93297f7d..51a55d53 100644 --- a/native/cds-bal-template/src/main/java/org/wso2/healthcare/cds/codegen/ballerina/tool/generator/BallerinaCDSProjectGenerator.java +++ b/native/cds-bal-template/src/main/java/org/wso2/healthcare/cds/codegen/ballerina/tool/generator/BallerinaCDSProjectGenerator.java @@ -132,6 +132,6 @@ private String hookIdToCamelCase(String text) { StringBuilder textCopy = new StringBuilder(text); textCopy.setCharAt(ZERO, Character.toUpperCase(firstCharOfText)); text = textCopy.toString(); - return text.replaceAll(UNDERSCORE, ""); + return text.replaceAll(UNDERSCORE, StringUtils.EMPTY); } } diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/BallerinaPackageGenTool.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/BallerinaPackageGenTool.java index d750a853..03b1ea79 100644 --- a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/BallerinaPackageGenTool.java +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/BallerinaPackageGenTool.java @@ -22,12 +22,13 @@ import org.wso2.healthcare.codegen.tool.framework.commons.core.TemplateGenerator; import org.wso2.healthcare.codegen.tool.framework.commons.core.ToolContext; import org.wso2.healthcare.codegen.tool.framework.commons.exception.CodeGenException; -import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRDataTypeDef; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.config.BallerinaPackageGenToolConfig; -import org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.PackageContextGenerator; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.PackageContextGeneratorFactory; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.AbstractPackageContextGenerator; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.templategen.PackageTemplateGenerator; -import org.wso2.healthcare.codegen.tool.framework.fhir.core.common.FHIRSpecificationData; import org.wso2.healthcare.codegen.tool.framework.fhir.core.AbstractFHIRTool; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.common.FHIRSpecificationData; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRDataTypeDef; import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRImplementationGuide; import java.util.HashMap; @@ -37,7 +38,6 @@ * Ballerina FHIR Package Generator Tool. */ public class BallerinaPackageGenTool extends AbstractFHIRTool { - private final Map enabledIgs = new HashMap<>(); private BallerinaPackageGenToolConfig packageGenToolConfig; @@ -62,7 +62,8 @@ public TemplateGenerator execute(ToolContext toolContext) throws CodeGenExceptio if (packageGenToolConfig.isEnabled()) { String targetRoot = packageGenToolConfig.getTargetDir(); Map dataTypes = ((FHIRSpecificationData) toolContext.getSpecificationData()).getDataTypes(); - PackageContextGenerator packageContextGenerator = new PackageContextGenerator( + AbstractPackageContextGenerator packageContextGenerator = PackageContextGeneratorFactory.getPackageContextGenerator( + packageGenToolConfig.getPackageConfig().getFhirVersion(), packageGenToolConfig, enabledIgs, toolContext.getSpecificationData()); diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/ToolConstants.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/ToolConstants.java index 4e7f2f85..79331009 100644 --- a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/ToolConstants.java +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/ToolConstants.java @@ -38,6 +38,8 @@ public class ToolConstants { public static final String CONFIG_PACKAGE_DISTRIBUTION_TOML = "tools.config.package.ballerina_distribution"; public static final String CONFIG_PACKAGE_AUTHORS = "authors"; public static final String CONFIG_PACKAGE_AUTHORS_TOML = "tools.config.package.authors"; + public static final String CONFIG_PACKAGE_FHIR_VERSION = "fhirVersion"; + public static final String CONFIG_PACKAGE_FHIR_VERSION_TOML = "tools.config.packageConfig.fhirVersion"; public static final String CONFIG_PACKAGE_REPOSITORY = "repository"; public static final String CONFIG_PACKAGE_REPOSITORY_TOML = "tools.config.package.repository"; public static final String CONFIG_BASE_PACKAGE = "basePackage"; @@ -69,6 +71,7 @@ public class ToolConstants { public static final String CONFIG_BALLERINA_KEYWORD_REPLACE = "replace"; public static final String CONFIG_BALLERINA_KEYWORD_REPLACE_TOML = "tools.config.ballerina_keyword.replace"; public static final String TEMPLATE_PATH = "templates"; + public static final String TEMPLATE_VERSION_PATH = "versions"; public static final String BAL_EXTENSION = ".bal"; public static final String TOML_EXTENSION = ".toml"; public static final String MD_EXTENSION = ".md"; @@ -84,7 +87,8 @@ public enum TokenPosition { MIDDLE, END } - public static final String FHIR_R4_DEFINITION_URL = "http://hl7.org/fhir/StructureDefinition"; + public static final String FHIR_R4_DEFINITION_URL = "https://hl7.org/fhir/R4/structuredefinition.html"; + public static final String FHIR_R5_DEFINITION_URL = "https://hl7.org/fhir/R5/structuredefinition.html"; public static final String LICENSE_YEAR = String.valueOf(LocalDate.now().getYear()); public static final String DATA_TYPE_EXTENSION = "Extension"; diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/config/BallerinaPackageGenToolConfig.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/config/BallerinaPackageGenToolConfig.java index 2f9aa666..5f97d613 100644 --- a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/config/BallerinaPackageGenToolConfig.java +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/config/BallerinaPackageGenToolConfig.java @@ -113,6 +113,15 @@ public void overrideConfig(String jsonPath, JsonElement value) { case "packageConfig.name.append": this.packageConfig.setName(packageConfig.getName() + "." + value.getAsString()); break; + case "packageConfig.fhirVersion": + this.packageConfig.setFhirVersion(value.getAsString()); + break; + case "packageConfig.repository": + this.packageConfig.setRepository(value.getAsString()); + break; + case "packageConfig.basePackage": + this.packageConfig.setBasePackage(value.getAsString()); + break; case "packageConfig.dependent.igs": List dependentIgList = new ArrayList<>(); for (JsonElement dependentIgJsonElement : value.getAsJsonArray()) { diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/config/PackageConfig.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/config/PackageConfig.java index a19bf8a5..6be3daf8 100644 --- a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/config/PackageConfig.java +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/config/PackageConfig.java @@ -42,6 +42,7 @@ public class PackageConfig { private String version; private String ballerinaDistribution; private String authors; + private String fhirVersion; private String repository; private String basePackage; private List dependencyConfigList; @@ -53,6 +54,7 @@ public PackageConfig(JsonObject packageConfigJson) { this.version = packageConfigJson.getAsJsonPrimitive(ToolConstants.CONFIG_PACKAGE_VERSION).getAsString(); this.ballerinaDistribution = packageConfigJson.getAsJsonPrimitive(ToolConstants.CONFIG_PACKAGE_DISTRIBUTION).getAsString(); this.authors = packageConfigJson.getAsJsonArray(ToolConstants.CONFIG_PACKAGE_AUTHORS).getAsString(); + this.fhirVersion = packageConfigJson.getAsJsonPrimitive(ToolConstants.CONFIG_PACKAGE_FHIR_VERSION).getAsString(); this.repository = packageConfigJson.getAsJsonPrimitive(ToolConstants.CONFIG_PACKAGE_REPOSITORY).getAsString(); this.basePackage = packageConfigJson.getAsJsonPrimitive(ToolConstants.CONFIG_BASE_PACKAGE).getAsString(); populateDependencies(packageConfigJson.getAsJsonArray(ToolConstants.CONFIG_PACKAGE_DEPENDENCY).getAsJsonArray()); @@ -64,6 +66,7 @@ public PackageConfig(TomlTable packageConfigToml) { this.version = packageConfigToml.getString(ToolConstants.CONFIG_PACKAGE_VERSION_TOML); this.ballerinaDistribution = packageConfigToml.getString(ToolConstants.CONFIG_PACKAGE_DISTRIBUTION_TOML); this.authors = packageConfigToml.getString(ToolConstants.CONFIG_PACKAGE_AUTHORS_TOML); + this.fhirVersion = packageConfigToml.getString(ToolConstants.CONFIG_PACKAGE_FHIR_VERSION_TOML); this.repository = packageConfigToml.getString(ToolConstants.CONFIG_PACKAGE_REPOSITORY_TOML); this.basePackage = packageConfigToml.getString(ToolConstants.CONFIG_BASE_PACKAGE_TOML); populateDependencies(packageConfigToml.getArrayOrEmpty(ToolConstants.CONFIG_PACKAGE_DEPENDENCY_TOML)); @@ -106,6 +109,10 @@ public String getAuthors() { return authors; } + public String getFhirVersion() { + return fhirVersion; + } + public String getRepository() { return repository; } @@ -149,6 +156,10 @@ public void setBallerinaDistribution(String ballerinaDistribution) { this.ballerinaDistribution = ballerinaDistribution; } + public void setFhirVersion(String fhirVersion) { + this.fhirVersion = fhirVersion; + } + public void setBasePackage(String basePackage) { this.basePackage = basePackage; } diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/model/DataTypeProfile.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/model/DataTypeProfile.java index bf59ea46..26e6f4f8 100644 --- a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/model/DataTypeProfile.java +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/model/DataTypeProfile.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.wso2.healthcare.fhir.ballerina.packagegen.tool.model; /** diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/model/ExtendedElement.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/model/ExtendedElement.java index 2dfc9cc1..2effb7c4 100644 --- a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/model/ExtendedElement.java +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/model/ExtendedElement.java @@ -31,6 +31,10 @@ public class ExtendedElement { private DataTypeDefinitionAnnotation annotation; private HashMap elements; + // Store datatype of extended elements extended from a primitive type + // e.g: FHIR R5 EuropeBase --> patient.birthDate + private String primitiveExtendedType; + public String getTypeName() { return typeName; } @@ -91,4 +95,12 @@ public boolean equals(Object o) { } return false; } + + public String getPrimitiveExtendedType() { + return primitiveExtendedType; + } + + public void setPrimitiveExtendedType(String primitiveExtendedType) { + this.primitiveExtendedType = primitiveExtendedType; + } } diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/model/ResourceTemplateContext.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/model/ResourceTemplateContext.java index 4bdc70d8..51757f4f 100644 --- a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/model/ResourceTemplateContext.java +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/model/ResourceTemplateContext.java @@ -18,8 +18,6 @@ package org.wso2.healthcare.fhir.ballerina.packagegen.tool.model; -import org.hl7.fhir.r4.model.ElementDefinition; - import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -39,7 +37,7 @@ public class ResourceTemplateContext { private ResourceDefinitionAnnotation resourceDefinitionAnnotation; // This was added to check the cardinality discrepancies of slice elements against their base elements // Related issue: https://github.com/wso2-enterprise/open-healthcare/issues/1504 - private HashMap snapshotElementDefinitions = new HashMap<>(); + private HashMap snapshotElementDefinitions = new HashMap<>(); private HashMap snapshotElements = new HashMap<>(); private List differentialElementIds = new ArrayList<>(); private HashMap resourceElements = new HashMap<>(); @@ -95,11 +93,11 @@ public void setResourceDefinitionAnnotation(ResourceDefinitionAnnotation resourc this.resourceDefinitionAnnotation = resourceDefinitionAnnotation; } - public HashMap getSnapshotElementDefinitions() { + public HashMap getSnapshotElementDefinitions() { return snapshotElementDefinitions; } - public void setSnapshotElementDefinitions(HashMap snapshotElementDefinitions) { + public void setSnapshotElementDefinitions(HashMap snapshotElementDefinitions) { this.snapshotElementDefinitions = snapshotElementDefinitions; } diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/AbstractDatatypeContextGenerator.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/AbstractDatatypeContextGenerator.java new file mode 100644 index 00000000..a029f643 --- /dev/null +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/AbstractDatatypeContextGenerator.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.common.FHIRSpecificationData; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRDataTypeDef; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.BallerinaDataType; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.DatatypeTemplateContext; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.Element; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.ExtendedElement; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.GeneratorUtils; + +import java.util.HashMap; +import java.util.Map; + +/** + * Abstract class for generating context for FHIR data types. + * This class provides methods to populate and manage the context for FHIR data types. + * Extended by R4DatatypeContextGenerator and R5DatatypeContextGenerator + */ + +public abstract class AbstractDatatypeContextGenerator { + private static final Log LOG = LogFactory.getLog(AbstractDatatypeContextGenerator.class); + private final Map datatypeDefnMap; + private final Map dataTypeTemplateContextMap; + + public AbstractDatatypeContextGenerator(FHIRSpecificationData fhirSpecificationData) { + this.datatypeDefnMap = fhirSpecificationData.getDataTypes(); + this.dataTypeTemplateContextMap = new HashMap<>(); + populateDatatypeContext(); + } + + public Map getDatatypeDefnMap() { + return datatypeDefnMap; + } + + public Map getDataTypeTemplateContextMap() { + return dataTypeTemplateContextMap; + } + + protected Map getDataTypeDefnMap() { + return datatypeDefnMap; + } + + protected Map datatypeTemplateContextMap() { + return dataTypeTemplateContextMap; + } + + protected void populateExtendedElementsMap(Element element, DatatypeTemplateContext context) { + LOG.debug("Started: Resource Extended Element Map population"); + if (!element.getDataType().equals("Extension")) { + if (element.hasChildElements()) { + for (Map.Entry childEntry : element.getChildElements().entrySet()) { + populateExtendedElementsMap(childEntry.getValue(), context); + } + } + ExtendedElement extendedElement; + String elementDataType = element.getDataType(); + if (elementDataType.equals("code") && element.hasChildElements()) { + extendedElement = GeneratorUtils.getInstance().populateExtendedElement(element, BallerinaDataType.Enum, elementDataType, + context.getName()); + context.getExtendedElements().putIfAbsent(element.getName(), extendedElement); + element.setExtended(true); + } + } + LOG.debug("Ended: Resource Extended Element Map population"); + } + + protected abstract void populateDatatypeContext(); +} diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/AbstractPackageContextGenerator.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/AbstractPackageContextGenerator.java new file mode 100644 index 00000000..853a0144 --- /dev/null +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/AbstractPackageContextGenerator.java @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.healthcare.codegen.tool.framework.commons.core.SpecificationData; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.common.FHIRSpecificationData; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRImplementationGuide; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.config.BallerinaPackageGenToolConfig; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.config.DependencyConfig; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.PackageTemplateContext; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.GeneratorUtils; + +import java.util.HashMap; +import java.util.Map; + +/** + * Abstract class for generating package context for Ballerina FHIR package generation. + * This class is responsible for populating the package context. + * Extended by R4PackageContextGenerator and R5PackageContextGenerator. + */ + +public abstract class AbstractPackageContextGenerator { + private static final Log LOG = LogFactory.getLog(AbstractPackageContextGenerator.class); + private final BallerinaPackageGenToolConfig toolConfig; + private PackageTemplateContext packageContext; + + public AbstractPackageContextGenerator(BallerinaPackageGenToolConfig config, Map igEntries, + SpecificationData specificationData) { + this.toolConfig = config; + GeneratorUtils.getInstance().setToolConfig(config); + populatePackageContext(igEntries, (FHIRSpecificationData) specificationData); + } + + /** + * Populate package context + * + * @param igEntries available IGs map + * @param specificationData specification data + */ + private void populatePackageContext(Map igEntries, + FHIRSpecificationData specificationData) { + LOG.debug("Started: Package Context population"); + for (Map.Entry entry : igEntries.entrySet()) { + this.packageContext = new PackageTemplateContext(); + + if (toolConfig.getPackageConfig().getBasePackage() != null) { + this.packageContext.setBasePackageName(toolConfig.getPackageConfig().getBasePackage()); + } + + Map dependencyMap = new HashMap<>(); + for (DependencyConfig dependencyConfig : toolConfig.getPackageConfig().getDependencyConfigList()) { + dependencyMap.put(dependencyConfig.getName(), dependencyConfig.getOrg() + "/" + dependencyConfig.getName()); + } + this.packageContext.setDependenciesMap(dependencyMap); + + FHIRImplementationGuide implementationGuide = entry.getValue(); + + populateDatatypeTemplateContext(specificationData); + populateResourceTemplateContext(implementationGuide); + populateIGTemplateContexts(entry.getValue().getName(), implementationGuide); + } + LOG.debug("Ended: Package Context population"); + } + + public PackageTemplateContext getPackageContext() { + return packageContext; + } + + public BallerinaPackageGenToolConfig getToolConfig() { + return toolConfig; + } + + protected abstract void populateDatatypeTemplateContext(FHIRSpecificationData specificationData); + + protected abstract void populateResourceTemplateContext(FHIRImplementationGuide implementationGuide); + + protected abstract void populateIGTemplateContexts(String igCode, FHIRImplementationGuide implementationGuide); + + protected abstract void populateSearchParameters(FHIRImplementationGuide implementationGuide); +} diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/AbstractResourceContextGenerator.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/AbstractResourceContextGenerator.java new file mode 100644 index 00000000..ab9ff860 --- /dev/null +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/AbstractResourceContextGenerator.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRImplementationGuide; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.config.BallerinaPackageGenToolConfig; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.DataTypeDefinitionAnnotation; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.DatatypeTemplateContext; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.ResourceTemplateContext; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.Element; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.ExtendedElement; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.GeneratorUtils; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.AnnotationElement; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.BallerinaDataType; + +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.Arrays; +import java.util.Iterator; +import java.util.HashSet; +import java.util.regex.Pattern; + +import static org.wso2.healthcare.fhir.ballerina.packagegen.tool.ToolConstants.CONSTRAINTS_LIB_IMPORT; + +/** + * Abstract class for generating resource context. + * This class provides methods to populate resource elements, + * Extended by R4ResourceContextGenerator and R5ResourceContextGenerator. + */ + +public abstract class AbstractResourceContextGenerator { + private static final Log LOG = LogFactory.getLog(AbstractResourceContextGenerator.class); + public final Set baseResources = new HashSet<>(Arrays.asList("Bundle", "OperationOutcome", "CodeSystem", "ValueSet", "DomainResource", "Resource")); + private final BallerinaPackageGenToolConfig toolConfig; + private final Map resourceTemplateContextMap; + private final Map resourceNameTypeMap; + private final Map datatypeTemplateContextMap; + private final Set dependentIgs = new HashSet<>(); + protected ResourceTemplateContext resourceTemplateContextInstance; + + public AbstractResourceContextGenerator(BallerinaPackageGenToolConfig config, FHIRImplementationGuide ig, + Map datatypeTemplateContextMap) { + LOG.debug("Resource Context Generator Initiated"); + this.toolConfig = config; + this.resourceTemplateContextMap = new HashMap<>(); + this.resourceNameTypeMap = new HashMap<>(); + this.datatypeTemplateContextMap = datatypeTemplateContextMap; + populateResourceTemplateContexts(ig); + } + + protected abstract void populateResourceTemplateContexts(FHIRImplementationGuide ig); + + protected void populateResourceElementMap(Element element) { + if (!element.isSlice()) { + if (element.hasChildElements()) { + Iterator> rootIterator = element.getChildElements().entrySet().iterator(); + Iterator> iterator = rootIterator; + while (iterator.hasNext()) { + Map.Entry childEntry = iterator.next(); + if (childEntry.getValue().isSlice()) { + iterator.remove(); + } else if (childEntry.getValue().hasChildElements()) { + rootIterator = iterator; + iterator = childEntry.getValue().getChildElements().entrySet().iterator(); + } else { + iterator = rootIterator; + } + } + } + + checkAndAddConstraintImport(element); + this.resourceTemplateContextInstance.getResourceElements().put(element.getName(), element); + } + } + + protected void checkAndAddConstraintImport(Element element) { + boolean isCardinalityConstrained = (element.getMin() >= 1 && element.getMax() > 1) || (element.isArray() && + element.getMax() > 0 && element.getMax() < Integer.MAX_VALUE); + boolean isConstraintsImportExists = this.resourceTemplateContextInstance.getResourceDependencies() + .stream() + .anyMatch(d -> d.equals(CONSTRAINTS_LIB_IMPORT)); + if (!isConstraintsImportExists && isCardinalityConstrained) { + this.resourceTemplateContextInstance.getResourceDependencies().add(CONSTRAINTS_LIB_IMPORT); + } + } + + protected void markExtendedElements(Element element) { + if (!"Extension".equals(element.getDataType())) { + if (this.resourceTemplateContextInstance.getDifferentialElementIds().contains(element.getName()) + || "Code".equals(element.getDataType()) + || "BackboneElement".equals(element.getDataType()) + || "BackboneType".equals(element.getDataType()) + || element.hasFixedValue()) { + element.setExtended(true); + } + if (element.hasChildElements()) { + for (Map.Entry childEntry : element.getChildElements().entrySet()) { + markExtendedElements(childEntry.getValue()); + if (childEntry.getValue().isExtended()) { + element.setExtended(true); + } + } + } + } + } + + /** + * Populate extended elements map + * + * @param element resource element + */ + protected void populateResourceExtendedElementsMap(Element element) { + LOG.debug("Started: Resource Extended Element Map population"); + if (!element.getDataType().equals("Extension")) { + if (element.hasChildElements()) { + for (Map.Entry childEntry : element.getChildElements().entrySet()) { + populateResourceExtendedElementsMap(childEntry.getValue()); + } + } + validateAndPopulateExtendedElement(element); + } + LOG.debug("Ended: Resource Extended Element Map population"); + } + + /** + * Validate and create extended elements from resource elements + * + * @param element resource element to be validated + */ + private void validateAndPopulateExtendedElement(Element element) { + LOG.debug("Started: Resource Extended Element validation"); + ExtendedElement extendedElement; + String elementDataType = element.getDataType(); + + if (elementDataType.equals("code") && element.hasChildElements()) { + extendedElement = GeneratorUtils.getInstance().populateExtendedElement(element, BallerinaDataType.Enum, elementDataType, + this.resourceTemplateContextInstance.getResourceName()); + putExtendedElementIfAbsent(element, extendedElement); + } else if (element.isSlice() || elementDataType.equals("BackboneElement") || elementDataType.equals("BackboneType") || (element.isExtended() && element.hasChildElements())) { + extendedElement = GeneratorUtils.getInstance().populateExtendedElement(element, BallerinaDataType.Record, elementDataType, + this.resourceTemplateContextInstance.getResourceName()); + extendedElement.setElements(element.getChildElements()); + + DataTypeDefinitionAnnotation annotation = new DataTypeDefinitionAnnotation(); + annotation.setName(extendedElement.getTypeName()); + + if (element.hasChildElements()) { + HashMap childElementAnnotations = new HashMap<>(); + for (Element subElement : element.getChildElements().values()) { + checkAndAddConstraintImport(subElement); + AnnotationElement annotationElement = GeneratorUtils.getInstance().populateAnnotationElement(subElement); + childElementAnnotations.put(annotationElement.getName(), annotationElement); + } + annotation.setElements(childElementAnnotations); + } + extendedElement.setAnnotation(annotation); + if (!element.isSlice() && this.resourceTemplateContextInstance.getSliceElements().containsKey(element.getPath())) { + for (Element slice : this.resourceTemplateContextInstance.getSliceElements().get(element.getPath())) { + slice.setDataType(extendedElement.getTypeName()); + } + } + putExtendedElementIfAbsent(element, extendedElement); + } + LOG.debug("Ended: Resource Extended Element validation"); + } + + protected void putExtendedElementIfAbsent(Element element, ExtendedElement extendedElement) { + if (extendedElement != null) { + boolean isAlreadyExists = this.resourceTemplateContextInstance.getExtendedElements().containsKey(extendedElement.getTypeName()); + if (isAlreadyExists) { + element.setDataType(this.resourceTemplateContextInstance.getExtendedElements().get(extendedElement.getTypeName()).getTypeName()); + } else { + this.resourceTemplateContextInstance.getExtendedElements().put(extendedElement.getTypeName(), extendedElement); + } + } + } + + protected void populateResourceElementAnnotationsMap(Element element) { + LOG.debug("Started: Resource Element Annotation Map population"); + AnnotationElement annotationElement = GeneratorUtils.getInstance().populateAnnotationElement(element); + this.resourceTemplateContextInstance.getResourceDefinitionAnnotation().getElements().put(element.getName(), annotationElement); + this.resourceTemplateContextInstance.getResourceDefinitionAnnotation().getElements().put(annotationElement.getName(), annotationElement); + LOG.debug("Ended: Resource Element Annotation Map population"); + } + + /** + * Validates whether given string has codes + * + * @param string A string with/without codes delimited by pipe(|) + * @return True or False + */ + private boolean isCodedString(String string) { + String[] codes = string.split(Pattern.quote("|")); + return codes.length > 1; + } + + public Map getResourceNameTypeMap() { + return resourceNameTypeMap; + } + + protected BallerinaPackageGenToolConfig getToolConfig() { + return toolConfig; + } + + protected Set getDependentIgs() { + return dependentIgs; + } + + public Map getResourceTemplateContextMap() { + return resourceTemplateContextMap; + } + + protected Map getDatatypeTemplateContextMap() { + return datatypeTemplateContextMap; + } +} diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/PackageContextGeneratorFactory.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/PackageContextGeneratorFactory.java new file mode 100644 index 00000000..4818dd85 --- /dev/null +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/PackageContextGeneratorFactory.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen; + +import org.wso2.healthcare.codegen.tool.framework.commons.core.SpecificationData; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRImplementationGuide; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.config.BallerinaPackageGenToolConfig; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.versions.r4.R4PackageContextGenerator; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.versions.r5.R5PackageContextGenerator; + +import java.util.Map; + +/** + * Factory class to create package context generators based on the FHIR version. + */ +public class PackageContextGeneratorFactory { + public static AbstractPackageContextGenerator getPackageContextGenerator(String fhirVersion, BallerinaPackageGenToolConfig config, + Map igEntries, SpecificationData specificationData) { + + switch (fhirVersion.toLowerCase()) { + case ("r4"): + return new R4PackageContextGenerator(config, igEntries, specificationData); + case ("r5"): + return new R5PackageContextGenerator(config, igEntries, specificationData); + default: + throw new IllegalArgumentException("Unsupported FHIR version: " + fhirVersion); + } + } +} diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/DatatypeContextGenerator.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r4/R4DatatypeContextGenerator.java similarity index 68% rename from native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/DatatypeContextGenerator.java rename to native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r4/R4DatatypeContextGenerator.java index affca7ed..5b37235e 100644 --- a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/DatatypeContextGenerator.java +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r4/R4DatatypeContextGenerator.java @@ -15,23 +15,22 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen; +package org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.versions.r4; import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.hl7.fhir.r4.model.ElementDefinition; import org.wso2.healthcare.codegen.tool.framework.fhir.core.common.FHIRSpecificationData; import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRDataTypeDef; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.versions.r4.model.FHIRR4DataTypeDef; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.ToolConstants; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.AnnotationElement; -import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.BallerinaDataType; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.DataTypeDefinitionAnnotation; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.DatatypeTemplateContext; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.Element; -import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.ExtendedElement; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.AbstractDatatypeContextGenerator; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.CommonUtil; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.GeneratorUtils; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.versions.r4.R4GeneratorUtils; import java.util.Arrays; import java.util.HashMap; @@ -39,13 +38,10 @@ import java.util.Map; /** - * Template context generator for FHIR datatypes to be used to generate datatypes source file. + * Datatype Template context generator for FHIR R4 datatypes to be used to generate datatypes source file. */ -public class DatatypeContextGenerator { +public class R4DatatypeContextGenerator extends AbstractDatatypeContextGenerator { - private static final Log LOG = LogFactory.getLog(DatatypeContextGenerator.class); - private final Map datatypeDefnMap; - private final Map dataTypeTemplateContextMap; private static final List DEFAULT_DATA_TYPES = Arrays.asList("Ratio", "Period", "Range", "Attachment", "Identifier", "Annotation", "HumanName", "CodeableConcept", "ContactPoint", "Coding", "Money", "Address", "Timing", "BackboneElement", "Quantity", "SampledData", "Signature", "Age", "Distance", "Duration", "Count", @@ -54,47 +50,45 @@ public class DatatypeContextGenerator { "Dosage", "xhtml", "ElementDefinition", "Extension", "Narrative", "ProdCharacteristic", "Population", "SubstanceAmount" ); - public DatatypeContextGenerator(FHIRSpecificationData fhirSpecificationData) { - this.datatypeDefnMap = fhirSpecificationData.getDataTypes(); - this.dataTypeTemplateContextMap = new HashMap<>(); - populateDatatypeContext(); + public R4DatatypeContextGenerator(FHIRSpecificationData fhirSpecificationData) { + super(fhirSpecificationData); } - public Map getDatatypeDefnMap() { - return datatypeDefnMap; - } - - public Map getDataTypeTemplateContextMap() { - return dataTypeTemplateContextMap; - } + @Override + protected void populateDatatypeContext() { + for (Map.Entry datatypeDefnEntry : getDataTypeDefnMap().entrySet()) { + FHIRR4DataTypeDef datatypeDefn = (FHIRR4DataTypeDef) datatypeDefnEntry.getValue(); - private void populateDatatypeContext() { - for (Map.Entry datatypeDefnEntry : datatypeDefnMap.entrySet()) { - FHIRDataTypeDef datatypeDefn = datatypeDefnEntry.getValue(); if (DEFAULT_DATA_TYPES.contains(datatypeDefn.getDefinition().getName()) || "Extension".equals(datatypeDefn.getDefinition().getType())) { continue; } + DatatypeTemplateContext context = new DatatypeTemplateContext(); String typeName = CommonUtil.getSplitTokenAt(datatypeDefn.getDefinition().getUrl(), "/", ToolConstants.TokenPosition.END); context.setName(GeneratorUtils.getInstance().getUniqueIdentifierFromId(typeName)); context.setBaseDataType(datatypeDefn.getDefinition().getType()); + DataTypeDefinitionAnnotation annotation = new DataTypeDefinitionAnnotation(); annotation.setName(datatypeDefn.getDefinition().getName()); + context.setAnnotation(annotation); + for (ElementDefinition elementDefinition : datatypeDefn.getDefinition().getSnapshot().getElement()) { if (elementDefinition.getPath().contains(".")) { - String elementName = elementDefinition.getPath().substring( - elementDefinition.getPath().lastIndexOf(".") + 1); + String elementName = elementDefinition.getPath().substring(elementDefinition.getPath().lastIndexOf(".") + 1); + if ("id".equals(elementName) || "extension".equals(elementName) || elementDefinition.getPath().contains(".extension.")) { //skipping for generating datatype extensions continue; } + Element element = new Element(); element.setMax(GeneratorUtils.getMaxCardinality(elementDefinition.getMax())); element.setMin(elementDefinition.getMin()); element.setArray(!"0".equals(elementDefinition.getBase().getMax()) && !"1".equals(elementDefinition.getBase().getMax())); + String typeCode = elementDefinition.getType().get(0).getCode(); if (GeneratorUtils.getInstance().shouldReplacedByBalType(typeCode)) { element.setDataType(GeneratorUtils.getInstance().resolveDataType(typeCode)); @@ -103,44 +97,28 @@ private void populateDatatypeContext() { } else { element.setDataType(typeCode); } + if (elementName.endsWith("[x]") && datatypeDefn.getDefinition().getType().equals( ToolConstants.DATA_TYPE_EXTENSION)) { - context.setBaseDataType(StringUtils.capitalise(typeCode + ToolConstants.DATA_TYPE_EXTENSION)); + context.setBaseDataType(StringUtils.capitalize(typeCode + ToolConstants.DATA_TYPE_EXTENSION)); } else if ("code".equals(typeCode)) { - GeneratorUtils.populateCodeValuesForCodeElements(elementDefinition, element); + R4GeneratorUtils.populateCodeValuesForCodeElements(elementDefinition, element); } + element.setName(GeneratorUtils.getInstance().resolveMultiDataTypeFieldNames(elementName, typeCode)); element.setDescription(CommonUtil.parseMultilineString(elementDefinition.getDefinition())); element.setPath(elementDefinition.getPath()); + //populate extended elements populateExtendedElementsMap(element, context); + //populate annotations AnnotationElement annotationElement = GeneratorUtils.getInstance().populateAnnotationElement(element); annotation.addElement(annotationElement); context.addElement(element); } } - dataTypeTemplateContextMap.putIfAbsent(datatypeDefn.getDefinition().getUrl(), context); - } - } - - private void populateExtendedElementsMap(Element element, DatatypeTemplateContext context) { - LOG.debug("Started: Resource Extended Element Map population"); - if (!element.getDataType().equals("Extension")) { - if (element.hasChildElements()) { - for (Map.Entry childEntry : element.getChildElements().entrySet()) { - populateExtendedElementsMap(childEntry.getValue(), context); - } - } - ExtendedElement extendedElement; - String elementDataType = element.getDataType(); - if (elementDataType.equals("code") && element.hasChildElements()) { - extendedElement = GeneratorUtils.getInstance().populateExtendedElement(element, BallerinaDataType.Enum, elementDataType, - context.getName()); - context.getExtendedElements().putIfAbsent(element.getName(), extendedElement); - element.setExtended(true); - } + datatypeTemplateContextMap().putIfAbsent(datatypeDefn.getDefinition().getUrl(), context); } - LOG.debug("Ended: Resource Extended Element Map population"); } } diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/PackageContextGenerator.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r4/R4PackageContextGenerator.java similarity index 52% rename from native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/PackageContextGenerator.java rename to native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r4/R4PackageContextGenerator.java index bda154eb..ea83cfeb 100644 --- a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/PackageContextGenerator.java +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r4/R4PackageContextGenerator.java @@ -16,70 +16,43 @@ * under the License. */ -package org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen; +package org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.versions.r4; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.healthcare.codegen.tool.framework.commons.core.SpecificationData; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.SearchParameter; import org.wso2.healthcare.codegen.tool.framework.fhir.core.common.FHIRSpecificationData; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.versions.r4.model.FHIRR4SearchParamDef; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.DataTypesRegistry; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.config.BallerinaPackageGenToolConfig; -import org.wso2.healthcare.fhir.ballerina.packagegen.tool.config.DependencyConfig; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.IGTemplateContext; -import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.PackageTemplateContext; -import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.SearchParameter; import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRImplementationGuide; import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRSearchParamDef; -import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.GeneratorUtils; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.AbstractPackageContextGenerator; -import java.util.*; +import java.util.Map; +import java.util.HashMap; +import java.util.ArrayList; /** - * Generator class for package related context + * Generator class for FHIR R4 package related context */ -public class PackageContextGenerator { - - private static final Log LOG = LogFactory.getLog(PackageContextGenerator.class); - private final BallerinaPackageGenToolConfig toolConfig; - private PackageTemplateContext packageContext; - - public PackageContextGenerator(BallerinaPackageGenToolConfig config, - Map igEntries, SpecificationData specificationData) { - LOG.debug("Package Context Generator Initiated"); - this.toolConfig = config; - GeneratorUtils.getInstance().setToolConfig(config); - populatePackageContext(igEntries, (FHIRSpecificationData) specificationData); - } - - /** - * Populate package context - * - * @param igEntries available IGs map - * @param specificationData specification data - */ - private void populatePackageContext(Map igEntries, - FHIRSpecificationData specificationData) { - LOG.debug("Started: Package Context population"); - for (Map.Entry entry : igEntries.entrySet()) { - this.packageContext = new PackageTemplateContext(); - - if (toolConfig.getPackageConfig().getBasePackage() != null) { - this.packageContext.setBasePackageName(toolConfig.getPackageConfig().getBasePackage()); - } +public class R4PackageContextGenerator extends AbstractPackageContextGenerator { - Map dependencyMap = new HashMap<>(); - for (DependencyConfig dependencyConfig : toolConfig.getPackageConfig().getDependencyConfigList()) { - dependencyMap.put(dependencyConfig.getName(), dependencyConfig.getOrg() + "/" + dependencyConfig.getName()); - } - this.packageContext.setDependenciesMap(dependencyMap); + private static final Log LOG = LogFactory.getLog(R4PackageContextGenerator.class); - FHIRImplementationGuide implementationGuide = entry.getValue(); + public R4PackageContextGenerator(BallerinaPackageGenToolConfig config, Map igEntries, + SpecificationData specificationData) { + super(config, igEntries, specificationData); + } - populateDatatypeTemplateContext(specificationData); - populateResourceTemplateContext(implementationGuide); - populateIGTemplateContexts(entry.getValue().getName(), implementationGuide); - } - LOG.debug("Ended: Package Context population"); + @Override + protected void populateDatatypeTemplateContext(FHIRSpecificationData specificationData) { + LOG.debug("Started: Datatype Template Context population"); + R4DatatypeContextGenerator r4DatatypeContextGenerator = new R4DatatypeContextGenerator(specificationData); + getPackageContext().setDatatypeTemplateContextMap(r4DatatypeContextGenerator.getDataTypeTemplateContextMap()); + LOG.debug("Ended: Datatype Template Context population"); } /** @@ -87,38 +60,33 @@ private void populatePackageContext(Map igEntri * * @param ig implementation guide DTO */ - private void populateResourceTemplateContext(FHIRImplementationGuide ig) { + @Override + protected void populateResourceTemplateContext(FHIRImplementationGuide ig) { LOG.debug("Started: Resource Template Context population"); - ResourceContextGenerator resourceContextGenerator = new ResourceContextGenerator(this.toolConfig, ig, - packageContext.getDatatypeTemplateContextMap()); - this.packageContext.setResourceTemplateContextMap(resourceContextGenerator.getResourceTemplateContextMap()); - this.packageContext.setResourceNameTypeMap(resourceContextGenerator.getResourceNameTypeMap()); - this.packageContext.setDataTypesRegistry(DataTypesRegistry.getInstance().getDataTypesRegistry()); + R4ResourceContextGenerator r4ResourceContextGenerator = new R4ResourceContextGenerator(getToolConfig(), ig, + getPackageContext().getDatatypeTemplateContextMap()); + getPackageContext().setResourceTemplateContextMap(r4ResourceContextGenerator.getResourceTemplateContextMap()); + getPackageContext().setResourceNameTypeMap(r4ResourceContextGenerator.getResourceNameTypeMap()); + getPackageContext().setDataTypesRegistry(DataTypesRegistry.getInstance().getDataTypesRegistry()); LOG.debug("Ended: Resource Template Context population"); } - private void populateDatatypeTemplateContext(FHIRSpecificationData specificationData) { - LOG.debug("Started: Datatype Template Context population"); - DatatypeContextGenerator datatypeContextGenerator = new DatatypeContextGenerator(specificationData); - this.packageContext.setDatatypeTemplateContextMap(datatypeContextGenerator.getDataTypeTemplateContextMap()); - LOG.debug("Ended: Datatype Template Context population"); - } - /** * Populate IG template contexts * * @param igCode given code for the IG * @param implementationGuide implementation guide DTO */ - private void populateIGTemplateContexts(String igCode, FHIRImplementationGuide implementationGuide) { + @Override + protected void populateIGTemplateContexts(String igCode, FHIRImplementationGuide implementationGuide) { LOG.debug("Started: IG Template Context population"); IGTemplateContext igTemplateContext = new IGTemplateContext(); - String igName = toolConfig.getPackageConfig().getName().replaceAll("\\.", "_"); + String igName = getToolConfig().getPackageConfig().getName().replaceAll("\\.", "_"); //todo: handle the case where IG resource exist in the spec dir igTemplateContext.setIgName(igName); igTemplateContext.setTitle(igName); igTemplateContext.setIgCode(igCode.replaceAll("\\.", "_")); - this.packageContext.setIgTemplateContext(igTemplateContext); + getPackageContext().setIgTemplateContext(igTemplateContext); populateSearchParameters(implementationGuide); LOG.debug("Ended: IG Template Context population"); } @@ -128,15 +96,18 @@ private void populateIGTemplateContexts(String igCode, FHIRImplementationGuide i * * @param implementationGuide implementation guide */ - private void populateSearchParameters(FHIRImplementationGuide implementationGuide) { + @Override + protected void populateSearchParameters(FHIRImplementationGuide implementationGuide) { LOG.debug("Started: Search Parameter population"); HashMap> searchParameterMap = new HashMap<>(); for (Map.Entry searchParamEntry : implementationGuide.getSearchParameters().entrySet()) { Map searchParameterTypeMap; SearchParameter searchParameter; - String searchParamName = searchParamEntry.getValue().getSearchParameter().getName(); - String searchParamType = searchParamEntry.getValue().getSearchParameter().getType().name(); + + FHIRR4SearchParamDef fhirSearchParamDef = (FHIRR4SearchParamDef) searchParamEntry.getValue(); + String searchParamName = fhirSearchParamDef.getSearchParameter().getName(); + String searchParamType = fhirSearchParamDef.getSearchParameter().getType().name(); String searchParamDerivedName = searchParamName + searchParamType; if (searchParameterMap.containsKey(searchParamName)) { @@ -153,8 +124,8 @@ private void populateSearchParameters(FHIRImplementationGuide implementationGuid } ArrayList bases = new ArrayList<>(); - for (String base : searchParamEntry.getValue().getBaseResources()) { - if (this.packageContext.getResourceNameTypeMap().containsValue(base)) { + for (String base : fhirSearchParamDef.getBaseResources()) { + if (getPackageContext().getResourceNameTypeMap().containsValue(base)) { if (!bases.contains(base)) { bases.add(base); } @@ -166,25 +137,24 @@ private void populateSearchParameters(FHIRImplementationGuide implementationGuid if (!bases.isEmpty()) { searchParameter.setName(searchParamName); searchParameter.setType(searchParamType); + if (searchParameter.getBase() != null) bases.addAll(searchParameter.getBase()); + searchParameter.setBase(bases); + if (searchParameter.getExpression() != null) { String expression = searchParameter.getExpression(); - expression = expression + " | " + searchParamEntry.getValue().getSearchParameter().getExpression(); + expression = expression + " | " + fhirSearchParamDef.getSearchParameter().getExpression(); searchParameter.setExpression(expression); } else { - searchParameter.setExpression(searchParamEntry.getValue().getSearchParameter().getExpression()); + searchParameter.setExpression(fhirSearchParamDef.getSearchParameter().getExpression()); } searchParameterTypeMap.put(searchParamDerivedName, searchParameter); searchParameterMap.put(searchParamName, searchParameterTypeMap); } } - this.packageContext.getIgTemplateContext().setSearchParameters(searchParameterMap); + getPackageContext().getIgTemplateContext().setSearchParameters(searchParameterMap); LOG.debug("Ended: Search Parameter population"); } - - public PackageTemplateContext getPackageContext() { - return packageContext; - } } diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/ResourceContextGenerator.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r4/R4ResourceContextGenerator.java similarity index 65% rename from native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/ResourceContextGenerator.java rename to native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r4/R4ResourceContextGenerator.java index 66247dc9..4cadffcf 100644 --- a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/ResourceContextGenerator.java +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r4/R4ResourceContextGenerator.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen; +package org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.versions.r4; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -28,56 +28,37 @@ import org.hl7.fhir.r4.model.Base; import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRImplementationGuide; import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRResourceDef; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.versions.r4.model.FHIRR4ResourceDef; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.DataTypesRegistry; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.ToolConstants; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.config.BallerinaPackageGenToolConfig; -import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.AnnotationElement; -import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.BallerinaDataType; -import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.DataTypeDefinitionAnnotation; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.DataTypeProfile; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.DatatypeTemplateContext; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.Element; -import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.ExtendedElement; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.ResourceDefinitionAnnotation; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.ResourceTemplateContext; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.AbstractResourceContextGenerator; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.CommonUtil; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.GeneratorUtils; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.versions.r4.R4GeneratorUtils; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.HashMap; import java.util.Map; import java.util.Set; -import java.util.HashSet; -import java.util.Iterator; import java.util.Comparator; import java.util.regex.Pattern; -import static org.wso2.healthcare.fhir.ballerina.packagegen.tool.ToolConstants.CONSTRAINTS_LIB_IMPORT; - /** - * Generator class for resource related context + * Generator class for FHIR R4 resource related context */ -public class ResourceContextGenerator { - private static final Log LOG = LogFactory.getLog(ResourceContextGenerator.class); - public final Set baseResources = new HashSet<>(Arrays.asList("Bundle", "OperationOutcome", "CodeSystem", - "ValueSet", "DomainResource", "Resource")); - private final BallerinaPackageGenToolConfig toolConfig; - private ResourceTemplateContext resourceTemplateContextInstance; - private final Map resourceTemplateContextMap; - private final Map resourceNameTypeMap; - private final Map datatypeTemplateContextMap; - private final Set dependentIgs = new HashSet<>(); - - public ResourceContextGenerator(BallerinaPackageGenToolConfig config, FHIRImplementationGuide ig, - Map datatypeTemplateContextMap) { - LOG.debug("Resource Context Generator Initiated"); - this.toolConfig = config; - this.resourceTemplateContextMap = new HashMap<>(); - this.resourceNameTypeMap = new HashMap<>(); - this.datatypeTemplateContextMap = datatypeTemplateContextMap; - populateResourceTemplateContexts(ig); +public class R4ResourceContextGenerator extends AbstractResourceContextGenerator { + private static final Log LOG = LogFactory.getLog(R4ResourceContextGenerator.class); + + public R4ResourceContextGenerator(BallerinaPackageGenToolConfig config, FHIRImplementationGuide ig, + Map datatypeTemplateContextMap) { + super(config, ig, datatypeTemplateContextMap); } /** @@ -85,24 +66,33 @@ public ResourceContextGenerator(BallerinaPackageGenToolConfig config, FHIRImplem * * @param ig FHIR implementation guide DTO */ - private void populateResourceTemplateContexts(FHIRImplementationGuide ig) { + @Override + protected void populateResourceTemplateContexts(FHIRImplementationGuide ig) { LOG.debug("Started: Resource Template Context population"); + for (Map.Entry definitionEntry : ig.getResources().entrySet()) { - StructureDefinition structureDefinition = definitionEntry.getValue().getDefinition(); + FHIRR4ResourceDef resourceDef = (FHIRR4ResourceDef) definitionEntry.getValue(); + StructureDefinition structureDefinition = (StructureDefinition) definitionEntry.getValue().getDefinition(); + if (!baseResources.contains(structureDefinition.getType())) { - this.resourceNameTypeMap.put(structureDefinition.getName(), structureDefinition.getType()); + getResourceNameTypeMap().put(structureDefinition.getName(), structureDefinition.getType()); this.resourceTemplateContextInstance = new ResourceTemplateContext(); this.resourceTemplateContextInstance.setResourceType(structureDefinition.getType()); this.resourceTemplateContextInstance.setResourceName(GeneratorUtils.getInstance().resolveSpecialCharacters(structureDefinition.getName())); - this.resourceTemplateContextInstance.setProfile(definitionEntry.getValue().getDefinition().getUrl()); + this.resourceTemplateContextInstance.setProfile(resourceDef.getDefinition().getUrl()); this.resourceTemplateContextInstance.setIgName(ig.getName()); ResourceDefinitionAnnotation resourceDefinitionAnnotation = new ResourceDefinitionAnnotation(); resourceDefinitionAnnotation.setName(GeneratorUtils.getInstance().resolveSpecialCharacters(structureDefinition.getName())); + DataTypesRegistry.getInstance().addDataType(GeneratorUtils.getInstance().resolveSpecialCharacters(structureDefinition.getName())); - resourceDefinitionAnnotation.setBaseType(CommonUtil.getSplitTokenAt(structureDefinition - .getBaseDefinition(), ToolConstants.RESOURCE_PATH_SEPERATOR, ToolConstants.TokenPosition.END)); + resourceDefinitionAnnotation.setBaseType(CommonUtil.getSplitTokenAt( + structureDefinition.getBaseDefinition(), + ToolConstants.RESOURCE_PATH_SEPERATOR, + ToolConstants.TokenPosition.END) + ); + resourceDefinitionAnnotation.setProfile(this.resourceTemplateContextInstance.getProfile()); resourceDefinitionAnnotation.setElements(new HashMap<>()); this.resourceTemplateContextInstance.setResourceDefinitionAnnotation(resourceDefinitionAnnotation); @@ -118,15 +108,15 @@ private void populateResourceTemplateContexts(FHIRImplementationGuide ig) { Map profiles = snapshotElement.getProfiles(); profiles.keySet().stream() - .flatMap(key -> toolConfig.getPackageConfig().getDependentIgs().keySet().stream() + .flatMap(key -> getToolConfig().getPackageConfig().getDependentIgs().keySet().stream() .filter(key::startsWith) - .map(profile -> toolConfig.getPackageConfig().getDependentIgs().get(profile))) + .map(profile -> getToolConfig().getPackageConfig().getDependentIgs().get(profile))) .distinct() - .forEach(dependentIgs::add); + .forEach(getDependentIgs()::add); } Set resourceDependencies = this.resourceTemplateContextInstance.getResourceDependencies(); - resourceDependencies.addAll(dependentIgs); + resourceDependencies.addAll(getDependentIgs()); this.resourceTemplateContextInstance.setResourceDependencies(resourceDependencies); for (Element resourceElement : this.resourceTemplateContextInstance.getResourceElements().values()) { @@ -140,7 +130,7 @@ private void populateResourceTemplateContexts(FHIRImplementationGuide ig) { } } - this.resourceTemplateContextMap.put(structureDefinition.getName(), this.resourceTemplateContextInstance); + getResourceTemplateContextMap().put(structureDefinition.getName(), this.resourceTemplateContextInstance); } } LOG.debug("Ended: Resource Template Context population"); @@ -150,7 +140,7 @@ private void populateElementDefinitionMap(List elementDefinit for (ElementDefinition elementDefinition : elementDefinitions) { String id = elementDefinition.getId(); int colonCount = StringUtils.countMatches(id, ":"); - if (colonCount>1) { + if (colonCount > 1) { // nested slice; ignore processing continue; } @@ -306,7 +296,7 @@ private Element populateElement(String rootName, String name, ElementDefinition. if (ToolConstants.ELEMENT.equals(type.getCode())) { element.setDataType(ToolConstants.ELEMENT + CommonUtil.toCamelCase(name)); } else { - element.setDataType(GeneratorUtils.getInstance().resolveDataType(toolConfig, type.getCode())); + element.setDataType(GeneratorUtils.getInstance().resolveDataType(getToolConfig(), type.getCode())); } //Adding profiles of the resource element type List profiles = type.getProfile(); @@ -314,16 +304,16 @@ private Element populateElement(String rootName, String name, ElementDefinition. for (CanonicalType profile : profiles) { String profileType = CommonUtil.getSplitTokenAt(profile.getValue(), "/", ToolConstants.TokenPosition.END); profileType = GeneratorUtils.getInstance().getUniqueIdentifierFromId(profileType); - if (datatypeTemplateContextMap.containsKey(profile.getValue())) { + if (getDatatypeTemplateContextMap().containsKey(profile.getValue())) { element.addProfile(profile.getValue(), profileType); DataTypesRegistry.getInstance().addDataType(profileType); } else { element.addProfile(profile.getValue(), profileType); } //check for prefix when non R4 profiles are available - for (String dependentIgUrl : toolConfig.getPackageConfig().getDependentIgs().keySet()) { + for (String dependentIgUrl : getToolConfig().getPackageConfig().getDependentIgs().keySet()) { if (profile.getValue().startsWith(dependentIgUrl)) { - String dependentIgPackageName = toolConfig.getPackageConfig().getDependentIgs().get(dependentIgUrl); + String dependentIgPackageName = getToolConfig().getPackageConfig().getDependentIgs().get(dependentIgUrl); String dependentIgPackagePrefix = CommonUtil.getSplitTokenAt(dependentIgPackageName, "\\.", ToolConstants.TokenPosition.END); element.getProfiles().get(profile.getValue()).setPrefix(dependentIgPackagePrefix); } @@ -362,7 +352,7 @@ private Element populateElement(String rootName, String name, ElementDefinition. Refer Issue: https://github.com/wso2-enterprise/open-healthcare/issues/928 */ if (element.getDataType().equals("code")) { - GeneratorUtils.populateCodeValuesForCodeElements(elementDefinition, element); + R4GeneratorUtils.populateCodeValuesForCodeElements(elementDefinition, element); } // markConstrainedElements(element); LOG.debug("Ended: Resource Element population"); @@ -397,125 +387,6 @@ private Element populateChildElementProperties(Property childProperty, String el return childElement; } - private void populateResourceElementMap(Element element) { - if (!element.isSlice()) { - if (element.hasChildElements()) { - Iterator> rootIterator = element.getChildElements().entrySet().iterator(); - Iterator> iterator = rootIterator; - while (iterator.hasNext()) { - Map.Entry childEntry = iterator.next(); - if (childEntry.getValue().isSlice()) { - iterator.remove(); - } else if (childEntry.getValue().hasChildElements()) { - rootIterator = iterator; - iterator = childEntry.getValue().getChildElements().entrySet().iterator(); - } else { - iterator = rootIterator; - } - } - } - checkAndAddConstraintImport(element); - this.resourceTemplateContextInstance.getResourceElements().put(element.getName(), element); - } - } - - private void checkAndAddConstraintImport(Element element) { - boolean isCardinalityConstrained = (element.getMin() >= 1 && element.getMax() > 1) || (element.isArray() && - element.getMax() > 0 && element.getMax() < Integer.MAX_VALUE); - boolean isConstraintsImportExists = this.resourceTemplateContextInstance.getResourceDependencies() - .stream() - .anyMatch(d -> d.equals(CONSTRAINTS_LIB_IMPORT)); - if (!isConstraintsImportExists && isCardinalityConstrained) { - this.resourceTemplateContextInstance.getResourceDependencies().add(CONSTRAINTS_LIB_IMPORT); - } - } - - private void markExtendedElements(Element element) { - if (!"Extension".equals(element.getDataType())) { - if (this.resourceTemplateContextInstance.getDifferentialElementIds().contains(element.getName()) || "Code".equals(element.getDataType()) || "BackboneElement".equals(element.getDataType()) || element.hasFixedValue()) { - element.setExtended(true); - } - if (element.hasChildElements()) { - for (Map.Entry childEntry : element.getChildElements().entrySet()) { - markExtendedElements(childEntry.getValue()); - if (childEntry.getValue().isExtended()) { - element.setExtended(true); - } - } - } - } - } - - /** - * Populate extended elements map - * - * @param element resource element - */ - private void populateResourceExtendedElementsMap(Element element) { - LOG.debug("Started: Resource Extended Element Map population"); - if (!element.getDataType().equals("Extension")) { - if (element.hasChildElements()) { - for (Map.Entry childEntry : element.getChildElements().entrySet()) { - populateResourceExtendedElementsMap(childEntry.getValue()); - } - } - validateAndPopulateExtendedElement(element); - } - LOG.debug("Ended: Resource Extended Element Map population"); - } - - /** - * Validate and create extended elements from resource elements - * - * @param element resource element to be validated - */ - private void validateAndPopulateExtendedElement(Element element) { - LOG.debug("Started: Resource Extended Element validation"); - ExtendedElement extendedElement; - String elementDataType = element.getDataType(); - if (elementDataType.equals("code") && element.hasChildElements()) { - extendedElement = GeneratorUtils.getInstance().populateExtendedElement(element, BallerinaDataType.Enum, elementDataType, - this.resourceTemplateContextInstance.getResourceName()); - putExtendedElementIfAbsent(element, extendedElement); - } else if (element.isSlice() || elementDataType.equals("BackboneElement") || (element.isExtended() && element.hasChildElements())) { - extendedElement = GeneratorUtils.getInstance().populateExtendedElement(element, BallerinaDataType.Record, elementDataType, - this.resourceTemplateContextInstance.getResourceName()); - extendedElement.setElements(element.getChildElements()); - - DataTypeDefinitionAnnotation annotation = new DataTypeDefinitionAnnotation(); - annotation.setName(extendedElement.getTypeName()); - - if (element.hasChildElements()) { - HashMap childElementAnnotations = new HashMap<>(); - for (Element subElement : element.getChildElements().values()) { - checkAndAddConstraintImport(subElement); - AnnotationElement annotationElement = GeneratorUtils.getInstance().populateAnnotationElement(subElement); - childElementAnnotations.put(annotationElement.getName(), annotationElement); - } - annotation.setElements(childElementAnnotations); - } - extendedElement.setAnnotation(annotation); - if (!element.isSlice() && this.resourceTemplateContextInstance.getSliceElements().containsKey(element.getPath())) { - for (Element slice : this.resourceTemplateContextInstance.getSliceElements().get(element.getPath())) { - slice.setDataType(extendedElement.getTypeName()); - } - } - putExtendedElementIfAbsent(element, extendedElement); - } - LOG.debug("Ended: Resource Extended Element validation"); - } - - private void putExtendedElementIfAbsent(Element element, ExtendedElement extendedElement) { - if (extendedElement != null) { - boolean isAlreadyExists = this.resourceTemplateContextInstance.getExtendedElements().containsKey(extendedElement.getTypeName()); - if (isAlreadyExists) { - element.setDataType(this.resourceTemplateContextInstance.getExtendedElements().get(extendedElement.getTypeName()).getTypeName()); - } else { - this.resourceTemplateContextInstance.getExtendedElements().put(extendedElement.getTypeName(), extendedElement); - } - } - } - private void populateResourceSliceElementsMap(Element element) { LOG.debug("Started: Resource Slice Element Map population"); if (ToolConstants.DATA_TYPE_EXTENSION.equals(element.getDataType()) && element.isSlice()) { @@ -525,7 +396,7 @@ private void populateResourceSliceElementsMap(Element element) { for (Map.Entry childEntry : element.getChildElements().entrySet()) { populateResourceSliceElementsMap(childEntry.getValue()); if (element.isSlice()) { - ElementDefinition elementDefinition = this.resourceTemplateContextInstance.getSnapshotElementDefinitions().get(childEntry.getValue().getPath()); + ElementDefinition elementDefinition = (ElementDefinition) this.resourceTemplateContextInstance.getSnapshotElementDefinitions().get(childEntry.getValue().getPath()); if (elementDefinition != null && isElementArray(elementDefinition)) { childEntry.getValue().setArray(true); } @@ -545,14 +416,6 @@ private void populateResourceSliceElementsMap(Element element) { LOG.debug("Ended: Resource Slice Element Map population"); } - private void populateResourceElementAnnotationsMap(Element element) { - LOG.debug("Started: Resource Element Annotation Map population"); - AnnotationElement annotationElement = GeneratorUtils.getInstance().populateAnnotationElement(element); - this.resourceTemplateContextInstance.getResourceDefinitionAnnotation().getElements().put(element.getName(), annotationElement); - this.resourceTemplateContextInstance.getResourceDefinitionAnnotation().getElements().put(annotationElement.getName(), annotationElement); - LOG.debug("Ended: Resource Element Annotation Map population"); - } - /** * Validates whether a resource attribute is on array of elements * @@ -562,23 +425,4 @@ private void populateResourceElementAnnotationsMap(Element element) { private boolean isElementArray(ElementDefinition elementDefinition) { return "*".equals(elementDefinition.getBase().getMax()) || Integer.parseInt(elementDefinition.getBase().getMax()) > 1; } - - /** - * Validates whether given string has codes - * - * @param string A string with/without codes delimited by pipe(|) - * @return True or False - */ - private boolean isCodedString(String string) { - String[] codes = string.split(Pattern.quote("|")); - return codes.length > 1; - } - - public Map getResourceTemplateContextMap() { - return resourceTemplateContextMap; - } - - public Map getResourceNameTypeMap() { - return resourceNameTypeMap; - } } diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r5/R5DatatypeContextGenerator.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r5/R5DatatypeContextGenerator.java new file mode 100644 index 00000000..113976b2 --- /dev/null +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r5/R5DatatypeContextGenerator.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.versions.r5; + +import org.apache.commons.lang.StringUtils; +import org.hl7.fhir.r5.model.ElementDefinition; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.common.FHIRSpecificationData; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRDataTypeDef; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.versions.r5.model.FHIRR5DataTypeDef; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.ToolConstants; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.AnnotationElement; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.DataTypeDefinitionAnnotation; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.DatatypeTemplateContext; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.Element; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.AbstractDatatypeContextGenerator; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.CommonUtil; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.GeneratorUtils; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.versions.r5.R5GeneratorUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * Datatype Template context generator for FHIR R5 datatypes to be used to generate datatypes source file. + */ +public class R5DatatypeContextGenerator extends AbstractDatatypeContextGenerator { + private static final List DEFAULT_DATA_TYPES = Arrays.asList( + "Ratio", "Period", "Range", "RatioRange", "Attachment", "Identifier", + "Annotation", "HumanName", "CodeableConcept", "ContactPoint", "Coding", + "Money", "Address", "Timing", "BackboneType", "Quantity", "SampledData", "Signature", + "Age", "Distance", "Duration", "Count", "MoneyQuantity", "SimpleQuantity", + "ContactDetail", "Contributor", "DataRequirement", "RelatedArtifact", "DataType", + "TriggerDefinition", "ParameterDefinition", "ExtendedContactDetail", + "Availability", "Expression", "UsageContext", "MonetaryComponent", "VirtualServiceDetail", + "CodeableReference", "Meta", "Reference", "Dosage", "xhtml", "Narrative", + "Extension", "ElementDefinition" + ); + + public R5DatatypeContextGenerator(FHIRSpecificationData fhirSpecificationData) { + super(fhirSpecificationData); + } + + @Override + protected void populateDatatypeContext() { + for (Map.Entry dataTypeDefnEntry : getDataTypeDefnMap().entrySet()) { + FHIRR5DataTypeDef datatypeDefn = (FHIRR5DataTypeDef) dataTypeDefnEntry.getValue(); + + if (DEFAULT_DATA_TYPES.contains(datatypeDefn.getDefinition().getName()) || + "Extension".equals(datatypeDefn.getDefinition().getType())) { + continue; + } + + DatatypeTemplateContext context = new DatatypeTemplateContext(); + String typeName = CommonUtil.getSplitTokenAt(datatypeDefn.getDefinition().getUrl(), "/", ToolConstants.TokenPosition.END); + context.setName(GeneratorUtils.getInstance().getUniqueIdentifierFromId(typeName)); + context.setBaseDataType(datatypeDefn.getDefinition().getType()); + + DataTypeDefinitionAnnotation annotation = new DataTypeDefinitionAnnotation(); + annotation.setName(datatypeDefn.getDefinition().getName()); + context.setAnnotation(annotation); + + for (ElementDefinition elementDefinition : datatypeDefn.getDefinition().getSnapshot().getElement()) { + if (elementDefinition.getPath().contains(".")) { + String elementName = elementDefinition.getPath().substring(elementDefinition.getPath().lastIndexOf(".") + 1); + + if ("id".equals(elementName) || "extension".equals(elementName) + || elementDefinition.getPath().contains(".extension.")) { + //skipping for generating datatype extensions + continue; + } + + Element element = new Element(); + element.setMax(GeneratorUtils.getMaxCardinality(elementDefinition.getMax())); + element.setMin(elementDefinition.getMin()); + element.setArray(!"0".equals(elementDefinition.getBase().getMax()) && !"1".equals(elementDefinition.getBase().getMax())); + + String typeCode = elementDefinition.getType().get(0).getCode(); + if (GeneratorUtils.getInstance().shouldReplacedByBalType(typeCode)) { + element.setDataType(GeneratorUtils.getInstance().resolveDataType(typeCode)); + } else if (ToolConstants.ELEMENT.equals(typeCode)) { + element.setDataType(ToolConstants.ELEMENT + CommonUtil.toCamelCase(elementName)); + } else { + element.setDataType(typeCode); + } + + if (elementName.endsWith("[x]") && datatypeDefn.getDefinition().getType().equals( + ToolConstants.DATA_TYPE_EXTENSION)) { + context.setBaseDataType(StringUtils.capitalize(typeCode + ToolConstants.DATA_TYPE_EXTENSION)); + } else if ("code".equals(typeCode)) { + R5GeneratorUtils.populateCodeValuesForCodeElements(elementDefinition, element); + } + + element.setName(GeneratorUtils.getInstance().resolveMultiDataTypeFieldNames(elementName, typeCode)); + element.setDescription(CommonUtil.parseMultilineString(elementDefinition.getDefinition())); + element.setPath(elementDefinition.getPath()); + + //populate extended elements + populateExtendedElementsMap(element, context); + + //populate annotations + AnnotationElement annotationElement = GeneratorUtils.getInstance().populateAnnotationElement(element); + annotation.addElement(annotationElement); + context.addElement(element); + } + } + datatypeTemplateContextMap().putIfAbsent(datatypeDefn.getDefinition().getUrl(), context); + } + } +} diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r5/R5PackageContextGenerator.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r5/R5PackageContextGenerator.java new file mode 100644 index 00000000..b5616990 --- /dev/null +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r5/R5PackageContextGenerator.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.versions.r5; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.SearchParameter; +import org.wso2.healthcare.codegen.tool.framework.commons.core.SpecificationData; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.common.FHIRSpecificationData; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRImplementationGuide; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRSearchParamDef; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.versions.r5.model.FHIRR5SearchParamDef; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.DataTypesRegistry; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.config.BallerinaPackageGenToolConfig; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.IGTemplateContext; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.AbstractPackageContextGenerator; + +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; + +/** + * Generator class for FHIR R5 package related context + */ +public class R5PackageContextGenerator extends AbstractPackageContextGenerator { + private static final Log LOG = LogFactory.getLog(R5PackageContextGenerator.class); + + public R5PackageContextGenerator(BallerinaPackageGenToolConfig config, Map igEntries, + SpecificationData specificationData) { + super(config, igEntries, specificationData); + } + + @Override + protected void populateDatatypeTemplateContext(FHIRSpecificationData specificationData) { + LOG.debug("Started: Datatype Template Context population"); + R5DatatypeContextGenerator r5DatatypeContextGenerator = new R5DatatypeContextGenerator(specificationData); + getPackageContext().setDatatypeTemplateContextMap(r5DatatypeContextGenerator.getDataTypeTemplateContextMap()); + LOG.debug("Ended: Datatype Template Context population"); + } + + @Override + protected void populateResourceTemplateContext(FHIRImplementationGuide ig) { + LOG.debug("Started: Resource Template Context population"); + R5ResourceContextGenerator r5ResourceContextGenerator = new R5ResourceContextGenerator(getToolConfig(), ig, getPackageContext().getDatatypeTemplateContextMap()); + getPackageContext().setResourceTemplateContextMap(r5ResourceContextGenerator.getResourceTemplateContextMap()); + getPackageContext().setResourceNameTypeMap(r5ResourceContextGenerator.getResourceNameTypeMap()); + getPackageContext().setDataTypesRegistry(DataTypesRegistry.getInstance().getDataTypesRegistry()); + LOG.debug("Ended: Resource Template Context population"); + } + + @Override + protected void populateIGTemplateContexts(String igCode, FHIRImplementationGuide implementationGuide) { + LOG.debug("Started: IG Template Context population"); + IGTemplateContext igTemplateContext = new IGTemplateContext(); + String igName = getToolConfig().getPackageConfig().getName().replaceAll("\\.", "_"); + igTemplateContext.setIgName(igName); + igTemplateContext.setTitle(igName); + igTemplateContext.setIgCode(igCode.replaceAll("\\.", "_")); + getPackageContext().setIgTemplateContext(igTemplateContext); + populateSearchParameters(implementationGuide); + LOG.debug("Ended: IG Template Context population"); + } + + @Override + protected void populateSearchParameters(FHIRImplementationGuide implementationGuide) { + LOG.debug("Started: Search Parameter population"); + HashMap> searchParameterMap = new HashMap<>(); + + for (Map.Entry searchParamEntry : implementationGuide.getSearchParameters().entrySet()) { + Map searchParameterTypeMap; + SearchParameter searchParameter; + + FHIRR5SearchParamDef fhirSearchParamDef = (FHIRR5SearchParamDef) searchParamEntry.getValue(); + String searchParamName = fhirSearchParamDef.getSearchParameter().getName(); + String searchParamType = fhirSearchParamDef.getSearchParameter().getType().name(); + String searchParamDerivedName = searchParamName + searchParamType; + + if (searchParameterMap.containsKey(searchParamName)) { + searchParameterTypeMap = searchParameterMap.get(searchParamName); + + if (searchParameterTypeMap.containsKey(searchParamDerivedName)) { + searchParameter = searchParameterTypeMap.get(searchParamDerivedName); + } else { + searchParameter = new SearchParameter(); + } + } else { + searchParameterTypeMap = new HashMap<>(); + searchParameter = new SearchParameter(); + } + + ArrayList bases = new ArrayList<>(); + for (String base : fhirSearchParamDef.getBaseResources()) { + if (getPackageContext().getResourceNameTypeMap().containsValue(base)) { + if (!bases.contains(base)) { + bases.add(base); + } + } else if (base.equals("Resource")) { + bases.add("Resource"); + } + } + + if (!bases.isEmpty()) { + searchParameter.setName(searchParamName); + searchParameter.setType(searchParamType); + + if (searchParameter.getBase() != null) { + bases.addAll(searchParameter.getBase()); + } + + searchParameter.setBase(bases); + + if (searchParameter.getExpression() != null) { + String expression = searchParameter.getExpression(); + expression = expression + " | " + fhirSearchParamDef.getSearchParameter().getExpression(); + searchParameter.setExpression(expression); + } else { + searchParameter.setExpression(fhirSearchParamDef.getSearchParameter().getExpression()); + } + searchParameterTypeMap.put(searchParamDerivedName, searchParameter); + searchParameterMap.put(searchParamName, searchParameterTypeMap); + } + } + getPackageContext().getIgTemplateContext().setSearchParameters(searchParameterMap); + LOG.debug("Ended: Search Parameter population"); + } +} diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r5/R5ResourceContextGenerator.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r5/R5ResourceContextGenerator.java new file mode 100644 index 00000000..7f1dd352 --- /dev/null +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/modelgen/versions/r5/R5ResourceContextGenerator.java @@ -0,0 +1,431 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.versions.r5; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.hl7.fhir.r5.model.Base; +import org.hl7.fhir.r5.model.CanonicalType; +import org.hl7.fhir.r5.model.Property; +import org.hl7.fhir.r5.model.ElementDefinition; +import org.hl7.fhir.r5.model.StructureDefinition; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRImplementationGuide; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRResourceDef; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.versions.r5.model.FHIRR5ResourceDef; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.DataTypesRegistry; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.ToolConstants; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.config.BallerinaPackageGenToolConfig; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.DatatypeTemplateContext; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.DataTypeProfile; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.Element; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.ResourceDefinitionAnnotation; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.ResourceTemplateContext; + +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.modelgen.AbstractResourceContextGenerator; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.CommonUtil; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.GeneratorUtils; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.versions.r5.R5GeneratorUtils; + +import java.util.Set; +import java.util.List; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.Comparator; +import java.util.regex.Pattern; + +/** + * Generator class for FHIR R5 resource related context + */ +public class R5ResourceContextGenerator extends AbstractResourceContextGenerator { + private static final Log LOG = LogFactory.getLog(R5ResourceContextGenerator.class); + + public R5ResourceContextGenerator(BallerinaPackageGenToolConfig config, FHIRImplementationGuide ig, + Map datatypeTemplateContextMap) { + super(config, ig, datatypeTemplateContextMap); + } + + /** + * Populate resource template contexts + * + * @param ig FHIR implementation guide DTO + */ + @Override + protected void populateResourceTemplateContexts(FHIRImplementationGuide ig) { + LOG.debug("Started: Resource Template Context population"); + + for (Map.Entry definitionEntry : ig.getResources().entrySet()) { + FHIRR5ResourceDef resourceDef = (FHIRR5ResourceDef) definitionEntry.getValue(); + StructureDefinition structureDefinition = (StructureDefinition) definitionEntry.getValue().getDefinition(); + + if (!baseResources.contains(structureDefinition.getType())) { + getResourceNameTypeMap().put(structureDefinition.getName(), structureDefinition.getType()); + + this.resourceTemplateContextInstance = new ResourceTemplateContext(); + this.resourceTemplateContextInstance.setResourceType(structureDefinition.getType()); + this.resourceTemplateContextInstance.setResourceName(GeneratorUtils.getInstance().resolveSpecialCharacters(structureDefinition.getName())); + this.resourceTemplateContextInstance.setProfile(resourceDef.getDefinition().getUrl()); + this.resourceTemplateContextInstance.setIgName(ig.getName()); + + ResourceDefinitionAnnotation resourceDefinitionAnnotation = new ResourceDefinitionAnnotation(); + resourceDefinitionAnnotation.setName(GeneratorUtils.getInstance().resolveSpecialCharacters(structureDefinition.getName())); + + DataTypesRegistry.getInstance().addDataType(GeneratorUtils.getInstance().resolveSpecialCharacters(structureDefinition.getName())); + resourceDefinitionAnnotation.setBaseType(CommonUtil.getSplitTokenAt( + structureDefinition.getBaseDefinition(), + ToolConstants.RESOURCE_PATH_SEPERATOR, + ToolConstants.TokenPosition.END) + ); + + resourceDefinitionAnnotation.setProfile(this.resourceTemplateContextInstance.getProfile()); + resourceDefinitionAnnotation.setElements(new HashMap<>()); + this.resourceTemplateContextInstance.setResourceDefinitionAnnotation(resourceDefinitionAnnotation); + + populateElementDefinitionMap(structureDefinition.getSnapshot().getElement()); + populateSnapshotElementMap(structureDefinition.getSnapshot().getElement()); + populateDifferentialElementIdsList(structureDefinition.getDifferential().getElement()); + + for (Element snapshotElement : this.resourceTemplateContextInstance.getSnapshotElements().values()) { + markExtendedElements(snapshotElement); + populateResourceSliceElementsMap(snapshotElement); + populateResourceElementMap(snapshotElement); + + Map profiles = snapshotElement.getProfiles(); + profiles.keySet().stream() + .flatMap(key -> getToolConfig().getPackageConfig().getDependentIgs().keySet().stream() + .filter(key::startsWith) + .map(profile -> getToolConfig().getPackageConfig().getDependentIgs().get(profile))) + .distinct() + .forEach(getDependentIgs()::add); + } + + Set resourceDependencies = this.resourceTemplateContextInstance.getResourceDependencies(); + resourceDependencies.addAll(getDependentIgs()); + this.resourceTemplateContextInstance.setResourceDependencies(resourceDependencies); + + for (Element resourceElement : this.resourceTemplateContextInstance.getResourceElements().values()) { + populateResourceExtendedElementsMap(resourceElement); + populateResourceElementAnnotationsMap(resourceElement); + } + + for (List slices : this.resourceTemplateContextInstance.getSliceElements().values()) { + for (Element slice : slices) { + populateResourceExtendedElementsMap(slice); + } + } + + getResourceTemplateContextMap().put(structureDefinition.getName(), this.resourceTemplateContextInstance); + } + } + LOG.debug("Ended: Resource Template Context population"); + } + + private void populateElementDefinitionMap(List elementDefinitions) { + for (ElementDefinition elementDefinition : elementDefinitions) { + String id = elementDefinition.getId(); + int colonCount = StringUtils.countMatches(id, ":"); + if (colonCount > 1) { + // nested slice; ignore processing + continue; + } + this.resourceTemplateContextInstance.getSnapshotElementDefinitions().put(id, elementDefinition); + } + } + + /** + * Populate resource elements map in a hierarchical way + * + * @param elementDefinitions FHIR element definition DTO + */ + private void populateSnapshotElementMap(List elementDefinitions) { + LOG.debug("Started: Snapshot Element Map population"); + elementDefinitions.sort(new Comparator() { + @Override + public int compare(ElementDefinition e1, ElementDefinition e2) { + return e1.getPath().compareToIgnoreCase(e2.getPath()); + } + }); + + String elementPath; + String[] elementPathTokens; + HashMap snapshotElementMap = new HashMap<>(); + + boolean isSlice; + String sliceNamePattern; + for (ElementDefinition elementDefinition : elementDefinitions) { + isSlice = false; + elementPath = elementDefinition.getPath(); + + // Adding logic to handle multi datatype element definitions in the + // format of .[x]:. + // i.e : MedicationRequest.medication[x]:medicationCodeableConcept.coding + String id = elementDefinition.getId(); + if (id.contains(":")) { + if (id.substring(id.indexOf("."), id.lastIndexOf(":")).contains(":")) { + // nested slice; ignore processing + continue; + } + } + if (id.contains("[x]:")) { + elementPath = id.replaceAll("\\w+([A-Z]?\\[x]:)", ""); + if (elementPath.contains(":")) { + elementPath = elementPath.replaceAll("\\w+([A-Z]?:)", ""); + String[] pathTokens = elementPath.split("\\."); + sliceNamePattern = ":" + pathTokens[pathTokens.length - 1]; + if (id.contains(sliceNamePattern)) { + isSlice = true; + } + } + } else if (id.contains(":")) { + elementPath = id.replaceAll("\\w+([A-Z]?:)", ""); + String[] pathTokens = elementPath.split("\\."); + sliceNamePattern = ":" + pathTokens[pathTokens.length - 1]; + if (id.endsWith(sliceNamePattern)) { + isSlice = true; + } + } + elementPathTokens = elementPath.split("\\."); + + if (elementPathTokens.length > 1) { + String rootElementName; + String elementName; + String resourceName = elementPathTokens[0]; + elementPath = elementPath.substring(resourceName.length() + 1); + + if (elementPath.split("\\.").length > 1) { + Map elementMap = snapshotElementMap; + while (elementPath.split("\\.").length > 1) { + elementPathTokens = elementPath.split("\\."); + rootElementName = elementPathTokens[0]; + if (rootElementName.contains("[x]")) + rootElementName = rootElementName.replace("[x]", elementDefinition.getBase().getPath().split("\\.")[0]); + + if (elementPathTokens.length == 2) { + elementName = elementPathTokens[1]; + if (elementMap.containsKey(rootElementName)) { + Element rootElement = elementMap.get(rootElementName); + List types = elementDefinition.getType(); + String tempElement = elementName.split(Pattern.quote("[x]"))[0]; + for (ElementDefinition.TypeRefComponent type : elementDefinition.getType()) { + if (types.size() > 1 || elementName.contains("[x]")) + elementName = tempElement + CommonUtil.toCamelCase(type.getCode()); + + Element childElement = populateElement(rootElementName, elementName, type, isSlice, elementDefinition); + if (ToolConstants.DATA_TYPE_EXTENSION.equals(childElement.getDataType()) && !elementName.equals("extension") + && !elementName.equals("modifierExtension")) { + continue; + } + if (rootElement.getChildElements() != null) { + if (!rootElement.getChildElements().containsKey(elementName)) { + rootElement.getChildElements().put(elementName, childElement); + } + } else { + HashMap newChildElements = new HashMap<>(); + newChildElements.put(elementName, childElement); + rootElement.setChildElements(newChildElements); + } + } + } + } + if (elementPath.contains("[x]")) + elementPath = elementPath.replace("[x]", elementDefinition.getBase().getPath().split("\\.")[0]); + elementPath = elementPath.substring(rootElementName.length() + 1); + if (elementMap.containsKey(rootElementName) && elementMap.get(rootElementName).hasChildElements()) + elementMap = elementMap.get(rootElementName).getChildElements(); + } + } else { + List types = elementDefinition.getType(); + String tempElement = elementPath.split(Pattern.quote("[x]"))[0]; + for (ElementDefinition.TypeRefComponent type : elementDefinition.getType()) { + if (types.size() > 1 || elementPath.contains("[x]")) + elementPath = tempElement + CommonUtil.toCamelCase(type.getCode()); + Element element = populateElement(resourceName, elementPath, type, isSlice, elementDefinition); + snapshotElementMap.put(elementPath, element); + } + } + } + } + this.resourceTemplateContextInstance.setSnapshotElements(snapshotElementMap); + LOG.debug("Ended: Snapshot Element Map population"); + } + + private void populateResourceSliceElementsMap(Element element) { + LOG.debug("Started: Resource Slice Element Map population"); + if (ToolConstants.DATA_TYPE_EXTENSION.equals(element.getDataType()) && element.isSlice()) { + return; + } + if (element.hasChildElements()) { + for (Map.Entry childEntry : element.getChildElements().entrySet()) { + populateResourceSliceElementsMap(childEntry.getValue()); + if (element.isSlice()) { + ElementDefinition elementDefinition = (ElementDefinition) this.resourceTemplateContextInstance.getSnapshotElementDefinitions().get(childEntry.getValue().getPath()); + if (elementDefinition != null && isElementArray(elementDefinition)) { + childEntry.getValue().setArray(true); + } + } + } + } + + if (element.isSlice()) { + if (this.resourceTemplateContextInstance.getSliceElements().get(element.getPath()) != null) { + this.resourceTemplateContextInstance.getSliceElements().get(element.getPath()).add(element); + } else { + ArrayList slices = new ArrayList<>(); + slices.add(element); + this.resourceTemplateContextInstance.getSliceElements().put(element.getPath(), slices); + } + } + LOG.debug("Ended: Resource Slice Element Map population"); + } + + /** + * Create resource element + * + * @param rootName element root + * @param name element name + * @param type element data type + * @param elementDefinition element definition DTO + * @return created element object + */ + private Element populateElement(String rootName, String name, ElementDefinition.TypeRefComponent type, boolean isSlice, ElementDefinition elementDefinition) { + LOG.debug("Started: Resource Element population"); + + Element element = new Element(); + element.setName(GeneratorUtils.getInstance().resolveSpecialCharacters(name)); + element.setRootElementName(rootName); + + if (ToolConstants.ELEMENT.equals(type.getCode())) { + element.setDataType(ToolConstants.ELEMENT + CommonUtil.toCamelCase(name)); + } else { + element.setDataType(GeneratorUtils.getInstance().resolveDataType(getToolConfig(), type.getCode())); + } + //Adding profiles of the resource element type + List profiles = type.getProfile(); + if (!profiles.isEmpty()) { + for (CanonicalType profile : profiles) { + String profileType = CommonUtil.getSplitTokenAt(profile.getValue(), "/", ToolConstants.TokenPosition.END); + profileType = GeneratorUtils.getInstance().getUniqueIdentifierFromId(profileType); + + if (getDatatypeTemplateContextMap().containsKey(profile.getValue())) { + element.addProfile(profile.getValue(), profileType); + DataTypesRegistry.getInstance().addDataType(profileType); + } else { + element.addProfile(profile.getValue(), profileType); + } + //check for prefix when non R5 profiles are available + for (String dependentIgUrl : getToolConfig().getPackageConfig().getDependentIgs().keySet()) { + if (profile.getValue().startsWith(dependentIgUrl)) { + String dependentIgPackageName = getToolConfig().getPackageConfig().getDependentIgs().get(dependentIgUrl); + String dependentIgPackagePrefix = CommonUtil.getSplitTokenAt(dependentIgPackageName, "\\.", ToolConstants.TokenPosition.END); + element.getProfiles().get(profile.getValue()).setPrefix(dependentIgPackagePrefix); + } + } + } + } else { + element.addProfile(element.getDataType(), element.getDataType()); + } + if (elementDefinition.hasFixed()) { + ArrayList values = new ArrayList<>(); + values.add(elementDefinition.getFixed().primitiveValue()); + element.setFixedValue(values); + } else if (elementDefinition.hasPattern() && !elementDefinition.getPattern().children().isEmpty()) { + HashMap childElements = new HashMap<>(); + for (Property childProperty : elementDefinition.getPattern().children()) { + if (childProperty.hasValues()) { + Element childElement = populateChildElementProperties(childProperty, elementDefinition.getPath()); + childElements.put(childProperty.getName(), childElement); + } + } + element.setChildElements(childElements); + } + + element.setMin(elementDefinition.getMin()); + element.setMax(GeneratorUtils.getMaxCardinality(elementDefinition.getMax())); + element.setArray(isElementArray(elementDefinition)); + element.setIsSlice(isSlice); + element.setPath(elementDefinition.getPath()); + element.setValueSet(elementDefinition.getBinding().getValueSet()); + element.setDescription(CommonUtil.parseMultilineString(elementDefinition.getDefinition())); + element.setSummary(CommonUtil.parseMultilineString(elementDefinition.getShort())); + element.setRequirement(CommonUtil.parseMultilineString(elementDefinition.getRequirements())); + + /* + Todo: Fix resolving of Codes from implementation Guide + Refer Issue: https://github.com/wso2-enterprise/open-healthcare/issues/928 + */ + if (element.getDataType().equals("code")) { + R5GeneratorUtils.populateCodeValuesForCodeElements(elementDefinition, element); + } +// markConstrainedElements(element); + LOG.debug("Ended: Resource Element population"); + return element; + } + + private void populateDifferentialElementIdsList(List elementDefinitions) { + String elementPath; + + for (ElementDefinition elementDefinition : elementDefinitions) { + elementPath = elementDefinition.getPath(); + String relativePath = elementPath.replace(this.resourceTemplateContextInstance.getResourceType() + ".", ""); + String[] pathTokens = relativePath.split("\\."); + if (pathTokens.length > 1) { + this.resourceTemplateContextInstance.getDifferentialElementIds().add(pathTokens[0]); + } + } + } + + private Element populateChildElementProperties(Property childProperty, String elementPath) { + Element childElement = new Element(); + childElement.setName(childProperty.getName()); + childElement.setDataType(childProperty.getTypeCode()); + childElement.setArray(childProperty.isList()); + childElement.setMin(1); + childElement.setMax(childProperty.getMaxCardinality()); + childElement.setDescription(childProperty.getDefinition()); + childElement.setPath(elementPath + "." + childProperty.getName()); + + ArrayList values = new ArrayList<>(); + for (Base value : childProperty.getValues()) { + if (!value.hasPrimitiveValue()) { + HashMap childElements = new HashMap<>(); + for (Property property : value.children()) { + if (property.hasValues()) + childElements.put(property.getName(), populateChildElementProperties(property, childElement.getPath())); + } + childElement.setChildElements(childElements); + } else { + values.add(value.primitiveValue()); + } + } + childElement.setFixedValue(values); +// markConstrainedElements(childElement); + return childElement; + } + + /** + * Validates whether a resource attribute is on array of elements + * + * @param elementDefinition Element definition DTO for specific FHIR attribute + * @return is an element array or not + */ + private boolean isElementArray(ElementDefinition elementDefinition) { + return "*".equals(elementDefinition.getBase().getMax()) || Integer.parseInt(elementDefinition.getBase().getMax()) > 1; + } +} diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/templategen/PackageTemplateGenerator.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/templategen/PackageTemplateGenerator.java index f115a4e8..3c5800cb 100644 --- a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/templategen/PackageTemplateGenerator.java +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/templategen/PackageTemplateGenerator.java @@ -98,6 +98,7 @@ public void generate(ToolContext toolContext, Map generatorPrope this.packageProperties.put("basePackageIdentifier", basePackageIdentifier); this.packageProperties.put("importIdentifier", basePackageIdentifier + ":"); } + generatePackageEssentials(toolConfig); LOG.debug("Ended: Package Template Generation"); } @@ -133,15 +134,32 @@ private void generatePackageEssentials(BallerinaPackageGenToolConfig toolConfig) LOG.debug("Started: Package Essentials Generation"); try { String packagePath = (String) this.packageProperties.get("packagePath"); - String filePath = CommonUtil.generateFilePath(packagePath, "Ballerina" - + ToolConstants.TOML_EXTENSION, ""); - this.getTemplateEngine().generateOutputAsFile(ToolConstants.TEMPLATE_PATH + ToolConstants.RESOURCE_PATH_SEPERATOR + "ballerina_toml.vm", - this.createTemplateContextForBallerinaToml(toolConfig), "", filePath); + String filePath = CommonUtil.generateFilePath(packagePath, "Ballerina" + ToolConstants.TOML_EXTENSION, ""); + + if(toolConfig.getPackageConfig().getFhirVersion().equals("r4")){ + this.getTemplateEngine().generateOutputAsFile( + ToolConstants.TEMPLATE_PATH + ToolConstants.RESOURCE_PATH_SEPERATOR + ToolConstants.TEMPLATE_VERSION_PATH + ToolConstants.RESOURCE_PATH_SEPERATOR + "r4" + ToolConstants.RESOURCE_PATH_SEPERATOR + "r4_ballerina_toml.vm", + this.createTemplateContextForBallerinaToml(toolConfig), "", filePath); + } + else if (toolConfig.getPackageConfig().getFhirVersion().equals("r5")) { + this.getTemplateEngine().generateOutputAsFile( + ToolConstants.TEMPLATE_PATH + ToolConstants.RESOURCE_PATH_SEPERATOR + ToolConstants.TEMPLATE_VERSION_PATH + ToolConstants.RESOURCE_PATH_SEPERATOR + "r5" + ToolConstants.RESOURCE_PATH_SEPERATOR + "r5_ballerina_toml.vm", + this.createTemplateContextForBallerinaToml(toolConfig), "", filePath); + } - filePath = CommonUtil.generateFilePath(packagePath, "Package" - + ToolConstants.MD_EXTENSION, ""); - this.getTemplateEngine().generateOutputAsFile(ToolConstants.TEMPLATE_PATH + ToolConstants.RESOURCE_PATH_SEPERATOR + "package.vm", - this.createTemplateContextForPackageMD(toolConfig), "", filePath); + filePath = CommonUtil.generateFilePath(packagePath, "Package" + ToolConstants.MD_EXTENSION, ""); + if(toolConfig.getPackageConfig().getFhirVersion().equals("r4")){ + this.getTemplateEngine().generateOutputAsFile( + ToolConstants.TEMPLATE_PATH + ToolConstants.RESOURCE_PATH_SEPERATOR + ToolConstants.TEMPLATE_VERSION_PATH + ToolConstants.RESOURCE_PATH_SEPERATOR + "r4" + ToolConstants.RESOURCE_PATH_SEPERATOR + "r4_package.vm", + this.createTemplateContextForPackageMD(toolConfig), "", filePath); + + } + else if (toolConfig.getPackageConfig().getFhirVersion().equals("r5")) { + this.getTemplateEngine().generateOutputAsFile( + ToolConstants.TEMPLATE_PATH + ToolConstants.RESOURCE_PATH_SEPERATOR + ToolConstants.TEMPLATE_VERSION_PATH + ToolConstants.RESOURCE_PATH_SEPERATOR + "r5" + ToolConstants.RESOURCE_PATH_SEPERATOR + "r5_package.vm", + this.createTemplateContextForPackageMD(toolConfig), "", filePath); + + } filePath = CommonUtil.generateFilePath(packagePath, "initializer" + ToolConstants.BAL_EXTENSION, ""); @@ -173,6 +191,7 @@ private TemplateContext createTemplateContextForBallerinaToml(BallerinaPackageGe templateContext.setProperty("version", toolConfig.getPackageConfig().getVersion()); templateContext.setProperty("distribution", toolConfig.getPackageConfig().getBallerinaDistribution()); templateContext.setProperty("authors", toolConfig.getPackageConfig().getAuthors()); + templateContext.setProperty("fhirVersion", toolConfig.getPackageConfig().getFhirVersion()); templateContext.setProperty("repository", toolConfig.getPackageConfig().getRepository()); templateContext.setProperty("igName", this.packageTemplateContext.getIgTemplateContext().getIgName()); diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/templategen/ResourceTemplateGenerator.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/templategen/ResourceTemplateGenerator.java index 493b7671..49f1cc47 100644 --- a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/templategen/ResourceTemplateGenerator.java +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/templategen/ResourceTemplateGenerator.java @@ -36,12 +36,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.Set; import java.util.TreeSet; -import static org.wso2.healthcare.fhir.ballerina.packagegen.tool.ToolConstants.CONSTRAINTS_LIB_IMPORT; - /** * Generator class for resource related template context */ diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/utils/CommonUtil.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/utils/CommonUtil.java index 11d9c283..c6a31e0f 100644 --- a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/utils/CommonUtil.java +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/utils/CommonUtil.java @@ -129,7 +129,8 @@ public static String toCamelCase(String str) { public static String validateCode(String code) { String newCode = code.trim().split(Pattern.quote(" "))[0]; return newCode.replaceAll(" *\\(.+?\\)", "") - .replace("+", ""); + .replace("+", "") + .replace("*", ""); } /** diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/utils/GeneratorUtils.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/utils/GeneratorUtils.java index e4d91aeb..4869c8be 100644 --- a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/utils/GeneratorUtils.java +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/utils/GeneratorUtils.java @@ -21,7 +21,6 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.hl7.fhir.r4.model.ElementDefinition; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.DataTypesRegistry; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.config.BallerinaPackageGenToolConfig; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.AnnotationElement; @@ -30,7 +29,6 @@ import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.ExtendedElement; import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.SearchParameter; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -310,32 +308,6 @@ public AnnotationElement populateAnnotationElement(Element element) { return annotationElement; } - /** - * Populates available code values for a given code element. - * - * @param elementDefinition element definition from FHIR specification - * @param element element model for template context - */ - public static void populateCodeValuesForCodeElements(ElementDefinition elementDefinition, Element element) { - if (!elementDefinition.getShort().contains("|")) { - return; - } - HashMap childElements = new HashMap<>(); - String[] codes = elementDefinition.getShort().split(Pattern.quote("|")); - for (String code : codes) { - code = CommonUtil.validateCode(code); - if (!code.trim().isEmpty()) { - Element childElement = new Element(); - childElement.setName(code); - childElement.setDataType("string"); - childElement.setRootElementName(element.getName()); - childElement.setValueSet(element.getValueSet()); - childElements.put(childElement.getName(), childElement); - } - } - element.setChildElements(childElements); - } - /** * Create extended element object * @@ -358,8 +330,19 @@ public ExtendedElement populateExtendedElement(Element element, BallerinaDataTyp if (element.getChildElements() != null) { extendedElement.setElements(element.getChildElements()); } - if (!GeneratorUtils.isPrimitiveElement(baseType)) + if (!GeneratorUtils.isPrimitiveElement(baseType)){ extendedElement.setBaseType(baseType); + } + else if (GeneratorUtils.isPrimitiveElement(baseType) && !baseType.equals("code")){ + // Handle the rare case of extended elements with primitive base types + // FHIR R5: Patient.birthDate, Patient.birthDate.id, Patient.birthDate.value etc. + // where Patient.birthDate = r5: date + + // The base type "code" is ignored because it converts to an ENUM by default + + extendedElement.setPrimitiveExtendedType(baseType); + } + LOG.debug("Ended: Resource Extended Element population"); return extendedElement; } @@ -404,9 +387,9 @@ public String getUniqueIdentifierFromId(String id) { StringBuilder uniqueIdentifier = new StringBuilder(); String[] idTokens = id.split("-"); for (String token : idTokens) { - uniqueIdentifier.append(StringUtils.capitalise(token)); + uniqueIdentifier.append(StringUtils.capitalize(token)); } - return StringUtils.capitalise(resolveSpecialCharacters(uniqueIdentifier.toString())).replaceAll("\\d", ""); + return StringUtils.capitalize(resolveSpecialCharacters(uniqueIdentifier.toString())).replaceAll("\\d", ""); } /** @@ -427,7 +410,7 @@ public String resolveKeywordConflict(String keyword) { public String resolveMultiDataTypeFieldNames(String fieldName, String typeName) { if (fieldName.endsWith("[x]")) { return resolveKeywordConflict(fieldName.substring(0, fieldName.length() - 3) + - StringUtils.capitalise(typeName)); + StringUtils.capitalize(typeName)); } return resolveKeywordConflict(fieldName); } diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/utils/versions/r4/R4GeneratorUtils.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/utils/versions/r4/R4GeneratorUtils.java new file mode 100644 index 00000000..b79a963d --- /dev/null +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/utils/versions/r4/R4GeneratorUtils.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.versions.r4; + +import org.hl7.fhir.r4.model.ElementDefinition; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.Element; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.CommonUtil; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.GeneratorUtils; + +import java.util.HashMap; +import java.util.regex.Pattern; + +public class R4GeneratorUtils extends GeneratorUtils { + private static final R4GeneratorUtils instance = new R4GeneratorUtils(); + + public static R4GeneratorUtils getInstance() { + return instance; + } + + /** + * Populates available code values for a given code element. + * + * @param elementDefinition element definition from FHIR specification + * @param element element model for template context + */ + public static void populateCodeValuesForCodeElements(ElementDefinition elementDefinition, Element element) { + if (!elementDefinition.getShort().contains("|")) { + return; + } + HashMap childElements = new HashMap<>(); + String[] codes = elementDefinition.getShort().split(Pattern.quote("|")); + for (String code : codes) { + code = CommonUtil.validateCode(code); + if (!code.trim().isEmpty()) { + Element childElement = new Element(); + childElement.setName(code); + childElement.setDataType("string"); + childElement.setRootElementName(element.getName()); + childElement.setValueSet(element.getValueSet()); + childElements.put(childElement.getName(), childElement); + } + } + element.setChildElements(childElements); + } +} diff --git a/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/utils/versions/r5/R5GeneratorUtils.java b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/utils/versions/r5/R5GeneratorUtils.java new file mode 100644 index 00000000..9e795b84 --- /dev/null +++ b/native/fhir-to-bal-lib/src/main/java/org/wso2/healthcare/fhir/ballerina/packagegen/tool/utils/versions/r5/R5GeneratorUtils.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.versions.r5; + +import org.hl7.fhir.r5.model.ElementDefinition; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.model.Element; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.CommonUtil; +import org.wso2.healthcare.fhir.ballerina.packagegen.tool.utils.GeneratorUtils; + +import java.util.HashMap; +import java.util.regex.Pattern; + +public class R5GeneratorUtils extends GeneratorUtils { + private static final R5GeneratorUtils instance = new R5GeneratorUtils(); + + public static R5GeneratorUtils getInstance() { + return instance; + } + + /** + * Populates available code values for a given code element. + * + * @param elementDefinition element definition from FHIR specification + * @param element element model for template context + */ + public static void populateCodeValuesForCodeElements(ElementDefinition elementDefinition, Element element) { + if (!elementDefinition.getShort().contains("|")) { + return; + } + HashMap childElements = new HashMap<>(); + String[] codes = elementDefinition.getShort().split(Pattern.quote("|")); + for (String code : codes) { + code = CommonUtil.validateCode(code); + if (!code.trim().isEmpty()) { + Element childElement = new Element(); + childElement.setName(code); + childElement.setDataType("string"); + childElement.setRootElementName(element.getName()); + childElement.setValueSet(element.getValueSet()); + childElements.put(childElement.getName(), childElement); + } + } + element.setChildElements(childElements); + } +} diff --git a/native/fhir-to-bal-lib/src/main/resources/templates/fhir_extended_datatypes.vm b/native/fhir-to-bal-lib/src/main/resources/templates/fhir_extended_datatypes.vm index e7f78ac8..6a3705ca 100644 --- a/native/fhir-to-bal-lib/src/main/resources/templates/fhir_extended_datatypes.vm +++ b/native/fhir-to-bal-lib/src/main/resources/templates/fhir_extended_datatypes.vm @@ -27,21 +27,25 @@ import $import; @${util.getBasePackageIdentifier()}DataTypeDefinition { name: "${mapEntry.value.annotation.name}", baseType: (), + #set($elementEntries = $mapEntry.value.annotation.elements.entrySet()) + #set($i = 0) + #set($len = $elementEntries.size()) elements: { - #foreach ($elementMapEntry in ${mapEntry.value.annotation.elements.entrySet()}) -#if($elementMapEntry) - + #foreach ($elementMapEntry in $elementEntries) + #if($elementMapEntry) "${elementMapEntry.value.name}": { - name: "${elementMapEntry.value.name}", - dataType: ${elementMapEntry.value.getDataTypeWithImportPrefix()}, - min: ${elementMapEntry.value.min}, - max: ${elementMapEntry.value.max}, - isArray: ${elementMapEntry.value.isArray()}, - description: "${elementMapEntry.value.description}", - path: "${elementMapEntry.value.path}" - }#if($velocityCount != $mapEntry.value.annotation.elements.entrySet().size()),#end -#end - #end + name: "${elementMapEntry.value.name}", + dataType: ${elementMapEntry.value.getDataTypeWithImportPrefix()}, + min: ${elementMapEntry.value.min}, + max: ${elementMapEntry.value.max}, + isArray: ${elementMapEntry.value.isArray()}, + description: "${elementMapEntry.value.description}", + path: "${elementMapEntry.value.path}" + }#if($i < $len - 1),#end + #set($i = $i + 1) + + #end + #end }, serializers: { 'xml: ${util.getBasePackageIdentifier()}complexDataTypeXMLSerializer, @@ -51,7 +55,6 @@ import $import; public type ${mapEntry.value.name} record {| #if($util.isTypeInclusion($mapEntry.value.baseDataType)) *$util.getTypeWithImport($mapEntry.value.baseDataType); - #end //Inherited child element from "Element" (Redefining to maintain order when serialize) (START) string id?; @@ -67,12 +70,15 @@ public type ${mapEntry.value.name} record {| #foreach ($elementMapEntry in ${mapEntry.value.extendedElements.entrySet()}) #if($elementMapEntry.value.getBalDataType().getType() == 'enum') public enum $elementMapEntry.value.typeName { -#foreach ($childElementMapEntry in ${elementMapEntry.value.elements.entrySet()}) - CODE_${elementMapEntry.value.typeName.toUpperCase()}_$util.resolveSpecialCharacters(${childElementMapEntry.key.toUpperCase()}).toUpperCase() = "$childElementMapEntry.key"#if($velocityCount != $elementMapEntry.value.elements.entrySet().size()),$util.getNewLine()#end -#end -$util.getNewLine()}; + #set($childEntries = $elementMapEntry.value.elements.entrySet()) + #set($i = 0) + #set($len = $childEntries.size()) + #foreach ($childElementMapEntry in $childEntries) + CODE_${elementMapEntry.value.typeName.toUpperCase()}_$util.resolveSpecialCharacters($childElementMapEntry.key.toUpperCase()).toUpperCase() = "$childElementMapEntry.key"#if($i < $len - 1),#end + #set($i = $i + 1) + #end +}; #end #end - #end diff --git a/native/fhir-to-bal-lib/src/main/resources/templates/fhir_resource.vm b/native/fhir-to-bal-lib/src/main/resources/templates/fhir_resource.vm index 6515fca1..eafeef90 100644 --- a/native/fhir-to-bal-lib/src/main/resources/templates/fhir_resource.vm +++ b/native/fhir-to-bal-lib/src/main/resources/templates/fhir_resource.vm @@ -17,6 +17,8 @@ // AUTO-GENERATED FILE. // This file is auto-generated by Ballerina. +#set($tab = " ") + #foreach($import in $imports) #if($import) import $import.toString(); @@ -31,77 +33,81 @@ public const RESOURCE_NAME_${util.resolveSpecialCharacters($resourceName.toUpper # + resourceType - The type of the resource describes #foreach($element in $resourceElements) # + $util.resolveSpecialCharacters($util.resolveKeywordConflict($element.getName())) - $element.getDescription() -#if($sliceElements.get($element.getPath())) -# * $element.getName() Slicings -#foreach($sliceElement in $sliceElements.get($element.getPath())) -#if ($sliceElement.getMax() == $INT_MAX) -#set($max = "*") -#else -#set($max = $sliceElement.getMax()) -#end -# $foreach.count) $sliceElement.getDataType(): $sliceElement.getSummary() -# - min = $sliceElement.getMin() -# - max = $max -# -#end -#end + #if($sliceElements.get($element.getPath())) + # * $element.getName() Slicings + #foreach($sliceElement in $sliceElements.get($element.getPath())) + #if ($sliceElement.getMax() == $INT_MAX) + #set($max = "*") + #else + #set($max = $sliceElement.getMax()) + #end + # $foreach.count) $sliceElement.getDataType(): $sliceElement.getSummary() + # - min = $sliceElement.getMin() + # - max = $max + # + #end + #end #end + @${importIdentifier}ResourceDefinition { resourceType: "${resourceType}", baseType: ${importIdentifier}DomainResource, profile: "${profile}", elements: { #foreach($element in ${annotationElements}) - "${element.getName()}" : { + "${element.getName()}" : { name: "${element.getName()}", dataType: #if(!$dataTypes.contains($element.getDataType()))${importIdentifier}$util.resolveSpecialCharacters($element.getDataType())#else$util.resolveSpecialCharacters($element.getDataType())#end, min: ${element.getMin()}, max: ${element.getMax()}, isArray: ${element.isArray()}, - #if($element.getValueSet()) - path: "${element.getPath()}", + #if($element.getValueSet()) + path: "${element.getPath()}", valueSet: "${element.getValueSet()}" - #else - path: "${element.getPath()}" - #end - }#if ($foreach.count != $annotationElements.size()),#end + #else + path: "${element.getPath()}" + #end + }#if ($foreach.count != $annotationElements.size()),#end #end -}, + }, + serializers: { 'xml: ${importIdentifier}fhirResourceXMLSerializer, 'json: ${importIdentifier}fhirResourceJsonSerializer } } + public type $util.resolveSpecialCharacters($resourceName) record {| *${importIdentifier}DomainResource; RESOURCE_NAME_${util.resolveSpecialCharacters($resourceName.toUpperCase())} resourceType = RESOURCE_NAME_${util.resolveSpecialCharacters($resourceName.toUpperCase())}; -#foreach($element in $resourceElements) -#set($min = 1) -#set($max = 1) -#set($separator = ",") -## Here we should add constraint:Array only for the Array elements and min or max is 1 -#if( ${util.isConstrainedArrayElement($element)} ) - @constraint:Array { -#if( $element.getMin() > 0 ) + #foreach($element in $resourceElements) + #set($min = 1) + #set($max = 1) + #set($separator = ",") + ## Here we should add constraint:Array only for the Array elements and min or max is 1 + #if( ${util.isConstrainedArrayElement($element)} ) +@constraint:Array { + #if( $element.getMin() > 0 ) minLength: { value: $min$separator message: "Validation failed for $.$element.getPath() constraint. This field must be an array containing at least one item." }#if( $element.getMax() > 0 )$separator#end -#end + #end -#if( $element.getMax() > 0 ) + #if( $element.getMax() > 0 ) maxLength: { value: $max$separator message: "Validation failed for $.$element.getPath() constraint. This field must be an array containing at most one item." } -#end + #end } -#end - #foreach($profileEntry in $element.getProfiles().entrySet())#if(!$dataTypes.contains($profileEntry.value.getProfileType()))#if(!$profileEntry.value.getPrefix())${importIdentifier}#else$profileEntry.value.getPrefix():#end#end$util.resolveSpecialCharacters($profileEntry.value.getProfileType())#if($element.isArray()) []#end#if($velocityCount != $element.getProfiles().size())#end#end $util.resolveKeywordConflict($util.resolveSpecialCharacters($element.getName()))#if(!$element.isRequired())?#end; -#end +$tab#end + #set($isDataTypeSet = false) + #foreach($profileEntry in $element.getProfiles().entrySet())#if(!$dataTypes.contains($profileEntry.value.getProfileType()))#if(!$profileEntry.value.getPrefix())${importIdentifier}#else$profileEntry.value.getPrefix():#end#end#if($element.isExtended())#foreach($key in $extendedElements.keySet())#if($key == $profileEntry.value.getProfileType() && $extendedElements.get($key).getPrimitiveExtendedType())$util.resolveSpecialCharacters($profileEntry.value.getProfileType()) | ${importIdentifier}$extendedElements.get($key).getPrimitiveExtendedType()#set($isDataTypeSet = true)#end#end#end#if(!$isDataTypeSet)$util.resolveSpecialCharacters($profileEntry.value.getProfileType())#end#if($element.isArray()) []#end#if($foreach.count != $element.getProfiles().size())|#end#end $util.resolveKeywordConflict($util.resolveSpecialCharacters($element.getName()))#if(!$element.isRequired())?#end; + #end ${importIdentifier}Element ...; |}; @@ -111,85 +117,88 @@ public type $util.resolveSpecialCharacters($resourceName) record {| # #foreach($element in $extendedElement.getAnnotation().getElements()) # + $util.resolveSpecialCharacters($util.resolveKeywordConflict($element.getName())) - $element.getDescription() -#if($element.hasSlicedElements()) -# * $element.getName() Slicing -#foreach($sliceElement in $element.getSlicedElements()) -# $foreach.count) $sliceElement.getName(): $sliceElement.getSummary() -# - min = $sliceElement.getMin() -# - max = $sliceElement.getMax() -# -#end -#end + #if($element.hasSlicedElements()) + # * $element.getName() Slicing + #foreach($sliceElement in $element.getSlicedElements()) + # $foreach.count) $sliceElement.getName(): $sliceElement.getSummary() + # - min = $sliceElement.getMin() + # - max = $sliceElement.getMax() + # + #end + #end #end + @${importIdentifier}DataTypeDefinition { name: "${extendedElement.getTypeName()}", baseType: $extendedElement.getAnnotation().getBaseType(), elements: { - #foreach($annotationElement in $extendedElement.getAnnotation().getElements()) - "${annotationElement.getName()}": { + #foreach($annotationElement in $extendedElement.getAnnotation().getElements()) + "${annotationElement.getName()}": { name: "${annotationElement.getName()}", dataType: #if(!$dataTypes.contains($annotationElement.getDataType()))${importIdentifier}$util.resolveSpecialCharacters($annotationElement.getDataType())#else$util.resolveSpecialCharacters($annotationElement.getDataType())#end, min: $annotationElement.getMin(), max: $annotationElement.getMax(), isArray: $annotationElement.isArray(), description: "$annotationElement.getDescription()", - #if($element.getValueSet()) - path: "${annotationElement.getPath()}", - valueSet: "${annotationElement.getValueSet()}" - #else - path: "${annotationElement.getPath()}" - #end - }#if ($foreach.count != $extendedElement.getAnnotation().getElements().size()),#end + #if($element.getValueSet()) + path: "${annotationElement.getPath()}", + valueSet: "${annotationElement.getValueSet()}" + #else + path: "${annotationElement.getPath()}" + #end + }#if ($foreach.count != $extendedElement.getAnnotation().getElements().size()), + #end + #end + }, - #end -}, serializers: { 'xml: ${importIdentifier}complexDataTypeXMLSerializer, 'json: ${importIdentifier}complexDataTypeJsonSerializer } } + public type $util.resolveSpecialCharacters($extendedElement.getTypeName()) record {| -#if ($extendedElement.getBaseType()) + #if ($extendedElement.getBaseType()) *#if(!$dataTypes.contains($extendedElement.getBaseType()))${importIdentifier}#end$extendedElement.getBaseType(); -#end + #end -#foreach($childElement in $extendedElement.getElements()) -#set($min = 1) -#set($max = 1) -#set($separator = ",") -## Here we should add constraint:Array only for the Array elements and min or max is 1 -#if( ${util.isConstrainedArrayElement($childElement)} ) - @constraint:Array { -#if( $childElement.getMin() > 0) + #foreach($childElement in $extendedElement.getElements()) + #set($min = 1) + #set($max = 1) + #set($separator = ",") + ## Here we should add constraint:Array only for the Array elements and min or max is 1 + #if( ${util.isConstrainedArrayElement($childElement)} ) +@constraint:Array { + #if( $childElement.getMin() > 0) minLength: { value: $min$separator message: "Validation failed for $.$childElement.getPath() constraint. This field must be an array containing at least one item." }#if( $childElement.getMax() > 0 )$separator#end -#end + #end -#if( $childElement.getMax() > 0) + #if( $childElement.getMax() > 0) maxLength: { value: $max$separator message: "Validation failed for $.$childElement.getPath() constraint. This field must be an array containing at most one item." } -#end + #end } -#end -#if($childElement.hasFixedValue()) - #if(!$dataTypes.contains($childElement.getDataType()))${importIdentifier}#end$util.resolveSpecialCharacters($childElement.getDataType())#if($childElement.isArray()) []#end $util.resolveSpecialCharacters($util.resolveKeywordConflict($childElement.getName()))#if(!$childElement.isRequired())?#end = #if($childElement.isArray()) [#end#foreach($value in $childElement.getFixedValue())$util.getTypedValue($value, $childElement.getDataType())#if($foreach.count != $childElement.getFixedValue().size()),#end#end#if($childElement.isArray())]#end; -#else - #if(!$dataTypes.contains($childElement.getDataType()))${importIdentifier}#end$util.resolveSpecialCharacters($childElement.getDataType())#if($childElement.isArray()) []#end $util.resolveSpecialCharacters($util.resolveKeywordConflict($childElement.getName()))#if(!$childElement.isRequired())?#end; -#end +$tab#end + #if($childElement.hasFixedValue()) + #if(!$dataTypes.contains($childElement.getDataType()))${importIdentifier}#end$util.resolveSpecialCharacters($childElement.getDataType())#if($childElement.isArray()) []#end $util.resolveSpecialCharacters($util.resolveKeywordConflict($childElement.getName()))#if(!$childElement.isRequired())?#end = #if($childElement.isArray()) [#end#foreach($value in $childElement.getFixedValue())$util.getTypedValue($value, $childElement.getDataType())#if($foreach.count != $childElement.getFixedValue().size()),#end#end#if($childElement.isArray())]#end; + #else + #if(!$dataTypes.contains($childElement.getDataType()))${importIdentifier}#end$util.resolveSpecialCharacters($childElement.getDataType())#if($childElement.isArray()) []#end $util.resolveSpecialCharacters($util.resolveKeywordConflict($childElement.getName()))#if(!$childElement.isRequired())?#end; + #end #end |}; + #elseif($extendedElement.getBalDataType().getType() == "enum") # $extendedElement.getTypeName() enum public enum $util.resolveSpecialCharacters($extendedElement.getTypeName()) { -#foreach($childElement in $extendedElement.getElements()) - CODE_$childElement.getRootElementName().toUpperCase()_$util.resolveSpecialCharacters($childElement.getName()).toUpperCase() = "$childElement.getName()"#if($foreach.count != $extendedElement.getElements().size()),$newline#end -#end - + #foreach($childElement in $extendedElement.getElements()) + CODE_$childElement.getRootElementName().toUpperCase()_$util.resolveSpecialCharacters($childElement.getName()).toUpperCase() = "$childElement.getName()"#if($foreach.count != $extendedElement.getElements().size()),#end + #end } #end -#end +#end \ No newline at end of file diff --git a/native/fhir-to-bal-lib/src/main/resources/templates/ballerina_toml.vm b/native/fhir-to-bal-lib/src/main/resources/templates/versions/r4/r4_ballerina_toml.vm similarity index 100% rename from native/fhir-to-bal-lib/src/main/resources/templates/ballerina_toml.vm rename to native/fhir-to-bal-lib/src/main/resources/templates/versions/r4/r4_ballerina_toml.vm diff --git a/native/fhir-to-bal-lib/src/main/resources/templates/package.vm b/native/fhir-to-bal-lib/src/main/resources/templates/versions/r4/r4_package.vm similarity index 100% rename from native/fhir-to-bal-lib/src/main/resources/templates/package.vm rename to native/fhir-to-bal-lib/src/main/resources/templates/versions/r4/r4_package.vm diff --git a/native/fhir-to-bal-lib/src/main/resources/templates/versions/r5/r5_ballerina_toml.vm b/native/fhir-to-bal-lib/src/main/resources/templates/versions/r5/r5_ballerina_toml.vm new file mode 100644 index 00000000..a42ee35d --- /dev/null +++ b/native/fhir-to-bal-lib/src/main/resources/templates/versions/r5/r5_ballerina_toml.vm @@ -0,0 +1,28 @@ +[package] +org = "${org}" +name = "${packageName}" +version = "${version}" +distribution = "${distribution}" +authors = ["${authors}"] +keywords = ["Healthcare", "FHIR", "R5", "${igName}"] +#if($isBasePackage) +export = [ +"${packageName}", +"${packageName}.parser", +"${packageName}.terminology", +"${packageName}.validator" +] +#else +export = ["${packageName}"] +#end + +#foreach($dependency in $dependencies) +[[dependency]] +org = "$dependency.getOrg()" +name = "$dependency.getName()" +version = "$dependency.getVersion()" + #if($dependency.getRepository()) + repository = "$dependency.getRepository()" + #else + #end +#end diff --git a/native/fhir-to-bal-lib/src/main/resources/templates/versions/r5/r5_package.vm b/native/fhir-to-bal-lib/src/main/resources/templates/versions/r5/r5_package.vm new file mode 100644 index 00000000..bfb2f1c5 --- /dev/null +++ b/native/fhir-to-bal-lib/src/main/resources/templates/versions/r5/r5_package.vm @@ -0,0 +1,39 @@ +#set( $H = '#' ) +Ballerina package containing FHIR resource data models +compliant with $igUrl implementation guide. + +#if(!$isBasePackage) + $H FHIR R5 ${igName} package +#end + +$H$H Package Overview + +| | | +|----------------------|----------------------| +| FHIR version | R5 | +| Implementation Guide | $igUrl | + +#if($isBasePackage) +This package includes, FHIR ${igName} Resource types. +#end + +**Note:** +**This package only supports FHIR JSON payload format only. FHIR XML payload support will be added soon.** + +$H$H Capabilities and features + +$H$H$H Supported FHIR resource types + +| | | +|------------------|---------------------------------------------| +#foreach($profile in $profiles) +| ${foreach.count}). $profile.getResourceName() | [[Definition]][s$foreach.count] [[Ballerina Record]][m$foreach.count] | +#end + +#foreach($profile in $profiles) +[m${foreach.count}]: https://lib.ballerina.io/$org/$packageName/$packageVersion#$profile.getResourceName() +#end + +#foreach($profile in $profiles) +[s$foreach.count]: $profile.getProfile() +#end diff --git a/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/test_constraints.bal b/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r4/test_constraints.bal similarity index 100% rename from native/fhir-to-bal-lib/src/test/resources/ballerina.tests/test_constraints.bal rename to native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r4/test_constraints.bal diff --git a/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/test_extended_profiles.bal b/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r4/test_extended_profiles.bal similarity index 99% rename from native/fhir-to-bal-lib/src/test/resources/ballerina.tests/test_extended_profiles.bal rename to native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r4/test_extended_profiles.bal index 081dcd7a..ad32c427 100644 --- a/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/test_extended_profiles.bal +++ b/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r4/test_extended_profiles.bal @@ -29,6 +29,7 @@ function testSlicings() { test:assertEquals(pulseOximetry.category[0], vsCat); } +@test:Config {} function testFixedValues() { USCorePulseOximetryProfileCodeCodingPulseOx pulseOx = {}; diff --git a/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/test_parse_and_serialize.bal b/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r4/test_parse_and_serialize.bal similarity index 100% rename from native/fhir-to-bal-lib/src/test/resources/ballerina.tests/test_parse_and_serialize.bal rename to native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r4/test_parse_and_serialize.bal diff --git a/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r5/test_constraints.bal b/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r5/test_constraints.bal new file mode 100644 index 00000000..03fa0d6c --- /dev/null +++ b/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r5/test_constraints.bal @@ -0,0 +1,56 @@ +import ballerina/constraint; +import ballerina/test; + +@test:Config {} +function testResourceElementConstraints() { + BodyStructureEu bodyStructure = { + "resourceType" : "BodyStructure", + "id" : "example-body-structure-eu", + "meta" : { + "profile" : ["http://hl7.eu/fhir/base-r5/StructureDefinition/BodyStructure-eu"] + }, + "includedStructure" : [ + { + "structure" : { + "coding" : [ + { + "system" : "http://snomed.info/sct", + "code" : "8205005", + "display" : "Wrist" + } + ] + }, + "laterality" : { + "coding" : [ + { + "system" : "http://snomed.info/sct", + "code" : "7771000", + "display" : "Left" + } + ] + }, + "qualifier" : [ + { + "coding" : [ + { + "system" : "http://snomed.info/sct", + "code" : "351726001", + "display" : "Below" + } + ] + } + ] + } + ], + "patient" : { + "reference" : "Patient/patient-eu-core-example" + } + }; + + BodyStructureEu|constraint:Error validate = constraint:validate(bodyStructure, BodyStructureEu); + if validate is BodyStructureEu { + test:assertTrue(true, "bodyStructure is valid"); + } else { + test:assertFail("bodyStructure should not be valid"); + } +} diff --git a/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r5/test_extended_profiles.bal b/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r5/test_extended_profiles.bal new file mode 100644 index 00000000..d7f0ad84 --- /dev/null +++ b/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r5/test_extended_profiles.bal @@ -0,0 +1,197 @@ +import ballerina/test; +import ballerinax/health.fhir.r5; + +@test:Config{} +function testSlicings(){ + BodyStructureEuIncludedStructureBodyLandmarkOrientationDistanceFromLandmark distanceFromLandmark = { + device: [ + { + "concept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "528404", + "display": "Measurement device" + } + ], + "text": "Pulse oximeter" + } + } + ] + }; + + BodyStructureEuIncludedStructureBodyLandmarkOrientation bodyLandmarkOrientation = { + "clockFacePosition": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "260330005", + "display": "3 o'clock position" + } + ] + } + ], + "distanceFromLandmark": [distanceFromLandmark] + }; + + BodyStructureEuIncludedStructure includedStructure = { + "structure": { + "coding": [ + { + "system" : "http://snomed.info/sct", + "code" : "8205005", + "display" : "Wrist" + } + ] + }, + "qualifier": [{ coding : [] }], + "bodyLandmarkOrientation": [bodyLandmarkOrientation] + }; + + BodyStructureEu bodyStructure = { + "resourceType": "BodyStructure", + "id": "example-body-structure-eu", + "meta": { + "profile": ["http://hl7.eu/fhir/base-r5/StructureDefinition/BodyStructure-eu"] + }, + "text": { + "status": "generated", + "div": "

Generated Narrative: BodyStructure example-body-structure-eu

morphology: Blister

IncludedStructures

-StructureLateralityQualifier
*WristLeftBelow

patient: John Doe Male, DoB: 1980-01-01

" + }, + "morphology": { + "coding": [ + { + "system" : "http://snomed.info/sct", + "code" : "339008", + "display" : "Blister" + } + ] + }, + "includedStructure": [includedStructure], + "patient": { + "reference" : "Patient/patient-eu-core-example" + } + }; + + test:assertEquals(bodyStructure.includedStructure[0], includedStructure); +} + + +@test:Config {} +function testFixedValues(){ + CoverageEhicType ehicCoverageType = {"coding": [{}]}; + + CoverageEhic euHealthInsuranceCard = { + "resourceType" : "Coverage", + "id" : "EhicExampleIt", + "meta" : { + "profile" : [ + "http://hl7.eu/fhir/base-r5/StructureDefinition/Coverage-eu-ehic" + ] + }, + "contained" : [ + { + "resourceType" : "Patient", + "id" : "PatientEhicInline", + "identifier" : [ + { + "system" : "http://hl7.it/sid/codiceFiscale", + "value" : "RSSMRA70A01F205V" + } + ], + "name" : [ + { + "family" : "Rossi", + "given" : ["Mario"] + } + ], + "birthDate" : "1970-01-01" + } + ], + "identifier" : [ + { + "system" : "http://example.org/ehic", + "value" : "80380000900090510553" + } + ], + "status" : "active", + "kind": "other", + "type": ehicCoverageType, + "beneficiary" : { + "reference" : "#PatientEhicInline" + }, + "period" : { + "end" : "2022-01-19" + }, + "insurer" : { + "display" : "SSN-MIN SALUTE - 500001" + } + }; + + CoverageEhicTypeCoding[] coding = euHealthInsuranceCard["type"].coding; + r5:Coding codingValue = coding[0]; + + test:assertEquals(codingValue.system, "http://terminology.hl7.eu/CodeSystem/v3-ActCode"); + test:assertEquals(codingValue.code, "ehic"); + test:assertEquals(codingValue.display, "European Health Insurance Card"); +} + + +@test:Config {} +function testExtensions(){ + PatientEuCore patient = { + meta:{ + profile: [PROFILE_BASE_PATIENTEUCORE] + }, + + name:[{ + family: "Doe", + given: ["John"] + }], + + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-birthPlace", + "valueAddress": { + "line": [ + "123 Example Street" + ], + "city": "Example City", + "state": "EX", + "postalCode": "12345", + "country": "EX" + } + }, + + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-sexParameterForClinicalUse", + "valueString": "male" + }, + + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-citizenship", + "valueString": "Austrian" + }, + + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-nationality", + "valueString": "Spanish" + } + ], + + active: true, + birthDate: "1980-01-01", + deceasedBoolean: false + }; + + // cloneWithType: Convert JSON to a user-defined types + PatientEuCore|error patientClone = patient.cloneWithType(PatientEuCore); + if patientClone is error { + test:assertFail("Error occurred while cloning the patient resource"); + } else { + test:assertEquals(patientClone.name[0].family, "Doe", "Patient family name is not equal"); + test:assertEquals(patientClone.birthDate, "1980-01-01", "Patient birthDate is not equal"); + test:assertEquals(patientClone.deceasedBoolean, false, "Patient deceasedBoolean is not equal"); + } +} diff --git a/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r5/test_parse_and_serialize.bal b/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r5/test_parse_and_serialize.bal new file mode 100644 index 00000000..5ab48676 --- /dev/null +++ b/native/fhir-to-bal-lib/src/test/resources/ballerina.tests/r5/test_parse_and_serialize.bal @@ -0,0 +1,131 @@ +import ballerina/test; +import ballerinax/health.fhir.r5.parser; +import ballerinax/health.fhir.r5; + +// Test FHIR ability to parse a given rersource (JSON/XML --> FHIR model) +@test:Config {} +function testParse() returns error? { + json patientPayload = { + "resourceType" : "Patient", + "id" : "patient-eu-core-example", + "meta" : { + "profile" : [ + "http://hl7.eu/fhir/base-r5/StructureDefinition/patient-eu-core" + ] + }, + "text" : { + "status" : "generated", + "div" : "

Generated Narrative: Patient patient-eu-core-example

John Doe Male, DoB: 1980-01-01


Contact Detail
  • ph: 555-1234(Home)
  • 123 Example Street Example City EX 12345 EX
Links:
" + }, + "name" : [ + { + "family" : "Doe", + "given" : [ + "John" + ] + } + ], + "telecom" : [ + { + "system" : "phone", + "value" : "555-1234", + "use" : "home" + } + ], + "gender" : "male", + "birthDate" : "1980-01-01", + "address" : [ + { + "line" : [ + "123 Example Street" + ], + "city" : "Example City", + "state" : "EX", + "postalCode" : "12345", + "country" : "EX" + } + ], + "managingOrganization" : { + "reference" : "Organization/organization-eu-core-example" + } + }; + + r5:HumanName[] name = [{ + family: "Doe", + given: ["John"] + }]; + + r5:date birthDate = "1980-01-01"; + + r5:Address[] address = [{ + line: ["123 Example Street"], + city: "Example City", + state: "EX", + postalCode: "12345", + country: "EX" + }]; + + anydata parsedResult = check parser:parse(patientPayload, PatientEuCore); + PatientEuCore patientModel = check parsedResult.ensureType(); + test:assertEquals(patientModel.name, name, "Patient name is not equal"); + test:assertEquals(patientModel.birthDate, birthDate, "Patient birthDate is not equal"); + test:assertEquals(patientModel.address, address, "Patient address is not equal"); +} + + +// Test FHIR ability to serialize a given resource (FHIR model --> JSON/XML) +@test:Config{} +function testSerialize(){ + PatientEuCore patient = { + meta:{ + profile: [PROFILE_BASE_PATIENTEUCORE] + }, + + name:[{ + family: "Doe", + given: ["John"] + }], + + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-birthPlace", + "valueAddress": { + "line": [ + "123 Example Street" + ], + "city": "Example City", + "state": "EX", + "postalCode": "12345", + "country": "EX" + } + }, + + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-sexParameterForClinicalUse", + "valueString": "male" + }, + + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-citizenship", + "valueString": "Austrian" + }, + + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-nationality", + "valueString": "Spanish" + } + ], + + active: true, + birthDate: "1980-01-01", + deceasedBoolean: false + }; + + r5:FHIRResourceEntity fhirEntity = new(patient); + json|r5:FHIRSerializerError jsonResult = fhirEntity.toJson(); + if jsonResult is json { + test:assertEquals(true, patient.active); + } else { + test:assertFail("Error occurred while serializing the patient model"); + } +} \ No newline at end of file diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/AbstractBallerinaProjectTool.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/AbstractBallerinaProjectTool.java new file mode 100644 index 00000000..5f1be5c2 --- /dev/null +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/AbstractBallerinaProjectTool.java @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.codegen.ballerina.project.tool; + +import org.wso2.healthcare.codegen.tool.framework.commons.config.ToolConfig; +import org.wso2.healthcare.codegen.tool.framework.commons.core.TemplateGenerator; +import org.wso2.healthcare.codegen.tool.framework.commons.core.ToolContext; +import org.wso2.healthcare.codegen.tool.framework.commons.exception.CodeGenException; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.AbstractFHIRTool; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.common.FHIRSpecificationData; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRImplementationGuide; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRSearchParamDef; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.config.BallerinaProjectToolConfig; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.config.IncludedIGConfig; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.generator.BallerinaProjectGenerator; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.BallerinaService; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.SearchParam; + +import java.io.File; +import java.util.Map; +import java.util.HashMap; +import java.util.List; +import java.util.ArrayList; +import java.util.Arrays; + +public abstract class AbstractBallerinaProjectTool extends AbstractFHIRTool { + private final Map igMap = new HashMap<>(); + private final Map dependenciesMap = new HashMap<>(); + private final Map serviceMap = new HashMap<>(); + private final List EXCLUDED_FHIR_APIS = new ArrayList<>(Arrays.asList("Bundle", + "CodeSystem", "DomainResource", "OperationOutcome", "Resource", "ValueSet")); + private BallerinaProjectToolConfig ballerinaProjectToolConfig; + + @Override + public void initialize(ToolConfig toolConfig) throws CodeGenException { + this.ballerinaProjectToolConfig = (BallerinaProjectToolConfig) toolConfig; + } + + protected BallerinaProjectToolConfig getBallerinaProjectToolConfig() { + return ballerinaProjectToolConfig; + } + + protected Map getIgMap() { + return igMap; + } + + protected Map getDependenciesMap() { + return dependenciesMap; + } + + protected Map getServiceMap() { + return serviceMap; + } + + protected List getExcludedFHIRApis() { + return EXCLUDED_FHIR_APIS; + } + + @Override + public TemplateGenerator execute(ToolContext toolContext) throws CodeGenException { + if (getBallerinaProjectToolConfig().isEnabled()) { + populateIGs(toolContext); + populateDependenciesMap(); + populateBalService(); + + if (getServiceMap().isEmpty()) { + throw new CodeGenException("No services found to generate"); + } + + String targetRoot = getBallerinaProjectToolConfig().getTargetDir(); + String targetDirectory = targetRoot + File.separator; + BallerinaProjectGenerator balProjectGenerator = new BallerinaProjectGenerator(targetDirectory); + Map generatorProperties = new HashMap<>(); + generatorProperties.put("config", getBallerinaProjectToolConfig()); + generatorProperties.put("serviceMap", getServiceMap()); + generatorProperties.put("dependenciesMap", getDependenciesMap()); + balProjectGenerator.setGeneratorProperties(generatorProperties); + return balProjectGenerator; + } + return null; + } + + /** + * Extract full IG based on the config. + * + * @param toolContext Tool context + */ + protected void populateIGs(ToolContext toolContext) { + + for (Map.Entry entry : getBallerinaProjectToolConfig().getIncludedIGConfigs().entrySet()) { + String igName = entry.getKey(); + FHIRImplementationGuide ig = ((FHIRSpecificationData) toolContext.getSpecificationData()). + getFhirImplementationGuides().get(igName); + String packageName = getBallerinaProjectToolConfig().getMetadataConfig().getNamePrefix(); + if (entry.getValue().isEnable() && ig != null) { + String igPackage = getBallerinaProjectToolConfig().getMetadataConfig().getOrg() + "/" + + getBallerinaProjectToolConfig().getMetadataConfig().getNamePrefix(); + igMap.put(packageName, ig); + + if (!packageName.equals(igName)) { + //Update key in the ig config global map + getBallerinaProjectToolConfig().getIncludedIGConfigs().remove(igName); + IncludedIGConfig updatedIGConfig = entry.getValue(); + updatedIGConfig.setImportStatement(igPackage); + getBallerinaProjectToolConfig().getIncludedIGConfigs().put(packageName, updatedIGConfig); + + ((FHIRSpecificationData) toolContext.getSpecificationData()).getFhirImplementationGuides().remove(igName); + ((FHIRSpecificationData) toolContext.getSpecificationData()).getFhirImplementationGuides().put(packageName, ig); + } + dependenciesMap.put("igPackage", igPackage); + } + } + } + + protected void populateDependenciesMap() { + String fhirVersion = getBallerinaProjectToolConfig().getFhirVersion(); + + String fhirBaseImportStatement = BallerinaProjectConstants.BASE_PACKAGE_IMPORT_SUFFIX + fhirVersion; + String fhirServiceImportStatement = BallerinaProjectConstants.SERVICE_PACKAGE_IMPORT_SUFFIX + fhirVersion; + String fhirInternationalImportStatement = BallerinaProjectConstants.INTERNATIONAL_PACKAGE_IMPORT_SUFFIX_R4; + + if (fhirVersion.equalsIgnoreCase("r5")) { + fhirInternationalImportStatement = BallerinaProjectConstants.INTERNATIONAL_PACKAGE_IMPORT_SUFFIX_R5; + } + + if (getBallerinaProjectToolConfig().getBasePackage() != null && !getBallerinaProjectToolConfig().getBasePackage().isEmpty()) { + fhirBaseImportStatement = getBallerinaProjectToolConfig().getBasePackage(); + } + + if (getBallerinaProjectToolConfig().getServicePackage() != null && !getBallerinaProjectToolConfig().getServicePackage().isEmpty()) { + fhirServiceImportStatement = getBallerinaProjectToolConfig().getServicePackage(); + } + + if (getBallerinaProjectToolConfig().getDependentPackage() != null && + !getBallerinaProjectToolConfig().getDependentPackage().isEmpty()) { + fhirInternationalImportStatement = getBallerinaProjectToolConfig().getDependentPackage(); + } + dependenciesMap.put("basePackage", fhirBaseImportStatement.toLowerCase()); + dependenciesMap.put("servicePackage", fhirServiceImportStatement.toLowerCase()); + dependenciesMap.put("dependentPackage", fhirInternationalImportStatement.toLowerCase()); + } + + protected abstract void populateBalService(); + + protected abstract SearchParam getSearchParam(Map.Entry parameter, String apiName); +} diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/BallerinaProjectConstants.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/BallerinaProjectConstants.java index 2a23a17b..7248c1df 100644 --- a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/BallerinaProjectConstants.java +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/BallerinaProjectConstants.java @@ -29,7 +29,8 @@ public class BallerinaProjectConstants { public static final String YAML_FILE_EXTENSION = ".yaml"; public static final String BASE_PACKAGE_IMPORT_SUFFIX = "ballerinax/health.fhir."; public static final String SERVICE_PACKAGE_IMPORT_SUFFIX = "ballerinax/health.fhir"; - public static final String INTERNATIONAL_PACKAGE_IMPORT_SUFFIX = "ballerinax/health.fhir.r4.international401"; + public static final String INTERNATIONAL_PACKAGE_IMPORT_SUFFIX_R4 = "ballerinax/health.fhir.r4.international401"; + public static final String INTERNATIONAL_PACKAGE_IMPORT_SUFFIX_R5 = "ballerinax/health.fhir.r5.international500"; public static final String RESOURCE_PATH_SEPERATOR = "/"; public class PrintStrings { diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/BallerinaProjectTool.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/BallerinaProjectTool.java deleted file mode 100644 index c43e5989..00000000 --- a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/BallerinaProjectTool.java +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.healthcare.fhir.codegen.ballerina.project.tool; - -import org.hl7.fhir.r4.model.CodeType; -import org.hl7.fhir.r4.model.StructureDefinition; -import org.wso2.healthcare.codegen.tool.framework.commons.config.ToolConfig; -import org.wso2.healthcare.codegen.tool.framework.commons.core.TemplateGenerator; -import org.wso2.healthcare.codegen.tool.framework.commons.core.ToolContext; -import org.wso2.healthcare.codegen.tool.framework.commons.exception.CodeGenException; -import org.wso2.healthcare.codegen.tool.framework.fhir.core.AbstractFHIRTool; -import org.wso2.healthcare.codegen.tool.framework.fhir.core.common.FHIRSpecificationData; -import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRImplementationGuide; -import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRResourceDef; -import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRSearchParamDef; -import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.config.BallerinaProjectToolConfig; -import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.config.IncludedIGConfig; -import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.generator.BallerinaProjectGenerator; -import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.BallerinaService; -import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.FHIRProfile; -import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.SearchParam; - -import java.io.File; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Main class for Ballerina Project Generator tool. - */ -public class BallerinaProjectTool extends AbstractFHIRTool { - private final Map igMap = new HashMap<>(); - private final Map serviceMap = new HashMap<>(); - private final Map dependenciesMap = new HashMap<>(); - - private final List EXCLUDED_FHIR_APIS = new ArrayList<>(Arrays.asList("Bundle", - "CodeSystem", "DomainResource", "OperationOutcome", "Resource", "ValueSet")); - private BallerinaProjectToolConfig ballerinaProjectToolConfig; - - @Override - public void initialize(ToolConfig toolConfig) { - this.ballerinaProjectToolConfig = (BallerinaProjectToolConfig) toolConfig; - } - - @Override - public TemplateGenerator execute(ToolContext toolContext) throws CodeGenException { - if (ballerinaProjectToolConfig.isEnabled()) { - populateIGs(toolContext); - populateDependenciesMap(); - populateBalService(); - - if (serviceMap.isEmpty()) { - throw new CodeGenException("No services found to generate"); - } - - String targetRoot = ballerinaProjectToolConfig.getTargetDir(); - String targetDirectory = targetRoot + File.separator; - BallerinaProjectGenerator balProjectGenerator = new BallerinaProjectGenerator(targetDirectory); - Map generatorProperties = new HashMap<>(); - generatorProperties.put("config", ballerinaProjectToolConfig); - generatorProperties.put("serviceMap", serviceMap); - generatorProperties.put("dependenciesMap", dependenciesMap); - balProjectGenerator.setGeneratorProperties(generatorProperties); - return balProjectGenerator; - } - return null; - } - - /** - * Extract full IG based on the config. - * - * @param toolContext Tool context - */ - private void populateIGs(ToolContext toolContext) { - - for (Map.Entry entry : ballerinaProjectToolConfig.getIncludedIGConfigs().entrySet()) { - String igName = entry.getKey(); - FHIRImplementationGuide ig = ((FHIRSpecificationData) toolContext.getSpecificationData()). - getFhirImplementationGuides().get(igName); - String packageName = ballerinaProjectToolConfig.getMetadataConfig().getNamePrefix(); - if (entry.getValue().isEnable() && ig != null) { - String igPackage = ballerinaProjectToolConfig.getMetadataConfig().getOrg() + "/" + - ballerinaProjectToolConfig.getMetadataConfig().getNamePrefix(); - igMap.put(packageName, ig); - - if (!packageName.equals(igName)) { - //Update key in the ig config global map - ballerinaProjectToolConfig.getIncludedIGConfigs().remove(igName); - IncludedIGConfig updatedIGConfig = entry.getValue(); - updatedIGConfig.setImportStatement(igPackage); - ballerinaProjectToolConfig.getIncludedIGConfigs().put(packageName, updatedIGConfig); - - ((FHIRSpecificationData) toolContext.getSpecificationData()).getFhirImplementationGuides().remove(igName); - ((FHIRSpecificationData) toolContext.getSpecificationData()).getFhirImplementationGuides().put(packageName, ig); - } - dependenciesMap.put("igPackage", igPackage); - } - } - } - - /** - * Populate Ballerina Service model according to configured IGs and Profiles. - */ - private void populateBalService() { - for (Map.Entry entry : igMap.entrySet()) { - String igName = entry.getKey(); - // extract structure definitions of resource types - Map resourceDefMap = new HashMap<>(); - entry.getValue().getResources().forEach((k, resourceDef) -> { - if (!EXCLUDED_FHIR_APIS.contains(resourceDef.getDefinition().getName()) && resourceDef.getDefinition() - .getKind().toCode().equalsIgnoreCase("RESOURCE")) { - resourceDefMap.put(k, resourceDef); - } - }); - // filter structure definitions based on included/excluded - List structureDefinitions = retrieveStructureDef(igName, resourceDefMap); - structureDefinitions.forEach(definition -> { - addResourceProfile(definition, definition.getType(), definition.getName(), definition.getUrl(), igName); - }); - //adding Search parameters - for (Map.Entry parameter : entry.getValue().getSearchParameters().entrySet()) { - List baseResources = parameter.getValue().getSearchParameter().getBase(); - for (CodeType baseType : baseResources) { - String apiName = baseType.getCode(); - if (!serviceMap.containsKey(apiName)) { - continue; - } - SearchParam param = getSearchParam(parameter, apiName); - serviceMap.get(apiName).addSearchParam(param); - } - } - } - } - - private List retrieveStructureDef(String igName, Map resourceDefMap) { - List structureDefinitions = new ArrayList<>(); - List includedProfiles = - ballerinaProjectToolConfig.getIncludedIGConfigs().get(igName).getIncludedProfiles(); - List excludedProfiles = - ballerinaProjectToolConfig.getIncludedIGConfigs().get(igName).getExcludedProfiles(); - if (!includedProfiles.isEmpty()) { - for (String profile : includedProfiles) { - if (resourceDefMap.containsKey(profile)) { - structureDefinitions.add(resourceDefMap.get(profile).getDefinition()); - } else { - // invalid url - System.out.println(BallerinaProjectConstants.PrintStrings.INVALID_PROFILE + profile); - } - } - if (structureDefinitions.isEmpty()) { - // nothing included - // generate template for all the profiles - System.out.println(BallerinaProjectConstants.PrintStrings.TEMPLATES_FOR_ALL_PROFILES); - resourceDefMap.forEach((k, resourceDef) -> { - structureDefinitions.add(resourceDef.getDefinition()); - }); - } - return structureDefinitions; - } - if (!excludedProfiles.isEmpty()) { - Map resourceDefMapCopy = new HashMap<>(resourceDefMap); - for (String profile : excludedProfiles) { - if (resourceDefMapCopy.containsKey(profile)) { - resourceDefMapCopy.remove(profile); - } else { - // invalid url - System.out.println(BallerinaProjectConstants.PrintStrings.INVALID_PROFILE + profile); - } - } - resourceDefMapCopy.forEach((k, resourceDef) -> { - structureDefinitions.add(resourceDef.getDefinition()); - }); - if (resourceDefMap.size() == resourceDefMapCopy.size()) { - System.out.println(BallerinaProjectConstants.PrintStrings.TEMPLATES_FOR_ALL_PROFILES); - } - return structureDefinitions; - } - // nothing included or excluded - // generate templates for all the profiles - System.out.println(BallerinaProjectConstants.PrintStrings.TEMPLATES_FOR_ALL_PROFILES); - resourceDefMap.forEach((k, v) -> { - structureDefinitions.add(v.getDefinition()); - }); - return structureDefinitions; - } - - private SearchParam getSearchParam(Map.Entry parameter, String apiName) { - SearchParam param = new SearchParam(parameter.getValue().getSearchParameter().getName(), - parameter.getValue().getSearchParameter().getCode()); - param.setSearchParamDef(parameter.getValue().getSearchParameter()); - param.setDescription(parameter.getValue().getSearchParameter().getDescription().replace("\"","")); - param.setDocumentation(parameter.getValue().getSearchParameter().getUrl()); - param.setTargetResource(apiName); - if (ballerinaProjectToolConfig.getSearchParamConfigs().contains(param.getSearchParamDef().getCode())) { - param.setBuiltIn(true); - } - return param; - } - - /** - * Adding Ballerina service model to a common map. - * - * @param structureDefinition FHIR StructureDefinition - * @param resourceType FHIR resource type - * @param profile FHIR profile - * @param url FHIR profile url - */ - private void addResourceProfile(StructureDefinition structureDefinition, String resourceType, String profile, - String url, String igName) { - - if (serviceMap.containsKey(resourceType)) { - if (structureDefinition.getAbstract()) { - //profiled resource added before - FHIRProfile fhirProfile = new FHIRProfile(structureDefinition, url, igName, resourceType); - fhirProfile.setFhirVersion(ballerinaProjectToolConfig.getFhirVersion()); - fhirProfile.setPackagePrefix(ballerinaProjectToolConfig); - fhirProfile.setAbstract(); - fhirProfile.addImport(ballerinaProjectToolConfig.getIncludedIGConfigs().get(igName).getImportStatement()); - serviceMap.get(resourceType).addFhirProfile(fhirProfile); - serviceMap.get(resourceType).addProfile(url); - } else { - //check for profiles - if (!serviceMap.get(resourceType).getProfiles().contains(profile)) { - FHIRProfile fhirProfile = new FHIRProfile(structureDefinition, url, igName, resourceType); - fhirProfile.addImport(ballerinaProjectToolConfig.getIncludedIGConfigs().get(igName).getImportStatement()); - fhirProfile.setFhirVersion(ballerinaProjectToolConfig.getFhirVersion()); - fhirProfile.setPackagePrefix(ballerinaProjectToolConfig); - serviceMap.get(resourceType).addFhirProfile(fhirProfile); - serviceMap.get(resourceType).addProfile(url); - } - } - } else { - BallerinaService ballerinaService = new BallerinaService(resourceType, ballerinaProjectToolConfig.getFhirVersion()); - FHIRProfile fhirProfile = new FHIRProfile(structureDefinition, url, igName, resourceType); - fhirProfile.addImport(ballerinaProjectToolConfig.getIncludedIGConfigs().get(igName).getImportStatement()); - fhirProfile.setFhirVersion(ballerinaProjectToolConfig.getFhirVersion()); - fhirProfile.setPackagePrefix(ballerinaProjectToolConfig); - ballerinaService.addFhirProfile(fhirProfile); - ballerinaService.addProfile(url); - ballerinaService.addIg(igName); - serviceMap.put(structureDefinition.getType(), ballerinaService); - } - } - - private void populateDependenciesMap() { - String fhirVersion = ballerinaProjectToolConfig.getFhirVersion(); - - String fhirBaseImportStatement = BallerinaProjectConstants.BASE_PACKAGE_IMPORT_SUFFIX + fhirVersion; - String fhirServiceImportStatement = BallerinaProjectConstants.SERVICE_PACKAGE_IMPORT_SUFFIX + fhirVersion; - String fhirInternationalImportStatement = - BallerinaProjectConstants.INTERNATIONAL_PACKAGE_IMPORT_SUFFIX; - - if (ballerinaProjectToolConfig.getBasePackage() != null && !ballerinaProjectToolConfig.getBasePackage().isEmpty()) { - fhirBaseImportStatement = ballerinaProjectToolConfig.getBasePackage(); - } - - if (ballerinaProjectToolConfig.getServicePackage() != null && !ballerinaProjectToolConfig.getServicePackage().isEmpty()) { - fhirServiceImportStatement = ballerinaProjectToolConfig.getServicePackage(); - } - - if (ballerinaProjectToolConfig.getDependentPackage() != null && - !ballerinaProjectToolConfig.getDependentPackage().isEmpty()) { - fhirInternationalImportStatement = ballerinaProjectToolConfig.getDependentPackage(); - } - dependenciesMap.put("basePackage", fhirBaseImportStatement.toLowerCase()); - dependenciesMap.put("servicePackage", fhirServiceImportStatement.toLowerCase()); - dependenciesMap.put("dependentPackage", fhirInternationalImportStatement.toLowerCase()); - } -} diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/BallerinaProjectToolFactory.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/BallerinaProjectToolFactory.java new file mode 100644 index 00000000..eb66afc3 --- /dev/null +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/BallerinaProjectToolFactory.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.codegen.ballerina.project.tool; + +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.versions.r4.R4BallerinaProjectTool; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.versions.r5.R5BallerinaProjectTool; + +public class BallerinaProjectToolFactory { + public AbstractBallerinaProjectTool getBallerinaProjectTool(String fhirVersion) { + if (fhirVersion.equals("r4")) { + return new R4BallerinaProjectTool(); + } else if (fhirVersion.equals("r5")) { + return new R5BallerinaProjectTool(); + } else { + throw new IllegalArgumentException("Unsupported FHIR version: " + fhirVersion); + } + } +} diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/config/BallerinaProjectToolConfig.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/config/BallerinaProjectToolConfig.java index 5efd4c31..1e1c406e 100644 --- a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/config/BallerinaProjectToolConfig.java +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/config/BallerinaProjectToolConfig.java @@ -59,28 +59,22 @@ public void configure(ConfigType configObj) throws CodeGenException { JsonObject jsonConfigObj = ((JsonConfigType) configObj).getConfigObj(); this.isEnabled = jsonConfigObj.getAsJsonPrimitive(BallerinaProjectConstants.CONFIG_ENABLE).getAsBoolean(); this.metadataConfig = new MetadataConfig(jsonConfigObj.getAsJsonObject("package")); - this.fhirVersion = jsonConfigObj. - getAsJsonObject("fhir").getAsJsonPrimitive("version").getAsString(); + this.fhirVersion = jsonConfigObj.getAsJsonObject("fhir").getAsJsonPrimitive("version").getAsString(); + populateIgConfigs(jsonConfigObj.getAsJsonArray("includedIGs")); - populateOperationConfigs(jsonConfigObj. - getAsJsonObject("builtIn").getAsJsonArray("operations")); - populateSearchParamConfigs(jsonConfigObj. - getAsJsonObject("builtIn").getAsJsonArray("searchParams")); - populateDependencyConfigs(jsonConfigObj. - getAsJsonArray("dependencies")); - populateInteractionConfigs(jsonConfigObj. - getAsJsonObject("builtIn").getAsJsonArray("interactions")); + populateOperationConfigs(jsonConfigObj.getAsJsonObject("builtIn").getAsJsonArray("operations")); + populateSearchParamConfigs(jsonConfigObj.getAsJsonObject("builtIn").getAsJsonArray("searchParams")); + populateDependencyConfigs(jsonConfigObj.getAsJsonArray("dependencies")); + populateInteractionConfigs(jsonConfigObj.getAsJsonObject("builtIn").getAsJsonArray("interactions")); + if (jsonConfigObj.getAsJsonPrimitive("basePackage") != null) { - this.basePackage = jsonConfigObj - .getAsJsonPrimitive("basePackage").getAsString(); + this.basePackage = jsonConfigObj.getAsJsonPrimitive("basePackage").getAsString(); } if (jsonConfigObj.getAsJsonPrimitive("servicePackage") != null) { - this.servicePackage = jsonConfigObj - .getAsJsonPrimitive("servicePackage").getAsString(); + this.servicePackage = jsonConfigObj.getAsJsonPrimitive("servicePackage").getAsString(); } if (jsonConfigObj.getAsJsonPrimitive("dependentPackage") != null) { - this.dependentPackage = jsonConfigObj - .getAsJsonPrimitive("dependentPackage").getAsString(); + this.dependentPackage = jsonConfigObj.getAsJsonPrimitive("dependentPackage").getAsString(); } } //todo: add toml type config handling @@ -96,10 +90,19 @@ public void overrideConfig(String jsonPath, JsonElement value) { case "project.package.version": this.metadataConfig.setVersion(value.getAsString()); break; + case "project.fhir.version": + this.fhirVersion = value.getAsString(); + break; case "project.package.namePrefix": this.metadataConfig.setNamePrefix(value.getAsString()); break; - case "project.package.dependentPackage": + case "project.basePackage": + this.basePackage = value.getAsString(); + break; + case "project.servicePackage": + this.servicePackage = value.getAsString(); + break; + case "project.dependentPackage": this.dependentPackage = value.getAsString(); break; case "project.package.igConfig": diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/generator/ComponentYamlGenerator.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/generator/ComponentYamlGenerator.java index a52a911a..fe15236c 100644 --- a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/generator/ComponentYamlGenerator.java +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/generator/ComponentYamlGenerator.java @@ -28,6 +28,7 @@ import java.io.File; import java.util.Map; +import java.util.Objects; /** * Generator for component.yaml file for Choreo components. @@ -44,14 +45,17 @@ public ComponentYamlGenerator(String targetDir) throws CodeGenException { public void generate(ToolContext toolContext, Map generatorProperties) throws CodeGenException { String directoryPath = generatorProperties.get("projectAPIPath") + File.separator + ".choreo" + File.separator; File fileDir = new File(directoryPath); + if (!fileDir.exists()) { if (!fileDir.mkdirs()) { LOG.error("Failed to create directories: " + fileDir); return; } } - this.getTemplateEngine().generateOutputAsFile(BallerinaProjectConstants.RESOURCE_PATH_TEMPLATES + - File.separator +"componentYaml.vm", createTemplateContext(generatorProperties), directoryPath, + // FILE.Seperator is not useful as for Windows it is \ but the VelocityEngine + // uses / as the file separator. + this.getTemplateEngine().generateOutputAsFile( BallerinaProjectConstants.RESOURCE_PATH_TEMPLATES + + "/componentYaml.vm", createTemplateContext(generatorProperties), directoryPath, "component.yaml"); } diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/generator/MetaGenerator.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/generator/MetaGenerator.java index 82f394ac..99c75b7b 100644 --- a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/generator/MetaGenerator.java +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/generator/MetaGenerator.java @@ -39,10 +39,20 @@ public MetaGenerator(String targetDir) throws CodeGenException { @Override public void generate(ToolContext toolContext, Map generatorProperties) throws CodeGenException { + BallerinaProjectToolConfig toolConfig = (BallerinaProjectToolConfig) generatorProperties.get("config"); String directoryPath = generatorProperties.get("projectAPIPath") + File.separator; - this.getTemplateEngine().generateOutputAsFile(BallerinaProjectConstants.RESOURCE_PATH_TEMPLATES + - BallerinaProjectConstants.RESOURCE_PATH_SEPERATOR + "moduleMd.vm", createTemplateContextForMeta(generatorProperties), directoryPath, - "Module.md"); + + if(toolConfig.getFhirVersion().equalsIgnoreCase("r5")){ + this.getTemplateEngine().generateOutputAsFile(BallerinaProjectConstants.RESOURCE_PATH_TEMPLATES + + BallerinaProjectConstants.RESOURCE_PATH_SEPERATOR + "r5ModuleMd.vm", createTemplateContextForMeta(generatorProperties), directoryPath, + "Module.md"); + } + else{ + this.getTemplateEngine().generateOutputAsFile(BallerinaProjectConstants.RESOURCE_PATH_TEMPLATES + + BallerinaProjectConstants.RESOURCE_PATH_SEPERATOR + "r4ModuleMd.vm", createTemplateContextForMeta(generatorProperties), directoryPath, + "Module.md"); + } + this.getTemplateEngine().generateOutputAsFile(BallerinaProjectConstants.RESOURCE_PATH_TEMPLATES + BallerinaProjectConstants.RESOURCE_PATH_SEPERATOR + "gitignore.vm", createTemplateContextForMeta(generatorProperties), directoryPath, ".gitignore"); diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/FHIRProfile.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/FHIRProfile.java index 7e870b24..84e419b8 100644 --- a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/FHIRProfile.java +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/FHIRProfile.java @@ -1,34 +1,15 @@ -/* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - package org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model; import com.google.gson.JsonObject; import org.apache.commons.text.CaseUtils; -import org.hl7.fhir.r4.model.StructureDefinition; import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.config.BallerinaProjectToolConfig; -import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.util.BallerinaProjectUtil; - -import java.util.*; -public class FHIRProfile { +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; - private StructureDefinition profileDef; +public class FHIRProfile { private String parentRef; private boolean isAbstract; private String name; @@ -38,25 +19,14 @@ public class FHIRProfile { private Map examples = new HashMap<>(); private String igName; private String resourceType; - private String packagePrefix; - public FHIRProfile(StructureDefinition profileDef, String url, String igName, String resourceType) { + public FHIRProfile(S profileDef, String url, String igName, String resourceType) { this.igName = igName; this.resourceType = resourceType; isAbstract = false; - this.profileDef = profileDef; this.url = url; this.importsList = new HashSet<>(); - this.name = BallerinaProjectUtil.resolveSpecialCharacters(profileDef.getName()); - } - - public StructureDefinition getProfileDef() { - return profileDef; - } - - public void setProfileDef(StructureDefinition profileDef) { - this.profileDef = profileDef; } public String getParentRef() { diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/GetterMethod.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/GetterMethod.java index 9d5c3433..df2a30bf 100644 --- a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/GetterMethod.java +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/GetterMethod.java @@ -21,8 +21,6 @@ import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; import java.util.List; public class GetterMethod extends Function { diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/SearchParam.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/SearchParam.java index e1803f17..4ca4cbd0 100644 --- a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/SearchParam.java +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/SearchParam.java @@ -18,9 +18,6 @@ package org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model; -import org.hl7.fhir.r4.model.SearchParameter; - -import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -29,7 +26,6 @@ public class SearchParam { private final String name; private final String code; private String targetResource; - private SearchParameter searchParamDef; private String description; private String documentation; private boolean builtIn; @@ -44,14 +40,6 @@ public String getName() { return name; } - public SearchParameter getSearchParamDef() { - return searchParamDef; - } - - public void setSearchParamDef(SearchParameter searchParamDef) { - this.searchParamDef = searchParamDef; - } - public String getDescription() { return extractDescription(description); } @@ -84,17 +72,17 @@ public void setTargetResource(String targetResource) { this.targetResource = targetResource; } - private String extractDescription(String originalDescription){ + private String extractDescription(String originalDescription) { List descriptions; - if (originalDescription.contains("Multiple Resources:")){ - descriptions = Arrays.asList(originalDescription.split("\\r\n\\* ")); - for (String resourceDesc:descriptions - ) { - if (resourceDesc.contains(targetResource)){ + if (originalDescription.contains("Multiple Resources:")) { + descriptions = Arrays.asList(originalDescription.split("\\r\n\\* ")); + for (String resourceDesc : descriptions + ) { + if (resourceDesc.contains(targetResource)) { return resourceDesc; } } - }else{ + } else { return originalDescription.replace("\n", ""); } return originalDescription; diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/versions/r4/R4FHIRProfile.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/versions/r4/R4FHIRProfile.java new file mode 100644 index 00000000..39c3dbf6 --- /dev/null +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/versions/r4/R4FHIRProfile.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.versions.r4; + +import org.hl7.fhir.r4.model.StructureDefinition; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.FHIRProfile; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.util.BallerinaProjectUtil; + +import java.util.*; + +public class R4FHIRProfile extends FHIRProfile { + private StructureDefinition profileDef; + + public R4FHIRProfile(StructureDefinition profileDef, String url, String igName, String resourceType) { + super(profileDef, url, igName, resourceType); + this.profileDef = profileDef; + setName(BallerinaProjectUtil.resolveSpecialCharacters(profileDef.getName())); + } + + public StructureDefinition getProfileDef() { + return profileDef; + } + + public void setProfileDef(StructureDefinition profileDef) { + this.profileDef = profileDef; + } +} diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/versions/r4/R4SearchParam.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/versions/r4/R4SearchParam.java new file mode 100644 index 00000000..e545a9a4 --- /dev/null +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/versions/r4/R4SearchParam.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.versions.r4; + +import org.hl7.fhir.r4.model.SearchParameter; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.SearchParam; + +public class R4SearchParam extends SearchParam { + private SearchParameter searchParamDef; + + public R4SearchParam(String name, String code) { + super(name, code); + } + + public SearchParameter getSearchParamDef() { + return searchParamDef; + } + + public void setSearchParamDef(SearchParameter searchParamDef) { + this.searchParamDef = searchParamDef; + } +} diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/versions/r5/R5FHIRProfile.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/versions/r5/R5FHIRProfile.java new file mode 100644 index 00000000..22b54dfc --- /dev/null +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/versions/r5/R5FHIRProfile.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.versions.r5; + +import com.google.gson.JsonObject; +import org.apache.commons.text.CaseUtils; +import org.hl7.fhir.r5.model.StructureDefinition; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.config.BallerinaProjectToolConfig; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.FHIRProfile; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.util.BallerinaProjectUtil; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +public class R5FHIRProfile extends FHIRProfile { + private StructureDefinition profileDef; + private String parentRef; + private boolean isAbstract; + private String name; + private String fhirVersion; + private String url; + private Set importsList; + private Map examples = new HashMap<>(); + private String igName; + private String resourceType; + + private String packagePrefix; + + public R5FHIRProfile(StructureDefinition profileDef, String url, String igName, String resourceType) { + super(profileDef, url, igName, resourceType); + this.profileDef = profileDef; + setName(BallerinaProjectUtil.resolveSpecialCharacters(profileDef.getName())); + } + + public StructureDefinition getProfileDef() { + return profileDef; + } + + public void setProfileDef(StructureDefinition profileDef) { + this.profileDef = profileDef; + } + + public String getParentRef() { + return parentRef; + } + + public void setParentRef(String parentRef) { + this.parentRef = parentRef; + } + + public boolean isAbstract() { + return isAbstract; + } + + public void setAbstract() { + isAbstract = true; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNamePrefix() { + return CaseUtils.toCamelCase(igName, true, '_') + CaseUtils.toCamelCase(resourceType, true, '_'); + } + + public String getFhirVersion() { + return fhirVersion; + } + + public void setFhirVersion(String fhirVersion) { + this.fhirVersion = fhirVersion; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public Set getImportsList() { + return importsList; + } + + public void addImport(String importItem) { + this.importsList.add(importItem); + } + + public void addExample(String interaction, JsonObject example) { + examples.put(interaction, example); + } + + public Map getExamples() { + return examples; + } + + public String getIgName() { + return igName; + } + + public String getResourceType() { + return resourceType; + } + + public String getPackagePrefix() { + return packagePrefix; + } + + public void setPackagePrefix(BallerinaProjectToolConfig config) { + String igPackage = config.getDependentPackage(); + if (igPackage.contains("/")) { + String pkgNameWithoutOrg = igPackage.split("/")[1]; + this.packagePrefix = pkgNameWithoutOrg.substring(pkgNameWithoutOrg.lastIndexOf(".") + 1); + } else { + this.packagePrefix = igPackage.substring(igPackage.lastIndexOf(".") + 1); + } + } +} diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/versions/r5/R5SearchParam.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/versions/r5/R5SearchParam.java new file mode 100644 index 00000000..9714093f --- /dev/null +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/model/versions/r5/R5SearchParam.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.versions.r5; + +import org.hl7.fhir.r5.model.SearchParameter; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.SearchParam; + +public class R5SearchParam extends SearchParam { + private SearchParameter searchParamDef; + + public R5SearchParam(String name, String code) { + super(name, code); + } + + public SearchParameter getSearchParamDef() { + return searchParamDef; + } + + public void setSearchParamDef(SearchParameter searchParamDef) { + this.searchParamDef = searchParamDef; + } +} diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/util/BallerinaProjectUtil.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/util/BallerinaProjectUtil.java index 5afd5640..b123e78e 100644 --- a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/util/BallerinaProjectUtil.java +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/util/BallerinaProjectUtil.java @@ -21,7 +21,6 @@ import org.apache.commons.text.CaseUtils; import java.util.List; -import java.util.Map; import java.util.regex.Pattern; /** diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/versions/r4/R4BallerinaProjectTool.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/versions/r4/R4BallerinaProjectTool.java new file mode 100644 index 00000000..8da76c0e --- /dev/null +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/versions/r4/R4BallerinaProjectTool.java @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.codegen.ballerina.project.tool.versions.r4; + +import org.hl7.fhir.r4.model.CodeType; +import org.hl7.fhir.r4.model.SearchParameter; +import org.hl7.fhir.r4.model.StructureDefinition; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRImplementationGuide; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRResourceDef; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRSearchParamDef; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.versions.r4.model.FHIRR4ResourceDef; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.BallerinaProjectConstants; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.AbstractBallerinaProjectTool; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.BallerinaService; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.versions.r4.R4FHIRProfile; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.SearchParam; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.versions.r4.R4SearchParam; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Main class for Ballerina Project Generator tool (FHIR R4). + */ +public class R4BallerinaProjectTool extends AbstractBallerinaProjectTool { + /** + * Populate Ballerina Service model according to configured IGs and Profiles. + */ + @Override + protected void populateBalService() { + for (Map.Entry entry : getIgMap().entrySet()) { + String igName = entry.getKey(); + + // extract structure definitions of resource types + Map resourceDefMap = new HashMap<>(); + + for (Map.Entry resourceEntry : entry.getValue().getResources().entrySet()) { + String key = resourceEntry.getKey(); + FHIRR4ResourceDef resourceDef = (FHIRR4ResourceDef) resourceEntry.getValue(); + String resourceName = resourceDef.getDefinition().getName(); + String resourceKind = resourceDef.getDefinition().getKind().toCode(); + + if (!getExcludedFHIRApis().contains(resourceName) && resourceKind.equalsIgnoreCase("RESOURCE")) { + resourceDefMap.put(key, resourceDef); + } + } + + // filter structure definitions based on included/excluded + List structureDefinitions = retrieveStructureDef(igName, resourceDefMap); + structureDefinitions.forEach(definition -> { + addResourceProfile(definition, definition.getType(), definition.getName(), definition.getUrl(), igName); + }); + + //adding Search parameters + for (Map.Entry parameter : entry.getValue().getSearchParameters().entrySet()) { + SearchParameter searchParameter = (SearchParameter) parameter.getValue().getSearchParameter(); + List baseResources = searchParameter.getBase(); + + for (CodeType baseType : baseResources) { + String apiName = baseType.getCode(); + if (!getServiceMap().containsKey(apiName)) { + continue; + } + SearchParam param = getSearchParam(parameter, apiName); + getServiceMap().get(apiName).addSearchParam(param); + } + } + } + } + + @Override + protected SearchParam getSearchParam(Map.Entry parameter, String apiName) { + SearchParameter searchParameter = (SearchParameter) parameter.getValue().getSearchParameter(); + R4SearchParam param = new R4SearchParam(searchParameter.getName(), searchParameter.getCode()); + + param.setSearchParamDef(searchParameter); + param.setDescription(searchParameter.getDescription().replace("\"", "")); + param.setDocumentation(searchParameter.getUrl()); + param.setTargetResource(apiName); + + if (getBallerinaProjectToolConfig().getSearchParamConfigs().contains(param.getSearchParamDef().getCode())) { + param.setBuiltIn(true); + } + return param; + } + + private List retrieveStructureDef(String igName, Map resourceDefMap) { + List structureDefinitions = new ArrayList<>(); + List includedProfiles = + getBallerinaProjectToolConfig().getIncludedIGConfigs().get(igName).getIncludedProfiles(); + List excludedProfiles = + getBallerinaProjectToolConfig().getIncludedIGConfigs().get(igName).getExcludedProfiles(); + if (!includedProfiles.isEmpty()) { + for (String profile : includedProfiles) { + if (resourceDefMap.containsKey(profile)) { + structureDefinitions.add((StructureDefinition) resourceDefMap.get(profile).getDefinition()); + } else { + // invalid url + System.out.println(BallerinaProjectConstants.PrintStrings.INVALID_PROFILE + profile); + } + } + if (structureDefinitions.isEmpty()) { + // nothing included + // generate template for all the profiles + System.out.println(BallerinaProjectConstants.PrintStrings.TEMPLATES_FOR_ALL_PROFILES); + resourceDefMap.forEach((k, resourceDef) -> { + structureDefinitions.add((StructureDefinition) resourceDef.getDefinition()); + }); + } + return structureDefinitions; + } + if (!excludedProfiles.isEmpty()) { + Map resourceDefMapCopy = new HashMap<>(resourceDefMap); + for (String profile : excludedProfiles) { + if (resourceDefMapCopy.containsKey(profile)) { + resourceDefMapCopy.remove(profile); + } else { + // invalid url + System.out.println(BallerinaProjectConstants.PrintStrings.INVALID_PROFILE + profile); + } + } + resourceDefMapCopy.forEach((k, resourceDef) -> { + structureDefinitions.add((StructureDefinition) resourceDef.getDefinition()); + }); + if (resourceDefMap.size() == resourceDefMapCopy.size()) { + System.out.println(BallerinaProjectConstants.PrintStrings.TEMPLATES_FOR_ALL_PROFILES); + } + return structureDefinitions; + } + // nothing included or excluded + // generate templates for all the profiles + System.out.println(BallerinaProjectConstants.PrintStrings.TEMPLATES_FOR_ALL_PROFILES); + resourceDefMap.forEach((k, v) -> { + structureDefinitions.add((StructureDefinition) v.getDefinition()); + }); + return structureDefinitions; + } + + /** + * Adding Ballerina service model to a common map. + * + * @param structureDefinition FHIR StructureDefinition + * @param resourceType FHIR resource type + * @param profile FHIR profile + * @param url FHIR profile url + */ + private void addResourceProfile(StructureDefinition structureDefinition, String resourceType, String profile, + String url, String igName) { + + if (getServiceMap().containsKey(resourceType)) { + if (structureDefinition.getAbstract()) { + //profiled resource added before + R4FHIRProfile fhirProfile = new R4FHIRProfile(structureDefinition, url, igName, resourceType); + fhirProfile.setFhirVersion(getBallerinaProjectToolConfig().getFhirVersion()); + fhirProfile.setPackagePrefix(getBallerinaProjectToolConfig()); + fhirProfile.setAbstract(); + fhirProfile.addImport(getBallerinaProjectToolConfig().getIncludedIGConfigs().get(igName).getImportStatement()); + getServiceMap().get(resourceType).addFhirProfile(fhirProfile); + getServiceMap().get(resourceType).addProfile(url); + } else { + //check for profiles + if (!getServiceMap().get(resourceType).getProfiles().contains(profile)) { + R4FHIRProfile fhirProfile = new R4FHIRProfile(structureDefinition, url, igName, resourceType); + fhirProfile.addImport(getBallerinaProjectToolConfig().getIncludedIGConfigs().get(igName).getImportStatement()); + fhirProfile.setFhirVersion(getBallerinaProjectToolConfig().getFhirVersion()); + fhirProfile.setPackagePrefix(getBallerinaProjectToolConfig()); + getServiceMap().get(resourceType).addFhirProfile(fhirProfile); + getServiceMap().get(resourceType).addProfile(url); + } + } + } else { + BallerinaService ballerinaService = new BallerinaService(resourceType, getBallerinaProjectToolConfig().getFhirVersion()); + R4FHIRProfile fhirProfile = new R4FHIRProfile(structureDefinition, url, igName, resourceType); + fhirProfile.addImport(getBallerinaProjectToolConfig().getIncludedIGConfigs().get(igName).getImportStatement()); + fhirProfile.setFhirVersion(getBallerinaProjectToolConfig().getFhirVersion()); + fhirProfile.setPackagePrefix(getBallerinaProjectToolConfig()); + ballerinaService.addFhirProfile(fhirProfile); + ballerinaService.addProfile(url); + ballerinaService.addIg(igName); + getServiceMap().put(structureDefinition.getType(), ballerinaService); + } + } +} diff --git a/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/versions/r5/R5BallerinaProjectTool.java b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/versions/r5/R5BallerinaProjectTool.java new file mode 100644 index 00000000..9da7acc9 --- /dev/null +++ b/native/fhir-to-bal-template/src/main/java/org/wso2/healthcare/fhir/codegen/ballerina/project/tool/versions/r5/R5BallerinaProjectTool.java @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.healthcare.fhir.codegen.ballerina.project.tool.versions.r5; + +import org.hl7.fhir.r5.model.StructureDefinition; +import org.hl7.fhir.r5.model.Enumerations; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.SearchParameter; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRImplementationGuide; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRResourceDef; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.model.FHIRSearchParamDef; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.versions.r5.model.FHIRR5ResourceDef; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.AbstractBallerinaProjectTool; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.BallerinaProjectConstants; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.BallerinaService; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.FHIRProfile; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.SearchParam; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.versions.r5.R5FHIRProfile; +import org.wso2.healthcare.fhir.codegen.ballerina.project.tool.model.versions.r5.R5SearchParam; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Main class for Ballerina Project Generator tool (FHIR R5). + */ +public class R5BallerinaProjectTool extends AbstractBallerinaProjectTool { + + /** + * Populate Ballerina Service model according to configured IGs and Profiles. + */ + @Override + protected void populateBalService() { + for (Map.Entry entry : getIgMap().entrySet()) { + String igName = entry.getKey(); + + // extract structure definitions of resource types + Map resourceDefMap = new HashMap<>(); + + for (Map.Entry resourceEntry : entry.getValue().getResources().entrySet()) { + String key = resourceEntry.getKey(); + FHIRR5ResourceDef resourceDef = (FHIRR5ResourceDef) resourceEntry.getValue(); + String resourceName = resourceDef.getDefinition().getName(); + String resourceKind = resourceDef.getDefinition().getKind().toCode(); + + if (!getExcludedFHIRApis().contains(resourceName) && resourceKind.equalsIgnoreCase("RESOURCE")) { + resourceDefMap.put(key, resourceDef); + } + } + + // filter structure definitions based on included/excluded + List structureDefinitions = retrieveStructureDef(igName, resourceDefMap); + structureDefinitions.forEach(definition -> { + addResourceProfile(definition, definition.getType(), definition.getName(), definition.getUrl(), igName); + }); + + //adding Search parameters + for (Map.Entry parameter : entry.getValue().getSearchParameters().entrySet()) { + SearchParameter searchParameter = (SearchParameter) parameter.getValue().getSearchParameter(); + List> baseResources = searchParameter.getBase(); + + for (Enumeration baseType : baseResources) { + String apiName = baseType.getCode(); + if (!getServiceMap().containsKey(apiName)) { + continue; + } + SearchParam param = getSearchParam(parameter, apiName); + getServiceMap().get(apiName).addSearchParam(param); + } + } + } + } + + private List retrieveStructureDef(String igName, Map resourceDefMap) { + List structureDefinitions = new ArrayList<>(); + List includedProfiles = + getBallerinaProjectToolConfig().getIncludedIGConfigs().get(igName).getIncludedProfiles(); + List excludedProfiles = + getBallerinaProjectToolConfig().getIncludedIGConfigs().get(igName).getExcludedProfiles(); + if (!includedProfiles.isEmpty()) { + for (String profile : includedProfiles) { + if (resourceDefMap.containsKey(profile)) { + structureDefinitions.add((StructureDefinition) resourceDefMap.get(profile).getDefinition()); + } else { + // invalid url + System.out.println(BallerinaProjectConstants.PrintStrings.INVALID_PROFILE + profile); + } + } + if (structureDefinitions.isEmpty()) { + // nothing included + // generate template for all the profiles + System.out.println(BallerinaProjectConstants.PrintStrings.TEMPLATES_FOR_ALL_PROFILES); + resourceDefMap.forEach((k, resourceDef) -> { + structureDefinitions.add((StructureDefinition) resourceDef.getDefinition()); + }); + } + return structureDefinitions; + } + if (!excludedProfiles.isEmpty()) { + Map resourceDefMapCopy = new HashMap<>(resourceDefMap); + for (String profile : excludedProfiles) { + if (resourceDefMapCopy.containsKey(profile)) { + resourceDefMapCopy.remove(profile); + } else { + // invalid url + System.out.println(BallerinaProjectConstants.PrintStrings.INVALID_PROFILE + profile); + } + } + resourceDefMapCopy.forEach((k, resourceDef) -> { + structureDefinitions.add((StructureDefinition) resourceDef.getDefinition()); + }); + if (resourceDefMap.size() == resourceDefMapCopy.size()) { + System.out.println(BallerinaProjectConstants.PrintStrings.TEMPLATES_FOR_ALL_PROFILES); + } + return structureDefinitions; + } + // nothing included or excluded + // generate templates for all the profiles + System.out.println(BallerinaProjectConstants.PrintStrings.TEMPLATES_FOR_ALL_PROFILES); + resourceDefMap.forEach((k, v) -> { + structureDefinitions.add((StructureDefinition) v.getDefinition()); + }); + return structureDefinitions; + } + + /** + * Adding Ballerina service model to a common map. + * + * @param structureDefinition FHIR StructureDefinition + * @param resourceType FHIR resource type + * @param profile FHIR profile + * @param url FHIR profile url + */ + private void addResourceProfile(StructureDefinition structureDefinition, String resourceType, String profile, + String url, String igName) { + + if (getServiceMap().containsKey(resourceType)) { + if (structureDefinition.getAbstract()) { + //profiled resource added before + R5FHIRProfile fhirProfile = new R5FHIRProfile(structureDefinition, url, igName, resourceType); + fhirProfile.setFhirVersion(getBallerinaProjectToolConfig().getFhirVersion()); + fhirProfile.setPackagePrefix(getBallerinaProjectToolConfig()); + fhirProfile.setAbstract(); + fhirProfile.addImport(getBallerinaProjectToolConfig().getIncludedIGConfigs().get(igName).getImportStatement()); + getServiceMap().get(resourceType).addFhirProfile(fhirProfile); + getServiceMap().get(resourceType).addProfile(url); + } else { + //check for profiles + if (!getServiceMap().get(resourceType).getProfiles().contains(profile)) { + FHIRProfile fhirProfile = new FHIRProfile(structureDefinition, url, igName, resourceType); + fhirProfile.addImport(getBallerinaProjectToolConfig().getIncludedIGConfigs().get(igName).getImportStatement()); + fhirProfile.setFhirVersion(getBallerinaProjectToolConfig().getFhirVersion()); + fhirProfile.setPackagePrefix(getBallerinaProjectToolConfig()); + getServiceMap().get(resourceType).addFhirProfile(fhirProfile); + getServiceMap().get(resourceType).addProfile(url); + } + } + } else { + BallerinaService ballerinaService = new BallerinaService(resourceType, getBallerinaProjectToolConfig().getFhirVersion()); + FHIRProfile fhirProfile = new FHIRProfile(structureDefinition, url, igName, resourceType); + fhirProfile.addImport(getBallerinaProjectToolConfig().getIncludedIGConfigs().get(igName).getImportStatement()); + fhirProfile.setFhirVersion(getBallerinaProjectToolConfig().getFhirVersion()); + fhirProfile.setPackagePrefix(getBallerinaProjectToolConfig()); + ballerinaService.addFhirProfile(fhirProfile); + ballerinaService.addProfile(url); + ballerinaService.addIg(igName); + getServiceMap().put(structureDefinition.getType(), ballerinaService); + } + } + + @Override + protected SearchParam getSearchParam(Map.Entry parameter, String apiName) { + SearchParameter searchParameter = (SearchParameter) parameter.getValue().getSearchParameter(); + R5SearchParam param = new R5SearchParam(searchParameter.getName(), searchParameter.getCode()); + + param.setSearchParamDef(searchParameter); + param.setDescription(searchParameter.getDescription().replace("\"", "")); + param.setDocumentation(searchParameter.getUrl()); + param.setTargetResource(apiName); + + if (getBallerinaProjectToolConfig().getSearchParamConfigs().contains(param.getSearchParamDef().getCode())) { + param.setBuiltIn(true); + } + return param; + } +} diff --git a/native/fhir-to-bal-template/src/main/resources/template/moduleMd.vm b/native/fhir-to-bal-template/src/main/resources/template/r4ModuleMd.vm similarity index 100% rename from native/fhir-to-bal-template/src/main/resources/template/moduleMd.vm rename to native/fhir-to-bal-template/src/main/resources/template/r4ModuleMd.vm diff --git a/native/fhir-to-bal-template/src/main/resources/template/r5ModuleMd.vm b/native/fhir-to-bal-template/src/main/resources/template/r5ModuleMd.vm new file mode 100644 index 00000000..f9036b3e --- /dev/null +++ b/native/fhir-to-bal-template/src/main/resources/template/r5ModuleMd.vm @@ -0,0 +1,165 @@ +#set ( $single_hash = '#' ) +#set ( $double_hash = '##' ) +#set ( $triple_hash = '###' ) +#set ( $underscore = '_' ) +# FHIR $service.getName() API Template + +## Overview +This Ballerina-based template implementation provides a RESTful FHIR API for managing `${service.getName()}` resources, adhering to the FHIR R5 specification. The API is designed to support CRUD operations International FHIR R5 ${service.getName()} FHIR API. + +| Module/Element | Version | +| -------------------- | ------- | +| FHIR version | $service.getFhirVersion() | +| Implementation Guide | #**##foreach($ig in $igURLs)[$ig]($ig)#if($foreach.hasNext), #end#end | +| Profile URL |#**##foreach($profile in $profileURLs)[$profile]($profile)#if($foreach.hasNext), #end#end| + +> **_Note:_** If you are having FHIR profiles from regional or custom implementation guides, you can use the Ballerina Health tool to generate the FHIR API templates for the FHIR profiles. For more information, see the [Ballerina Health tool](https://ballerina.io/learn/health-tool/#fhir-template-generation). + +## Prerequisites +- [Ballerina](https://ballerina.io/downloads/) (2201.10.2 or later) +- [VSCode](https://code.visualstudio.com/download) as the IDE and install the required vscode plugins + - Ballerina (https://marketplace.visualstudio.com/items?itemName=WSO2.ballerina) + - Ballerina Integrator (https://marketplace.visualstudio.com/items?itemName=WSO2.ballerina-integrator) + +### Pull the Template from Central +```sh +bal new -t $metaConfig.getOrg()/$templateName $apiName +``` + +### Run the Template +Run the Ballerina project created by the service template by executing: +```sh +bal run +``` +Once successfully executed, the listener will be started at port `9090`. Then, you can invoke the service using the following curl command: +```sh +curl http://localhost:9090/fhir/r5/$service.getName() +``` +Now, the service will be invoked and return an `OperationOutcome`, until the code template is implemented completely. + +> **_Note:_** This template is designed to be used as a starting point for implementing the FHIR API. The template is not complete and will return an `OperationOutcome` until the code is implemented. + +## API Endpoints + +### Retrieve a ${service.getName()} by ID +```http +GET /fhir/r5/${service.getName()}/{id} +``` +- **Response:** Returns a `${service.getName()}` resource or an `OperationOutcome` if not found. + +### Retrieve a Specific Version of a ${service.getName()} Resource +```http +GET /fhir/r5/${service.getName()}/{id}/_history/{vid} +``` +- **Response:** Returns a specific historical version of a `${service.getName()}` resource. + +### Search for ${service.getName()}s +```http +GET /fhir/r5/${service.getName()} +``` +- **Response:** Returns a `Bundle` containing matching `$service.getName()` resources. + +### Create a ${service.getName()} Resource +```http +POST /fhir/r5/${service.getName()} +``` +- **Request Body:** `${service.getName()}` resource. +- **Response:** Returns the created `${service.getName()}` resource. + +### Update a ${service.getName()} Resource +```http +PUT /fhir/r5/${service.getName()}/{id} +``` +- **Request Body:** Updated `${service.getName()}` resource. +- **Response:** Returns the updated `${service.getName()}` resource. + +### Patch a ${service.getName()} Resource +```http +PATCH /fhir/r5/${service.getName()}/{id} +``` +- **Request Body:** JSON Patch object. +- **Response:** Returns the updated `${service.getName()}` resource. + +### Delete a ${service.getName()} Resource +```http +DELETE /fhir/r5/${service.getName()}/{id} +``` +- **Response:** Returns an `OperationOutcome` indicating success or failure. + +### Retrieve Update History for a ${service.getName()} +```http +GET /fhir/r5/${service.getName()}/{id}/_history +``` +- **Response:** Returns a `Bundle` of historical versions of the `${service.getName()}` resource. + +### Retrieve Update History for All ${service.getName()}s +```http +GET /fhir/r5/${service.getName()}/_history +``` +- **Response:** Returns a `Bundle` of historical versions of all `${service.getName()}` resources. + +## Business Logic Implementation +The template is designed to work as a Facade API to expose your data as in FHIR. The following are the key steps which you can follow to implement the business logic: +- Handle business logic to work with search parameters. +- Implement the source system backend connection logic to fetch data. +- Perform data mapping inside the service to align with the FHIR models. + +## Additional Configuration +Modify `apiConfig` in the `fhirr5:Listener` initialization if needed to adjust service settings. + +#### Adding a Custom Search Parameter +The `apiConfig` object is used to configure the FHIR API. By default, it consists of the search parameters for the FHIR API defined for the Implementation Guide. If there are custom search parameters, they can be defined in the `apiConfig` object. Following is an example of how to add a custom search parameter: + +```json + searchParameters: [ + .... + { + name: "custom-search-parameter", // Custom search parameter name + active: true // Whether the search parameter is active + information: { // Optional information about the search parameter + description: "Custom search parameter description", + builtin: false, + } + } + ] + ``` + +#### Adding a Custom Operation + +Following are the steps to add a custom operation to the FHIR API template: + +1. The `apiConfig` object is used to configure the FHIR API. By default, it consists of the operations for the FHIR API defined for the Implementation Guide. If there are custom operations, they can be defined in the `apiConfig` object. Following is an example of how to add a custom operation: +```json + operations: [ + .... + { + name: "custom-operation", // Custom operation name + active: true // Whether the operation is active + information: { // Optional information about the operation + description: "Custom operation description", + builtin: false, + } + } + ] + ``` + 2. Add the context related to the custom operation in the service.bal file. Following is an example of how to add a custom operation: + ```typescript + isolated resource function post fhir/r5/${service.getName()}/\$custom\-operation(r5:FHIRContext fhirContext, ${service.getName()} procedure) returns r5:OperationOutcome|r5:FHIRError { + return r5:createFHIRError("Not implemented", r5:ERROR, r5:INFORMATIONAL, httpStatusCode = http:STATUS_NOT_IMPLEMENTED); + } + ``` + +#### Adding a Custom Profile/Combination of Profiles +Additionally, If you want to have a custom profile or a combination of profiles served from this same API template, you can add them to this FHIR API template. To add a custom profile, follow the steps below: + +- Add the profile type to the aggregated resource type. + - **Example:** `public type ${service.getName()} r5:${service.getName()}|;` +- Add the new profile URL in `api_config.bal` file. You need to add it as a string inside the `profiles` array. + - **Example:** + ```ballerina + profiles: ["http://hl7.org/fhir/StructureDefinition/${service.getName()}", "new_profile_url"] + ``` + +## License +This project is subject to the [WSO2 Software License](../LICENCE). + diff --git a/native/health-cli/pom.xml b/native/health-cli/pom.xml index f164d1ec..572afb30 100644 --- a/native/health-cli/pom.xml +++ b/native/health-cli/pom.xml @@ -214,6 +214,7 @@ org.codehaus.mojo exec-maven-plugin + generate-test-uscore test @@ -223,10 +224,16 @@ TestRunner test + + + fhirVersion + r4 + + - copy-bal-test-file + copy-r4-bal-test-file test exec @@ -235,12 +242,15 @@ bash -c - cp -r ../fhir-to-bal-lib/src/test/resources/ballerina.tests/* target/test-classes/health.fhir.r4.uscore501/tests + + mkdir -p target/test-classes/health.fhir.r4.uscore501/tests && + cp -r ../fhir-to-bal-lib/src/test/resources/ballerina.tests/r4/* target/test-classes/health.fhir.r4.uscore501/tests + - run-bal-tests + run-r4-bal-tests test exec @@ -253,6 +263,56 @@ + + + + generate-test-europebase + test + + java + + + TestRunner + test + + + fhirVersion + r5 + + + + + + copy-r5-bal-test-file + test + + exec + + + bash + + -c + + mkdir -p target/test-classes/health.fhir.r5.europebase/tests && + cp -r ../fhir-to-bal-lib/src/test/resources/ballerina.tests/r5/* target/test-classes/health.fhir.r5.europebase/tests + + + + + + run-r5-bal-tests + test + + exec + + + bal + + test + target/test-classes/health.fhir.r5.europebase/ + + + diff --git a/native/health-cli/src/main/java/io/ballerina/health/cmd/core/config/HealthCmdConfig.java b/native/health-cli/src/main/java/io/ballerina/health/cmd/core/config/HealthCmdConfig.java index 540cbe92..b48a44b3 100644 --- a/native/health-cli/src/main/java/io/ballerina/health/cmd/core/config/HealthCmdConfig.java +++ b/native/health-cli/src/main/java/io/ballerina/health/cmd/core/config/HealthCmdConfig.java @@ -33,7 +33,7 @@ public class HealthCmdConfig { public static JsonObject getParsedConfigFromPath(Path toolConfigPath) throws BallerinaHealthException { Gson gson = new Gson(); - if (toolConfigPath != null && StringUtils.isNotEmpty(toolConfigPath.toString())) { + if (toolConfigPath != null && StringUtils.isNotBlank(toolConfigPath.toString())) { try { JsonObject toolConfigObj = gson.fromJson(new FileReader(toolConfigPath.toFile()), JsonObject.class); if (toolConfigObj != null) { diff --git a/native/health-cli/src/main/java/io/ballerina/health/cmd/core/utils/HealthCmdConstants.java b/native/health-cli/src/main/java/io/ballerina/health/cmd/core/utils/HealthCmdConstants.java index 356ec6a1..1fbcc256 100644 --- a/native/health-cli/src/main/java/io/ballerina/health/cmd/core/utils/HealthCmdConstants.java +++ b/native/health-cli/src/main/java/io/ballerina/health/cmd/core/utils/HealthCmdConstants.java @@ -46,6 +46,7 @@ public class HealthCmdConstants { public static final String CDS_TOOL_CLASS_NAME = "org.wso2.healthcare.cds.codegen.ballerina.tool.BallerinaCDSProjectTool"; public static final String PROJECT_PACKAGE_ORG = "project.package.org"; public static final String PROJECT_PACKAGE_VERSION = "project.package.version"; + public static final String PROJECT_PACKAGE_BASE_PACKAGE = "project.package.basePackage"; public static final String PROJECT_PACKAGE_DEPENDENT_PACKAGE = "project.package.dependentPackage"; public static final String PROJECT_PACKAGE_NAME_PREFIX = "project.package.namePrefix"; public static final String USER_DIR = "user.dir"; @@ -65,6 +66,7 @@ public class HealthCmdConstants { public static final String CMD_OPTION_ORG_NAME = "--org-name"; public static final String CMD_OPTION_ORG_NAME_DESCRIPTION = "Organization name of the Ballerina package"; public static final String CMD_OPTION_PACKAGE_VERSION = "--package-version"; + public static final String CMD_OPTION_FHIR_VERSION = "--fhir-version"; public static final String CMD_OPTION_PACKAGE_VERSION_DESCRIPTION = "Location of the CDS hooks definition file"; public static final String CMD_OPTION_DEPENDENT_PACKAGE = "--dependent-package"; public static final String CMD_OPTION_INPUT = "--input"; diff --git a/native/health-cli/src/main/java/io/ballerina/health/cmd/core/utils/HealthCmdUtils.java b/native/health-cli/src/main/java/io/ballerina/health/cmd/core/utils/HealthCmdUtils.java index bb03b06f..8a67b5d3 100644 --- a/native/health-cli/src/main/java/io/ballerina/health/cmd/core/utils/HealthCmdUtils.java +++ b/native/health-cli/src/main/java/io/ballerina/health/cmd/core/utils/HealthCmdUtils.java @@ -20,6 +20,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Map; +import java.util.stream.Stream; /** * Utility methods for health command. @@ -136,4 +137,52 @@ public static JsonObject tomlToJson(TomlParseResult tomlParseResult) { return JsonParser.parseString(josnString).getAsJsonObject(); } + + public static String getSpecFhirVersion(String specificationPath) { + try (Stream paths = Files.walk(Paths.get(specificationPath))) { + return paths + .filter(Files::isRegularFile) + .filter(path -> path.getFileName().toString().contains("StructureDefinition")) + .filter(path -> path.toString().endsWith(".json") || path.toString().endsWith(".toml")) + .findFirst() + .map(HealthCmdUtils::extractFhirVersion) + .orElse(null); + } catch (IOException e) { + e.printStackTrace(); + return null; + } + } + + private static String extractFhirVersion(Path path) { + String fhirVersion = ""; + + try { + String content = Files.readString(path); + if (path.toString().endsWith(".json")) { + JsonObject json = JsonParser.parseString(content).getAsJsonObject(); + fhirVersion = json.has("fhirVersion") ? json.get("fhirVersion").getAsString() : null; + } else if (path.toString().endsWith(".toml")) { + for (String line : content.split("\n")) { + line = line.trim(); + if (line.startsWith("fhir.version")) { + String[] parts = line.split("=", 2); + if (parts.length == 2) { + fhirVersion = parts[1].trim().replaceAll("[\"']", ""); // remove quotes + } + } + } + } + + if (fhirVersion.startsWith("4.")) { + fhirVersion = "r4"; + } else if (fhirVersion.startsWith("5.")) { + fhirVersion = "r5"; + } + + return fhirVersion; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } } diff --git a/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/CrdTemplateGenHandler.java b/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/CrdTemplateGenHandler.java index ae57e05e..71fe7fb0 100644 --- a/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/CrdTemplateGenHandler.java +++ b/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/CrdTemplateGenHandler.java @@ -45,19 +45,8 @@ import java.util.Map; import java.util.Set; -import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CDS; -import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CDS_CONFIG_CLASS_NAME; -import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CDS_TOOL_CLASS_NAME; -import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_CDS_JSON_SCHEMA_FILENAME; -import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_ORG_NAME; -import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_PACKAGE_NAME; -import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.CMD_OPTION_PACKAGE_VERSION; -import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.HOOKS; -import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.PROJECT_PACKAGE_NAME_PREFIX; -import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.PROJECT_PACKAGE_ORG; -import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.PROJECT_PACKAGE_VERSION; +import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.*; import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.PrintStrings.CDS_HOOKS_VALIDATION; -import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.TOOLS; import static io.ballerina.health.cmd.core.utils.HealthCmdUtils.exitError; import static io.ballerina.health.cmd.core.utils.HealthCmdUtils.parseTomlToJson; @@ -68,8 +57,8 @@ public class CrdTemplateGenHandler implements Handler { private String packageName; private String orgName; - private String version; - + private String packageVersion; + private String fhirVersion; private JsonObject configJson; private InputStream cdsHooksJsonSchemaStream; private PrintStream printStream; @@ -92,7 +81,8 @@ public void init(PrintStream printStream, String cdsToolConfigFilePath) { public void setArgs(Map argsMap) { this.packageName = (String) argsMap.get(CMD_OPTION_PACKAGE_NAME); this.orgName = (String) argsMap.get(CMD_OPTION_ORG_NAME); - this.version = (String) argsMap.get(CMD_OPTION_PACKAGE_VERSION); + this.packageVersion = (String) argsMap.get(CMD_OPTION_PACKAGE_VERSION); + this.fhirVersion = (String) argsMap.get(HealthCmdConstants.CMD_OPTION_FHIR_VERSION); } @Override @@ -133,14 +123,25 @@ public boolean execute(String cdsHookDefinitionFilePath, String targetOutputPath JsonElement overrideConfig = new Gson().toJsonTree(orgName.toLowerCase()); toolConfigInstance.overrideConfig(PROJECT_PACKAGE_ORG, overrideConfig); } - if (version != null && !version.isEmpty()) { - JsonElement overrideConfig = new Gson().toJsonTree(version.toLowerCase()); + if (packageVersion != null && !packageVersion.isEmpty()) { + JsonElement overrideConfig = new Gson().toJsonTree(packageVersion.toLowerCase()); toolConfigInstance.overrideConfig(PROJECT_PACKAGE_VERSION, overrideConfig); } if (packageName != null && !packageName.isEmpty()) { JsonElement overrideConfig = new Gson().toJsonTree(packageName.toLowerCase()); toolConfigInstance.overrideConfig(PROJECT_PACKAGE_NAME_PREFIX, overrideConfig); } + if (fhirVersion != null && !fhirVersion.isEmpty() && fhirVersion.equalsIgnoreCase("r5")) { + // Override basePackage and dependentPackage in cds-tool-config.json + final String r5BasePackage = "ballerinax/health.fhir.r5"; + final String r5DependentPackage = "ballerinax/health.fhir.r5.cds"; // MIGHT NOT BE AVAILABLE + + JsonElement overrideConfigBase = new Gson().toJsonTree(r5BasePackage); + JsonElement overrideConfigDependent = new Gson().toJsonTree(r5DependentPackage); + + toolConfigInstance.overrideConfig(PROJECT_PACKAGE_BASE_PACKAGE, overrideConfigBase); + toolConfigInstance.overrideConfig(PROJECT_PACKAGE_DEPENDENT_PACKAGE, overrideConfigDependent); + } Class toolClazz = classLoader.loadClass(CDS_TOOL_CLASS_NAME); tool = (Tool) toolClazz.getConstructor().newInstance(); @@ -152,16 +153,20 @@ public boolean execute(String cdsHookDefinitionFilePath, String targetOutputPath } catch (ClassNotFoundException e) { printStream.println(ErrorMessages.TOOL_IMPL_NOT_FOUND + e.getMessage()); HealthCmdUtils.throwLauncherException(e); + } catch (InstantiationException | IllegalAccessException e) { printStream.println(ErrorMessages.CONFIG_INITIALIZING_FAILED); HealthCmdUtils.throwLauncherException(e); + } catch (CodeGenException e) { printStream.println(ErrorMessages.UNKNOWN_ERROR); printStream.println(e); HealthCmdUtils.throwLauncherException(e); + } catch (InvocationTargetException | NoSuchMethodException e) { HealthCmdUtils.throwLauncherException(e); } + if (crdTemplateGenerator != null) { try { crdTemplateGenerator.generate(null, crdTemplateGenerator.getGeneratorProperties()); @@ -189,7 +194,7 @@ private void validateCdsHooks(JsonElement cdsHooksJson) { try { jsonNode = mapper.readTree(cdsHooksJson.toString()); } catch (JsonProcessingException e) { - HealthCmdUtils.throwLauncherException(e); + HealthCmdUtils.throwLauncherException(e); } Set errors = jsonSchema.validate(jsonNode); diff --git a/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/FhirClientGenHandler.java b/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/FhirClientGenHandler.java index fef028db..b686dbec 100644 --- a/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/FhirClientGenHandler.java +++ b/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/FhirClientGenHandler.java @@ -20,6 +20,7 @@ import java.io.PrintStream; import java.util.Map; + /** * Handler for client generation. */ diff --git a/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/FhirPackageGenHandler.java b/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/FhirPackageGenHandler.java index 6485f61c..7d63c293 100644 --- a/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/FhirPackageGenHandler.java +++ b/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/FhirPackageGenHandler.java @@ -38,6 +38,8 @@ import java.lang.reflect.InvocationTargetException; import java.util.Map; +import static io.ballerina.health.cmd.core.utils.HealthCmdConstants.*; + /** * Handler for package generation tool. */ @@ -45,7 +47,8 @@ public class FhirPackageGenHandler implements Handler { private String packageName; private String orgName; - private String version; + private String packageVersion; + private String fhirVersion; private String[] dependentIgs; private JsonObject configJson; @@ -71,7 +74,8 @@ public void setArgs(Map argsMap) { this.packageName = (String) argsMap.get("--package-name"); this.orgName = (String) argsMap.get("--org-name"); - this.version = (String) argsMap.get("--package-version"); + this.packageVersion = (String) argsMap.get("--package-version"); + this.fhirVersion = (String) argsMap.get("--fhir-version"); this.dependentIgs = (String[]) argsMap.get("--dependent-ig"); } @@ -99,6 +103,7 @@ public boolean execute(String specificationPath, String targetOutputPath) { //override tool level configs here Tool tool; TemplateGenerator mainTemplateGenerator = null; + try { ClassLoader classLoader = this.getClass().getClassLoader(); String configClassName = "org.wso2.healthcare.fhir.ballerina.packagegen.tool.config." + @@ -121,9 +126,24 @@ public boolean execute(String specificationPath, String targetOutputPath) { JsonElement overrideConfig = new Gson().toJsonTree(orgName.toLowerCase()); toolConfigInstance.overrideConfig("packageConfig.org", overrideConfig); } - if (version != null && !version.isEmpty()) { - JsonElement overrideConfig = new Gson().toJsonTree(version.toLowerCase()); - toolConfigInstance.overrideConfig("packageConfig.version", overrideConfig); + if (packageVersion != null && !packageVersion.isEmpty()) { + JsonElement overrideConfig = new Gson().toJsonTree(packageVersion.toLowerCase()); + toolConfigInstance.overrideConfig("packageConfig.packageVersion", overrideConfig); + } + if (fhirVersion != null && !fhirVersion.isEmpty() && !fhirVersion.equalsIgnoreCase("r4")) { + JsonElement overrideConfig = new Gson().toJsonTree(fhirVersion.toLowerCase()); + toolConfigInstance.overrideConfig("packageConfig.fhirVersion", overrideConfig); + } + if (fhirVersion != null && !fhirVersion.isEmpty() && fhirVersion.equalsIgnoreCase("r5")) { + // Override basePackage and dependentPackage in tool-config.json + final String r5Repository = "https://github.com/ballerina-platform/module-ballerinax-health.fhir.r5"; + final String r5BasePackage = "ballerinax/health.fhir.r5"; + + JsonElement overrideConfigRepository = new Gson().toJsonTree(r5Repository); + JsonElement overrideConfigBase = new Gson().toJsonTree(r5BasePackage); + + toolConfigInstance.overrideConfig("packageConfig.repository", overrideConfigRepository); + toolConfigInstance.overrideConfig("packageConfig.basePackage", overrideConfigBase); } if (dependentIgs != null && dependentIgs.length > 0) { // Create a JSON array from the String array diff --git a/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/FhirTemplateGenHandler.java b/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/FhirTemplateGenHandler.java index 2096a023..8eb08eb9 100644 --- a/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/FhirTemplateGenHandler.java +++ b/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/FhirTemplateGenHandler.java @@ -36,6 +36,7 @@ import java.io.PrintStream; import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.Map; /** @@ -45,7 +46,8 @@ public class FhirTemplateGenHandler implements Handler { private String packageName; private String orgName; - private String version; + private String packageVersion; + private String fhirVersion; private String dependentPackage; private String[] includedProfiles; @@ -75,7 +77,8 @@ public void setArgs(Map argsMap) { this.packageName = (String) argsMap.get("--package-name"); this.orgName = (String) argsMap.get("--org-name"); - this.version = (String) argsMap.get("--package-version"); + this.packageVersion = (String) argsMap.get("--package-version"); + this.fhirVersion = (String) argsMap.get("--fhir-version"); this.dependentPackage = (String) argsMap.get("--dependent-package"); this.includedProfiles = (String[]) argsMap.get("--included-profile"); this.excludedProfiles = (String[]) argsMap.get("--excluded-profile"); @@ -96,17 +99,19 @@ public boolean execute(String specificationPath, String targetOutputPath) { JsonObject toolExecConfig = toolExecConfigs.getAsJsonObject(); //override tool level configs here - Tool tool; TemplateGenerator mainTemplateGenerator = null; + try { ClassLoader classLoader = this.getClass().getClassLoader(); String configClassName = "org.wso2.healthcare.fhir.codegen.ballerina.project.tool." + "config.BallerinaProjectToolConfig"; - Class configClazz = classLoader.loadClass(configClassName); - String toolClassName = "org.wso2.healthcare.fhir.codegen.ballerina.project.tool.BallerinaProjectTool"; - Class toolClazz = classLoader.loadClass(toolClassName); - ToolConfig toolConfigInstance = (ToolConfig) configClazz.getConstructor().newInstance(); + Class configClass = classLoader.loadClass(configClassName); + + String toolClassName = "org.wso2.healthcare.fhir.codegen.ballerina.project.tool.BallerinaProjectToolFactory"; + Class toolClass = classLoader.loadClass(toolClassName); + + ToolConfig toolConfigInstance = (ToolConfig) configClass.getConstructor().newInstance(); toolConfigInstance.setTargetDir(targetOutputPath); toolConfigInstance.setToolName(HealthCmdConstants.CMD_MODE_TEMPLATE); @@ -118,10 +123,32 @@ public boolean execute(String specificationPath, String targetOutputPath) { JsonElement overrideConfig = new Gson().toJsonTree(orgName.toLowerCase()); toolConfigInstance.overrideConfig("project.package.org", overrideConfig); } - if (version != null && !version.isEmpty()) { - JsonElement overrideConfig = new Gson().toJsonTree(version.toLowerCase()); + if (packageVersion != null && !packageVersion.isEmpty()) { + JsonElement overrideConfig = new Gson().toJsonTree(packageVersion.toLowerCase()); toolConfigInstance.overrideConfig("project.package.version", overrideConfig); } + if (fhirVersion != null && !fhirVersion.isEmpty() && !fhirVersion.equalsIgnoreCase("r4")) { + JsonElement overrideConfig = new Gson().toJsonTree(fhirVersion.toLowerCase()); + toolConfigInstance.overrideConfig("project.fhir.version", overrideConfig); + } + if (fhirVersion != null && !fhirVersion.isEmpty() && fhirVersion.equalsIgnoreCase("r5")) { + String namePrefix = "health.fhir.r5.international500"; + String basePackage = "ballerinax/health.fhir.r5"; + String servicePackage = "ballerinax/health.fhirr5"; + String dependentPackage = "ballerinax/health.fhir.r5.international500"; + + JsonElement overrideNamePrefix = new Gson().toJsonTree(namePrefix); + toolConfigInstance.overrideConfig("project.package.namePrefix", overrideNamePrefix); + + JsonElement overrideBasePackage = new Gson().toJsonTree(basePackage); + toolConfigInstance.overrideConfig("project.basePackage", overrideBasePackage); + + JsonElement overrideServicePackage = new Gson().toJsonTree(servicePackage); + toolConfigInstance.overrideConfig("project.servicePackage", overrideServicePackage); + + JsonElement overrideDependentPackage = new Gson().toJsonTree(dependentPackage); + toolConfigInstance.overrideConfig("project.dependentPackage", overrideDependentPackage); + } if (dependentPackage != null) { JsonElement overrideConfig = new Gson().toJsonTree(dependentPackage); JsonElement nameConfig = @@ -137,20 +164,27 @@ public boolean execute(String specificationPath, String targetOutputPath) { ) ); - tool = (Tool) toolClazz.getConstructor().newInstance(); + Object toolFactory = toolClass.getConstructor().newInstance(); + Method getToolMethod = toolClass.getMethod("getBallerinaProjectTool", String.class); + tool = (Tool) getToolMethod.invoke(toolFactory, fhirVersion); + tool.initialize(toolConfigInstance); fhirToolLib.getToolImplementations().putIfAbsent(HealthCmdConstants.CMD_MODE_PACKAGE, tool); mainTemplateGenerator = tool.execute(fhirToolLib.getToolContext()); + } catch (ClassNotFoundException e) { printStream.println(ErrorMessages.TOOL_IMPL_NOT_FOUND + e.getMessage()); HealthCmdUtils.throwLauncherException(e); + } catch (InstantiationException | IllegalAccessException e) { printStream.println(ErrorMessages.CONFIG_INITIALIZING_FAILED); HealthCmdUtils.throwLauncherException(e); + } catch (CodeGenException e) { printStream.println(ErrorMessages.UNKNOWN_ERROR); printStream.println(e); HealthCmdUtils.throwLauncherException(e); + } catch (InvocationTargetException | NoSuchMethodException e) { throw new RuntimeException(e); } diff --git a/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/Handler.java b/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/Handler.java index 020e4a3c..1c22d4bf 100644 --- a/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/Handler.java +++ b/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/Handler.java @@ -25,7 +25,8 @@ import org.wso2.healthcare.codegen.tool.framework.commons.core.AbstractTool; import org.wso2.healthcare.codegen.tool.framework.commons.exception.CodeGenException; import org.wso2.healthcare.codegen.tool.framework.commons.model.JsonConfigType; -import org.wso2.healthcare.codegen.tool.framework.fhir.core.FHIRSpecParser; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.AbstractFHIRSpecParser; +import org.wso2.healthcare.codegen.tool.framework.fhir.core.FHIRSpecParserFactory; import org.wso2.healthcare.codegen.tool.framework.fhir.core.FHIRTool; import org.wso2.healthcare.codegen.tool.framework.fhir.core.config.FHIRToolConfig; @@ -50,17 +51,27 @@ default AbstractTool initializeLib(String libName, PrintStream printStream, Json JsonConfigType toolConfig; FHIRTool fhirToolLib; FHIRToolConfig fhirToolConfig = new FHIRToolConfig(); + String fhirVersion; + try { + fhirVersion = HealthCmdUtils.getSpecFhirVersion(specificationPath); + + if (fhirVersion == null) { + printStream.println(ErrorMessages.LIB_INITIALIZING_FAILED + "Unable to find FHIR version in the specification"); + return null; + } + toolConfig = new JsonConfigType(configJson); - fhirToolLib = new FHIRTool(); + fhirToolLib = new FHIRTool(fhirVersion); fhirToolConfig.configure(toolConfig); fhirToolConfig.setSpecBasePath(specificationPath); fhirToolLib.initialize(fhirToolConfig); - FHIRSpecParser specParser = new FHIRSpecParser(); + AbstractFHIRSpecParser specParser = FHIRSpecParserFactory.getParser(fhirVersion); specParser.parseIG(fhirToolConfig, HealthCmdConstants.CMD_DEFAULT_IG_NAME, specificationPath); return fhirToolLib; + } catch (CodeGenException e) { printStream.println(ErrorMessages.LIB_INITIALIZING_FAILED + Arrays.toString(e.getStackTrace()) + e.getMessage()); @@ -78,7 +89,7 @@ default AbstractTool initializeLib(String libName, PrintStream printStream, Json void init(PrintStream printStream, String specificationPath); - void setArgs(Map argsMap); + void setArgs(Map argsMap); boolean execute(String specificationPath, String targetOutputPath); } diff --git a/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/HandlerFactory.java b/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/HandlerFactory.java index 3bfbf0db..bb7aadbf 100644 --- a/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/HandlerFactory.java +++ b/native/health-cli/src/main/java/io/ballerina/health/cmd/handler/HandlerFactory.java @@ -36,21 +36,26 @@ public class HandlerFactory { public static Handler createHandler(String subCommand, String mode, PrintStream printStream, String specificationPath) throws BallerinaHealthException { + switch (subCommand + SEMICOLON + mode) { case CMD_FHIR_MODE_TEMPLATE: Handler templateHandler = new FhirTemplateGenHandler(); templateHandler.init(printStream, specificationPath); return templateHandler; + case CMD_FHIR_MODE_CLIENT: return new FhirClientGenHandler(); + case CMD_FHIR_MODE_PACKAGE: Handler packageHandler = new FhirPackageGenHandler(); packageHandler.init(printStream, specificationPath); return packageHandler; + case CMD_CDS_MODE_TEMPLATE: Handler crdTemplateGenHandler = new CrdTemplateGenHandler(); crdTemplateGenHandler.init(printStream, specificationPath); return crdTemplateGenHandler; + default: throw new BallerinaHealthException(ErrorMessages.INVALID_MODE); } diff --git a/native/health-cli/src/main/resources/tool-config.json b/native/health-cli/src/main/resources/tool-config.json index 38283c27..fe905c26 100644 --- a/native/health-cli/src/main/resources/tool-config.json +++ b/native/health-cli/src/main/resources/tool-config.json @@ -13,6 +13,7 @@ "authors": [ "Ballerina" ], + "fhirVersion": "r4", "repository": "https://github.com/ballerina-platform/module-ballerinax-health.fhir.r4", "basePackage": "ballerinax/health.fhir.r4", "parentPackage": "", diff --git a/native/health-cli/src/test/java/TestRunner.java b/native/health-cli/src/test/java/TestRunner.java index 6de468ed..c79d21ff 100644 --- a/native/health-cli/src/test/java/TestRunner.java +++ b/native/health-cli/src/test/java/TestRunner.java @@ -23,6 +23,7 @@ import io.ballerina.health.cmd.handler.HandlerFactory; import java.io.File; +import java.net.URISyntaxException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.HashMap; @@ -33,28 +34,46 @@ public class TestRunner { private static final Path executionPath = Paths.get(System.getProperty("user.dir")); public static void main(String[] args) { - runTestForFhirTool(); - runTestForCdsTool(); + // System.setProperty("fhirVersion", "r4"); // Uncomment if directly running the TestRunner.java + try { + runTestForCdsTool(); + if (System.getProperty("fhirVersion").equalsIgnoreCase("r4")) { + runTestForR4FhirTool(); + } else { + runTestForR5FhirTool(); + } + } catch (URISyntaxException e) { + e.printStackTrace(); + } } - private static void runTestForCdsTool(){ + private static void runTestForCdsTool() throws URISyntaxException { Map argsMap = new HashMap<>(); String packageName = "health.fhir.cds"; String orgName = "ballerinax"; String packageVersion = "1.1.0"; + String fhirVersion = "r4"; argsMap.put("--package-name", packageName); argsMap.put("--org-name", orgName); argsMap.put("--package-version", packageVersion); + argsMap.put("--fhir-version", fhirVersion); String mode = "template"; String command = "cds"; - String resourcePath = Paths.get(Objects.requireNonNull(TestRunner.class.getClassLoader().getResource("io")).getPath()).getParent().getParent().toString()+ "/test-classes" + "/cds.hooks"; - System.out.println(resourcePath); + String resourcePath = Paths.get(Objects.requireNonNull(TestRunner.class.getClassLoader().getResource("io")).toURI()).getParent().getParent().toString() + File.separator + "test-classes" + File.separator + "cds.hooks"; + System.out.println("Resource Path: " + resourcePath); + File resourcesDirectory = new File(resourcePath); String specPath = resourcesDirectory.getAbsolutePath(); + System.out.println("Spec Path: " + specPath); + + String outPutPath = Paths.get(Objects.requireNonNull(TestRunner.class.getClassLoader().getResource("io")).toURI()).getParent().getParent().toString() + File.separator + "test-classes"; + System.out.println("Output Path: " + outPutPath); + + //spec path is the last argument Path specificationPath; - String outPutPath = Paths.get(Objects.requireNonNull(TestRunner.class.getClassLoader().getResource("io")).getPath()).getParent().getParent().toString() + "/test-classes"; + try { specificationPath = HealthCmdUtils.getSpecificationPath(specPath, executionPath.toString()); } catch (BallerinaHealthException e) { @@ -71,36 +90,107 @@ private static void runTestForCdsTool(){ } toolHandler.setArgs(argsMap); - toolHandler.execute(specificationPath+File.separator+"tool-config.toml", getTargetOutputPath(outPutPath).toString()); + toolHandler.execute(specificationPath + File.separator + "tool-config.toml", getTargetOutputPath(outPutPath).toString()); } - private static void runTestForFhirTool(){ + /** + * This method generates a Ballerina package for the R4 FHIR profiles. + * The current provided profile is USCore501 + * If needed to generate a template comment the lines indicated as // FOR PACKAGE + * and uncomment the lines indicated as // FOR TEMPLATE + */ + private static void runTestForR4FhirTool() throws URISyntaxException { Map argsMap = new HashMap<>(); String packageName = "health.fhir.r4.uscore501"; String orgName = "ballerinax"; String packageVersion = "1.1.0"; - argsMap.put("--package-name", packageName); + String fhirVersion = "r4"; + argsMap.put("--package-name", packageName); // FOR PACKAGE + argsMap.put("--package-version", packageVersion); // FOR PACKAGE + argsMap.put("--dependency", null); // FOR PACKAGE + // argsMap.put("--dependent-package", orgName + "/" + packageName); // FOR TEMPLATE argsMap.put("--org-name", orgName); - argsMap.put("--package-version", packageVersion); + argsMap.put("--fhir-version", fhirVersion); argsMap.put("--included-profile", null); argsMap.put("--excluded-profile", null); - argsMap.put("--dependency", null); String mode = "package"; String command = "fhir"; - String resourcePath = Paths.get(Objects.requireNonNull(TestRunner.class.getClassLoader().getResource("io")).getPath()).getParent().getParent().toString() + "/test-classes" + "/profiles.USCore"; + String resourcePath = Paths.get(Objects.requireNonNull(TestRunner.class.getClassLoader().getResource("io")).toURI()).getParent().getParent().toString() + File.separator + "test-classes" + File.separator + "profiles.USCore"; + System.out.println("Resource Path: " + resourcePath); + File resourcesDirectory = new File(resourcePath); String specPath = resourcesDirectory.getAbsolutePath(); - String outPutPath = Paths.get(Objects.requireNonNull(TestRunner.class.getClassLoader().getResource("io")).getPath()).getParent().getParent().toString() + "/test-classes"; + System.out.println("Spec Path: " + specPath); + + String outPutPath = Paths.get(Objects.requireNonNull(TestRunner.class.getClassLoader().getResource("io")).toURI()).getParent().getParent().toString() + File.separator + "test-classes"; + System.out.println("Output Path: " + outPutPath); //spec path is the last argument Path specificationPath; + try { specificationPath = HealthCmdUtils.validateAndSetSpecificationPath(specPath, executionPath.toString()); } catch (BallerinaHealthException e) { System.out.println("Invalid specification path received for FHIR tool command."); throw new BLauncherException(); } + + Handler toolHandler = null; + try { + toolHandler = HandlerFactory.createHandler(command, mode, System.out, specificationPath.toString()); + } catch (BallerinaHealthException e) { + System.out.println(e); + throw new BLauncherException(); + } + + toolHandler.setArgs(argsMap); + toolHandler.execute(specificationPath.toString(), getTargetOutputPath(outPutPath).toString()); + } + + /** + * This method generates a Ballerina package for the R5 FHIR profiles. + * Current provided profile is EuropeBase + * If needed to generate a template comment the lines indicated as // FOR PACKAGE + * and uncomment the lines indicated as // FOR TEMPLATE + */ + private static void runTestForR5FhirTool() throws URISyntaxException { + Map argsMap = new HashMap<>(); + String packageName = "health.fhir.r5.europebase"; + String orgName = "ballerinax"; + String packageVersion = "1.1.0"; + String fhirVersion = "r5"; + argsMap.put("--package-name", packageName); // FOR PACKAGE + argsMap.put("--package-version", packageVersion); // FOR PACKAGE + argsMap.put("--dependency", null); // FOR PACKAGE + // argsMap.put("--dependent-package", orgName + "/" + packageName); // FOR TEMPLATE + argsMap.put("--org-name", orgName); + argsMap.put("--fhir-version", fhirVersion); + argsMap.put("--included-profile", null); + argsMap.put("--excluded-profile", null); + String mode = "package"; + String command = "fhir"; + + String resourcePath = Paths.get(Objects.requireNonNull(TestRunner.class.getClassLoader().getResource("io")).toURI()).getParent().getParent().toString() + File.separator + "test-classes" + File.separator + "profiles.EuropeBase"; + System.out.println("Resource Path: " + resourcePath); + + File resourcesDirectory = new File(resourcePath); + String specPath = resourcesDirectory.getAbsolutePath(); + System.out.println("Spec Path: " + specPath); + + String outPutPath = Paths.get(Objects.requireNonNull(TestRunner.class.getClassLoader().getResource("io")).toURI()).getParent().getParent().toString() + File.separator + "test-classes"; + System.out.println("Output Path: " + outPutPath); + + //spec path is the last argument + Path specificationPath; + + try { + specificationPath = HealthCmdUtils.validateAndSetSpecificationPath(specPath, executionPath.toString()); + } catch (BallerinaHealthException e) { + System.out.println("Invalid specification path received for FHIR tool command."); + throw new BLauncherException(); + } + Handler toolHandler = null; try { toolHandler = HandlerFactory.createHandler(command, mode, System.out, specificationPath.toString()); @@ -113,7 +203,7 @@ private static void runTestForFhirTool(){ toolHandler.execute(specificationPath.toString(), getTargetOutputPath(outPutPath).toString()); } - private static Path getTargetOutputPath(String outputPath){ + private static Path getTargetOutputPath(String outputPath) { Path targetOutputPath = TestRunner.executionPath; if (outputPath != null) { if (Paths.get(outputPath).isAbsolute()) { @@ -126,4 +216,4 @@ private static Path getTargetOutputPath(String outputPath){ } return targetOutputPath; } -} +} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/CodeSystem-v3-ActCode-EU.json b/native/health-cli/src/test/resources/profiles.EuropeBase/CodeSystem-v3-ActCode-EU.json new file mode 100644 index 00000000..e416e31c --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/CodeSystem-v3-ActCode-EU.json @@ -0,0 +1 @@ +{"resourceType":"CodeSystem","id":"v3-ActCode-EU","text":{"status":"generated","div":"

Generated Narrative: CodeSystem v3-ActCode-EU

This case-sensitive code system http://terminology.hl7.eu/CodeSystem/v3-ActCode defines the following code:

CodeDisplayDefinition
ehic European Health Insurance CardEuropean Health Insurance Card
"},"url":"http://terminology.hl7.eu/CodeSystem/v3-ActCode","version":"0.1.0-ballot","name":"EuV3ActCode","title":"HL7 V3 ActCode - EU extensions","status":"draft","experimental":true,"date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"European extensions to the V3 ActCode code system","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","caseSensitive":true,"content":"complete","count":1,"concept":[{"code":"ehic","display":"European Health Insurance Card","definition":"European Health Insurance Card"}]} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/ImplementationGuide-hl7.fhir.eu.base-r5.json b/native/health-cli/src/test/resources/profiles.EuropeBase/ImplementationGuide-hl7.fhir.eu.base-r5.json new file mode 100644 index 00000000..2358768c --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/ImplementationGuide-hl7.fhir.eu.base-r5.json @@ -0,0 +1 @@ +{"resourceType":"ImplementationGuide","id":"hl7.fhir.eu.base-r5","text":{"status":"generated","div":"

Generated Narrative: ImplementationGuide hl7.fhir.eu.base-r5

Hl7EuBaseIg

The official URL for this implementation guide is:

http://hl7.eu/fhir/base-r5/ImplementationGuide/hl7.fhir.eu.base-r5

This guide collects base and core profiles to be used in the European context. It also includes common artifacts, such as the profiles describing the European Health Insurance Card.

\n
"},"url":"http://hl7.eu/fhir/base-r5/ImplementationGuide/hl7.fhir.eu.base-r5","version":"0.1.0-ballot","name":"Hl7EuBaseIg","title":"HL7 Europe Base and Core FHIR IG","status":"draft","date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"This guide collects base and core profiles to be used in the European context. It also includes common artifacts, such as the profiles describing the European Health Insurance Card.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","packageId":"hl7.fhir.eu.base-r5","license":"CC0-1.0","fhirVersion":["5.0.0"],"dependsOn":[{"id":"hl7tx","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/implementationguide-dependency-comment","valueMarkdown":"Automatically added as a dependency - all IGs depend on HL7 Terminology"}],"uri":"http://terminology.hl7.org/ImplementationGuide/hl7.terminology","packageId":"hl7.terminology.r5","version":"6.3.0"},{"id":"hl7ext","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/implementationguide-dependency-comment","valueMarkdown":"Automatically added as a dependency - all IGs depend on the HL7 Extension Pack"}],"uri":"http://hl7.org/fhir/extensions/ImplementationGuide/hl7.fhir.uv.extensions","packageId":"hl7.fhir.uv.extensions.r5","version":"5.2.0"},{"id":"hl7_fhir_eu_extensions_r5","uri":"http://hl7.eu/fhir/extensions","packageId":"hl7.fhir.eu.extensions.r5","version":"0.1.1-ballot"}],"definition":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/ig-internal-dependency","valueCode":"hl7.fhir.uv.tools.r5#0.5.0"}],"resource":[{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:complex-type"}],"reference":{"reference":"StructureDefinition/Address-eu"},"name":"Address (EU)","description":"This profile extends the Address data type for supporting streetname, housenumber and postal box.","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"}],"reference":{"reference":"StructureDefinition/BodyStructure-eu"},"name":"Body structure (EU base)","description":"This profile specifies how the HL7 FHIR BodyStructure resource should be used for conveying commonly used concepts in the European context.","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"}],"reference":{"reference":"ValueSet/siteLaterality-eu"},"name":"Body Structure Laterality","description":"Body Structure site laterality qualifier. It indicates - for example - the body site laterality from which a laboratory specimen is collected. (based on SNOMED CT)","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"}],"reference":{"reference":"ValueSet/siteQualifier-eu"},"name":"Body Structure Qualifier","description":"Body Structure site qualifier. It indicates - for example - the body site qualifier from which a laboratory specimen is collected. (based on SNOMED CT)","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"}],"reference":{"reference":"StructureDefinition/Coverage-eu-ehic"},"name":"Coverage: EHIC","description":"Coverage profile for the European Health Insurance Card","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"}],"reference":{"reference":"ValueSet/oid-ehicPersonalId"},"name":"EHIC Personal ID (system IDs - oid)","description":"System identifiers (oid) used for the EHIC#6 Personal Identification Number","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"}],"reference":{"reference":"ValueSet/uri-ehicPersonalId"},"name":"EHIC Personal ID (system IDs - uri)","description":"System identifiers (uri) used for the EHIC#6 Personal Identification Number","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Coverage"}],"reference":{"reference":"Coverage/EhicExampleIt"},"name":"EhicExampleIt","description":"Example of Italian EHIC (Tessera TEAM)","isExample":true,"profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Coverage-eu-ehic"]},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"BodyStructure"}],"reference":{"reference":"BodyStructure/example-body-structure-eu"},"name":"Example Body Structure","description":"An example instance of the BodyStructureEu profile.","isExample":true,"profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/BodyStructure-eu"]},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Organization"}],"reference":{"reference":"Organization/organization-eu-core-example"},"name":"Example Organization","description":"An example of an organization resource","isExample":true,"profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu"]},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Patient"}],"reference":{"reference":"Patient/patient-eu-core-example"},"name":"Example Patient","description":"An example of a patient resource","isExample":true,"profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/patient-eu"]},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Practitioner"}],"reference":{"reference":"Practitioner/practitioner-eu-core-example"},"name":"Example Practitioner (EU core)","description":"An example of a Practitioner resource conforming to the Practitioner (EU core) profile.","isExample":true,"profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/practitioner-eu"]},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"PractitionerRole"}],"reference":{"reference":"PractitionerRole/practitionerRole-eu-core-example"},"name":"Example PractitionerRole (EU core)","description":"An example of a PractitionerRole resource conforming to the PractitionerRole (EU core) profile.","isExample":true,"profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/practitionerRole-eu"]},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CodeSystem"}],"reference":{"reference":"CodeSystem/v3-ActCode-EU"},"name":"HL7 V3 ActCode - EU extensions","description":"European extensions to the V3 ActCode code system","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"}],"reference":{"reference":"ValueSet/iso-ehicCountryCode"},"name":"ISO 3166 - EHIC Country Codes","description":"ISO 3166 - Country Codes used by the European Healthcare Insurance Card","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"}],"reference":{"reference":"StructureDefinition/location-eu"},"name":"Location (EU base)","description":"This profile sets minimum expectations for the Location resource to be used for the purpose of this guide.","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Location"}],"reference":{"reference":"Location/example-location"},"name":"Location: example","description":"Example of Location resource conformant with the core profile","isExample":true,"profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/location-eu"]},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"}],"reference":{"reference":"StructureDefinition/organization-eu"},"name":"Organization (EU base)","description":"This profile specifies how the HL7 FHIR Organization resource should be used for conveying commonly used concepts in the European context.","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"}],"reference":{"reference":"StructureDefinition/organization-eu-core"},"name":"Organization (EU core)","description":"This profile sets minimum expectations for the Organization resource common to most of the use cases.","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"}],"reference":{"reference":"StructureDefinition/Patient-eu-ehic"},"name":"Patient (EHIC)","description":"This profile represents the constraints applied to the Patient resource when sed with the EHIC coverage profile.","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"}],"reference":{"reference":"StructureDefinition/patient-eu"},"name":"Patient (EU base)","description":"This profile specifies how the HL7 FHIR Patient resource should be used for conveying commonly used concepts in the European context.","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"}],"reference":{"reference":"StructureDefinition/patient-eu-core"},"name":"Patient (EU core)","description":"This profile sets minimum expectations for the Patient resource common to most of the use cases.\nWhen the ips-pat-1 invariant is satisfied \\(Patient.name.given, Patient.name.family or Patient.name.text SHALL be present\\) then this profile complies with the IPS patient profile.","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"}],"reference":{"reference":"StructureDefinition/Patient-animal-eu"},"name":"Patient: Animal","description":"This profile defines how to represent an Animal as subject of care in FHIR for the purpose of this guide.\nThis is used to identify the species when a specimen is collected from an animal","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Patient"}],"reference":{"reference":"Patient/Patient-animal-example"},"name":"Patient: animal example","description":"An example of a patient resource for animals","isExample":true,"profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Patient-animal-eu"]},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"}],"reference":{"reference":"StructureDefinition/practitioner-eu"},"name":"Practitioner (EU base)","description":"This profile specifies how the HL7 FHIR Practitioner resource should be used for conveying commonly used concepts in the European context.","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"}],"reference":{"reference":"StructureDefinition/practitioner-eu-core"},"name":"Practitioner (EU core)","description":"This profile sets minimum expectations for the Practitioner resource common to most of the use cases.","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"}],"reference":{"reference":"StructureDefinition/practitionerRole-eu"},"name":"PractitionerRole (EU base)","description":"This profile specifies how the HL7 FHIR PractitionerRole resource should be used for conveying commonly used concepts in the European context.","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"}],"reference":{"reference":"StructureDefinition/practitionerRole-eu-core"},"name":"PractitionerRole (EU core)","description":"This profile sets minimum expectations for the PractitionerRole resource common to most of the use cases.","isExample":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"}],"reference":{"reference":"ValueSet/speciesType-eu"},"name":"Types of species","description":"Types of animal species for non-human subjects","isExample":false}],"page":{"sourceUrl":"toc.html","name":"toc.html","title":"Table of Contents","generation":"html","page":[{"sourceUrl":"index.html","name":"index.html","title":"Home","generation":"markdown"},{"sourceUrl":"authors.html","name":"authors.html","title":"Authors and Contributors","generation":"markdown"},{"sourceUrl":"copyright.html","name":"copyright.html","title":"Copyright","generation":"markdown"},{"sourceUrl":"crossversionanalysis.html","name":"crossversionanalysis.html","title":"Cross-version Analysis","generation":"markdown"},{"sourceUrl":"downloads.html","name":"downloads.html","title":"Downloads","generation":"markdown"},{"sourceUrl":"dependencies.html","name":"dependencies.html","title":"Dependencies","generation":"markdown"},{"sourceUrl":"knownissues.html","name":"knownissues.html","title":"Known Issues","generation":"markdown"},{"sourceUrl":"introduction.html","name":"introduction.html","title":"Introduction","generation":"markdown"}]},"parameter":[{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"copyrightyear"},"value":"2024+"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"releaselabel"},"value":"ballot"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"special-url"},"value":"http://terminology.hl7.eu/CodeSystem/v3-ActCode"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"apply-contact"},"value":"true"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"apply-jurisdiction"},"value":"true"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"apply-publisher"},"value":"true"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"apply-version"},"value":"true"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"show-inherited-invariants"},"value":"true"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"usage-stats-opt-out"},"value":"true"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"autoload-resources"},"value":"true"},{"code":{"system":"http://hl7.org/fhir/guide-parameter-code","code":"path-resource"},"value":"input/capabilities"},{"code":{"system":"http://hl7.org/fhir/guide-parameter-code","code":"path-resource"},"value":"input/examples"},{"code":{"system":"http://hl7.org/fhir/guide-parameter-code","code":"path-resource"},"value":"input/extensions"},{"code":{"system":"http://hl7.org/fhir/guide-parameter-code","code":"path-resource"},"value":"input/models"},{"code":{"system":"http://hl7.org/fhir/guide-parameter-code","code":"path-resource"},"value":"input/operations"},{"code":{"system":"http://hl7.org/fhir/guide-parameter-code","code":"path-resource"},"value":"input/profiles"},{"code":{"system":"http://hl7.org/fhir/guide-parameter-code","code":"path-resource"},"value":"input/resources"},{"code":{"system":"http://hl7.org/fhir/guide-parameter-code","code":"path-resource"},"value":"input/vocabulary"},{"code":{"system":"http://hl7.org/fhir/guide-parameter-code","code":"path-resource"},"value":"input/maps"},{"code":{"system":"http://hl7.org/fhir/guide-parameter-code","code":"path-resource"},"value":"input/testing"},{"code":{"system":"http://hl7.org/fhir/guide-parameter-code","code":"path-resource"},"value":"input/history"},{"code":{"system":"http://hl7.org/fhir/guide-parameter-code","code":"path-resource"},"value":"fsh-generated/resources"},{"code":{"system":"http://hl7.org/fhir/guide-parameter-code","code":"path-pages"},"value":"template/config"},{"code":{"system":"http://hl7.org/fhir/guide-parameter-code","code":"path-pages"},"value":"input/images"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"path-liquid"},"value":"template/liquid"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"path-liquid"},"value":"input/liquid"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"path-qa"},"value":"temp/qa"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"path-temp"},"value":"temp/pages"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"path-output"},"value":"output"},{"code":{"system":"http://hl7.org/fhir/guide-parameter-code","code":"path-tx-cache"},"value":"input-cache/txcache"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"path-suppressed-warnings"},"value":"input/ignoreWarnings.txt"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"path-history"},"value":"http://hl7.eu/fhir/base-r5/history.html"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"template-html"},"value":"template-page.html"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"template-md"},"value":"template-page-md.html"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"apply-context"},"value":"true"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"apply-copyright"},"value":"true"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"apply-license"},"value":"true"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"apply-wg"},"value":"true"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"active-tables"},"value":"true"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"fmm-definition"},"value":"http://hl7.org/fhir/versions.html#maturity"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"propagate-status"},"value":"true"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"excludelogbinaryformat"},"value":"true"},{"code":{"system":"http://hl7.org/fhir/tools/CodeSystem/ig-parameters","code":"tabbed-snapshots"},"value":"true"}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-Address-eu.json b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-Address-eu.json new file mode 100644 index 00000000..56c0acc3 --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-Address-eu.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"Address-eu","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition Address-eu

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Address 0..*AddressAn address expressed using postal conventions (as opposed to GPS or other location definition formats)
\".\"\".\"\".\" line
\".\"\".\"\".\"\".\" Slices for extension 0..*ExtensionExtension
Slice: Unordered, Open by value:url
\".\"\".\"\".\"\".\"\".\" extension:streetName 0..*stringstreetName
URL: http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetName
\".\"\".\"\".\"\".\"\".\" extension:houseNumber 0..*stringhouseNumber
URL: http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumber
\".\"\".\"\".\"\".\"\".\" extension:postBox 0..*stringpostBox
URL: http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-postBox
\".\"\".\"\".\" country
\".\"\".\"\".\"\".\" Slices for extension 0..*ExtensionExtension
Slice: Unordered, Open by value:url
\".\"\".\"\".\"\".\"\".\" extension:countryCode 0..1(Complex)code for string
URL: http://hl7.org/fhir/StructureDefinition/iso21090-codedString
\".\"\".\"\".\"\".\"\".\"\".\" value[x] 1..1CodingValue of extension
Binding: Iso316612 (preferred)

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu","version":"0.1.0-ballot","name":"AddressEu","title":"Address (EU)","status":"draft","date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"This profile extends the Address data type for supporting streetname, housenumber and postal box.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","fhirVersion":"5.0.0","mapping":[{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 V2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"servd","uri":"http://www.omg.org/spec/ServD/1.0/","name":"ServD"},{"identity":"vcard","uri":"http://w3.org/vcard","name":"vCard Mapping"}],"kind":"complex-type","abstract":false,"type":"Address","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Address","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"5.0.0"}],"element":[{"id":"Address","path":"Address","short":"An address expressed using postal conventions (as opposed to GPS or other location definition formats)","definition":"An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations which might not be valid for mail delivery. There are a variety of postal address formats defined around the world.\nThe ISO21090-codedString may be used to provide a coded representation of the contents of strings in an Address.","comment":"Note: address is intended to describe postal addresses for administrative purposes, not to describe absolute geographical coordinates. Postal addresses are often used as proxies for physical locations (also see the [Location](http://hl7.org/fhir/R5/location.html#) resource).","min":0,"max":"*","base":{"path":"Address","min":0,"max":"*"},"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"mapping":[{"identity":"rim","map":"n/a,AD"},{"identity":"v2","map":"XAD"},{"identity":"servd","map":"Address"}]},{"id":"Address.id","path":"Address.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Address.extension","path":"Address.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Address.use","path":"Address.use","short":"home | work | temp | old | billing - purpose of this address","definition":"The purpose of this address.","comment":"Applications can assume that an address is current unless it explicitly says that it is temporary or old.","requirements":"Allows an appropriate address to be chosen from a list of many.","min":0,"max":"1","base":{"path":"Address.use","min":0,"max":"1"},"type":[{"code":"code"}],"example":[{"label":"General","valueCode":"home"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because applications should not mistake a temporary or old address etc.for a current/permanent one","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AddressUse"}],"strength":"required","description":"The use of an address (home / work / etc.).","valueSet":"http://hl7.org/fhir/ValueSet/address-use|5.0.0"},"mapping":[{"identity":"v2","map":"XAD.7"},{"identity":"rim","map":"unique(./use)"},{"identity":"servd","map":"./AddressPurpose"}]},{"id":"Address.type","path":"Address.type","short":"postal | physical | both","definition":"Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.","comment":"The definition of Address states that \"address is intended to describe postal addresses, not physical locations\". However, many applications track whether an address has a dual purpose of being a location that can be visited as well as being a valid delivery destination, and Postal addresses are often used as proxies for physical locations (also see the [Location](http://hl7.org/fhir/R5/location.html#) resource).","min":0,"max":"1","base":{"path":"Address.type","min":0,"max":"1"},"type":[{"code":"code"}],"example":[{"label":"General","valueCode":"both"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AddressType"}],"strength":"required","description":"The type of an address (physical / postal).","valueSet":"http://hl7.org/fhir/ValueSet/address-type|5.0.0"},"mapping":[{"identity":"v2","map":"XAD.18"},{"identity":"rim","map":"unique(./use)"},{"identity":"vcard","map":"address type parameter"}]},{"id":"Address.text","path":"Address.text","short":"Text representation of the address","definition":"Specifies the entire address as it should be displayed e.g. on a postal label. This may be provided instead of or as well as the specific parts.","comment":"Can provide both a text representation and parts. Applications updating an address SHALL ensure that when both text and parts are present, no content is included in the text that isn't found in a part.","requirements":"A renderable, unencoded form.","min":0,"max":"1","base":{"path":"Address.text","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"137 Nowhere Street, Erewhon 9132"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.1 + XAD.2 + XAD.3 + XAD.4 + XAD.5 + XAD.6"},{"identity":"rim","map":"./formatted"},{"identity":"vcard","map":"address label parameter"}]},{"id":"Address.line","path":"Address.line","short":"Street name, number, direction & P.O. Box etc.","definition":"This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.","min":0,"max":"*","base":{"path":"Address.line","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"The order in which lines should appear in an address label","example":[{"label":"General","valueString":"137 Nowhere Street"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.1 + XAD.2 (note: XAD.1 and XAD.2 have different meanings for a company address than for a person address)"},{"identity":"rim","map":"AD.part[parttype = AL]"},{"identity":"vcard","map":"street"},{"identity":"servd","map":"./StreetAddress (newline delimitted)"}]},{"id":"Address.line.id","path":"Address.line.id","representation":["xmlAttr"],"short":"xml:id (or equivalent in JSON)","definition":"unique id for the element within a resource (for internal references)","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false},{"id":"Address.line.extension","path":"Address.line.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"rules":"open"},"short":"Extension","definition":"An Extension","min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false},{"id":"Address.line.extension:streetName","path":"Address.line.extension","sliceName":"streetName","short":"streetName","definition":"streetName.","min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetName"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"ADXP[partType=STR]"}]},{"id":"Address.line.extension:houseNumber","path":"Address.line.extension","sliceName":"houseNumber","short":"houseNumber","definition":"The number of a building, house or lot alongside the street. Also known as \"primary street number\". This does not number the street but rather the building.","min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumber"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"ADXP[partType=BNR]"}]},{"id":"Address.line.extension:postBox","path":"Address.line.extension","sliceName":"postBox","short":"postBox","definition":"A numbered box located in a post station.","min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-postBox"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"ADXP[partType=POB]"}]},{"id":"Address.line.value","path":"Address.line.value","representation":["xmlAttr"],"short":"Primitive value for string","definition":"The actual value","min":0,"max":"1","base":{"path":"string.value","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"},{"url":"http://hl7.org/fhir/StructureDefinition/regex","valueString":"^[\\s\\S]+$"}],"code":"http://hl7.org/fhirpath/System.String"}],"maxLength":1048576,"isModifier":false,"isSummary":false},{"id":"Address.city","path":"Address.city","short":"Name of city, town etc.","definition":"The name of the city, town, suburb, village or other community or delivery center.","alias":["Municpality"],"min":0,"max":"1","base":{"path":"Address.city","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"Erewhon"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.3"},{"identity":"rim","map":"AD.part[parttype = CTY]"},{"identity":"vcard","map":"locality"},{"identity":"servd","map":"./Jurisdiction"}]},{"id":"Address.district","path":"Address.district","short":"District name (aka county)","definition":"The name of the administrative area (county).","comment":"District is sometimes known as county, but in some regions 'county' is used in place of city (municipality), so county name should be conveyed in city instead.","alias":["County"],"min":0,"max":"1","base":{"path":"Address.district","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"Madison"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.9"},{"identity":"rim","map":"AD.part[parttype = CNT | CPA]"}]},{"id":"Address.state","path":"Address.state","short":"Sub-unit of country (abbreviations ok)","definition":"Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (e.g. US 2 letter state codes).","alias":["Province","Territory"],"min":0,"max":"1","base":{"path":"Address.state","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.4"},{"identity":"rim","map":"AD.part[parttype = STA]"},{"identity":"vcard","map":"region"},{"identity":"servd","map":"./Region"}]},{"id":"Address.postalCode","path":"Address.postalCode","short":"Postal code for area","definition":"A postal code designating a region defined by the postal service.","alias":["Zip"],"min":0,"max":"1","base":{"path":"Address.postalCode","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"9132"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.5"},{"identity":"rim","map":"AD.part[parttype = ZIP]"},{"identity":"vcard","map":"code"},{"identity":"servd","map":"./PostalIdentificationCode"}]},{"id":"Address.country","path":"Address.country","short":"Country (e.g. may be ISO 3166 2 or 3 letter code)","definition":"Country - a nation as commonly understood or generally accepted.","comment":"ISO 3166 2- or 3- letter codes MAY be used in place of a human readable country name.","min":0,"max":"1","base":{"path":"Address.country","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.6"},{"identity":"rim","map":"AD.part[parttype = CNT]"},{"identity":"vcard","map":"country"},{"identity":"servd","map":"./Country"}]},{"id":"Address.country.id","path":"Address.country.id","representation":["xmlAttr"],"short":"xml:id (or equivalent in JSON)","definition":"unique id for the element within a resource (for internal references)","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false},{"id":"Address.country.extension","path":"Address.country.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"ordered":false,"rules":"open"},"short":"Extension","definition":"An Extension","min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false},{"id":"Address.country.extension:countryCode","path":"Address.country.extension","sliceName":"countryCode","short":"code for string","definition":"Provides a coded expression for the content represented in a string.","min":0,"max":"1","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/iso21090-codedString"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"SC.code"}]},{"id":"Address.country.extension:countryCode.id","path":"Address.country.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Address.country.extension:countryCode.extension","path":"Address.country.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Extension","definition":"An Extension","min":0,"max":"0","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false},{"id":"Address.country.extension:countryCode.url","path":"Address.country.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"uri"}],"code":"http://hl7.org/fhirpath/System.String"}],"fixedUri":"http://hl7.org/fhir/StructureDefinition/iso21090-codedString","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Address.country.extension:countryCode.value[x]","path":"Address.country.extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R5/extensibility.html) for a list).","min":1,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"Coding"}],"condition":["ext-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"strength":"preferred","valueSet":"http://hl7.org/fhir/ValueSet/iso3166-1-2"},"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Address.country.value","path":"Address.country.value","representation":["xmlAttr"],"short":"Primitive value for string","definition":"The actual value","min":0,"max":"1","base":{"path":"string.value","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"},{"url":"http://hl7.org/fhir/StructureDefinition/regex","valueString":"^[\\s\\S]+$"}],"code":"http://hl7.org/fhirpath/System.String"}],"maxLength":1048576,"isModifier":false,"isSummary":false},{"id":"Address.period","path":"Address.period","short":"Time period when address was/is in use","definition":"Time period when address was/is in use.","requirements":"Allows addresses to be placed in historical context.","min":0,"max":"1","base":{"path":"Address.period","min":0,"max":"1"},"type":[{"code":"Period"}],"example":[{"label":"General","valuePeriod":{"start":"2010-03-23","end":"2010-07-01"}}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.12 / XAD.13 + XAD.14"},{"identity":"rim","map":"./usablePeriod[type=\"IVL\"]"},{"identity":"servd","map":"./StartDate and ./EndDate"}]}]},"differential":{"element":[{"id":"Address","path":"Address"},{"id":"Address.line.extension","path":"Address.line.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"rules":"open"}},{"id":"Address.line.extension:streetName","path":"Address.line.extension","sliceName":"streetName","min":0,"max":"*","type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetName"]}]},{"id":"Address.line.extension:houseNumber","path":"Address.line.extension","sliceName":"houseNumber","min":0,"max":"*","type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumber"]}]},{"id":"Address.line.extension:postBox","path":"Address.line.extension","sliceName":"postBox","min":0,"max":"*","type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-postBox"]}]},{"id":"Address.country.extension","path":"Address.country.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"ordered":false,"rules":"open"}},{"id":"Address.country.extension:countryCode","path":"Address.country.extension","sliceName":"countryCode","min":0,"max":"1","type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/iso21090-codedString"]}]},{"id":"Address.country.extension:countryCode.value[x]","path":"Address.country.extension.value[x]","binding":{"strength":"preferred","valueSet":"http://hl7.org/fhir/ValueSet/iso3166-1-2"}}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-BodyStructure-eu.json b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-BodyStructure-eu.json new file mode 100644 index 00000000..875a14f7 --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-BodyStructure-eu.json @@ -0,0 +1,1742 @@ +{ + "resourceType": "StructureDefinition", + "id": "BodyStructure-eu", + "text": { + "status": "extensions", + "div": "

Generated Narrative: StructureDefinition BodyStructure-eu

\r\n\r\n\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" BodyStructure 0..*BodyStructureSpecific and identified anatomical structure
\".\"\".\"\".\" morphology 0..1CodeableConceptKind of Structure
Binding: SNOMEDCTMorphologicAbnormalities (preferred)
\".\"\".\"\".\" includedStructure
\".\"\".\"\".\"\".\" structure 1..1CodeableConceptCode that represents the included structure
Binding: SNOMEDCTBodyStructures (preferred)
\".\"\".\"\".\"\".\" laterality 0..1CodeableConceptCode that represents the included structure laterality
Binding: Body Structure Laterality (preferred)
\".\"\".\"\".\"\".\" qualifier 0..*CodeableConceptCode that represents the included structure qualifier
Binding: Body Structure Qualifier (preferred)

\"doco\" Documentation for this format
" + }, + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm", + "valueInteger": 2 + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status", + "valueCode": "draft" + } + ], + "url": "http://hl7.eu/fhir/base-r5/StructureDefinition/BodyStructure-eu", + "version": "0.1.0-ballot", + "name": "BodyStructureEu", + "title": "Body structure (EU base)", + "status": "draft", + "date": "2025-05-06T08:06:03+02:00", + "publisher": "HL7 Europe", + "contact": [ + { + "name": "HL7 Europe", + "telecom": [ + { + "system": "url", + "value": "http://hl7.eu" + } + ] + } + ], + "description": "This profile specifies how the HL7 FHIR BodyStructure resource should be used for conveying commonly used concepts in the European context.", + "jurisdiction": [ + { + "coding": [ + { + "system": "http://unstats.un.org/unsd/methods/m49/m49.htm", + "code": "150", + "display": "Europe" + } + ] + } + ], + "copyright": "Used by permission of HL7 Europe, all rights reserved Creative Commons License", + "fhirVersion": "5.0.0", + "mapping": [ + { + "identity": "w5", + "uri": "http://hl7.org/fhir/fivews", + "name": "FiveWs Pattern Mapping" + }, + { + "identity": "rim", + "uri": "http://hl7.org/v3", + "name": "RIM Mapping" + }, + { + "identity": "openehr", + "uri": "http://openehr.org", + "name": "Open EHR Archetype Mapping" + }, + { + "identity": "v2", + "uri": "http://hl7.org/v2", + "name": "HL7 V2 Mapping" + } + ], + "kind": "resource", + "abstract": false, + "type": "BodyStructure", + "baseDefinition": "http://hl7.org/fhir/StructureDefinition/BodyStructure", + "derivation": "constraint", + "snapshot": { + "extension": [ + { + "url": "http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version", + "valueString": "5.0.0" + } + ], + "element": [ + { + "id": "BodyStructure", + "path": "BodyStructure", + "short": "Specific and identified anatomical structure", + "definition": "Record details about an anatomical structure. This resource may be used when a coded concept does not provide the necessary detail needed for the use case.", + "alias": [ + "anatomical location" + ], + "min": 0, + "max": "*", + "base": { + "path": "BodyStructure", + "min": 0, + "max": "*" + }, + "constraint": [ + { + "key": "dom-2", + "severity": "error", + "human": "If the resource is contained in another resource, it SHALL NOT contain nested Resources", + "expression": "contained.contained.empty()", + "source": "http://hl7.org/fhir/StructureDefinition/DomainResource" + }, + { + "key": "dom-3", + "severity": "error", + "human": "If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource", + "expression": "contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()", + "source": "http://hl7.org/fhir/StructureDefinition/DomainResource" + }, + { + "key": "dom-4", + "severity": "error", + "human": "If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated", + "expression": "contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()", + "source": "http://hl7.org/fhir/StructureDefinition/DomainResource" + }, + { + "key": "dom-5", + "severity": "error", + "human": "If a resource is contained in another resource, it SHALL NOT have a security label", + "expression": "contained.meta.security.empty()", + "source": "http://hl7.org/fhir/StructureDefinition/DomainResource" + }, + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice", + "valueBoolean": true + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation", + "valueMarkdown": "When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time." + } + ], + "key": "dom-6", + "severity": "warning", + "human": "A resource should have narrative for robust management", + "expression": "text.`div`.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/DomainResource" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "Entity, Role, or Act,Act" + }, + { + "identity": "w5", + "map": "clinical.diagnostics" + }, + { + "identity": "openehr", + "map": "Archetype ID openEHR-EHR-CLUSTER.anatomical_location.v1 Concept name Anatomical Location Concept description Record details about an anatomical location. Keywords location, site, anatomical Copyright © openEHR Foundation Purpose To record details about anatomical location. Misuse Not for specifiying unilateral/bilateral occurrence - this is related to an evaluation which perhaps includes multiple locations. Author Author name: Heather Leslie Organization: Ocean Informatics Email: heather.leslie@oceaninformatics.com Date of Origination: 2008-11-10 Translator Norwegian Bokmål: Lars Bitsch-Larsen, Haukeland University Hospital of Bergen, Norway, MD, DEAA, MBA, spec in anesthesia, spec in tropical medicine. Arabic (Syria): Mona Saleh Other contributors Heather Leslie, Ocean Informatics, Australia (Editor) Ian McNicoll, freshEHR Clinical Informatics, United Kingdom (Editor) Dunmail Hodkinson, Black Pear Software Ltd, UK References Use cases: - 5LICS, midclavicular line - L forearm, 2cm anterior to the cubital fossa - Right iliac fossa - 5 cm below L tibial tuberosity - 2 cm medial to R nipple - 4 cm below R costal margin in midclavicular line - R femur - midline nose - medial aspect of R great toe nail." + } + ] + }, + { + "id": "BodyStructure.id", + "path": "BodyStructure.id", + "short": "Logical id of this artifact", + "definition": "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.", + "comment": "Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case.", + "min": 0, + "max": "1", + "base": { + "path": "Resource.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "id" + } + ], + "code": "http://hl7.org/fhirpath/System.String" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true + }, + { + "id": "BodyStructure.meta", + "path": "BodyStructure.meta", + "short": "Metadata about the resource", + "definition": "The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.", + "min": 0, + "max": "1", + "base": { + "path": "Resource.meta", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Meta" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true + }, + { + "id": "BodyStructure.implicitRules", + "path": "BodyStructure.implicitRules", + "short": "A set of rules under which this content was created", + "definition": "A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.", + "comment": "Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of its narrative along with other profiles, value sets, etc.", + "min": 0, + "max": "1", + "base": { + "path": "Resource.implicitRules", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "uri" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": true, + "isModifierReason": "This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies its meaning or interpretation", + "isSummary": true + }, + { + "id": "BodyStructure.language", + "path": "BodyStructure.language", + "short": "Language of the resource content", + "definition": "The base language in which the resource is written.", + "comment": "Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).", + "min": 0, + "max": "1", + "base": { + "path": "Resource.language", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "code" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "Language" + } + ], + "strength": "required", + "description": "IETF language tag for a human language", + "valueSet": "http://hl7.org/fhir/ValueSet/all-languages|5.0.0", + "additional": [ + { + "purpose": "starter", + "valueSet": "http://hl7.org/fhir/ValueSet/languages" + } + ] + } + }, + { + "id": "BodyStructure.text", + "path": "BodyStructure.text", + "short": "Text summary of the resource, for human interpretation", + "definition": "A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.", + "comment": "Contained resources do not have a narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.", + "alias": [ + "narrative", + "html", + "xhtml", + "display" + ], + "min": 0, + "max": "1", + "base": { + "path": "DomainResource.text", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Narrative" + } + ], + "condition": [ + "dom-6" + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "Act.text?" + } + ] + }, + { + "id": "BodyStructure.contained", + "path": "BodyStructure.contained", + "short": "Contained, inline Resources", + "definition": "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning.", + "comment": "This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags in their meta elements, but SHALL NOT have security labels.", + "alias": [ + "inline resources", + "anonymous resources", + "contained resources" + ], + "min": 0, + "max": "*", + "base": { + "path": "DomainResource.contained", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Resource" + } + ], + "condition": [ + "dom-2", + "dom-4", + "dom-3", + "dom-5" + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "BodyStructure.extension", + "path": "BodyStructure.extension", + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "DomainResource.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "BodyStructure.modifierExtension", + "path": "BodyStructure.modifierExtension", + "short": "Extensions that cannot be ignored", + "definition": "May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "DomainResource.modifierExtension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "mustSupport": false, + "isModifier": true, + "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them", + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "BodyStructure.identifier", + "path": "BodyStructure.identifier", + "short": "Bodystructure identifier", + "definition": "Identifier for this instance of the anatomical structure.", + "min": 0, + "max": "*", + "base": { + "path": "BodyStructure.identifier", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Identifier" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.identifier" + }, + { + "identity": "rim", + "map": ".id" + }, + { + "identity": "openehr", + "map": "Specific location Cluster Optional (0..1) Cardinality: Mandatory, repeating, unordered (1..*)" + } + ] + }, + { + "id": "BodyStructure.active", + "path": "BodyStructure.active", + "short": "Whether this record is in active use", + "definition": "Whether this body site is in active use.", + "comment": "This element is labeled as a modifier because it may be used to mark that the resource was created in error.", + "requirements": "Need to be able to mark a body site entry as not to be used because it was created in error.", + "min": 0, + "max": "1", + "base": { + "path": "BodyStructure.active", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "boolean" + } + ], + "meaningWhenMissing": "This resource is generally assumed to be active if no value is provided for the active element", + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": true, + "isModifierReason": "This element is labelled as a modifier because it is a status element that can indicate that a record should not be treated as valid", + "isSummary": true, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.status" + }, + { + "identity": "rim", + "map": "statusCode" + } + ] + }, + { + "id": "BodyStructure.morphology", + "path": "BodyStructure.morphology", + "short": "Kind of Structure", + "definition": "The kind of structure being represented by the body structure at `BodyStructure.location`. This can define both normal and abnormal morphologies.", + "comment": "The minimum cardinality of 0 supports the use case of specifying a location without defining a morphology.", + "min": 0, + "max": "1", + "base": { + "path": "BodyStructure.morphology", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true, + "binding": { + "strength": "preferred", + "valueSet": "http://hl7.org/fhir/ValueSet/bodystructure-code" + }, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.what[x]" + }, + { + "identity": "v2", + "map": "SPM-4/SPM-5" + } + ] + }, + { + "id": "BodyStructure.includedStructure", + "path": "BodyStructure.includedStructure", + "short": "Included anatomic location(s)", + "definition": "The anatomical location(s) or region(s) of the specimen, lesion, or body structure.", + "min": 1, + "max": "*", + "base": { + "path": "BodyStructure.includedStructure", + "min": 1, + "max": "*" + }, + "type": [ + { + "code": "BackboneElement" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false + }, + { + "id": "BodyStructure.includedStructure.id", + "path": "BodyStructure.includedStructure.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ], + "code": "http://hl7.org/fhirpath/System.String" + } + ], + "condition": [ + "ele-1" + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "BodyStructure.includedStructure.extension", + "path": "BodyStructure.includedStructure.extension", + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "BodyStructure.includedStructure.modifierExtension", + "path": "BodyStructure.includedStructure.modifierExtension", + "short": "Extensions that cannot be ignored even if unrecognized", + "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).", + "alias": [ + "extensions", + "user content", + "modifiers" + ], + "min": 0, + "max": "*", + "base": { + "path": "BackboneElement.modifierExtension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": true, + "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them", + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "BodyStructure.includedStructure.structure", + "path": "BodyStructure.includedStructure.structure", + "short": "Code that represents the included structure", + "definition": "Code that represents the included structure.", + "min": 1, + "max": "1", + "base": { + "path": "BodyStructure.includedStructure.structure", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true, + "binding": { + "strength": "preferred", + "valueSet": "http://hl7.org/fhir/ValueSet/body-site" + }, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.what[x]" + }, + { + "identity": "v2", + "map": "OBX-20/SPM-8/SPM-10" + }, + { + "identity": "rim", + "map": ".targetSiteCode" + }, + { + "identity": "openehr", + "map": "Name of location" + } + ] + }, + { + "id": "BodyStructure.includedStructure.laterality", + "path": "BodyStructure.includedStructure.laterality", + "short": "Code that represents the included structure laterality", + "definition": "Code that represents the included structure laterality.", + "min": 0, + "max": "1", + "base": { + "path": "BodyStructure.includedStructure.laterality", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "binding": { + "strength": "preferred", + "valueSet": "http://hl7.eu/fhir/base-r5/ValueSet/siteLaterality-eu" + }, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.what[x]" + }, + { + "identity": "v2", + "map": "No distinct element defined in V2.x. The IHE Radiology Technical Framework directs the use of OBR-15-specimen source to contain laterality for imaging studies./SPM-9" + }, + { + "identity": "rim", + "map": ".targetSiteCode" + }, + { + "identity": "openehr", + "map": "Combines Side, Numerical identifier, Anatomical plane,and Aspect" + } + ] + }, + { + "id": "BodyStructure.includedStructure.bodyLandmarkOrientation", + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation", + "short": "Landmark relative location", + "definition": "Body locations in relation to a specific body landmark (tatoo, scar, other body structure).", + "min": 0, + "max": "*", + "base": { + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "BackboneElement" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false + }, + { + "id": "BodyStructure.includedStructure.bodyLandmarkOrientation.id", + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ], + "code": "http://hl7.org/fhirpath/System.String" + } + ], + "condition": [ + "ele-1" + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "BodyStructure.includedStructure.bodyLandmarkOrientation.extension", + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.extension", + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "BodyStructure.includedStructure.bodyLandmarkOrientation.modifierExtension", + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.modifierExtension", + "short": "Extensions that cannot be ignored even if unrecognized", + "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).", + "alias": [ + "extensions", + "user content", + "modifiers" + ], + "min": 0, + "max": "*", + "base": { + "path": "BackboneElement.modifierExtension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": true, + "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them", + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "BodyStructure.includedStructure.bodyLandmarkOrientation.landmarkDescription", + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.landmarkDescription", + "short": "Body ]andmark description", + "definition": "A description of a landmark on the body used as a reference to locate something else.", + "min": 0, + "max": "*", + "base": { + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.landmarkDescription", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "bodyLandmarkOrientationLandmarkDescription" + } + ], + "strength": "example", + "description": "Select SNOMED code system values. Values used in a podiatry setting to decsribe landmarks on the body.", + "valueSet": "http://hl7.org/fhir/ValueSet/body-site" + }, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.what[x]" + } + ] + }, + { + "id": "BodyStructure.includedStructure.bodyLandmarkOrientation.clockFacePosition", + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.clockFacePosition", + "short": "Clockface orientation", + "definition": "An description of the direction away from a landmark something is located based on a radial clock dial.", + "min": 0, + "max": "*", + "base": { + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.clockFacePosition", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "bodyLandmarkOrientationClockFacePosition" + } + ], + "strength": "example", + "description": "Select SNOMED CT codes. A set of codes that describe a things orientation based on a hourly positions of a clock face.", + "valueSet": "http://hl7.org/fhir/ValueSet/bodystructure-bodylandmarkorientation-clockface-position" + }, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.what[x]" + } + ] + }, + { + "id": "BodyStructure.includedStructure.bodyLandmarkOrientation.distanceFromLandmark", + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.distanceFromLandmark", + "short": "Landmark relative location", + "definition": "The distance in centimeters a certain observation is made from a body landmark.", + "min": 0, + "max": "*", + "base": { + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.distanceFromLandmark", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "BackboneElement" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false + }, + { + "id": "BodyStructure.includedStructure.bodyLandmarkOrientation.distanceFromLandmark.id", + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.distanceFromLandmark.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ], + "code": "http://hl7.org/fhirpath/System.String" + } + ], + "condition": [ + "ele-1" + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "BodyStructure.includedStructure.bodyLandmarkOrientation.distanceFromLandmark.extension", + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.distanceFromLandmark.extension", + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "BodyStructure.includedStructure.bodyLandmarkOrientation.distanceFromLandmark.modifierExtension", + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.distanceFromLandmark.modifierExtension", + "short": "Extensions that cannot be ignored even if unrecognized", + "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).", + "alias": [ + "extensions", + "user content", + "modifiers" + ], + "min": 0, + "max": "*", + "base": { + "path": "BackboneElement.modifierExtension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": true, + "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them", + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "BodyStructure.includedStructure.bodyLandmarkOrientation.distanceFromLandmark.device", + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.distanceFromLandmark.device", + "short": "Measurement device", + "definition": "An instrument, tool, analyzer, etc. used in the measurement.", + "min": 0, + "max": "*", + "base": { + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.distanceFromLandmark.device", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "CodeableReference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Device" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "DeviceType" + } + ], + "strength": "example", + "description": "Codes to identify medical devices.", + "valueSet": "http://hl7.org/fhir/ValueSet/device-type" + }, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.what[x]" + } + ] + }, + { + "id": "BodyStructure.includedStructure.bodyLandmarkOrientation.distanceFromLandmark.value", + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.distanceFromLandmark.value", + "short": "Measured distance from body landmark", + "definition": "The measured distance (e.g., in cm) from a body landmark.", + "min": 0, + "max": "*", + "base": { + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.distanceFromLandmark.value", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Quantity" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false + }, + { + "id": "BodyStructure.includedStructure.bodyLandmarkOrientation.surfaceOrientation", + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.surfaceOrientation", + "short": "Relative landmark surface orientation", + "definition": "The surface area a body location is in relation to a landmark.", + "min": 0, + "max": "*", + "base": { + "path": "BodyStructure.includedStructure.bodyLandmarkOrientation.surfaceOrientation", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "bodyLandmarkOrientationSurfaceOrientation" + } + ], + "strength": "preferred", + "description": "Select SNOMED code system values. The surface area a body location is in relation to a landmark.", + "valueSet": "http://hl7.org/fhir/ValueSet/bodystructure-relative-location" + }, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.what[x]" + } + ] + }, + { + "id": "BodyStructure.includedStructure.spatialReference", + "path": "BodyStructure.includedStructure.spatialReference", + "short": "Cartesian reference for structure", + "definition": "XY or XYZ-coordinate orientation for structure.", + "min": 0, + "max": "*", + "base": { + "path": "BodyStructure.includedStructure.spatialReference", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/ImagingSelection" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.where[x]" + } + ] + }, + { + "id": "BodyStructure.includedStructure.qualifier", + "path": "BodyStructure.includedStructure.qualifier", + "short": "Code that represents the included structure qualifier", + "definition": "Code that represents the included structure qualifier.", + "min": 0, + "max": "*", + "base": { + "path": "BodyStructure.includedStructure.qualifier", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "binding": { + "strength": "preferred", + "valueSet": "http://hl7.eu/fhir/base-r5/ValueSet/siteQualifier-eu" + }, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.what[x]" + }, + { + "identity": "v2", + "map": "No distinct element defined in V2.x. The IHE Radiology Technical Framework directs the use of OBR-15-specimen source to contain laterality for imaging studies./SPM-9" + }, + { + "identity": "rim", + "map": ".targetSiteCode" + }, + { + "identity": "openehr", + "map": "Combines Side, Numerical identifier, Anatomical plane,and Aspect" + } + ] + }, + { + "id": "BodyStructure.excludedStructure", + "path": "BodyStructure.excludedStructure", + "short": "Excluded anatomic locations(s)", + "definition": "The anatomical location(s) or region(s) not occupied or represented by the specimen, lesion, or body structure.", + "min": 0, + "max": "*", + "base": { + "path": "BodyStructure.excludedStructure", + "min": 0, + "max": "*" + }, + "contentReference": "http://hl7.org/fhir/StructureDefinition/BodyStructure#BodyStructure.includedStructure", + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false + }, + { + "id": "BodyStructure.description", + "path": "BodyStructure.description", + "short": "Text description", + "definition": "A summary, characterization or explanation of the body structure.", + "comment": "This description could include any visual markings used to orientate the viewer e.g. external reference points, special sutures, ink markings.", + "min": 0, + "max": "1", + "base": { + "path": "BodyStructure.description", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "markdown" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.what[x]" + }, + { + "identity": "v2", + "map": "NTE" + }, + { + "identity": "rim", + "map": ".text" + }, + { + "identity": "openehr", + "map": "Description of anatomical location/Visual markings/orientation" + } + ] + }, + { + "id": "BodyStructure.image", + "path": "BodyStructure.image", + "short": "Attached images", + "definition": "Image or images used to identify a location.", + "min": 0, + "max": "*", + "base": { + "path": "BodyStructure.image", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Attachment" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.what[x]" + }, + { + "identity": "v2", + "map": "OBX" + }, + { + "identity": "rim", + "map": "outboundRelationship[typeCode=COMP].target" + }, + { + "identity": "openehr", + "map": "Image" + } + ] + }, + { + "id": "BodyStructure.patient", + "path": "BodyStructure.patient", + "short": "Who this is about", + "definition": "The person to which the body site belongs.", + "min": 1, + "max": "1", + "base": { + "path": "BodyStructure.patient", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Patient" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.subject[x]" + }, + { + "identity": "v2", + "map": "PID-3" + }, + { + "identity": "rim", + "map": ".scoper or .scoper.playsRole" + } + ] + } + ] + }, + "differential": { + "element": [ + { + "id": "BodyStructure", + "path": "BodyStructure" + }, + { + "id": "BodyStructure.morphology", + "path": "BodyStructure.morphology", + "binding": { + "strength": "preferred", + "valueSet": "http://hl7.org/fhir/ValueSet/bodystructure-code" + } + }, + { + "id": "BodyStructure.includedStructure.structure", + "path": "BodyStructure.includedStructure.structure", + "binding": { + "strength": "preferred", + "valueSet": "http://hl7.org/fhir/ValueSet/body-site" + } + }, + { + "id": "BodyStructure.includedStructure.laterality", + "path": "BodyStructure.includedStructure.laterality", + "binding": { + "strength": "preferred", + "valueSet": "http://hl7.eu/fhir/base-r5/ValueSet/siteLaterality-eu" + } + }, + { + "id": "BodyStructure.includedStructure.qualifier", + "path": "BodyStructure.includedStructure.qualifier", + "binding": { + "strength": "preferred", + "valueSet": "http://hl7.eu/fhir/base-r5/ValueSet/siteQualifier-eu" + } + } + ] + } +} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-Coverage-eu-ehic.json b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-Coverage-eu-ehic.json new file mode 100644 index 00000000..4e73559f --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-Coverage-eu-ehic.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"Coverage-eu-ehic","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition Coverage-eu-ehic

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Coverage 0..*CoverageInsurance or medical plan or a payment agreement
\".\"\".\"\".\" identifier 1..1IdentifierEHIC#8 - Identification number of the card
\".\"\".\"\".\" type 1..1CodeableConceptCoverage category such as medical or accident
Required Pattern: At least the following
\".\"\".\"\".\"\".\" coding1..*CodingCode defined by a terminology system
Fixed Value: (complex)
\".\"\".\"\".\"\".\"\".\" system1..1uriIdentity of the terminology system
Fixed Value: http://terminology.hl7.eu/CodeSystem/v3-ActCode
\".\"\".\"\".\"\".\"\".\" code1..1codeSymbol in syntax defined by the system
Fixed Value: ehic
\".\"\".\"\".\"\".\"\".\" display1..1stringRepresentation defined by the system
Fixed Value: European Health Insurance Card
\".\"\".\"\".\" beneficiary 1..1Reference(Patient (EHIC))EHIC fields #3 to #6 (Name, Id, birthDate)
\".\"\".\"\".\" period 1..1PeriodCoverage start and end dates
\".\"\".\"\".\"\".\" end 1..1dateTimeEHIC#9 - Expiry date
\".\"\".\"\".\" insurer 1..1Reference(Organization)Issuer of the policy
\".\"\".\"\".\"\".\" display 1..1stringEHIC#7 - Identification number of the institution

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.eu/fhir/base-r5/StructureDefinition/Coverage-eu-ehic","version":"0.1.0-ballot","name":"CoverageEhic","title":"Coverage: EHIC","status":"draft","date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"Coverage profile for the European Health Insurance Card","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","fhirVersion":"5.0.0","mapping":[{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"cdanetv4","uri":"http://www.cda-adc.ca/en/services/cdanet/","name":"Canadian Dental Association eclaims standard"},{"identity":"cpha3pharm","uri":"http://www.pharmacists.ca/","name":"Canadian Pharmacy Association eclaims standard"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 V2 Mapping"}],"kind":"resource","abstract":false,"type":"Coverage","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Coverage","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"5.0.0"}],"element":[{"id":"Coverage","path":"Coverage","short":"Insurance or medical plan or a payment agreement","definition":"Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment.","comment":"The Coverage resource contains the insurance card level information, which is customary to provide on claims and other communications between providers and insurers.","min":0,"max":"*","base":{"path":"Coverage","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity, Role, or Act,Coverage"},{"identity":"workflow","map":"Event"},{"identity":"w5","map":"financial.support"}]},{"id":"Coverage.id","path":"Coverage.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Coverage.meta","path":"Coverage.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Coverage.implicitRules","path":"Coverage.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of its narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies its meaning or interpretation","isSummary":true},{"id":"Coverage.language","path":"Coverage.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]}},{"id":"Coverage.text","path":"Coverage.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have a narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"condition":["dom-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Coverage.contained","path":"Coverage.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags in their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"condition":["dom-2","dom-4","dom-3","dom-5"],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Coverage.extension","path":"Coverage.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Coverage.modifierExtension","path":"Coverage.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Coverage.identifier","path":"Coverage.identifier","short":"EHIC#8 - Identification number of the card","definition":"Logical number of the card","comment":"The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Certificate number, Personal Health Number or Case ID. May be constructed as the concatenation of the Coverage.SubscriberID and the Coverage.dependant. Note that not all insurers issue unique member IDs therefore searches may result in multiple responses.","requirements":"Allows coverages to be distinguished and referenced.","min":1,"max":"1","base":{"path":"Coverage.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.identifier"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"cdanetv4","map":"C02"},{"identity":"rim","map":".id"},{"identity":"cpha3pharm","map":"C.32, C.33, C.39"}]},{"id":"Coverage.status","path":"Coverage.status","short":"active | cancelled | draft | entered-in-error","definition":"The status of the resource instance.","comment":"This element is labeled as a modifier because the status contains the code entered-in-error that marks the coverage as not currently valid.","requirements":"Need to track the status of the resource as 'draft' resources may undergo further edits while 'active' resources are immutable and may only have their status changed to 'cancelled'.","min":1,"max":"1","base":{"path":"Coverage.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CoverageStatus"}],"strength":"required","description":"A code specifying the state of the resource instance.","valueSet":"http://hl7.org/fhir/ValueSet/fm-status|5.0.0"},"mapping":[{"identity":"workflow","map":"Event.status"},{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":"Act.status"}]},{"id":"Coverage.kind","path":"Coverage.kind","short":"insurance | self-pay | other","definition":"The nature of the coverage be it insurance, or cash payment such as self-pay.","requirements":"This is used to implement conformance on other elements.","min":1,"max":"1","base":{"path":"Coverage.kind","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CoverageKind"}],"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/coverage-kind|5.0.0"}},{"id":"Coverage.paymentBy","path":"Coverage.paymentBy","short":"Self-pay parties and responsibility","definition":"Link to the paying party and optionally what specifically they will be responsible to pay.","min":0,"max":"*","base":{"path":"Coverage.paymentBy","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false},{"id":"Coverage.paymentBy.id","path":"Coverage.paymentBy.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Coverage.paymentBy.extension","path":"Coverage.paymentBy.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Coverage.paymentBy.modifierExtension","path":"Coverage.paymentBy.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Coverage.paymentBy.party","path":"Coverage.paymentBy.party","short":"Parties performing self-payment","definition":"The list of parties providing non-insurance payment for the treatment costs.","min":1,"max":"1","base":{"path":"Coverage.paymentBy.party","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Coverage.paymentBy.responsibility","path":"Coverage.paymentBy.responsibility","short":"Party's responsibility","definition":" Description of the financial responsibility.","min":0,"max":"1","base":{"path":"Coverage.paymentBy.responsibility","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Coverage.type","path":"Coverage.type","short":"Coverage category such as medical or accident","definition":"The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization.","requirements":"The order of application of coverages is dependent on the types of coverage.","min":1,"max":"1","base":{"path":"Coverage.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://terminology.hl7.eu/CodeSystem/v3-ActCode","code":"ehic","display":"European Health Insurance Card"}]},"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CoverageType"}],"strength":"preferred","description":"The type of insurance: public health, worker compensation; private accident, auto, private health, etc.) or a direct payment by an individual or organization.","valueSet":"http://hl7.org/fhir/ValueSet/coverage-type"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"v2","map":"IN1-15"}]},{"id":"Coverage.policyHolder","path":"Coverage.policyHolder","short":"Owner of the policy","definition":"The party who 'owns' the insurance policy.","comment":"For example: may be an individual, corporation or the subscriber's employer.","requirements":"This provides employer information in the case of Worker's Compensation and other policies.","min":0,"max":"1","base":{"path":"Coverage.policyHolder","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"cdanetv4","map":"D01 through D09"},{"identity":"v2","map":"IN1-16, 18, 19-name of insured, address, date of birth"},{"identity":"cpha3pharm","map":"C.35"}]},{"id":"Coverage.subscriber","path":"Coverage.subscriber","short":"Subscriber to the policy","definition":"The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due.","comment":"May be self or a parent in the case of dependants. A subscriber is only required on certain types of policies not all policies and that it is appropriate to have just a policyholder and a beneficiary when not other party can join that policy instance.","requirements":"This is the party who is entitled to the benfits under the policy.","min":0,"max":"1","base":{"path":"Coverage.subscriber","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"cdanetv4","map":"D01 through D09"},{"identity":"v2","map":"IN1-16, 18, 19-name of insured, address, date of birth"},{"identity":"cpha3pharm","map":"C.35"}]},{"id":"Coverage.subscriberId","path":"Coverage.subscriberId","short":"ID assigned to the subscriber","definition":"The insurer assigned ID for the Subscriber.","requirements":"The insurer requires this identifier on correspondance and claims (digital and otherwise).","min":0,"max":"*","base":{"path":"Coverage.subscriberId","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"cdanetv4","map":"D01 through D09"},{"identity":"v2","map":"IN1-16, 18, 19-name of insured, address, date of birth"},{"identity":"cpha3pharm","map":"C.35"}]},{"id":"Coverage.beneficiary","path":"Coverage.beneficiary","short":"EHIC fields #3 to #6 (Name, Id, birthDate)","definition":"The party who benefits from the insurance coverage; the patient when products and/or services are provided.","requirements":"This is the party who receives treatment for which the costs are reimbursed under the coverage.","min":1,"max":"1","base":{"path":"Coverage.beneficiary","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Patient-eu-ehic"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.subject"},{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"cdanetv4","map":"D01 through D09"},{"identity":"v2","map":"IN1-16, 18, 19-name of insured, address, date of birth"},{"identity":"cpha3pharm","map":"C.35"}]},{"id":"Coverage.dependent","path":"Coverage.dependent","short":"Dependent number","definition":"A designator for a dependent under the coverage.","comment":"Sometimes the member number is constructed from the subscriberId and the dependant number.","requirements":"For some coverages a single identifier is issued to the Subscriber and then an additional dependent number is issued to each beneficiary.","min":0,"max":"1","base":{"path":"Coverage.dependent","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"cdanetv4","map":"C17"},{"identity":"v2","map":"- No exact HL7 V2 equivalent concept seems to exist;"}]},{"id":"Coverage.relationship","path":"Coverage.relationship","short":"Beneficiary relationship to the subscriber","definition":"The relationship of beneficiary (patient) to the subscriber.","comment":"Typically, an individual uses policies which are theirs (relationship='self') before policies owned by others.","requirements":"The relationship between the patient and the subscriber to determine coordination of benefits.","min":0,"max":"1","base":{"path":"Coverage.relationship","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Relationship"}],"strength":"extensible","description":"The relationship between the Subscriber and the Beneficiary (insured/covered party/patient).","valueSet":"http://hl7.org/fhir/ValueSet/subscriber-relationship"},"mapping":[{"identity":"cdanetv4","map":"C03"}]},{"id":"Coverage.period","path":"Coverage.period","short":"Coverage start and end dates","definition":"Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.","requirements":"Some insurers require the submission of the coverage term.","min":1,"max":"1","base":{"path":"Coverage.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.occurrence[x]"},{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"v2","map":"IN1-12 / IN1-13"},{"identity":"rim","map":"Act.effectiveTime"}]},{"id":"Coverage.period.id","path":"Coverage.period.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Coverage.period.extension","path":"Coverage.period.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Coverage.period.start","path":"Coverage.period.start","short":"Starting time with inclusive boundary","definition":"The start of the period. The boundary is inclusive.","comment":"If the low element is missing, the meaning is that the low boundary is not known.","min":0,"max":"1","base":{"path":"Period.start","min":0,"max":"1"},"type":[{"code":"dateTime"}],"condition":["per-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"DR.1"},{"identity":"rim","map":"./low"}]},{"id":"Coverage.period.end","path":"Coverage.period.end","short":"EHIC#9 - Expiry date","definition":"Expiry date of the card","comment":"The end value includes any matching date/time. i.e. 2012-02-03T10:00:00 is in a period that has an end value of 2012-02-03.","min":1,"max":"1","base":{"path":"Period.end","min":0,"max":"1"},"type":[{"code":"dateTime"}],"meaningWhenMissing":"If the end of the period is missing, it means that the period is ongoing","condition":["per-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"DR.2"},{"identity":"rim","map":"./high"}]},{"id":"Coverage.insurer","path":"Coverage.insurer","short":"Issuer of the policy","definition":"The program or plan underwriter, payor, insurance company.","comment":"May provide multiple identifiers such as insurance company identifier or business identifier (BIN number).","requirements":"Need to identify the issuer to target for claim processing and for coordination of benefit processing.","min":1,"max":"1","base":{"path":"Coverage.insurer","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Coverage.insurer.id","path":"Coverage.insurer.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Coverage.insurer.extension","path":"Coverage.insurer.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Coverage.insurer.reference","path":"Coverage.insurer.reference","short":"Literal reference, Relative, internal or absolute URL","definition":"A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.","comment":"Using absolute URLs provides a stable scalable approach suitable for a cloud/web context, while using relative/logical references provides a flexible approach suitable for use when trading across closed eco-system boundaries. Absolute URLs do not need to point to a FHIR RESTful server, though this is the preferred approach. If the URL conforms to the structure \"[type]/[id]\" then it should be assumed that the reference is to a FHIR RESTful server.","min":0,"max":"1","base":{"path":"Reference.reference","min":0,"max":"1"},"type":[{"code":"string"}],"condition":["ref-2","ref-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Coverage.insurer.type","path":"Coverage.insurer.type","short":"Type the reference refers to (e.g. \"Patient\") - must be a resource in resources","definition":"The expected type of the target of the reference. If both Reference.type and Reference.reference are populated and Reference.reference is a FHIR URL, both SHALL be consistent.\n\nThe type is the Canonical URL of Resource Definition that is the type this reference refers to. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition/ e.g. \"Patient\" is a reference to http://hl7.org/fhir/StructureDefinition/Patient. Absolute URLs are only allowed for logical models (and can only be used in references in logical models, not resources).","comment":"This element is used to indicate the type of the target of the reference. This may be used which ever of the other elements are populated (or not). In some cases, the type of the target may be determined by inspection of the reference (e.g. a known RESTful URL) or by resolving the target of the reference.","min":0,"max":"1","base":{"path":"Reference.type","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"FHIRResourceTypeExt"}],"strength":"extensible","description":"Aa resource (or, for logical models, the URI of the logical model).","valueSet":"http://hl7.org/fhir/ValueSet/resource-types"},"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Coverage.insurer.identifier","path":"Coverage.insurer.identifier","short":"Logical reference, when literal reference is not known","definition":"An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference.","comment":"When an identifier is provided in place of a reference, any system processing the reference will only be able to resolve the identifier to a reference if it understands the business context in which the identifier is used. Sometimes this is global (e.g. a national identifier) but often it is not. For this reason, none of the useful mechanisms described for working with references (e.g. chaining, includes) are possible, nor should servers be expected to be able resolve the reference. Servers may accept an identifier based reference untouched, resolve it, and/or reject it - see CapabilityStatement.rest.resource.referencePolicy. \n\nWhen both an identifier and a literal reference are provided, the literal reference is preferred. Applications processing the resource are allowed - but not required - to check that the identifier matches the literal reference\n\nApplications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it.\n\nReference is intended to point to a structure that can potentially be expressed as a FHIR resource, though there is no need for it to exist as an actual FHIR resource instance - except in as much as an application wishes to actual find the target of the reference. The content referred to be the identifier must meet the logical constraints implied by any limitations on what resource types are permitted for the reference. For example, it would not be legitimate to send the identifier for a drug prescription if the type were Reference(Observation|DiagnosticReport). One of the use-cases for Reference.identifier is the situation where no FHIR representation exists (where the type is Reference (Any).\n\nThis element only allows for a single identifier. In the case where additional identifers are required, use the [http://hl7.org/fhir/StructureDefinition/additionalIdentifier](http://hl7.org/fhir/extensions/StructureDefinition-additionalIdentifier.html) extension.","min":0,"max":"1","base":{"path":"Reference.identifier","min":0,"max":"1"},"type":[{"code":"Identifier"}],"condition":["ref-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".identifier"}]},{"id":"Coverage.insurer.display","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"Coverage.insurer.display","short":"EHIC#7 - Identification number of the institution","definition":"Identification number and acronym of the competent institution","comment":"This is generally not the same as the Resource.text of the referenced resource. The purpose is to identify what's being referenced, not to fully describe it.","min":1,"max":"1","base":{"path":"Reference.display","min":0,"max":"1"},"type":[{"code":"string"}],"condition":["ref-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Coverage.class","path":"Coverage.class","short":"Additional coverage classifications","definition":"A suite of underwriter specific classifiers.","comment":"For example, class may be used to identify a class of coverage or employer group, policy, or plan.","requirements":"The codes provided on the health card which identify or confirm the specific policy for the insurer.","min":0,"max":"*","base":{"path":"Coverage.class","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false},{"id":"Coverage.class.id","path":"Coverage.class.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Coverage.class.extension","path":"Coverage.class.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Coverage.class.modifierExtension","path":"Coverage.class.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Coverage.class.type","path":"Coverage.class.type","short":"Type of class such as 'group' or 'plan'","definition":"The type of classification for which an insurer-specific class label or number and optional name is provided. For example, type may be used to identify a class of coverage or employer group, policy, or plan.","requirements":"The insurer issued label for a specific health card value.","min":1,"max":"1","base":{"path":"Coverage.class.type","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CoverageClass"}],"strength":"extensible","description":"The policy classifications, e.g. Group, Plan, Class, etc.","valueSet":"http://hl7.org/fhir/ValueSet/coverage-class"}},{"id":"Coverage.class.value","path":"Coverage.class.value","short":"Value associated with the type","definition":"The alphanumeric identifier associated with the insurer issued label.","comment":"For example, the Group or Plan number.","requirements":"The insurer issued label and identifier are necessary to identify the specific policy, group, etc..","min":1,"max":"1","base":{"path":"Coverage.class.value","min":1,"max":"1"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"cdanetv4","map":"C11 (Division,Section)"},{"identity":"v2","map":"IN1-2"},{"identity":"cpha3pharm","map":"C.31"}]},{"id":"Coverage.class.name","path":"Coverage.class.name","short":"Human readable description of the type and value","definition":"A short description for the class.","requirements":"Used to provide a meaningful description in correspondence to the patient.","min":0,"max":"1","base":{"path":"Coverage.class.name","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"cdanetv4","map":"C11 (Division,Section)"},{"identity":"v2","map":"IN1-8"},{"identity":"cpha3pharm","map":"C.31"}]},{"id":"Coverage.order","path":"Coverage.order","short":"Relative order of the coverage","definition":"The order of applicability of this coverage relative to other coverages which are currently in force. Note, there may be gaps in the numbering and this does not imply primary, secondary etc. as the specific positioning of coverages depends upon the episode of care. For example; a patient might have (0) auto insurance (1) their own health insurance and (2) spouse's health insurance. When claiming for treatments which were not the result of an auto accident then only coverages (1) and (2) above would be applicatble and would apply in the order specified in parenthesis.","requirements":"Used in managing the coordination of benefits.","min":0,"max":"1","base":{"path":"Coverage.order","min":0,"max":"1"},"type":[{"code":"positiveInt"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Coverage.network","path":"Coverage.network","short":"Insurer network","definition":"The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply.","requirements":"Used in referral for treatment and in claims processing.","min":0,"max":"1","base":{"path":"Coverage.network","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"cdanetv4","map":"D10"}]},{"id":"Coverage.costToBeneficiary","path":"Coverage.costToBeneficiary","short":"Patient payments for services/products","definition":"A suite of codes indicating the cost category and associated amount which have been detailed in the policy and may have been included on the health card.","comment":"For example by knowing the patient visit co-pay, the provider can collect the amount prior to undertaking treatment.","requirements":"Required by providers to manage financial transaction with the patient.","alias":["CoPay","Deductible","Exceptions"],"min":0,"max":"*","base":{"path":"Coverage.costToBeneficiary","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false},{"id":"Coverage.costToBeneficiary.id","path":"Coverage.costToBeneficiary.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Coverage.costToBeneficiary.extension","path":"Coverage.costToBeneficiary.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Coverage.costToBeneficiary.modifierExtension","path":"Coverage.costToBeneficiary.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Coverage.costToBeneficiary.type","path":"Coverage.costToBeneficiary.type","short":"Cost category","definition":"The category of patient centric costs associated with treatment.","comment":"For example visit, specialist visits, emergency, inpatient care, etc.","requirements":"Needed to identify the category associated with the amount for the patient.","min":0,"max":"1","base":{"path":"Coverage.costToBeneficiary.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CopayTypes"}],"strength":"extensible","description":"The types of services to which patient copayments are specified.","valueSet":"http://hl7.org/fhir/ValueSet/coverage-copay-type"}},{"id":"Coverage.costToBeneficiary.category","path":"Coverage.costToBeneficiary.category","short":"Benefit classification","definition":"Code to identify the general type of benefits under which products and services are provided.","comment":"Examples include Medical Care, Periodontics, Renal Dialysis, Vision Coverage.","requirements":"Needed to convey the category of service or product for which eligibility is sought.","min":0,"max":"1","base":{"path":"Coverage.costToBeneficiary.category","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"BenefitCategory"}],"strength":"example","valueSet":"http://hl7.org/fhir/ValueSet/ex-benefitcategory"}},{"id":"Coverage.costToBeneficiary.network","path":"Coverage.costToBeneficiary.network","short":"In or out of network","definition":"Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers.","requirements":"Needed as in or out of network providers are treated differently under the coverage.","min":0,"max":"1","base":{"path":"Coverage.costToBeneficiary.network","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"BenefitNetwork"}],"strength":"example","valueSet":"http://hl7.org/fhir/ValueSet/benefit-network"}},{"id":"Coverage.costToBeneficiary.unit","path":"Coverage.costToBeneficiary.unit","short":"Individual or family","definition":"Indicates if the benefits apply to an individual or to the family.","requirements":"Needed for the understanding of the benefits.","min":0,"max":"1","base":{"path":"Coverage.costToBeneficiary.unit","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"BenefitUnit"}],"strength":"example","valueSet":"http://hl7.org/fhir/ValueSet/benefit-unit"}},{"id":"Coverage.costToBeneficiary.term","path":"Coverage.costToBeneficiary.term","short":"Annual or lifetime","definition":"The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.","requirements":"Needed for the understanding of the benefits.","min":0,"max":"1","base":{"path":"Coverage.costToBeneficiary.term","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"BenefitTerm"}],"strength":"example","valueSet":"http://hl7.org/fhir/ValueSet/benefit-term"}},{"id":"Coverage.costToBeneficiary.value[x]","path":"Coverage.costToBeneficiary.value[x]","short":"The amount or percentage due from the beneficiary","definition":"The amount due from the patient for the cost category.","comment":"Amount may be expressed as a percentage of the service/product cost or a fixed amount of currency.","requirements":"Needed to identify the amount for the patient associated with the category.","min":0,"max":"1","base":{"path":"Coverage.costToBeneficiary.value[x]","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]},{"code":"Money"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"cdanetv4","map":"C11 (Division,Section)"},{"identity":"v2","map":"IN1-8"},{"identity":"cpha3pharm","map":"C.31"}]},{"id":"Coverage.costToBeneficiary.exception","path":"Coverage.costToBeneficiary.exception","short":"Exceptions for patient payments","definition":"A suite of codes indicating exceptions or reductions to patient costs and their effective periods.","requirements":"Required by providers to manage financial transaction with the patient.","min":0,"max":"*","base":{"path":"Coverage.costToBeneficiary.exception","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false},{"id":"Coverage.costToBeneficiary.exception.id","path":"Coverage.costToBeneficiary.exception.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Coverage.costToBeneficiary.exception.extension","path":"Coverage.costToBeneficiary.exception.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Coverage.costToBeneficiary.exception.modifierExtension","path":"Coverage.costToBeneficiary.exception.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Coverage.costToBeneficiary.exception.type","path":"Coverage.costToBeneficiary.exception.type","short":"Exception category","definition":"The code for the specific exception.","requirements":"Needed to identify the exception associated with the amount for the patient.","min":1,"max":"1","base":{"path":"Coverage.costToBeneficiary.exception.type","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CoverageFinancialException"}],"strength":"example","description":"The types of exceptions from the part or full value of financial obligations such as copays.","valueSet":"http://hl7.org/fhir/ValueSet/coverage-financial-exception"}},{"id":"Coverage.costToBeneficiary.exception.period","path":"Coverage.costToBeneficiary.exception.period","short":"The effective period of the exception","definition":"The timeframe the exception is in force.","requirements":"Needed to identify the applicable timeframe for the exception for the correct calculation of patient costs.","min":0,"max":"1","base":{"path":"Coverage.costToBeneficiary.exception.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Coverage.subrogation","path":"Coverage.subrogation","short":"Reimbursement to insurer","definition":"When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs.","comment":"Typically, automotive and worker's compensation policies would be flagged with 'subrogation=true' to enable healthcare payors to collect against accident claims.","requirements":"See definition for when to be used.","min":0,"max":"1","base":{"path":"Coverage.subrogation","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false},{"id":"Coverage.contract","path":"Coverage.contract","short":"Contract details","definition":"The policy(s) which constitute this insurance coverage.","requirements":"To reference the legally binding contract between the policy holder and the insurer.","min":0,"max":"*","base":{"path":"Coverage.contract","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Contract"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"cdanetv4","map":"D01 through D09"},{"identity":"v2","map":"IN1-16, 18, 19"},{"identity":"rim","map":"n/a"},{"identity":"cpha3pharm","map":"C.35"}]},{"id":"Coverage.insurancePlan","path":"Coverage.insurancePlan","short":"Insurance plan details","definition":"The insurance plan details, benefits and costs, which constitute this insurance coverage.","requirements":"To associate the plan benefits and costs with the coverage which is an instance of that plan.","min":0,"max":"1","base":{"path":"Coverage.insurancePlan","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/InsurancePlan"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false}]},"differential":{"element":[{"id":"Coverage","path":"Coverage"},{"id":"Coverage.identifier","path":"Coverage.identifier","short":"EHIC#8 - Identification number of the card","definition":"Logical number of the card","min":1,"max":"1"},{"id":"Coverage.type","path":"Coverage.type","min":1,"patternCodeableConcept":{"coding":[{"system":"http://terminology.hl7.eu/CodeSystem/v3-ActCode","code":"ehic","display":"European Health Insurance Card"}]}},{"id":"Coverage.beneficiary","path":"Coverage.beneficiary","short":"EHIC fields #3 to #6 (Name, Id, birthDate)","type":[{"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Patient-eu-ehic"]}]},{"id":"Coverage.period","path":"Coverage.period","min":1},{"id":"Coverage.period.end","path":"Coverage.period.end","short":"EHIC#9 - Expiry date","definition":"Expiry date of the card","min":1},{"id":"Coverage.insurer","path":"Coverage.insurer","min":1},{"id":"Coverage.insurer.display","path":"Coverage.insurer.display","short":"EHIC#7 - Identification number of the institution","definition":"Identification number and acronym of the competent institution","min":1}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-Patient-animal-eu.json b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-Patient-animal-eu.json new file mode 100644 index 00000000..f13c23dc --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-Patient-animal-eu.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"Patient-animal-eu","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition Patient-animal-eu

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Patient 0..*PatientInformation about an individual or animal receiving health care services
\".\"\".\"\".\" Slices for extension 1..*ExtensionExtension
Slice: Unordered, Open by value:url
\".\"\".\"\".\"\".\" extension:patient-animal 1..1(Complex)This patient is known to be an animal (non-human)
URL: http://hl7.org/fhir/StructureDefinition/patient-animal
\".\"\".\"\".\"\".\"\".\" Slices for extension Content/Rules for all slices
\".\"\".\"\".\"\".\"\".\"\".\" extension:species 1..1ExtensionExtension
\".\"\".\"\".\"\".\"\".\"\".\"\".\" value[x] 1..1CodeableConceptValue of extension
Binding: Types of species (example)
\".\"\".\"\".\"\".\" extension:recordedSexOrGender 0..1(Complex)A recorded sex or gender property for the individual
URL: http://hl7.org/fhir/StructureDefinition/individual-recordedSexOrGender
\".\"\".\"\".\" telecom 0..0
\".\"\".\"\".\" maritalStatus 0..0

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.eu/fhir/base-r5/StructureDefinition/Patient-animal-eu","version":"0.1.0-ballot","name":"PatientAnimalEu","title":"Patient: Animal","status":"draft","date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"This profile defines how to represent an Animal as subject of care in FHIR for the purpose of this guide.\nThis is used to identify the species when a specimen is collected from an animal","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","fhirVersion":"5.0.0","mapping":[{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"interface","uri":"http://hl7.org/fhir/interface","name":"Interface Pattern"},{"identity":"cda","uri":"http://hl7.org/v3/cda","name":"CDA (R2)"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 V2 Mapping"},{"identity":"loinc","uri":"http://loinc.org","name":"LOINC code for the element"}],"kind":"resource","abstract":false,"type":"Patient","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Patient","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"5.0.0"}],"element":[{"id":"Patient","path":"Patient","short":"Information about an individual or animal receiving health care services","definition":"Demographics and other administrative information about an individual or animal receiving care or other health-related services.","alias":["SubjectOfCare Client Resident"],"min":0,"max":"*","base":{"path":"Patient","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity, Role, or Act,Patient[classCode=PAT]"},{"identity":"w5","map":"administrative.individual"},{"identity":"interface","map":"ParticipantLiving"},{"identity":"cda","map":"ClinicalDocument.recordTarget.patientRole"}]},{"id":"Patient.id","path":"Patient.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Patient.meta","path":"Patient.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Patient.implicitRules","path":"Patient.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of its narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies its meaning or interpretation","isSummary":true},{"id":"Patient.language","path":"Patient.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]}},{"id":"Patient.text","path":"Patient.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have a narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"condition":["dom-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Patient.contained","path":"Patient.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags in their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"condition":["dom-2","dom-4","dom-3","dom-5"],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.extension","path":"Patient.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"ordered":false,"rules":"open"},"short":"Extension","definition":"An Extension","min":1,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false},{"id":"Patient.extension:patient-animal","path":"Patient.extension","sliceName":"patient-animal","short":"This patient is known to be an animal (non-human)","definition":"This patient is known to be an animal.","comment":"The absence of the animal extension does not imply that the patient is a human. If a system requires such a positive assertion that the patient is human, an extension will be required. (Do not use a species of homo-sapiens in animal species, as this would incorrectly infer that the patient is an animal).","min":1,"max":"1","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/patient-animal"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"player[classCode=ANM]"}]},{"id":"Patient.extension:patient-animal.id","path":"Patient.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.extension:patient-animal.extension","path":"Patient.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":1,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.extension:patient-animal.extension:species","path":"Patient.extension.extension","sliceName":"species","short":"Extension","definition":"An Extension","min":1,"max":"1","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false},{"id":"Patient.extension:patient-animal.extension:species.id","path":"Patient.extension.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.extension:patient-animal.extension:species.extension","path":"Patient.extension.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Extension","definition":"An Extension","min":0,"max":"0","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false},{"id":"Patient.extension:patient-animal.extension:species.url","path":"Patient.extension.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"species","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.extension:patient-animal.extension:species.value[x]","path":"Patient.extension.extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R5/extensibility.html) for a list).","min":1,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["ext-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"strength":"example","valueSet":"http://hl7.eu/fhir/base-r5/ValueSet/speciesType-eu"},"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.extension:patient-animal.extension:breed","path":"Patient.extension.extension","sliceName":"breed","short":"The animal breed. E.g. Poodle, Angus.","definition":"Identifies the detailed categorization of the kind of animal.","comment":"Breed MAY be used to provide further taxonomic or non-taxonomic classification. It may involve local or proprietary designation--such as commercial strain--and/or additional information such as production type.","min":0,"max":"1","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PID-35 (where more detailed value is present)"},{"identity":"rim","map":"playedRole[classCode=GEN]/scoper[classCode=ANM, determinerCode=KIND]/code"}]},{"id":"Patient.extension:patient-animal.extension:breed.id","path":"Patient.extension.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.extension:patient-animal.extension:breed.extension","path":"Patient.extension.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Extension","definition":"An Extension","min":0,"max":"0","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false},{"id":"Patient.extension:patient-animal.extension:breed.url","path":"Patient.extension.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"breed","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.extension:patient-animal.extension:breed.value[x]","path":"Patient.extension.extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R5/extensibility.html) for a list).","min":1,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["ext-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AnimalBreed"}],"strength":"example","description":"The breed of an animal.","valueSet":"http://hl7.org/fhir/ValueSet/animal-breeds"},"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.extension:patient-animal.extension:genderStatus","path":"Patient.extension.extension","sliceName":"genderStatus","short":"The status of the animal's reproductive parts. E.g. Neutered, Intact.","definition":"Indicates the current state of the animal's reproductive organs.","min":0,"max":"1","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"genderStatusCode"}]},{"id":"Patient.extension:patient-animal.extension:genderStatus.id","path":"Patient.extension.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.extension:patient-animal.extension:genderStatus.extension","path":"Patient.extension.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Extension","definition":"An Extension","min":0,"max":"0","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false},{"id":"Patient.extension:patient-animal.extension:genderStatus.url","path":"Patient.extension.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"genderStatus","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.extension:patient-animal.extension:genderStatus.value[x]","path":"Patient.extension.extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R5/extensibility.html) for a list).","min":1,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["ext-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AnimalGenderStatus"}],"strength":"example","description":"The state of the animal's reproductive organs.","valueSet":"http://hl7.org/fhir/ValueSet/animal-genderstatus"},"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.extension:patient-animal.url","path":"Patient.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"uri"}],"code":"http://hl7.org/fhirpath/System.String"}],"fixedUri":"http://hl7.org/fhir/StructureDefinition/patient-animal","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.extension:patient-animal.value[x]","path":"Patient.extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R5/extensibility.html) for a list).","min":0,"max":"0","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"base64Binary"},{"code":"boolean"},{"code":"canonical"},{"code":"code"},{"code":"date"},{"code":"dateTime"},{"code":"decimal"},{"code":"id"},{"code":"instant"},{"code":"integer"},{"code":"integer64"},{"code":"markdown"},{"code":"oid"},{"code":"positiveInt"},{"code":"string"},{"code":"time"},{"code":"unsignedInt"},{"code":"uri"},{"code":"url"},{"code":"uuid"},{"code":"Address"},{"code":"Age"},{"code":"Annotation"},{"code":"Attachment"},{"code":"CodeableConcept"},{"code":"CodeableReference"},{"code":"Coding"},{"code":"ContactPoint"},{"code":"Count"},{"code":"Distance"},{"code":"Duration"},{"code":"HumanName"},{"code":"Identifier"},{"code":"Money"},{"code":"Period"},{"code":"Quantity"},{"code":"Range"},{"code":"Ratio"},{"code":"RatioRange"},{"code":"Reference"},{"code":"SampledData"},{"code":"Signature"},{"code":"Timing"},{"code":"ContactDetail"},{"code":"DataRequirement"},{"code":"Expression"},{"code":"ParameterDefinition"},{"code":"RelatedArtifact"},{"code":"TriggerDefinition"},{"code":"UsageContext"},{"code":"Availability"},{"code":"ExtendedContactDetail"},{"code":"Dosage"},{"code":"Meta"}],"condition":["ext-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.extension:recordedSexOrGender","path":"Patient.extension","sliceName":"recordedSexOrGender","short":"A recorded sex or gender property for the individual","definition":"A sex or gender property for the individual from a document or other record","min":0,"max":"1","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/individual-recordedSexOrGender"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false},{"id":"Patient.modifierExtension","path":"Patient.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.identifier","path":"Patient.identifier","short":"An identifier for this patient","definition":"An identifier for this patient.","requirements":"Patients are almost always assigned specific numerical identifiers.","min":0,"max":"*","base":{"path":"Patient.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"PID-3"},{"identity":"rim","map":"id"},{"identity":"interface","map":"Participant.identifier"},{"identity":"cda","map":".id"}]},{"id":"Patient.active","path":"Patient.active","short":"Whether this patient's record is in active use","definition":"Whether this patient record is in active use. \nMany systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules.\n\nIt is often used to filter patient lists to exclude inactive patients\n\nDeceased patients may also be marked as inactive for the same reasons, but may be active for some time after death.","comment":"If a record is inactive, and linked to an active record, then future patient/record updates should occur on the other patient.","requirements":"Need to be able to mark a patient record as not to be used because it was created in error.","min":0,"max":"1","base":{"path":"Patient.active","min":0,"max":"1"},"type":[{"code":"boolean"}],"meaningWhenMissing":"This resource is generally assumed to be active if no value is provided for the active element","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that can indicate that a record should not be treated as valid","isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":"statusCode"},{"identity":"interface","map":"Participant.active"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.name","path":"Patient.name","short":"A name associated with the patient","definition":"A name associated with the individual.","comment":"A patient may have multiple names with different uses or applicable periods. For animals, the name is a \"HumanName\" in the sense that is assigned and used by humans and has the same patterns. Animal names may be communicated as given names, and optionally may include a family name.","requirements":"Need to be able to track the patient by multiple names. Examples are your official name and a partner name.","min":0,"max":"*","base":{"path":"Patient.name","min":0,"max":"*"},"type":[{"code":"HumanName"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-5, PID-9"},{"identity":"rim","map":"name"},{"identity":"interface","map":"Participant.name"},{"identity":"cda","map":".patient.name"}]},{"id":"Patient.telecom","path":"Patient.telecom","short":"Use contact.telecom","definition":"A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.","comment":"Animals do not have phones, their contacts do. Contact.telecom should be used.","requirements":"People have (primary) ways to contact them in some way such as phone, email.","min":0,"max":"0","base":{"path":"Patient.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-13, PID-14, PID-40"},{"identity":"rim","map":"telecom"},{"identity":"interface","map":"ParticipantContactable.telecom"},{"identity":"cda","map":".telecom"}]},{"id":"Patient.gender","path":"Patient.gender","short":"male | female | other | unknown","definition":"Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.","comment":"The gender might not match the biological sex as determined by genetics or the individual's preferred identification. Note that for both humans and particularly animals, there are other legitimate possibilities than male and female, though the vast majority of systems and contexts only support male and female. Systems providing decision support or enforcing business rules should ideally do this on the basis of Observations dealing with the specific sex or gender aspect of interest (anatomical, chromosomal, social, etc.) However, because these observations are infrequently recorded, defaulting to the administrative gender is common practice. Where such defaulting occurs, rule enforcement should allow for the variation between administrative and biological, chromosomal and other gender aspects. For example, an alert about a hysterectomy on a male should be handled as a warning or overridable error, not a \"hard\" error. See the Patient Gender and Sex section for additional information about communicating patient gender and sex.","requirements":"Needed for identification of the individual, in combination with (at least) name and birth date.","min":0,"max":"1","base":{"path":"Patient.gender","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AdministrativeGender"}],"strength":"required","description":"The gender of a person used for administrative purposes.","valueSet":"http://hl7.org/fhir/ValueSet/administrative-gender|5.0.0"},"mapping":[{"identity":"v2","map":"PID-8"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/administrativeGender"},{"identity":"interface","map":"ParticipantLiving.gender"},{"identity":"cda","map":".patient.administrativeGenderCode"}]},{"id":"Patient.birthDate","path":"Patient.birthDate","short":"The date of birth for the individual","definition":"The date of birth for the individual.","comment":"Partial dates are allowed if the specific date of birth is unknown. There is a standard extension \"patient-birthTime\" available that should be used where Time is required (such as in maternity/infant care systems).","requirements":"Age of the individual drives many clinical processes.","min":0,"max":"1","base":{"path":"Patient.birthDate","min":0,"max":"1"},"type":[{"code":"date"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-7"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/birthTime"},{"identity":"interface","map":"ParticipantLiving.birthDate"},{"identity":"cda","map":".patient.birthTime"},{"identity":"loinc","map":"21112-8"}]},{"id":"Patient.deceased[x]","path":"Patient.deceased[x]","short":"Indicates if the individual is deceased or not","definition":"Indicates if the individual is deceased or not.","comment":"If there's no value in the instance, it means there is no statement on whether or not the individual is deceased. Most systems will interpret the absence of a value as a sign of the person being alive.","requirements":"The fact that a patient is deceased influences the clinical process. Also, in human communication and relation management it is necessary to know whether the person is alive.","min":0,"max":"1","base":{"path":"Patient.deceased[x]","min":0,"max":"1"},"type":[{"code":"boolean"},{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because once a patient is marked as deceased, the actions that are appropriate to perform on the patient may be significantly different.","isSummary":true,"mapping":[{"identity":"v2","map":"PID-30 (bool) and PID-29 (datetime)"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/deceasedInd, player[classCode=PSN|ANM and determinerCode=INSTANCE]/deceasedTime"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.address","path":"Patient.address","short":"An address for the individual","definition":"An address for the individual.","comment":"Patient may have multiple addresses with different uses or applicable periods.","requirements":"May need to keep track of patient addresses for contacting, billing or reporting requirements and also to help with identification.","min":0,"max":"*","base":{"path":"Patient.address","min":0,"max":"*"},"type":[{"code":"Address"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-11"},{"identity":"rim","map":"addr"},{"identity":"interface","map":"ParticipantContactable.address"},{"identity":"cda","map":".addr"}]},{"id":"Patient.maritalStatus","path":"Patient.maritalStatus","short":"Marital (civil) status of a patient","definition":"This field contains a patient's most recent marital (civil) status.","requirements":"Most, if not all systems capture it.","min":0,"max":"0","base":{"path":"Patient.maritalStatus","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MaritalStatus"}],"strength":"extensible","description":"The domestic partnership status of a person.","valueSet":"http://hl7.org/fhir/ValueSet/marital-status"},"mapping":[{"identity":"v2","map":"PID-16"},{"identity":"rim","map":"player[classCode=PSN]/maritalStatusCode"},{"identity":"cda","map":".patient.maritalStatusCode"}]},{"id":"Patient.multipleBirth[x]","path":"Patient.multipleBirth[x]","short":"Whether patient is part of a multiple birth","definition":"Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).","comment":"Where the valueInteger is provided, the number is the birth number in the sequence. E.g. The middle birth in triplets would be valueInteger=2 and the third born would have valueInteger=3 If a boolean value was provided for this triplets example, then all 3 patient records would have valueBoolean=true (the ordering is not indicated).","requirements":"For disambiguation of multiple-birth children, especially relevant where the care provider doesn't meet the patient, such as labs.","min":0,"max":"1","base":{"path":"Patient.multipleBirth[x]","min":0,"max":"1"},"type":[{"code":"boolean"},{"code":"integer"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PID-24 (bool), PID-25 (integer)"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/multipleBirthInd, player[classCode=PSN|ANM and determinerCode=INSTANCE]/multipleBirthOrderNumber"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.photo","path":"Patient.photo","short":"Image of the patient","definition":"Image of the patient.","comment":"Guidelines:\n* Use id photos, not clinical photos.\n* Limit dimensions to thumbnail.\n* Keep byte count low to ease resource updates.","requirements":"Many EHR systems have the capability to capture an image of the patient. Fits with newer social media usage too.","min":0,"max":"*","base":{"path":"Patient.photo","min":0,"max":"*"},"type":[{"code":"Attachment"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-5 - needs a profile"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/desc"},{"identity":"interface","map":"ParticipantLiving.photo"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact","path":"Patient.contact","short":"A contact party (e.g. guardian, partner, friend) for the patient","definition":"A contact party (e.g. guardian, partner, friend) for the patient.","comment":"Contact covers all kinds of contact parties: family members, business contacts, guardians, caregivers. Not applicable to register pedigree and family ties beyond use of having contact.","requirements":"Need to track people you can contact about the patient.","min":0,"max":"*","base":{"path":"Patient.contact","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"pat-1","severity":"error","human":"SHALL at least contain a contact's details or a reference to an organization","expression":"name.exists() or telecom.exists() or address.exists() or organization.exists()","source":"http://hl7.org/fhir/StructureDefinition/Patient"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/scopedRole[classCode=CON]"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.id","path":"Patient.contact.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.contact.extension","path":"Patient.contact.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.contact.modifierExtension","path":"Patient.contact.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.contact.relationship","path":"Patient.contact.relationship","short":"The kind of relationship","definition":"The nature of the relationship between the patient and the contact person.","requirements":"Used to determine which contact person is the most relevant to approach, depending on circumstances.","min":0,"max":"*","base":{"path":"Patient.contact.relationship","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ContactRelationship"}],"strength":"extensible","description":"The nature of the relationship between a patient and a contact person for that patient.","valueSet":"http://hl7.org/fhir/ValueSet/patient-contactrelationship"},"mapping":[{"identity":"v2","map":"NK1-7, NK1-3"},{"identity":"rim","map":"code"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.name","path":"Patient.contact.name","short":"A name associated with the contact person","definition":"A name associated with the contact person.","requirements":"Contact persons need to be identified by name, but it is uncommon to need details about multiple other names for that contact person.","min":0,"max":"1","base":{"path":"Patient.contact.name","min":0,"max":"1"},"type":[{"code":"HumanName"}],"condition":["pat-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-2"},{"identity":"rim","map":"name"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.telecom","path":"Patient.contact.telecom","short":"A contact detail for the person","definition":"A contact detail for the person, e.g. a telephone number or an email address.","comment":"Contact may have multiple ways to be contacted with different uses or applicable periods. May need to have options for contacting the person urgently, and also to help with identification.","requirements":"People have (primary) ways to contact them in some way such as phone, email.","min":0,"max":"*","base":{"path":"Patient.contact.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"condition":["pat-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-5, NK1-6, NK1-40"},{"identity":"rim","map":"telecom"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.address","path":"Patient.contact.address","short":"Address for the contact person","definition":"Address for the contact person.","requirements":"Need to keep track where the contact person can be contacted per postal mail or visited.","min":0,"max":"1","base":{"path":"Patient.contact.address","min":0,"max":"1"},"type":[{"code":"Address"}],"condition":["pat-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-4"},{"identity":"rim","map":"addr"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.gender","path":"Patient.contact.gender","short":"male | female | other | unknown","definition":"Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.","requirements":"Needed to address the person correctly.","min":0,"max":"1","base":{"path":"Patient.contact.gender","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AdministrativeGender"}],"strength":"required","description":"The gender of a person used for administrative purposes.","valueSet":"http://hl7.org/fhir/ValueSet/administrative-gender|5.0.0"},"mapping":[{"identity":"v2","map":"NK1-15"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/administrativeGender"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.organization","path":"Patient.contact.organization","short":"Organization that is associated with the contact","definition":"Organization on behalf of which the contact is acting or for which the contact is working.","requirements":"For guardians or business related contacts, the organization is relevant.","min":0,"max":"1","base":{"path":"Patient.contact.organization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"condition":["pat-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-13, NK1-30, NK1-31, NK1-32, NK1-41"},{"identity":"rim","map":"scoper"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.period","path":"Patient.contact.period","short":"The period during which this contact person or organization is valid to be contacted relating to this patient","definition":"The period during which this contact person or organization is valid to be contacted relating to this patient.","min":0,"max":"1","base":{"path":"Patient.contact.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"effectiveTime"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.communication","path":"Patient.communication","short":"A language which may be used to communicate with the patient about his or her health","definition":"A language which may be used to communicate with the patient about his or her health.","comment":"If no language is specified, this *implies* that the default local language is spoken. If you need to convey proficiency for multiple modes, then you need multiple Patient.Communication associations. For animals, language is not a relevant field, and should be absent from the instance. If the Patient does not speak the default local language, then the Interpreter Required Standard can be used to explicitly declare that an interpreter is required.","requirements":"If a patient does not speak the local language, interpreters may be required, so languages spoken and proficiency are important things to keep track of both for patient and other persons of interest.","min":0,"max":"*","base":{"path":"Patient.communication","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"LanguageCommunication"},{"identity":"interface","map":"ParticipantLiving.communication"},{"identity":"cda","map":"patient.languageCommunication"}]},{"id":"Patient.communication.id","path":"Patient.communication.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.communication.extension","path":"Patient.communication.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.communication.modifierExtension","path":"Patient.communication.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.communication.language","path":"Patient.communication.language","short":"The language which can be used to communicate with the patient about his or her health","definition":"The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-AU\" for Australian English.","comment":"The structure aa-BB with this exact casing is one the most widely used notations for locale. However not all systems actually code this but instead have it as free text. Hence CodeableConcept instead of code as the data type.","requirements":"Most systems in multilingual countries will want to convey language. Not all systems actually need the regional dialect.","min":1,"max":"1","base":{"path":"Patient.communication.language","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]},"mapping":[{"identity":"v2","map":"PID-15, LAN-2"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/languageCommunication/code"},{"identity":"cda","map":".languageCode"}]},{"id":"Patient.communication.preferred","path":"Patient.communication.preferred","short":"Language preference indicator","definition":"Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).","comment":"This language is specifically identified for communicating healthcare information.","requirements":"People that master multiple languages up to certain level may prefer one or more, i.e. feel more confident in communicating in a particular language making other languages sort of a fall back method.","min":0,"max":"1","base":{"path":"Patient.communication.preferred","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PID-15"},{"identity":"rim","map":"preferenceInd"},{"identity":"cda","map":".preferenceInd"}]},{"id":"Patient.generalPractitioner","path":"Patient.generalPractitioner","short":"Patient's nominated primary care provider","definition":"Patient's nominated care provider.","comment":"This may be the primary care provider (in a GP context), or it may be a patient nominated care manager in a community/disability setting, or even organization that will provide people to perform the care provider roles. It is not to be used to record Care Teams, these should be in a CareTeam resource that may be linked to the CarePlan or EpisodeOfCare resources.\nMultiple GPs may be recorded against the patient for various reasons, such as a student that has his home GP listed along with the GP at university during the school semesters, or a \"fly-in/fly-out\" worker that has the onsite GP also included with his home GP to remain aware of medical issues.\n\nJurisdictions may decide that they can profile this down to 1 if desired, or 1 per type.","alias":["careProvider"],"min":0,"max":"*","base":{"path":"Patient.generalPractitioner","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization","http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PD1-4"},{"identity":"rim","map":"subjectOf.CareEvent.performer.AssignedEntity"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.managingOrganization","path":"Patient.managingOrganization","short":"Organization that is the custodian of the patient record","definition":"Organization that is the custodian of the patient record.","comment":"There is only one managing organization for a specific patient record. Other organizations will have their own Patient record, and may use the Link property to join the records together (or a Person resource which can include confidence ratings for the association).","requirements":"Need to know who recognizes this patient record, manages and updates it.","min":0,"max":"1","base":{"path":"Patient.managingOrganization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"scoper"},{"identity":"cda","map":".providerOrganization"}]},{"id":"Patient.link","path":"Patient.link","short":"Link to a Patient or RelatedPerson resource that concerns the same actual individual","definition":"Link to a Patient or RelatedPerson resource that concerns the same actual individual.","comment":"There is no assumption that linked patient records have mutual links.","requirements":"There are multiple use cases: \n\n* Duplicate patient records due to the clerical errors associated with the difficulties of identifying humans consistently, and \n* Distribution of patient information across multiple servers.","min":0,"max":"*","base":{"path":"Patient.link","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because it might not be the main Patient resource, and the referenced patient should be used instead of this Patient record. This is when the link.type value is 'replaced-by'","isSummary":true,"mapping":[{"identity":"rim","map":"outboundLink"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.link.id","path":"Patient.link.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.link.extension","path":"Patient.link.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.link.modifierExtension","path":"Patient.link.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.link.other","path":"Patient.link.other","short":"The other patient or related person resource that the link refers to","definition":"Link to a Patient or RelatedPerson resource that concerns the same actual individual.","comment":"Referencing a RelatedPerson here removes the need to use a Person record to associate a Patient and RelatedPerson as the same individual.","min":1,"max":"1","base":{"path":"Patient.link.other","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy","valueBoolean":false}],"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-3, MRG-1"},{"identity":"rim","map":"id"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.link.type","path":"Patient.link.type","short":"replaced-by | replaces | refer | seealso","definition":"The type of link between this patient resource and another patient resource.","min":1,"max":"1","base":{"path":"Patient.link.type","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"LinkType"}],"strength":"required","description":"The type of link between this patient resource and another Patient resource, or Patient/RelatedPerson when using the `seealso` code","valueSet":"http://hl7.org/fhir/ValueSet/link-type|5.0.0"},"mapping":[{"identity":"rim","map":"typeCode"},{"identity":"cda","map":"n/a"}]}]},"differential":{"element":[{"id":"Patient","path":"Patient"},{"id":"Patient.extension","path":"Patient.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"ordered":false,"rules":"open"},"min":1},{"id":"Patient.extension:patient-animal","path":"Patient.extension","sliceName":"patient-animal","min":1,"max":"1","type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/patient-animal"]}]},{"id":"Patient.extension:patient-animal.extension:species","path":"Patient.extension.extension","sliceName":"species"},{"id":"Patient.extension:patient-animal.extension:species.value[x]","path":"Patient.extension.extension.value[x]","binding":{"strength":"example","valueSet":"http://hl7.eu/fhir/base-r5/ValueSet/speciesType-eu"}},{"id":"Patient.extension:recordedSexOrGender","path":"Patient.extension","sliceName":"recordedSexOrGender","min":0,"max":"1","type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/individual-recordedSexOrGender"]}]},{"id":"Patient.telecom","path":"Patient.telecom","short":"Use contact.telecom","comment":"Animals do not have phones, their contacts do. Contact.telecom should be used.","max":"0"},{"id":"Patient.maritalStatus","path":"Patient.maritalStatus","max":"0"}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-Patient-eu-ehic.json b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-Patient-eu-ehic.json new file mode 100644 index 00000000..2abee277 --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-Patient-eu-ehic.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"Patient-eu-ehic","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition Patient-eu-ehic

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Patient Patient
\".\"\".\"\".\" identifier 1..*IdentifierAn identifier for this patient
\".\"\".\"\".\"\".\" system 1..1uriThe namespace for the identifier value
Binding: EHIC Personal ID (system IDs - uri) (extensible)
\".\"\".\"\".\"\".\" value 1..1stringThe value that is unique
\".\"\".\"\".\" name 1..*HumanNameA name associated with the patient
\".\"\".\"\".\"\".\" family 1..1stringEHIC#3 - Name
\".\"\".\"\".\"\".\" given 1..*stringEHIC#4 - Given names
\".\"\".\"\".\" birthDate 1..1dateEHIC#5 - Date of birth

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.eu/fhir/base-r5/StructureDefinition/Patient-eu-ehic","version":"0.1.0-ballot","name":"PatientEhic","title":"Patient (EHIC)","status":"draft","date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"This profile represents the constraints applied to the Patient resource when sed with the EHIC coverage profile.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","fhirVersion":"5.0.0","mapping":[{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"interface","uri":"http://hl7.org/fhir/interface","name":"Interface Pattern"},{"identity":"cda","uri":"http://hl7.org/v3/cda","name":"CDA (R2)"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 V2 Mapping"},{"identity":"loinc","uri":"http://loinc.org","name":"LOINC code for the element"}],"kind":"resource","abstract":false,"type":"Patient","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Patient","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"5.0.0"}],"element":[{"id":"Patient","path":"Patient","short":"Information about an individual or animal receiving health care services","definition":"Demographics and other administrative information about an individual or animal receiving care or other health-related services.","alias":["SubjectOfCare Client Resident"],"min":0,"max":"*","base":{"path":"Patient","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity, Role, or Act,Patient[classCode=PAT]"},{"identity":"w5","map":"administrative.individual"},{"identity":"interface","map":"ParticipantLiving"},{"identity":"cda","map":"ClinicalDocument.recordTarget.patientRole"}]},{"id":"Patient.id","path":"Patient.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Patient.meta","path":"Patient.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Patient.implicitRules","path":"Patient.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of its narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies its meaning or interpretation","isSummary":true},{"id":"Patient.language","path":"Patient.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]}},{"id":"Patient.text","path":"Patient.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have a narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"condition":["dom-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Patient.contained","path":"Patient.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags in their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"condition":["dom-2","dom-4","dom-3","dom-5"],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.extension","path":"Patient.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.modifierExtension","path":"Patient.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.identifier","path":"Patient.identifier","short":"An identifier for this patient","definition":"An identifier for this patient.","requirements":"Patients are almost always assigned specific numerical identifiers.","min":1,"max":"*","base":{"path":"Patient.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"PID-3"},{"identity":"rim","map":"id"},{"identity":"interface","map":"Participant.identifier"},{"identity":"cda","map":".id"}]},{"id":"Patient.identifier.id","path":"Patient.identifier.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.identifier.extension","path":"Patient.identifier.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.identifier.use","path":"Patient.identifier.use","short":"usual | official | temp | secondary | old (If known)","definition":"The purpose of this identifier.","comment":"Applications can assume that an identifier is permanent unless it explicitly says that it is temporary.","requirements":"Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers.","min":0,"max":"1","base":{"path":"Identifier.use","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because applications should not mistake a temporary id for a permanent one.","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"IdentifierUse"}],"strength":"required","description":"Identifies the purpose for this identifier, if known .","valueSet":"http://hl7.org/fhir/ValueSet/identifier-use|5.0.0"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"Role.code or implied by context"}]},{"id":"Patient.identifier.type","path":"Patient.identifier.type","short":"Description of identifier","definition":"A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.","comment":"This element deals only with general categories of identifiers. It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage. Where the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type.","requirements":"Allows users to make use of identifiers when the identifier system is not known.","min":0,"max":"1","base":{"path":"Identifier.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"IdentifierType"}],"strength":"extensible","description":"A coded type for an identifier that can be used to determine which identifier to use for a specific purpose.","valueSet":"http://hl7.org/fhir/ValueSet/identifier-type"},"mapping":[{"identity":"v2","map":"CX.5"},{"identity":"rim","map":"Role.code or implied by context"}]},{"id":"Patient.identifier.system","path":"Patient.identifier.system","short":"The namespace for the identifier value","definition":"Establishes the namespace for the value - that is, an absolute URL that describes a set values that are unique.","comment":"Identifier.system is always case sensitive.","requirements":"There are many sets of identifiers. To perform matching of two identifiers, we need to know what set we're dealing with. The system identifies a particular set of unique identifiers.","min":1,"max":"1","base":{"path":"Identifier.system","min":0,"max":"1"},"type":[{"code":"uri"}],"example":[{"label":"General","valueUri":"http://www.acme.com/identifiers/patient"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","valueSet":"http://hl7.eu/fhir/base-r5/ValueSet/uri-ehicPersonalId"},"mapping":[{"identity":"v2","map":"CX.4 / EI-2-4"},{"identity":"rim","map":"II.root or Role.id.root"},{"identity":"servd","map":"./IdentifierType"}]},{"id":"Patient.identifier.value","path":"Patient.identifier.value","short":"The value that is unique","definition":"The portion of the identifier typically relevant to the user and which is unique within the context of the system.","comment":"If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986. The value's primary purpose is computational mapping. As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.) A value formatted for human display can be conveyed using the [http://hl7.org/fhir/StructureDefinition/rendered-value](http://hl7.org/fhir/extensions/StructureDefinition-rendered-value.html)). Identifier.value is to be treated as case sensitive unless knowledge of the Identifier.system allows the processer to be confident that non-case-sensitive processing is safe.","min":1,"max":"1","base":{"path":"Identifier.value","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"123456"}],"condition":["ident-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.1 / EI.1"},{"identity":"rim","map":"II.extension or II.root if system indicates OID or GUID (Or Role.id.extension or root)"},{"identity":"servd","map":"./Value"}]},{"id":"Patient.identifier.period","path":"Patient.identifier.period","short":"Time period when id is/was valid for use","definition":"Time period during which identifier is/was valid for use.","min":0,"max":"1","base":{"path":"Identifier.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.7 + CX.8"},{"identity":"rim","map":"Role.effectiveTime or implied by context"},{"identity":"servd","map":"./StartDate and ./EndDate"}]},{"id":"Patient.identifier.assigner","path":"Patient.identifier.assigner","short":"Organization that issued id (may be just text)","definition":"Organization that issued/manages the identifier.","comment":"The Identifier.assigner may omit the .reference element and only contain a .display element reflecting the name or other textual information about the assigning organization.","min":0,"max":"1","base":{"path":"Identifier.assigner","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.4 / (CX.4,CX.9,CX.10)"},{"identity":"rim","map":"II.assigningAuthorityName but note that this is an improper use by the definition of the field. Also Role.scoper"},{"identity":"servd","map":"./IdentifierIssuingAuthority"}]},{"id":"Patient.active","path":"Patient.active","short":"Whether this patient's record is in active use","definition":"Whether this patient record is in active use. \nMany systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules.\n\nIt is often used to filter patient lists to exclude inactive patients\n\nDeceased patients may also be marked as inactive for the same reasons, but may be active for some time after death.","comment":"If a record is inactive, and linked to an active record, then future patient/record updates should occur on the other patient.","requirements":"Need to be able to mark a patient record as not to be used because it was created in error.","min":0,"max":"1","base":{"path":"Patient.active","min":0,"max":"1"},"type":[{"code":"boolean"}],"meaningWhenMissing":"This resource is generally assumed to be active if no value is provided for the active element","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that can indicate that a record should not be treated as valid","isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":"statusCode"},{"identity":"interface","map":"Participant.active"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.name","path":"Patient.name","short":"A name associated with the patient","definition":"A name associated with the individual.","comment":"A patient may have multiple names with different uses or applicable periods. For animals, the name is a \"HumanName\" in the sense that is assigned and used by humans and has the same patterns. Animal names may be communicated as given names, and optionally may include a family name.","requirements":"Need to be able to track the patient by multiple names. Examples are your official name and a partner name.","min":1,"max":"*","base":{"path":"Patient.name","min":0,"max":"*"},"type":[{"code":"HumanName"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-5, PID-9"},{"identity":"rim","map":"name"},{"identity":"interface","map":"Participant.name"},{"identity":"cda","map":".patient.name"}]},{"id":"Patient.name.id","path":"Patient.name.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.name.extension","path":"Patient.name.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.name.use","path":"Patient.name.use","short":"usual | official | temp | nickname | anonymous | old | maiden","definition":"Identifies the purpose for this name.","comment":"Applications can assume that a name is current unless it explicitly says that it is temporary or old.","requirements":"Allows the appropriate name for a particular context of use to be selected from among a set of names.","min":0,"max":"1","base":{"path":"HumanName.use","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because applications should not mistake a temporary or old name etc.for a current/permanent one","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"NameUse"}],"strength":"required","description":"The use of a human name.","valueSet":"http://hl7.org/fhir/ValueSet/name-use|5.0.0"},"mapping":[{"identity":"v2","map":"XPN.7, but often indicated by which field contains the name"},{"identity":"rim","map":"unique(./use)"},{"identity":"servd","map":"./NamePurpose"}]},{"id":"Patient.name.text","path":"Patient.name.text","short":"Text representation of the full name","definition":"Specifies the entire name as it should be displayed e.g. on an application UI. This may be provided instead of or as well as the specific parts.","comment":"Can provide both a text representation and parts. Applications updating a name SHALL ensure that when both text and parts are present, no content is included in the text that isn't found in a part.","requirements":"A renderable, unencoded form.","min":0,"max":"1","base":{"path":"HumanName.text","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"implied by XPN.11"},{"identity":"rim","map":"./formatted"}]},{"id":"Patient.name.family","path":"Patient.name.family","short":"EHIC#3 - Name","definition":"Forename of the card holder","comment":"Family Name may be decomposed into specific parts using extensions (de, nl, es related cultures).","alias":["surname"],"min":1,"max":"1","base":{"path":"HumanName.family","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.1/FN.1"},{"identity":"rim","map":"./part[partType = FAM]"},{"identity":"servd","map":"./FamilyName"}]},{"id":"Patient.name.given","path":"Patient.name.given","short":"EHIC#4 - Given names","definition":"Surname of the card holder","comment":"If only initials are recorded, they may be used in place of the full name parts. Initials may be separated into multiple given names but often aren't due to paractical limitations. This element is not called \"first name\" since given names do not always come first.","alias":["first name","middle name"],"min":1,"max":"*","base":{"path":"HumanName.given","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"Given Names appear in the correct order for presenting the name","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.2 + XPN.3"},{"identity":"rim","map":"./part[partType = GIV]"},{"identity":"servd","map":"./GivenNames"}]},{"id":"Patient.name.prefix","path":"Patient.name.prefix","short":"Parts that come before the name","definition":"Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.","min":0,"max":"*","base":{"path":"HumanName.prefix","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"Prefixes appear in the correct order for presenting the name","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.5"},{"identity":"rim","map":"./part[partType = PFX]"},{"identity":"servd","map":"./TitleCode"}]},{"id":"Patient.name.suffix","path":"Patient.name.suffix","short":"Parts that come after the name","definition":"Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.","min":0,"max":"*","base":{"path":"HumanName.suffix","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"Suffixes appear in the correct order for presenting the name","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN/4"},{"identity":"rim","map":"./part[partType = SFX]"}]},{"id":"Patient.name.period","path":"Patient.name.period","short":"Time period when name was/is in use","definition":"Indicates the period of time when this name was valid for the named person.","requirements":"Allows names to be placed in historical context.","min":0,"max":"1","base":{"path":"HumanName.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.13 + XPN.14"},{"identity":"rim","map":"./usablePeriod[type=\"IVL\"]"},{"identity":"servd","map":"./StartDate and ./EndDate"}]},{"id":"Patient.telecom","path":"Patient.telecom","short":"A contact detail for the individual","definition":"A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.","comment":"A Patient may have multiple ways to be contacted with different uses or applicable periods. May need to have options for contacting the person urgently and also to help with identification. The address might not go directly to the individual, but may reach another party that is able to proxy for the patient (i.e. home phone, or pet owner's phone).","requirements":"People have (primary) ways to contact them in some way such as phone, email.","min":0,"max":"*","base":{"path":"Patient.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-13, PID-14, PID-40"},{"identity":"rim","map":"telecom"},{"identity":"interface","map":"ParticipantContactable.telecom"},{"identity":"cda","map":".telecom"}]},{"id":"Patient.gender","path":"Patient.gender","short":"male | female | other | unknown","definition":"Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.","comment":"The gender might not match the biological sex as determined by genetics or the individual's preferred identification. Note that for both humans and particularly animals, there are other legitimate possibilities than male and female, though the vast majority of systems and contexts only support male and female. Systems providing decision support or enforcing business rules should ideally do this on the basis of Observations dealing with the specific sex or gender aspect of interest (anatomical, chromosomal, social, etc.) However, because these observations are infrequently recorded, defaulting to the administrative gender is common practice. Where such defaulting occurs, rule enforcement should allow for the variation between administrative and biological, chromosomal and other gender aspects. For example, an alert about a hysterectomy on a male should be handled as a warning or overridable error, not a \"hard\" error. See the Patient Gender and Sex section for additional information about communicating patient gender and sex.","requirements":"Needed for identification of the individual, in combination with (at least) name and birth date.","min":0,"max":"1","base":{"path":"Patient.gender","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AdministrativeGender"}],"strength":"required","description":"The gender of a person used for administrative purposes.","valueSet":"http://hl7.org/fhir/ValueSet/administrative-gender|5.0.0"},"mapping":[{"identity":"v2","map":"PID-8"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/administrativeGender"},{"identity":"interface","map":"ParticipantLiving.gender"},{"identity":"cda","map":".patient.administrativeGenderCode"}]},{"id":"Patient.birthDate","path":"Patient.birthDate","short":"EHIC#5 - Date of birth","definition":"Date of birth of the card holder","comment":"Partial dates are allowed if the specific date of birth is unknown. There is a standard extension \"patient-birthTime\" available that should be used where Time is required (such as in maternity/infant care systems).","requirements":"Age of the individual drives many clinical processes.","min":1,"max":"1","base":{"path":"Patient.birthDate","min":0,"max":"1"},"type":[{"code":"date"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-7"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/birthTime"},{"identity":"interface","map":"ParticipantLiving.birthDate"},{"identity":"cda","map":".patient.birthTime"},{"identity":"loinc","map":"21112-8"}]},{"id":"Patient.deceased[x]","path":"Patient.deceased[x]","short":"Indicates if the individual is deceased or not","definition":"Indicates if the individual is deceased or not.","comment":"If there's no value in the instance, it means there is no statement on whether or not the individual is deceased. Most systems will interpret the absence of a value as a sign of the person being alive.","requirements":"The fact that a patient is deceased influences the clinical process. Also, in human communication and relation management it is necessary to know whether the person is alive.","min":0,"max":"1","base":{"path":"Patient.deceased[x]","min":0,"max":"1"},"type":[{"code":"boolean"},{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because once a patient is marked as deceased, the actions that are appropriate to perform on the patient may be significantly different.","isSummary":true,"mapping":[{"identity":"v2","map":"PID-30 (bool) and PID-29 (datetime)"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/deceasedInd, player[classCode=PSN|ANM and determinerCode=INSTANCE]/deceasedTime"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.address","path":"Patient.address","short":"An address for the individual","definition":"An address for the individual.","comment":"Patient may have multiple addresses with different uses or applicable periods.","requirements":"May need to keep track of patient addresses for contacting, billing or reporting requirements and also to help with identification.","min":0,"max":"*","base":{"path":"Patient.address","min":0,"max":"*"},"type":[{"code":"Address"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-11"},{"identity":"rim","map":"addr"},{"identity":"interface","map":"ParticipantContactable.address"},{"identity":"cda","map":".addr"}]},{"id":"Patient.maritalStatus","path":"Patient.maritalStatus","short":"Marital (civil) status of a patient","definition":"This field contains a patient's most recent marital (civil) status.","requirements":"Most, if not all systems capture it.","min":0,"max":"1","base":{"path":"Patient.maritalStatus","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MaritalStatus"}],"strength":"extensible","description":"The domestic partnership status of a person.","valueSet":"http://hl7.org/fhir/ValueSet/marital-status"},"mapping":[{"identity":"v2","map":"PID-16"},{"identity":"rim","map":"player[classCode=PSN]/maritalStatusCode"},{"identity":"cda","map":".patient.maritalStatusCode"}]},{"id":"Patient.multipleBirth[x]","path":"Patient.multipleBirth[x]","short":"Whether patient is part of a multiple birth","definition":"Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).","comment":"Where the valueInteger is provided, the number is the birth number in the sequence. E.g. The middle birth in triplets would be valueInteger=2 and the third born would have valueInteger=3 If a boolean value was provided for this triplets example, then all 3 patient records would have valueBoolean=true (the ordering is not indicated).","requirements":"For disambiguation of multiple-birth children, especially relevant where the care provider doesn't meet the patient, such as labs.","min":0,"max":"1","base":{"path":"Patient.multipleBirth[x]","min":0,"max":"1"},"type":[{"code":"boolean"},{"code":"integer"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PID-24 (bool), PID-25 (integer)"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/multipleBirthInd, player[classCode=PSN|ANM and determinerCode=INSTANCE]/multipleBirthOrderNumber"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.photo","path":"Patient.photo","short":"Image of the patient","definition":"Image of the patient.","comment":"Guidelines:\n* Use id photos, not clinical photos.\n* Limit dimensions to thumbnail.\n* Keep byte count low to ease resource updates.","requirements":"Many EHR systems have the capability to capture an image of the patient. Fits with newer social media usage too.","min":0,"max":"*","base":{"path":"Patient.photo","min":0,"max":"*"},"type":[{"code":"Attachment"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-5 - needs a profile"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/desc"},{"identity":"interface","map":"ParticipantLiving.photo"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact","path":"Patient.contact","short":"A contact party (e.g. guardian, partner, friend) for the patient","definition":"A contact party (e.g. guardian, partner, friend) for the patient.","comment":"Contact covers all kinds of contact parties: family members, business contacts, guardians, caregivers. Not applicable to register pedigree and family ties beyond use of having contact.","requirements":"Need to track people you can contact about the patient.","min":0,"max":"*","base":{"path":"Patient.contact","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"pat-1","severity":"error","human":"SHALL at least contain a contact's details or a reference to an organization","expression":"name.exists() or telecom.exists() or address.exists() or organization.exists()","source":"http://hl7.org/fhir/StructureDefinition/Patient"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/scopedRole[classCode=CON]"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.id","path":"Patient.contact.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.contact.extension","path":"Patient.contact.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.contact.modifierExtension","path":"Patient.contact.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.contact.relationship","path":"Patient.contact.relationship","short":"The kind of relationship","definition":"The nature of the relationship between the patient and the contact person.","requirements":"Used to determine which contact person is the most relevant to approach, depending on circumstances.","min":0,"max":"*","base":{"path":"Patient.contact.relationship","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ContactRelationship"}],"strength":"extensible","description":"The nature of the relationship between a patient and a contact person for that patient.","valueSet":"http://hl7.org/fhir/ValueSet/patient-contactrelationship"},"mapping":[{"identity":"v2","map":"NK1-7, NK1-3"},{"identity":"rim","map":"code"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.name","path":"Patient.contact.name","short":"A name associated with the contact person","definition":"A name associated with the contact person.","requirements":"Contact persons need to be identified by name, but it is uncommon to need details about multiple other names for that contact person.","min":0,"max":"1","base":{"path":"Patient.contact.name","min":0,"max":"1"},"type":[{"code":"HumanName"}],"condition":["pat-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-2"},{"identity":"rim","map":"name"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.telecom","path":"Patient.contact.telecom","short":"A contact detail for the person","definition":"A contact detail for the person, e.g. a telephone number or an email address.","comment":"Contact may have multiple ways to be contacted with different uses or applicable periods. May need to have options for contacting the person urgently, and also to help with identification.","requirements":"People have (primary) ways to contact them in some way such as phone, email.","min":0,"max":"*","base":{"path":"Patient.contact.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"condition":["pat-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-5, NK1-6, NK1-40"},{"identity":"rim","map":"telecom"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.address","path":"Patient.contact.address","short":"Address for the contact person","definition":"Address for the contact person.","requirements":"Need to keep track where the contact person can be contacted per postal mail or visited.","min":0,"max":"1","base":{"path":"Patient.contact.address","min":0,"max":"1"},"type":[{"code":"Address"}],"condition":["pat-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-4"},{"identity":"rim","map":"addr"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.gender","path":"Patient.contact.gender","short":"male | female | other | unknown","definition":"Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.","requirements":"Needed to address the person correctly.","min":0,"max":"1","base":{"path":"Patient.contact.gender","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AdministrativeGender"}],"strength":"required","description":"The gender of a person used for administrative purposes.","valueSet":"http://hl7.org/fhir/ValueSet/administrative-gender|5.0.0"},"mapping":[{"identity":"v2","map":"NK1-15"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/administrativeGender"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.organization","path":"Patient.contact.organization","short":"Organization that is associated with the contact","definition":"Organization on behalf of which the contact is acting or for which the contact is working.","requirements":"For guardians or business related contacts, the organization is relevant.","min":0,"max":"1","base":{"path":"Patient.contact.organization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"condition":["pat-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-13, NK1-30, NK1-31, NK1-32, NK1-41"},{"identity":"rim","map":"scoper"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.period","path":"Patient.contact.period","short":"The period during which this contact person or organization is valid to be contacted relating to this patient","definition":"The period during which this contact person or organization is valid to be contacted relating to this patient.","min":0,"max":"1","base":{"path":"Patient.contact.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"effectiveTime"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.communication","path":"Patient.communication","short":"A language which may be used to communicate with the patient about his or her health","definition":"A language which may be used to communicate with the patient about his or her health.","comment":"If no language is specified, this *implies* that the default local language is spoken. If you need to convey proficiency for multiple modes, then you need multiple Patient.Communication associations. For animals, language is not a relevant field, and should be absent from the instance. If the Patient does not speak the default local language, then the Interpreter Required Standard can be used to explicitly declare that an interpreter is required.","requirements":"If a patient does not speak the local language, interpreters may be required, so languages spoken and proficiency are important things to keep track of both for patient and other persons of interest.","min":0,"max":"*","base":{"path":"Patient.communication","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"LanguageCommunication"},{"identity":"interface","map":"ParticipantLiving.communication"},{"identity":"cda","map":"patient.languageCommunication"}]},{"id":"Patient.communication.id","path":"Patient.communication.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.communication.extension","path":"Patient.communication.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.communication.modifierExtension","path":"Patient.communication.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.communication.language","path":"Patient.communication.language","short":"The language which can be used to communicate with the patient about his or her health","definition":"The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-AU\" for Australian English.","comment":"The structure aa-BB with this exact casing is one the most widely used notations for locale. However not all systems actually code this but instead have it as free text. Hence CodeableConcept instead of code as the data type.","requirements":"Most systems in multilingual countries will want to convey language. Not all systems actually need the regional dialect.","min":1,"max":"1","base":{"path":"Patient.communication.language","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]},"mapping":[{"identity":"v2","map":"PID-15, LAN-2"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/languageCommunication/code"},{"identity":"cda","map":".languageCode"}]},{"id":"Patient.communication.preferred","path":"Patient.communication.preferred","short":"Language preference indicator","definition":"Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).","comment":"This language is specifically identified for communicating healthcare information.","requirements":"People that master multiple languages up to certain level may prefer one or more, i.e. feel more confident in communicating in a particular language making other languages sort of a fall back method.","min":0,"max":"1","base":{"path":"Patient.communication.preferred","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PID-15"},{"identity":"rim","map":"preferenceInd"},{"identity":"cda","map":".preferenceInd"}]},{"id":"Patient.generalPractitioner","path":"Patient.generalPractitioner","short":"Patient's nominated primary care provider","definition":"Patient's nominated care provider.","comment":"This may be the primary care provider (in a GP context), or it may be a patient nominated care manager in a community/disability setting, or even organization that will provide people to perform the care provider roles. It is not to be used to record Care Teams, these should be in a CareTeam resource that may be linked to the CarePlan or EpisodeOfCare resources.\nMultiple GPs may be recorded against the patient for various reasons, such as a student that has his home GP listed along with the GP at university during the school semesters, or a \"fly-in/fly-out\" worker that has the onsite GP also included with his home GP to remain aware of medical issues.\n\nJurisdictions may decide that they can profile this down to 1 if desired, or 1 per type.","alias":["careProvider"],"min":0,"max":"*","base":{"path":"Patient.generalPractitioner","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization","http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PD1-4"},{"identity":"rim","map":"subjectOf.CareEvent.performer.AssignedEntity"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.managingOrganization","path":"Patient.managingOrganization","short":"Organization that is the custodian of the patient record","definition":"Organization that is the custodian of the patient record.","comment":"There is only one managing organization for a specific patient record. Other organizations will have their own Patient record, and may use the Link property to join the records together (or a Person resource which can include confidence ratings for the association).","requirements":"Need to know who recognizes this patient record, manages and updates it.","min":0,"max":"1","base":{"path":"Patient.managingOrganization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"scoper"},{"identity":"cda","map":".providerOrganization"}]},{"id":"Patient.link","path":"Patient.link","short":"Link to a Patient or RelatedPerson resource that concerns the same actual individual","definition":"Link to a Patient or RelatedPerson resource that concerns the same actual individual.","comment":"There is no assumption that linked patient records have mutual links.","requirements":"There are multiple use cases: \n\n* Duplicate patient records due to the clerical errors associated with the difficulties of identifying humans consistently, and \n* Distribution of patient information across multiple servers.","min":0,"max":"*","base":{"path":"Patient.link","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because it might not be the main Patient resource, and the referenced patient should be used instead of this Patient record. This is when the link.type value is 'replaced-by'","isSummary":true,"mapping":[{"identity":"rim","map":"outboundLink"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.link.id","path":"Patient.link.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.link.extension","path":"Patient.link.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.link.modifierExtension","path":"Patient.link.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.link.other","path":"Patient.link.other","short":"The other patient or related person resource that the link refers to","definition":"Link to a Patient or RelatedPerson resource that concerns the same actual individual.","comment":"Referencing a RelatedPerson here removes the need to use a Person record to associate a Patient and RelatedPerson as the same individual.","min":1,"max":"1","base":{"path":"Patient.link.other","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy","valueBoolean":false}],"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-3, MRG-1"},{"identity":"rim","map":"id"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.link.type","path":"Patient.link.type","short":"replaced-by | replaces | refer | seealso","definition":"The type of link between this patient resource and another patient resource.","min":1,"max":"1","base":{"path":"Patient.link.type","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"LinkType"}],"strength":"required","description":"The type of link between this patient resource and another Patient resource, or Patient/RelatedPerson when using the `seealso` code","valueSet":"http://hl7.org/fhir/ValueSet/link-type|5.0.0"},"mapping":[{"identity":"rim","map":"typeCode"},{"identity":"cda","map":"n/a"}]}]},"differential":{"element":[{"id":"Patient.identifier","path":"Patient.identifier","min":1},{"id":"Patient.identifier.system","path":"Patient.identifier.system","min":1,"binding":{"strength":"extensible","valueSet":"http://hl7.eu/fhir/base-r5/ValueSet/uri-ehicPersonalId"}},{"id":"Patient.identifier.value","path":"Patient.identifier.value","min":1},{"id":"Patient.name","path":"Patient.name","min":1},{"id":"Patient.name.family","path":"Patient.name.family","short":"EHIC#3 - Name","definition":"Forename of the card holder","min":1},{"id":"Patient.name.given","path":"Patient.name.given","short":"EHIC#4 - Given names","definition":"Surname of the card holder","min":1},{"id":"Patient.birthDate","path":"Patient.birthDate","short":"EHIC#5 - Date of birth","definition":"Date of birth of the card holder","min":1}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-location-eu.json b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-location-eu.json new file mode 100644 index 00000000..ef2f6011 --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-location-eu.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"location-eu","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition location-eu

\r\n\r\n\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Location 0..*LocationDetails and position information for a place
\".\"\".\"\".\" name 0..1stringLocation name
\".\"\".\"\".\" type 0..*CodeableConceptLocation type
\".\"\".\"\".\" contact
\".\"\".\"\".\"\".\" telecom 0..*ContactPointLocation telecom
\".\"\".\"\".\" address 0..1AddressEuPhysical location

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.eu/fhir/base-r5/StructureDefinition/location-eu","version":"0.1.0-ballot","name":"LocationEu","title":"Location (EU base)","status":"draft","date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"This profile sets minimum expectations for the Location resource to be used for the purpose of this guide.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","fhirVersion":"5.0.0","mapping":[{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"interface","uri":"http://hl7.org/fhir/interface","name":"Interface Pattern"}],"kind":"resource","abstract":false,"type":"Location","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Location","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"5.0.0"}],"element":[{"id":"Location","path":"Location","short":"Details and position information for a place","definition":"Details and position information for a place where services are provided and resources and participants may be stored, found, contained, or accommodated.","min":0,"max":"*","base":{"path":"Location","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity, Role, or Act,.Role[classCode=SDLC]"},{"identity":"w5","map":"administrative.entity"},{"identity":"interface","map":"ParticipantContactable"}]},{"id":"Location.id","path":"Location.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Location.meta","path":"Location.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Location.implicitRules","path":"Location.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of its narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies its meaning or interpretation","isSummary":true},{"id":"Location.language","path":"Location.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]}},{"id":"Location.text","path":"Location.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have a narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"condition":["dom-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Location.contained","path":"Location.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags in their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"condition":["dom-2","dom-4","dom-3","dom-5"],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Location.extension","path":"Location.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Location.modifierExtension","path":"Location.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Location.identifier","path":"Location.identifier","short":"Unique code or number identifying the location to its users","definition":"Unique code or number identifying the location to its users.","requirements":"Organization label locations in registries, need to keep track of those.","min":0,"max":"*","base":{"path":"Location.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"rim","map":".id"},{"identity":"interface","map":"Participant.identifier"}]},{"id":"Location.status","path":"Location.status","short":"active | suspended | inactive","definition":"The status property covers the general availability of the resource, not the current value which may be covered by the operationStatus, or by a schedule/slots if they are configured for the location.","min":0,"max":"1","base":{"path":"Location.status","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"LocationStatus"}],"strength":"required","description":"Indicates whether the location is still in use.","valueSet":"http://hl7.org/fhir/ValueSet/location-status|5.0.0"},"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":".statusCode"},{"identity":"interface","map":"Participant.active"}]},{"id":"Location.operationalStatus","path":"Location.operationalStatus","short":"The operational status of the location (typically only for a bed/room)","definition":"The operational status covers operation values most relevant to beds (but can also apply to rooms/units/chairs/etc. such as an isolation unit/dialysis chair). This typically covers concepts such as contamination, housekeeping, and other activities like maintenance.","min":0,"max":"1","base":{"path":"Location.operationalStatus","min":0,"max":"1"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"OperationalStatus"}],"strength":"preferred","description":"The operational status if the location (where typically a bed/room).","valueSet":"http://terminology.hl7.org/ValueSet/v2-0116"},"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":"n/a"}]},{"id":"Location.name","path":"Location.name","short":"Location name","definition":"Name of the location as used by humans. Does not need to be unique.","comment":"If the name of a location changes, consider putting the old name in the alias column so that it can still be located through searches.","min":0,"max":"1","base":{"path":"Location.name","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".name"},{"identity":"interface","map":"Participant.name"}]},{"id":"Location.alias","path":"Location.alias","short":"A list of alternate names that the location is known as, or was known as, in the past","definition":"A list of alternate names that the location is known as, or was known as, in the past.","comment":"There are no dates associated with the alias/historic names, as this is not intended to track when names were used, but to assist in searching so that older names can still result in identifying the location.","requirements":"Over time locations and organizations go through many changes and can be known by different names.\n\nFor searching knowing previous names that the location was known by can be very useful.","min":0,"max":"*","base":{"path":"Location.alias","min":0,"max":"*"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".name"}]},{"id":"Location.description","path":"Location.description","short":"Additional details about the location that could be displayed as further information to identify the location beyond its name","definition":"Description of the Location, which helps in finding or referencing the place.","requirements":"Humans need additional information to verify a correct location has been identified.","min":0,"max":"1","base":{"path":"Location.description","min":0,"max":"1"},"type":[{"code":"markdown"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".playingEntity[classCode=PLC determinerCode=INSTANCE].desc"}]},{"id":"Location.mode","path":"Location.mode","short":"instance | kind","definition":"Indicates whether a resource instance represents a specific location or a class of locations.","comment":"This is labeled as a modifier because whether or not the location is a class of locations changes how it can be used and understood.","requirements":"When using a Location resource for scheduling or orders, we need to be able to refer to a class of Locations instead of a specific Location.","min":0,"max":"1","base":{"path":"Location.mode","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"LocationMode"}],"strength":"required","description":"Indicates whether a resource instance represents a specific location or a class of locations.","valueSet":"http://hl7.org/fhir/ValueSet/location-mode|5.0.0"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".playingEntity[classCode=PLC].determinerCode"}]},{"id":"Location.type","path":"Location.type","short":"Location type","definition":"Indicates the type of function performed at the location.","min":0,"max":"*","base":{"path":"Location.type","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"LocationType"}],"strength":"extensible","description":"Indicates the type of function performed at the location.","valueSet":"http://terminology.hl7.org/ValueSet/v3-ServiceDeliveryLocationRoleType"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".code"}]},{"id":"Location.contact","path":"Location.contact","short":"Official contact details for the location","definition":"The contact details of communication devices available at the location. This can include addresses, phone numbers, fax numbers, mobile numbers, email addresses and web sites.","comment":"The address/telecom use code 'home' are not to be used. Note that these contacts are not the contact details of people who provide the service (that would be through PractitionerRole), these are official contacts for the Healthcare itself for specific purposes. E.g. Mailing Addresses, Billing Addresses, Contact numbers for Booking or Billing Enquiries, general web address, web address for online bookings etc.\n\nIf this is empty (or the type of interest is empty), refer to the organization's contacts.","requirements":"Need to keep track of both simple contact details and also assigned contacts within larger organizations.","min":0,"max":"*","base":{"path":"Location.contact","min":0,"max":"*"},"type":[{"code":"ExtendedContactDetail"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".telecom and .addr and other .role(relevant datatype properties mapped from role into extendedcontactdetail)"}]},{"id":"Location.contact.id","path":"Location.contact.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Location.contact.extension","path":"Location.contact.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Location.contact.purpose","path":"Location.contact.purpose","short":"The type of contact","definition":"The purpose/type of contact.","comment":"If no purpose is defined, then these contact details may be used for any purpose.","min":0,"max":"1","base":{"path":"ExtendedContactDetail.purpose","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Purpose"}],"strength":"preferred","description":"The purpose for which an extended contact detail should be used.","valueSet":"http://terminology.hl7.org/ValueSet/contactentity-type"}},{"id":"Location.contact.name","path":"Location.contact.name","short":"Name of an individual to contact","definition":"The name of an individual to contact, some types of contact detail are usually blank.","comment":"If there is no named individual, the telecom/address information is not generally monitored by a specific individual.","min":0,"max":"*","base":{"path":"ExtendedContactDetail.name","min":0,"max":"*"},"type":[{"code":"HumanName"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Location.contact.telecom","path":"Location.contact.telecom","short":"Location telecom","definition":"The contact details application for the purpose defined.","min":0,"max":"*","base":{"path":"ExtendedContactDetail.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Location.contact.address","path":"Location.contact.address","short":"Address for the contact","definition":"Address for the contact.","comment":"More than 1 address would be for different purposes, and thus should be entered as a different entry,.","min":0,"max":"1","base":{"path":"ExtendedContactDetail.address","min":0,"max":"1"},"type":[{"code":"Address"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Location.contact.organization","path":"Location.contact.organization","short":"This contact detail is handled/monitored by a specific organization","definition":"This contact detail is handled/monitored by a specific organization. If the name is provided in the contact, then it is referring to the named individual within this organization.","requirements":"Some specific types of contact information can be an handled by an organization (eg legal council is via a specific firm).","min":0,"max":"1","base":{"path":"ExtendedContactDetail.organization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Location.contact.period","path":"Location.contact.period","short":"Period that this contact was valid for usage","definition":"Period that this contact was valid for usage.","comment":"If the details have multiple periods, then enter in a new ExtendedContact with the new period.","min":0,"max":"1","base":{"path":"ExtendedContactDetail.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Location.address","path":"Location.address","short":"Physical location","definition":"Physical location.","comment":"Additional addresses should be recorded using another instance of the Location resource, or via the Organization.","requirements":"If locations can be visited, we need to keep track of their address.","min":0,"max":"1","base":{"path":"Location.address","min":0,"max":"1"},"type":[{"code":"Address","profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".addr"},{"identity":"interface","map":"ParticipantContactable.address"}]},{"id":"Location.form","path":"Location.form","short":"Physical form of the location","definition":"Physical form of the location, e.g. building, room, vehicle, road, virtual.","requirements":"For purposes of showing relevant locations in queries, we need to categorize locations.","min":0,"max":"1","base":{"path":"Location.form","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"LocationForm"}],"strength":"example","description":"Physical form of the location.","valueSet":"http://hl7.org/fhir/ValueSet/location-form"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".playingEntity [classCode=PLC].code"}]},{"id":"Location.position","path":"Location.position","short":"The absolute geographic location","definition":"The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML).","comment":"To define a boundary shape for this location use the standard extension `[http://hl7.org/fhir/StructureDefinition/location-boundary-geojson](http://hl7.org/fhir/extensions/StructureDefinition-location-boundary-geojson.html)`, and search using the `contains` special search parameter.","requirements":"For mobile applications and automated route-finding knowing the exact location of the Location is required.","min":0,"max":"1","base":{"path":"Location.position","min":0,"max":"1"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".playingEntity [classCode=PLC determinerCode=INSTANCE].positionText"}]},{"id":"Location.position.id","path":"Location.position.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Location.position.extension","path":"Location.position.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Location.position.modifierExtension","path":"Location.position.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Location.position.longitude","path":"Location.position.longitude","short":"Longitude with WGS84 datum","definition":"Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes on Location main page).","min":1,"max":"1","base":{"path":"Location.position.longitude","min":1,"max":"1"},"type":[{"code":"decimal"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"(RIM Opted not to map the sub-elements of GPS location, is now an OBS)"}]},{"id":"Location.position.latitude","path":"Location.position.latitude","short":"Latitude with WGS84 datum","definition":"Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes on Location main page).","min":1,"max":"1","base":{"path":"Location.position.latitude","min":1,"max":"1"},"type":[{"code":"decimal"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"(RIM Opted not to map the sub-elements of GPS location, is now an OBS)"}]},{"id":"Location.position.altitude","path":"Location.position.altitude","short":"Altitude with WGS84 datum","definition":"Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes on Location main page).","min":0,"max":"1","base":{"path":"Location.position.altitude","min":0,"max":"1"},"type":[{"code":"decimal"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"(RIM Opted not to map the sub-elements of GPS location, is now an OBS)"}]},{"id":"Location.managingOrganization","path":"Location.managingOrganization","short":"Organization responsible for provisioning and upkeep","definition":"The organization responsible for the provisioning and upkeep of the location.","comment":"This can also be used as the part of the organization hierarchy where this location provides services. These services can be defined through the HealthcareService resource.","requirements":"Need to know who manages the location.","min":0,"max":"1","base":{"path":"Location.managingOrganization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".scopingEntity[classCode=ORG determinerKind=INSTANCE]"}]},{"id":"Location.partOf","path":"Location.partOf","short":"Another Location this one is physically a part of","definition":"Another Location of which this Location is physically a part of.","requirements":"For purposes of location, display and identification, knowing which locations are located within other locations is important.","min":0,"max":"1","base":{"path":"Location.partOf","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy","valueBoolean":true}],"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Location"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".inboundLink[typeCode=PART].source[classCode=SDLOC]"}]},{"id":"Location.characteristic","path":"Location.characteristic","short":"Collection of characteristics (attributes)","definition":"Collection of characteristics (attributes).","comment":"These could be such things as is wheelchair accessible.","min":0,"max":"*","base":{"path":"Location.characteristic","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"LocationCharacteristic"}],"strength":"example","description":"A custom attribute that could be provided at a service (e.g. Wheelchair accessibiliy).","valueSet":"http://hl7.org/fhir/ValueSet/location-characteristic"},"mapping":[{"identity":"rim","map":".actrelationship[typeCode=PERT].observation"}]},{"id":"Location.hoursOfOperation","path":"Location.hoursOfOperation","short":"What days/times during a week is this location usually open (including exceptions)","definition":"What days/times during a week is this location usually open, and any exceptions where the location is not available.","comment":"This type of information is commonly found published in directories and on websites informing customers when the facility is available.\n\nSpecific services within the location may have their own hours which could be shorter (or longer) than the locations hours.\n\nSystems may choose to render availability differently than it is exchanged on the interface. For example, rather than \"Mon, Tue, Wed, Thur, Fri from 9am-12am; Mon, Tue, Wed, Thur, Fri from 1pm-5pm\" as would be implied by two availableTime repetitions, an application could render this information as \"Mon-Fri 9-12am and 1-5pm\".\r\rThe availableStartTime is the opening time, and the availableEndTime is the closing time.","min":0,"max":"*","base":{"path":"Location.hoursOfOperation","min":0,"max":"*"},"type":[{"code":"Availability"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"Location.virtualService","path":"Location.virtualService","short":"Connection details of a virtual service (e.g. conference call)","definition":"Connection details of a virtual service (e.g. shared conference call facility with dedicated number/details).","comment":"There are two types of virtual meetings that often exist:\r\r* a persistent, virtual meeting room that can only be used for a single purpose at a time,\r * and a dynamic virtual meeting room that is generated on demand for a specific purpose.\r\r Implementers may consider using Appointment.virtualService for virtual meeting rooms that are generated on-demand.","min":0,"max":"*","base":{"path":"Location.virtualService","min":0,"max":"*"},"type":[{"code":"VirtualServiceDetail"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Location.endpoint","path":"Location.endpoint","short":"Technical endpoints providing access to services operated for the location","definition":"Technical endpoints providing access to services operated for the location.","requirements":"Organizations may have different systems at different locations that provide various services and need to be able to define the technical connection details for how to connect to them, and for what purpose.","min":0,"max":"*","base":{"path":"Location.endpoint","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Endpoint"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]}]},"differential":{"element":[{"id":"Location","path":"Location"},{"id":"Location.name","path":"Location.name","short":"Location name"},{"id":"Location.type","path":"Location.type","short":"Location type"},{"id":"Location.contact.telecom","path":"Location.contact.telecom","short":"Location telecom"},{"id":"Location.address","path":"Location.address","type":[{"code":"Address","profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu"]}]}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-organization-eu-core.json b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-organization-eu-core.json new file mode 100644 index 00000000..7d5983ec --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-organization-eu-core.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"organization-eu-core","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition organization-eu-core

\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Organization 0..*OrganizationEuA grouping of people or organizations with a common purpose
\".\"\".\"\".\" name 1..1stringName of the organization
\".\"\".\"\".\" partOf 0..1Reference(Organization (EU core))The organization of which this organization is part of: e.g. an ERN

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu-core","version":"0.1.0-ballot","name":"OrganizationEuCore","title":"Organization (EU core)","status":"draft","date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"This profile sets minimum expectations for the Organization resource common to most of the use cases.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","fhirVersion":"5.0.0","mapping":[{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 V2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"interface","uri":"http://hl7.org/fhir/interface","name":"Interface Pattern"},{"identity":"servd","uri":"http://www.omg.org/spec/ServD/1.0/","name":"ServD"}],"kind":"resource","abstract":false,"type":"Organization","baseDefinition":"http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"0.1.0-ballot"}],"element":[{"id":"Organization","path":"Organization","short":"A grouping of people or organizations with a common purpose","definition":"A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc.","min":0,"max":"*","base":{"path":"Organization","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"org-1","severity":"error","human":"The organization SHALL at least have a name or an identifier, and possibly more than one","expression":"(identifier.count() + name.count()) > 0","source":"http://hl7.org/fhir/StructureDefinition/Organization"},{"key":"name-or-identier","severity":"error","human":"identifier or name SHALL be present","expression":"identifier.exists() or name.exists()","source":"http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity, Role, or Act,Organization(classCode=ORG, determinerCode=INST)"},{"identity":"w5","map":"administrative.group"},{"identity":"v2","map":"(also see master files messages)"},{"identity":"interface","map":"ParticipantContactable"},{"identity":"servd","map":"Organization"}]},{"id":"Organization.id","path":"Organization.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Organization.meta","path":"Organization.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Organization.implicitRules","path":"Organization.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of its narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies its meaning or interpretation","isSummary":true},{"id":"Organization.language","path":"Organization.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]}},{"id":"Organization.text","path":"Organization.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have a narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"condition":["dom-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Organization.contained","path":"Organization.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags in their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"condition":["dom-2","dom-4","dom-3","dom-5"],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Organization.extension","path":"Organization.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Organization.modifierExtension","path":"Organization.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Organization.identifier","path":"Organization.identifier","short":"Identifies this organization across multiple systems","definition":"Identifier for the organization that is used to identify the organization across multiple disparate systems.","requirements":"Organizations are known by a variety of ids. Some institutions maintain several, and most collect identifiers for exchange with other organizations concerning the organization.","min":0,"max":"*","base":{"path":"Organization.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"condition":["org-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"XON.10 / XON.3"},{"identity":"rim","map":".scopes[Role](classCode=IDENT)"},{"identity":"interface","map":"Participant.identifier"},{"identity":"servd","map":"./Identifiers"}]},{"id":"Organization.active","path":"Organization.active","short":"Whether the organization's record is still in active use","definition":"Whether the organization's record is still in active use.","comment":"This active flag is not intended to be used to mark an organization as temporarily closed or under construction. Instead the Location(s) within the Organization should have the suspended status. If further details of the reason for the suspension are required, then an extension on this element should be used.\n\nThis element is labeled as a modifier because it may be used to mark that the resource was created in error.","requirements":"Need a flag to indicate a record is no longer to be used and should generally be hidden for the user in the UI.","min":0,"max":"1","base":{"path":"Organization.active","min":0,"max":"1"},"type":[{"code":"boolean"}],"meaningWhenMissing":"This resource is generally assumed to be active if no value is provided for the active element","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that can indicate that a record should not be treated as valid","isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"v2","map":"No equivalent in HL7 V2"},{"identity":"rim","map":".status"},{"identity":"interface","map":"Participant.active"},{"identity":"servd","map":"./Status (however this concept in ServD more covers why the organization is active or not, could be delisted, deregistered, not operational yet) this could alternatively be derived from ./StartDate and ./EndDate and given a context date."}]},{"id":"Organization.type","path":"Organization.type","short":"Organization type","definition":"The kind(s) of organization that this is.","comment":"Organizations can be corporations, wards, sections, clinical teams, government departments, etc. Note that code is generally a classifier of the type of organization; in many applications, codes are used to identity a particular organization (say, ward) as opposed to another of the same type - these are identifiers, not codes\n\nWhen considering if multiple types are appropriate, you should evaluate if child organizations would be a more appropriate use of the concept, as different types likely are in different sub-areas of the organization. This is most likely to be used where type values have orthogonal values, such as a religious, academic and medical center.\n\nWe expect that some jurisdictions will profile this optionality to be a single cardinality.","requirements":"Need to be able to track the kind of organization that this is - different organization types have different uses.","min":0,"max":"*","base":{"path":"Organization.type","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"OrganizationType"}],"strength":"example","description":"Used to categorize the organization.","valueSet":"http://hl7.org/fhir/ValueSet/organization-type"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"v2","map":"No equivalent in v2"},{"identity":"rim","map":".code"},{"identity":"servd","map":"n/a"}]},{"id":"Organization.name","path":"Organization.name","short":"Name of the organization","definition":"A name associated with the organization.","comment":"If the name of an organization changes, consider putting the old name in the alias column so that it can still be located through searches.","requirements":"Need to use the name as the label of the organization.","min":1,"max":"1","base":{"path":"Organization.name","min":0,"max":"1"},"type":[{"code":"string"}],"condition":["org-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XON.1"},{"identity":"rim","map":".name"},{"identity":"interface","map":"Participant.name"},{"identity":"servd","map":".PreferredName/Name"}]},{"id":"Organization.alias","path":"Organization.alias","short":"A list of alternate names that the organization is known as, or was known as in the past","definition":"A list of alternate names that the organization is known as, or was known as in the past.","comment":"There are no dates associated with the alias/historic names, as this is not intended to track when names were used, but to assist in searching so that older names can still result in identifying the organization.","requirements":"Over time locations and organizations go through many changes and can be known by different names.\n\nFor searching knowing previous names that the organization was known by can be very useful.","min":0,"max":"*","base":{"path":"Organization.alias","min":0,"max":"*"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".name"}]},{"id":"Organization.description","path":"Organization.description","short":"Additional details about the Organization that could be displayed as further information to identify the Organization beyond its name","definition":"Description of the organization, which helps provide additional general context on the organization to ensure that the correct organization is selected.","requirements":"Humans need additional information to verify a correct Organization has been selected.","min":0,"max":"1","base":{"path":"Organization.description","min":0,"max":"1"},"type":[{"code":"markdown"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".playingEntity[classCode=PLC determinerCode=INSTANCE].desc"}]},{"id":"Organization.contact","path":"Organization.contact","short":"Organization contact infos","definition":"The contact details of communication devices available relevant to the specific Organization. This can include addresses, phone numbers, fax numbers, mobile numbers, email addresses and web sites.","comment":"The address/telecom use code 'home' are not to be used. Note that these contacts are not the contact details of people who provide the service (that would be through PractitionerRole), these are official contacts for the Organization itself for specific purposes. E.g. Mailing Addresses, Billing Addresses, Contact numbers for Booking or Billing Enquiries, general web address, web address for online bookings etc.","requirements":"Need to keep track of assigned contact points within bigger organization.","min":0,"max":"*","base":{"path":"Organization.contact","min":0,"max":"*"},"type":[{"code":"ExtendedContactDetail"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"org-3","severity":"error","human":"The telecom of an organization can never be of use 'home'","expression":"telecom.where(use = 'home').empty()","source":"http://hl7.org/fhir/StructureDefinition/Organization"},{"key":"org-4","severity":"error","human":"The address of an organization can never be of use 'home'","expression":"address.where(use = 'home').empty()","source":"http://hl7.org/fhir/StructureDefinition/Organization"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".contactParty"}]},{"id":"Organization.contact.id","path":"Organization.contact.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.contact.extension","path":"Organization.contact.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.contact.purpose","path":"Organization.contact.purpose","short":"The type of contact","definition":"The purpose/type of contact.","comment":"If no purpose is defined, then these contact details may be used for any purpose.","min":0,"max":"1","base":{"path":"ExtendedContactDetail.purpose","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Purpose"}],"strength":"preferred","description":"The purpose for which an extended contact detail should be used.","valueSet":"http://terminology.hl7.org/ValueSet/contactentity-type"}},{"id":"Organization.contact.name","path":"Organization.contact.name","short":"Name of an individual to contact","definition":"The name of an individual to contact, some types of contact detail are usually blank.","comment":"If there is no named individual, the telecom/address information is not generally monitored by a specific individual.","min":0,"max":"*","base":{"path":"ExtendedContactDetail.name","min":0,"max":"*"},"type":[{"code":"HumanName"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Organization.contact.telecom","path":"Organization.contact.telecom","short":"Organization telecom","definition":"The contact details application for the purpose defined.","min":0,"max":"*","base":{"path":"ExtendedContactDetail.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Organization.contact.address","path":"Organization.contact.address","short":"Address for the contact","definition":"Address for the contact.","comment":"More than 1 address would be for different purposes, and thus should be entered as a different entry,.","min":0,"max":"1","base":{"path":"ExtendedContactDetail.address","min":0,"max":"1"},"type":[{"code":"Address","profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Organization.contact.organization","path":"Organization.contact.organization","short":"This contact detail is handled/monitored by a specific organization","definition":"This contact detail is handled/monitored by a specific organization. If the name is provided in the contact, then it is referring to the named individual within this organization.","requirements":"Some specific types of contact information can be an handled by an organization (eg legal council is via a specific firm).","min":0,"max":"1","base":{"path":"ExtendedContactDetail.organization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Organization.contact.period","path":"Organization.contact.period","short":"Period that this contact was valid for usage","definition":"Period that this contact was valid for usage.","comment":"If the details have multiple periods, then enter in a new ExtendedContact with the new period.","min":0,"max":"1","base":{"path":"ExtendedContactDetail.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Organization.partOf","path":"Organization.partOf","short":"The organization of which this organization is part of: e.g. an ERN","definition":"The organization of which this organization forms a part.","requirements":"Need to be able to track the hierarchy of organizations within an organization.","min":0,"max":"1","base":{"path":"Organization.partOf","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy","valueBoolean":true}],"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu-core"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"No equivalent in HL7 V2"},{"identity":"rim","map":".playedBy[classCode=Part].scoper"},{"identity":"servd","map":"n/a"}]},{"id":"Organization.endpoint","path":"Organization.endpoint","short":"Technical endpoints providing access to services operated for the organization","definition":"Technical endpoints providing access to services operated for the organization.","requirements":"Organizations have multiple systems that provide various services and need to be able to define the technical connection details for how to connect to them, and for what purpose.","min":0,"max":"*","base":{"path":"Organization.endpoint","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Endpoint"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.qualification","path":"Organization.qualification","short":"Qualifications, certifications, accreditations, licenses, training, etc. pertaining to the provision of care","definition":"The official certifications, accreditations, training, designations and licenses that authorize and/or otherwise endorse the provision of care by the organization.\r\rFor example, an approval to provide a type of services issued by a certifying body (such as the US Joint Commission) to an organization.","min":0,"max":"*","base":{"path":"Organization.qualification","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"CER?"},{"identity":"rim","map":"n/a"}]},{"id":"Organization.qualification.id","path":"Organization.qualification.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.qualification.extension","path":"Organization.qualification.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.qualification.modifierExtension","path":"Organization.qualification.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Organization.qualification.identifier","path":"Organization.qualification.identifier","short":"An identifier for this qualification for the organization","definition":"An identifier allocated to this qualification for this organization.","requirements":"Often, specific identities are assigned for the qualification by the assigning organization.","min":0,"max":"*","base":{"path":"Organization.qualification.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.qualification.code","path":"Organization.qualification.code","short":"Coded representation of the qualification","definition":"Coded representation of the qualification.","min":1,"max":"1","base":{"path":"Organization.qualification.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Qualification"}],"strength":"example","description":"Specific qualification the organization has to provide a service."},"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.qualification.period","path":"Organization.qualification.period","short":"Period during which the qualification is valid","definition":"Period during which the qualification is valid.","requirements":"Qualifications are often for a limited period of time, and can be revoked.","min":0,"max":"1","base":{"path":"Organization.qualification.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.qualification.issuer","path":"Organization.qualification.issuer","short":"Organization that regulates and issues the qualification","definition":"Organization that regulates and issues the qualification.","min":0,"max":"1","base":{"path":"Organization.qualification.issuer","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]}]},"differential":{"element":[{"id":"Organization","path":"Organization"},{"id":"Organization.name","path":"Organization.name","min":1},{"id":"Organization.partOf","path":"Organization.partOf","type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy","valueBoolean":true}],"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu-core"]}]}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-organization-eu.json b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-organization-eu.json new file mode 100644 index 00000000..72d74be7 --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-organization-eu.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"organization-eu","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition organization-eu

\r\n\r\n\r\n\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Organization C0..*OrganizationA grouping of people or organizations with a common purpose
name-or-identier: identifier or name SHALL be present
\".\"\".\"\".\" type 0..*CodeableConceptOrganization type
\".\"\".\"\".\" name 0..1stringName of the organization
\".\"\".\"\".\" contact 0..*ExtendedContactDetailOrganization contact infos
\".\"\".\"\".\"\".\" telecom 0..*ContactPointOrganization telecom
\".\"\".\"\".\"\".\" address 0..1AddressEuAddress for the contact
\".\"\".\"\".\" partOf 0..1Reference(Organization (EU base))The organization of which this organization is part of: e.g. an ERN

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu","version":"0.1.0-ballot","name":"OrganizationEu","title":"Organization (EU base)","status":"draft","date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"This profile specifies how the HL7 FHIR Organization resource should be used for conveying commonly used concepts in the European context.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","fhirVersion":"5.0.0","mapping":[{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 V2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"interface","uri":"http://hl7.org/fhir/interface","name":"Interface Pattern"},{"identity":"servd","uri":"http://www.omg.org/spec/ServD/1.0/","name":"ServD"}],"kind":"resource","abstract":false,"type":"Organization","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Organization","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"5.0.0"}],"element":[{"id":"Organization","path":"Organization","short":"A grouping of people or organizations with a common purpose","definition":"A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc.","min":0,"max":"*","base":{"path":"Organization","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"org-1","severity":"error","human":"The organization SHALL at least have a name or an identifier, and possibly more than one","expression":"(identifier.count() + name.count()) > 0","source":"http://hl7.org/fhir/StructureDefinition/Organization"},{"key":"name-or-identier","severity":"error","human":"identifier or name SHALL be present","expression":"identifier.exists() or name.exists()","source":"http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity, Role, or Act,Organization(classCode=ORG, determinerCode=INST)"},{"identity":"w5","map":"administrative.group"},{"identity":"v2","map":"(also see master files messages)"},{"identity":"interface","map":"ParticipantContactable"},{"identity":"servd","map":"Organization"}]},{"id":"Organization.id","path":"Organization.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Organization.meta","path":"Organization.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Organization.implicitRules","path":"Organization.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of its narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies its meaning or interpretation","isSummary":true},{"id":"Organization.language","path":"Organization.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]}},{"id":"Organization.text","path":"Organization.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have a narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"condition":["dom-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Organization.contained","path":"Organization.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags in their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"condition":["dom-2","dom-4","dom-3","dom-5"],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Organization.extension","path":"Organization.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Organization.modifierExtension","path":"Organization.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Organization.identifier","path":"Organization.identifier","short":"Identifies this organization across multiple systems","definition":"Identifier for the organization that is used to identify the organization across multiple disparate systems.","requirements":"Organizations are known by a variety of ids. Some institutions maintain several, and most collect identifiers for exchange with other organizations concerning the organization.","min":0,"max":"*","base":{"path":"Organization.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"condition":["org-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"XON.10 / XON.3"},{"identity":"rim","map":".scopes[Role](classCode=IDENT)"},{"identity":"interface","map":"Participant.identifier"},{"identity":"servd","map":"./Identifiers"}]},{"id":"Organization.active","path":"Organization.active","short":"Whether the organization's record is still in active use","definition":"Whether the organization's record is still in active use.","comment":"This active flag is not intended to be used to mark an organization as temporarily closed or under construction. Instead the Location(s) within the Organization should have the suspended status. If further details of the reason for the suspension are required, then an extension on this element should be used.\n\nThis element is labeled as a modifier because it may be used to mark that the resource was created in error.","requirements":"Need a flag to indicate a record is no longer to be used and should generally be hidden for the user in the UI.","min":0,"max":"1","base":{"path":"Organization.active","min":0,"max":"1"},"type":[{"code":"boolean"}],"meaningWhenMissing":"This resource is generally assumed to be active if no value is provided for the active element","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that can indicate that a record should not be treated as valid","isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"v2","map":"No equivalent in HL7 V2"},{"identity":"rim","map":".status"},{"identity":"interface","map":"Participant.active"},{"identity":"servd","map":"./Status (however this concept in ServD more covers why the organization is active or not, could be delisted, deregistered, not operational yet) this could alternatively be derived from ./StartDate and ./EndDate and given a context date."}]},{"id":"Organization.type","path":"Organization.type","short":"Organization type","definition":"The kind(s) of organization that this is.","comment":"Organizations can be corporations, wards, sections, clinical teams, government departments, etc. Note that code is generally a classifier of the type of organization; in many applications, codes are used to identity a particular organization (say, ward) as opposed to another of the same type - these are identifiers, not codes\n\nWhen considering if multiple types are appropriate, you should evaluate if child organizations would be a more appropriate use of the concept, as different types likely are in different sub-areas of the organization. This is most likely to be used where type values have orthogonal values, such as a religious, academic and medical center.\n\nWe expect that some jurisdictions will profile this optionality to be a single cardinality.","requirements":"Need to be able to track the kind of organization that this is - different organization types have different uses.","min":0,"max":"*","base":{"path":"Organization.type","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"OrganizationType"}],"strength":"example","description":"Used to categorize the organization.","valueSet":"http://hl7.org/fhir/ValueSet/organization-type"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"v2","map":"No equivalent in v2"},{"identity":"rim","map":".code"},{"identity":"servd","map":"n/a"}]},{"id":"Organization.name","path":"Organization.name","short":"Name of the organization","definition":"A name associated with the organization.","comment":"If the name of an organization changes, consider putting the old name in the alias column so that it can still be located through searches.","requirements":"Need to use the name as the label of the organization.","min":0,"max":"1","base":{"path":"Organization.name","min":0,"max":"1"},"type":[{"code":"string"}],"condition":["org-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XON.1"},{"identity":"rim","map":".name"},{"identity":"interface","map":"Participant.name"},{"identity":"servd","map":".PreferredName/Name"}]},{"id":"Organization.alias","path":"Organization.alias","short":"A list of alternate names that the organization is known as, or was known as in the past","definition":"A list of alternate names that the organization is known as, or was known as in the past.","comment":"There are no dates associated with the alias/historic names, as this is not intended to track when names were used, but to assist in searching so that older names can still result in identifying the organization.","requirements":"Over time locations and organizations go through many changes and can be known by different names.\n\nFor searching knowing previous names that the organization was known by can be very useful.","min":0,"max":"*","base":{"path":"Organization.alias","min":0,"max":"*"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".name"}]},{"id":"Organization.description","path":"Organization.description","short":"Additional details about the Organization that could be displayed as further information to identify the Organization beyond its name","definition":"Description of the organization, which helps provide additional general context on the organization to ensure that the correct organization is selected.","requirements":"Humans need additional information to verify a correct Organization has been selected.","min":0,"max":"1","base":{"path":"Organization.description","min":0,"max":"1"},"type":[{"code":"markdown"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".playingEntity[classCode=PLC determinerCode=INSTANCE].desc"}]},{"id":"Organization.contact","path":"Organization.contact","short":"Organization contact infos","definition":"The contact details of communication devices available relevant to the specific Organization. This can include addresses, phone numbers, fax numbers, mobile numbers, email addresses and web sites.","comment":"The address/telecom use code 'home' are not to be used. Note that these contacts are not the contact details of people who provide the service (that would be through PractitionerRole), these are official contacts for the Organization itself for specific purposes. E.g. Mailing Addresses, Billing Addresses, Contact numbers for Booking or Billing Enquiries, general web address, web address for online bookings etc.","requirements":"Need to keep track of assigned contact points within bigger organization.","min":0,"max":"*","base":{"path":"Organization.contact","min":0,"max":"*"},"type":[{"code":"ExtendedContactDetail"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"org-3","severity":"error","human":"The telecom of an organization can never be of use 'home'","expression":"telecom.where(use = 'home').empty()","source":"http://hl7.org/fhir/StructureDefinition/Organization"},{"key":"org-4","severity":"error","human":"The address of an organization can never be of use 'home'","expression":"address.where(use = 'home').empty()","source":"http://hl7.org/fhir/StructureDefinition/Organization"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".contactParty"}]},{"id":"Organization.contact.id","path":"Organization.contact.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.contact.extension","path":"Organization.contact.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.contact.purpose","path":"Organization.contact.purpose","short":"The type of contact","definition":"The purpose/type of contact.","comment":"If no purpose is defined, then these contact details may be used for any purpose.","min":0,"max":"1","base":{"path":"ExtendedContactDetail.purpose","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Purpose"}],"strength":"preferred","description":"The purpose for which an extended contact detail should be used.","valueSet":"http://terminology.hl7.org/ValueSet/contactentity-type"}},{"id":"Organization.contact.name","path":"Organization.contact.name","short":"Name of an individual to contact","definition":"The name of an individual to contact, some types of contact detail are usually blank.","comment":"If there is no named individual, the telecom/address information is not generally monitored by a specific individual.","min":0,"max":"*","base":{"path":"ExtendedContactDetail.name","min":0,"max":"*"},"type":[{"code":"HumanName"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Organization.contact.telecom","path":"Organization.contact.telecom","short":"Organization telecom","definition":"The contact details application for the purpose defined.","min":0,"max":"*","base":{"path":"ExtendedContactDetail.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Organization.contact.address","path":"Organization.contact.address","short":"Address for the contact","definition":"Address for the contact.","comment":"More than 1 address would be for different purposes, and thus should be entered as a different entry,.","min":0,"max":"1","base":{"path":"ExtendedContactDetail.address","min":0,"max":"1"},"type":[{"code":"Address","profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Organization.contact.organization","path":"Organization.contact.organization","short":"This contact detail is handled/monitored by a specific organization","definition":"This contact detail is handled/monitored by a specific organization. If the name is provided in the contact, then it is referring to the named individual within this organization.","requirements":"Some specific types of contact information can be an handled by an organization (eg legal council is via a specific firm).","min":0,"max":"1","base":{"path":"ExtendedContactDetail.organization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Organization.contact.period","path":"Organization.contact.period","short":"Period that this contact was valid for usage","definition":"Period that this contact was valid for usage.","comment":"If the details have multiple periods, then enter in a new ExtendedContact with the new period.","min":0,"max":"1","base":{"path":"ExtendedContactDetail.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Organization.partOf","path":"Organization.partOf","short":"The organization of which this organization is part of: e.g. an ERN","definition":"The organization of which this organization forms a part.","requirements":"Need to be able to track the hierarchy of organizations within an organization.","min":0,"max":"1","base":{"path":"Organization.partOf","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy","valueBoolean":true}],"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"No equivalent in HL7 V2"},{"identity":"rim","map":".playedBy[classCode=Part].scoper"},{"identity":"servd","map":"n/a"}]},{"id":"Organization.endpoint","path":"Organization.endpoint","short":"Technical endpoints providing access to services operated for the organization","definition":"Technical endpoints providing access to services operated for the organization.","requirements":"Organizations have multiple systems that provide various services and need to be able to define the technical connection details for how to connect to them, and for what purpose.","min":0,"max":"*","base":{"path":"Organization.endpoint","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Endpoint"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.qualification","path":"Organization.qualification","short":"Qualifications, certifications, accreditations, licenses, training, etc. pertaining to the provision of care","definition":"The official certifications, accreditations, training, designations and licenses that authorize and/or otherwise endorse the provision of care by the organization.\r\rFor example, an approval to provide a type of services issued by a certifying body (such as the US Joint Commission) to an organization.","min":0,"max":"*","base":{"path":"Organization.qualification","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"CER?"},{"identity":"rim","map":"n/a"}]},{"id":"Organization.qualification.id","path":"Organization.qualification.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.qualification.extension","path":"Organization.qualification.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.qualification.modifierExtension","path":"Organization.qualification.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Organization.qualification.identifier","path":"Organization.qualification.identifier","short":"An identifier for this qualification for the organization","definition":"An identifier allocated to this qualification for this organization.","requirements":"Often, specific identities are assigned for the qualification by the assigning organization.","min":0,"max":"*","base":{"path":"Organization.qualification.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.qualification.code","path":"Organization.qualification.code","short":"Coded representation of the qualification","definition":"Coded representation of the qualification.","min":1,"max":"1","base":{"path":"Organization.qualification.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Qualification"}],"strength":"example","description":"Specific qualification the organization has to provide a service."},"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.qualification.period","path":"Organization.qualification.period","short":"Period during which the qualification is valid","definition":"Period during which the qualification is valid.","requirements":"Qualifications are often for a limited period of time, and can be revoked.","min":0,"max":"1","base":{"path":"Organization.qualification.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.qualification.issuer","path":"Organization.qualification.issuer","short":"Organization that regulates and issues the qualification","definition":"Organization that regulates and issues the qualification.","min":0,"max":"1","base":{"path":"Organization.qualification.issuer","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]}]},"differential":{"element":[{"id":"Organization","path":"Organization","constraint":[{"key":"name-or-identier","severity":"error","human":"identifier or name SHALL be present","expression":"identifier.exists() or name.exists()","source":"http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu"}]},{"id":"Organization.type","path":"Organization.type","short":"Organization type"},{"id":"Organization.name","path":"Organization.name","short":"Name of the organization"},{"id":"Organization.contact","path":"Organization.contact","short":"Organization contact infos"},{"id":"Organization.contact.telecom","path":"Organization.contact.telecom","short":"Organization telecom"},{"id":"Organization.contact.address","path":"Organization.contact.address","type":[{"code":"Address","profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu"]}]},{"id":"Organization.partOf","path":"Organization.partOf","short":"The organization of which this organization is part of: e.g. an ERN","type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy","valueBoolean":true}],"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu"]}]}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-patient-eu-core.json b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-patient-eu-core.json new file mode 100644 index 00000000..6f7f9141 --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-patient-eu-core.json @@ -0,0 +1,3300 @@ +{ + "resourceType": "StructureDefinition", + "id": "patient-eu-core", + "text": { + "status": "extensions", + "div": "

Generated Narrative: StructureDefinition patient-eu-core

\r\n\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Patient 0..*PatientEuInformation about an individual or animal receiving health care services
\".\"\".\"\".\" name C1..*HumanNameA name associated with the patient
eu-pat-1: given, family, text or a data-absent-reason extension SHALL be present
\".\"\".\"\".\" birthDate 1..1dateThe date of birth for the patient
\".\"\".\"\".\"\".\" Slices for extension 0..*ExtensionExtension
Slice: Unordered, Open by value:url
\".\"\".\"\".\"\".\"\".\" extension:dob-absent-reason 0..1codeReason for not providing the Date of Birth.
URL: http://hl7.org/fhir/StructureDefinition/data-absent-reason
Binding: DataAbsentReason (required)

\"doco\" Documentation for this format
" + }, + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm", + "valueInteger": 2 + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status", + "valueCode": "draft" + } + ], + "url": "http://hl7.eu/fhir/base-r5/StructureDefinition/patient-eu-core", + "version": "0.1.0-ballot", + "name": "PatientEuCore", + "title": "Patient (EU core)", + "status": "draft", + "date": "2025-05-06T08:06:03+02:00", + "publisher": "HL7 Europe", + "contact": [ + { + "name": "HL7 Europe", + "telecom": [ + { + "system": "url", + "value": "http://hl7.eu" + } + ] + } + ], + "description": "This profile sets minimum expectations for the Patient resource common to most of the use cases.\nWhen the ips-pat-1 invariant is satisfied \\(Patient.name.given, Patient.name.family or Patient.name.text SHALL be present\\) then this profile complies with the IPS patient profile.", + "jurisdiction": [ + { + "coding": [ + { + "system": "http://unstats.un.org/unsd/methods/m49/m49.htm", + "code": "150", + "display": "Europe" + } + ] + } + ], + "copyright": "Used by permission of HL7 Europe, all rights reserved Creative Commons License", + "fhirVersion": "5.0.0", + "mapping": [ + { + "identity": "w5", + "uri": "http://hl7.org/fhir/fivews", + "name": "FiveWs Pattern Mapping" + }, + { + "identity": "rim", + "uri": "http://hl7.org/v3", + "name": "RIM Mapping" + }, + { + "identity": "interface", + "uri": "http://hl7.org/fhir/interface", + "name": "Interface Pattern" + }, + { + "identity": "cda", + "uri": "http://hl7.org/v3/cda", + "name": "CDA (R2)" + }, + { + "identity": "v2", + "uri": "http://hl7.org/v2", + "name": "HL7 V2 Mapping" + }, + { + "identity": "loinc", + "uri": "http://loinc.org", + "name": "LOINC code for the element" + } + ], + "kind": "resource", + "abstract": false, + "type": "Patient", + "baseDefinition": "http://hl7.eu/fhir/base-r5/StructureDefinition/patient-eu", + "derivation": "constraint", + "snapshot": { + "extension": [ + { + "url": "http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version", + "valueString": "0.1.0-ballot" + } + ], + "element": [ + { + "id": "Patient", + "path": "Patient", + "short": "Information about an individual or animal receiving health care services", + "definition": "Demographics and other administrative information about an individual or animal receiving care or other health-related services.", + "alias": [ + "SubjectOfCare Client Resident" + ], + "min": 0, + "max": "*", + "base": { + "path": "Patient", + "min": 0, + "max": "*" + }, + "constraint": [ + { + "key": "dom-2", + "severity": "error", + "human": "If the resource is contained in another resource, it SHALL NOT contain nested Resources", + "expression": "contained.contained.empty()", + "source": "http://hl7.org/fhir/StructureDefinition/DomainResource" + }, + { + "key": "dom-3", + "severity": "error", + "human": "If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource", + "expression": "contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()", + "source": "http://hl7.org/fhir/StructureDefinition/DomainResource" + }, + { + "key": "dom-4", + "severity": "error", + "human": "If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated", + "expression": "contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()", + "source": "http://hl7.org/fhir/StructureDefinition/DomainResource" + }, + { + "key": "dom-5", + "severity": "error", + "human": "If a resource is contained in another resource, it SHALL NOT have a security label", + "expression": "contained.meta.security.empty()", + "source": "http://hl7.org/fhir/StructureDefinition/DomainResource" + }, + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice", + "valueBoolean": true + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation", + "valueMarkdown": "When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time." + } + ], + "key": "dom-6", + "severity": "warning", + "human": "A resource should have narrative for robust management", + "expression": "text.`div`.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/DomainResource" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "Entity, Role, or Act,Patient[classCode=PAT]" + }, + { + "identity": "w5", + "map": "administrative.individual" + }, + { + "identity": "interface", + "map": "ParticipantLiving" + }, + { + "identity": "cda", + "map": "ClinicalDocument.recordTarget.patientRole" + } + ] + }, + { + "id": "Patient.id", + "path": "Patient.id", + "short": "Logical id of this artifact", + "definition": "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.", + "comment": "Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case.", + "min": 0, + "max": "1", + "base": { + "path": "Resource.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "id" + } + ], + "code": "http://hl7.org/fhirpath/System.String" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true + }, + { + "id": "Patient.meta", + "path": "Patient.meta", + "short": "Metadata about the resource", + "definition": "The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.", + "min": 0, + "max": "1", + "base": { + "path": "Resource.meta", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Meta" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true + }, + { + "id": "Patient.implicitRules", + "path": "Patient.implicitRules", + "short": "A set of rules under which this content was created", + "definition": "A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.", + "comment": "Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of its narrative along with other profiles, value sets, etc.", + "min": 0, + "max": "1", + "base": { + "path": "Resource.implicitRules", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "uri" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": true, + "isModifierReason": "This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies its meaning or interpretation", + "isSummary": true + }, + { + "id": "Patient.language", + "path": "Patient.language", + "short": "Language of the resource content", + "definition": "The base language in which the resource is written.", + "comment": "Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).", + "min": 0, + "max": "1", + "base": { + "path": "Resource.language", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "code" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "Language" + } + ], + "strength": "required", + "description": "IETF language tag for a human language", + "valueSet": "http://hl7.org/fhir/ValueSet/all-languages|5.0.0", + "additional": [ + { + "purpose": "starter", + "valueSet": "http://hl7.org/fhir/ValueSet/languages" + } + ] + } + }, + { + "id": "Patient.text", + "path": "Patient.text", + "short": "Text summary of the resource, for human interpretation", + "definition": "A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.", + "comment": "Contained resources do not have a narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.", + "alias": [ + "narrative", + "html", + "xhtml", + "display" + ], + "min": 0, + "max": "1", + "base": { + "path": "DomainResource.text", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Narrative" + } + ], + "condition": [ + "dom-6" + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "Act.text?" + } + ] + }, + { + "id": "Patient.contained", + "path": "Patient.contained", + "short": "Contained, inline Resources", + "definition": "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning.", + "comment": "This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags in their meta elements, but SHALL NOT have security labels.", + "alias": [ + "inline resources", + "anonymous resources", + "contained resources" + ], + "min": 0, + "max": "*", + "base": { + "path": "DomainResource.contained", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Resource" + } + ], + "condition": [ + "dom-2", + "dom-4", + "dom-3", + "dom-5" + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Patient.extension", + "path": "Patient.extension", + "slicing": { + "discriminator": [ + { + "type": "value", + "path": "url" + } + ], + "ordered": false, + "rules": "open" + }, + "short": "Extension", + "definition": "An Extension", + "min": 0, + "max": "*", + "base": { + "path": "DomainResource.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false + }, + { + "id": "Patient.extension:birthPlace", + "path": "Patient.extension", + "sliceName": "birthPlace", + "short": "Place of Birth for patient", + "definition": "The registered place of birth of the patient. A sytem may use the address.text if they don't store the birthPlace address in discrete elements.", + "min": 0, + "max": "1", + "base": { + "path": "DomainResource.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension", + "profile": [ + "http://hl7.org/fhir/StructureDefinition/patient-birthPlace" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false + }, + { + "id": "Patient.extension:birthPlace.id", + "path": "Patient.extension.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "id" + } + ], + "code": "http://hl7.org/fhirpath/System.String" + } + ], + "condition": [ + "ele-1" + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Patient.extension:birthPlace.extension", + "path": "Patient.extension.extension", + "slicing": { + "discriminator": [ + { + "type": "value", + "path": "url" + } + ], + "description": "Extensions are always sliced by (at least) url", + "rules": "open" + }, + "short": "Extension", + "definition": "An Extension", + "min": 0, + "max": "0", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false + }, + { + "id": "Patient.extension:birthPlace.url", + "path": "Patient.extension.url", + "representation": [ + "xmlAttr" + ], + "short": "identifies the meaning of the extension", + "definition": "Source of the definition for the extension code - a logical name or a URL.", + "comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.", + "min": 1, + "max": "1", + "base": { + "path": "Extension.url", + "min": 1, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "uri" + } + ], + "code": "http://hl7.org/fhirpath/System.String" + } + ], + "fixedUri": "http://hl7.org/fhir/StructureDefinition/patient-birthPlace", + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Patient.extension:birthPlace.value[x]", + "path": "Patient.extension.value[x]", + "short": "Value of extension", + "definition": "Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R5/extensibility.html) for a list).", + "min": 1, + "max": "1", + "base": { + "path": "Extension.value[x]", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Address", + "profile": [ + "http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu" + ] + } + ], + "condition": [ + "ext-1" + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Patient.extension:sex-for-clinical-use", + "path": "Patient.extension", + "sliceName": "sex-for-clinical-use", + "short": "Sex for clinical use", + "definition": "A parameter that provides guidance on how a recipient should apply settings or reference ranges that are derived from observable information such as an organ inventory, recent hormone lab tests, genetic testing, menstrual status, obstetric history, etc..", + "min": 0, + "max": "*", + "base": { + "path": "DomainResource.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension", + "profile": [ + "http://hl7.org/fhir/StructureDefinition/patient-sexParameterForClinicalUse" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false + }, + { + "id": "Patient.extension:patient-citizenship", + "path": "Patient.extension", + "sliceName": "patient-citizenship", + "short": "Citizenship", + "definition": "The patient's legal status as citizen of a country.", + "min": 0, + "max": "*", + "base": { + "path": "DomainResource.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension", + "profile": [ + "http://hl7.org/fhir/StructureDefinition/patient-citizenship" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false + }, + { + "id": "Patient.extension:patient-nationality", + "path": "Patient.extension", + "sliceName": "patient-nationality", + "short": "Nationality", + "definition": "The nationality of the patient.", + "min": 0, + "max": "*", + "base": { + "path": "DomainResource.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension", + "profile": [ + "http://hl7.org/fhir/StructureDefinition/patient-nationality" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false + }, + { + "id": "Patient.modifierExtension", + "path": "Patient.modifierExtension", + "short": "Extensions that cannot be ignored", + "definition": "May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "DomainResource.modifierExtension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "mustSupport": false, + "isModifier": true, + "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them", + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Patient.identifier", + "path": "Patient.identifier", + "short": "Patient identifiers", + "definition": "An identifier for this patient.", + "requirements": "Patients are almost always assigned specific numerical identifiers.", + "min": 0, + "max": "*", + "base": { + "path": "Patient.identifier", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Identifier" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.identifier" + }, + { + "identity": "v2", + "map": "PID-3" + }, + { + "identity": "rim", + "map": "id" + }, + { + "identity": "interface", + "map": "Participant.identifier" + }, + { + "identity": "cda", + "map": ".id" + } + ] + }, + { + "id": "Patient.active", + "path": "Patient.active", + "short": "Whether this patient's record is in active use", + "definition": "Whether this patient record is in active use. \nMany systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules.\n\nIt is often used to filter patient lists to exclude inactive patients\n\nDeceased patients may also be marked as inactive for the same reasons, but may be active for some time after death.", + "comment": "If a record is inactive, and linked to an active record, then future patient/record updates should occur on the other patient.", + "requirements": "Need to be able to mark a patient record as not to be used because it was created in error.", + "min": 0, + "max": "1", + "base": { + "path": "Patient.active", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "boolean" + } + ], + "meaningWhenMissing": "This resource is generally assumed to be active if no value is provided for the active element", + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": true, + "isModifierReason": "This element is labelled as a modifier because it is a status element that can indicate that a record should not be treated as valid", + "isSummary": true, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.status" + }, + { + "identity": "rim", + "map": "statusCode" + }, + { + "identity": "interface", + "map": "Participant.active" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + }, + { + "id": "Patient.name", + "path": "Patient.name", + "short": "A name associated with the patient", + "definition": "A name associated with the individual.", + "comment": "A patient may have multiple names with different uses or applicable periods. For animals, the name is a \"HumanName\" in the sense that is assigned and used by humans and has the same patterns. Animal names may be communicated as given names, and optionally may include a family name.", + "requirements": "Need to be able to track the patient by multiple names. Examples are your official name and a partner name.\r\nThe Alphabetic representation of the name SHALL be always provided", + "min": 1, + "max": "*", + "base": { + "path": "Patient.name", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "HumanName" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "eu-pat-1", + "severity": "error", + "human": "given, family, text or a data-absent-reason extension SHALL be present", + "expression": "family.exists() or given.exists() or text.exists() or extension('http://hl7.org/fhir/StructureDefinition/data-absent-reason').exists()", + "source": "http://hl7.eu/fhir/base-r5/StructureDefinition/patient-eu-core" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "PID-5, PID-9" + }, + { + "identity": "rim", + "map": "name" + }, + { + "identity": "interface", + "map": "Participant.name" + }, + { + "identity": "cda", + "map": ".patient.name" + } + ] + }, + { + "id": "Patient.name.id", + "path": "Patient.name.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "id" + } + ], + "code": "http://hl7.org/fhirpath/System.String" + } + ], + "condition": [ + "ele-1" + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Patient.name.extension", + "path": "Patient.name.extension", + "slicing": { + "discriminator": [ + { + "type": "value", + "path": "url" + } + ], + "description": "Extensions are always sliced by (at least) url", + "rules": "open" + }, + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Patient.name.extension:name-absent-reason", + "path": "Patient.name.extension", + "sliceName": "name-absent-reason", + "short": "Reason for not providing the name.", + "definition": "Reason for not providing the name.", + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension", + "profile": [ + "http://hl7.org/fhir/StructureDefinition/data-absent-reason" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "ANY.nullFlavor" + } + ] + }, + { + "id": "Patient.name.use", + "path": "Patient.name.use", + "short": "usual | official | temp | nickname | anonymous | old | maiden", + "definition": "Identifies the purpose for this name.", + "comment": "Applications can assume that a name is current unless it explicitly says that it is temporary or old.", + "requirements": "Allows the appropriate name for a particular context of use to be selected from among a set of names.", + "min": 0, + "max": "1", + "base": { + "path": "HumanName.use", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "code" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": true, + "isModifierReason": "This is labeled as \"Is Modifier\" because applications should not mistake a temporary or old name etc.for a current/permanent one", + "isSummary": true, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "NameUse" + } + ], + "strength": "required", + "description": "The use of a human name.", + "valueSet": "http://hl7.org/fhir/ValueSet/name-use|5.0.0" + }, + "mapping": [ + { + "identity": "v2", + "map": "XPN.7, but often indicated by which field contains the name" + }, + { + "identity": "rim", + "map": "unique(./use)" + }, + { + "identity": "servd", + "map": "./NamePurpose" + } + ] + }, + { + "id": "Patient.name.text", + "path": "Patient.name.text", + "short": "Text representation of the full name.", + "definition": "Text representation of the full name. Due to the cultural variance around the world a consuming system may not know how to present the name correctly; moreover not all the parts of the name go in given or family. Creators are therefore strongly encouraged to provide through this element a presented version of the name. Future versions of this guide may require this element.", + "comment": "Can provide both a text representation and parts. Applications updating a name SHALL ensure that when both text and parts are present, no content is included in the text that isn't found in a part.", + "requirements": "A renderable, unencoded form.", + "min": 0, + "max": "1", + "base": { + "path": "HumanName.text", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "string" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "implied by XPN.11" + }, + { + "identity": "rim", + "map": "./formatted" + } + ] + }, + { + "id": "Patient.name.family", + "path": "Patient.name.family", + "short": "Family name.", + "definition": "Family name. When more the family is composed by more than one names, this element documents the full composed family name with the proper * name.familyrder. The parts are recorded in the fhater and mother family names extensions.", + "comment": "Family Name may be decomposed into specific parts using extensions (de, nl, es related cultures).", + "alias": [ + "surname" + ], + "min": 0, + "max": "1", + "base": { + "path": "HumanName.family", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "string" + } + ], + "example": [ + { + "label": "spanish", + "valueString": "Valero Iglesias" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "XPN.1/FN.1" + }, + { + "identity": "rim", + "map": "./part[partType = FAM]" + }, + { + "identity": "servd", + "map": "./FamilyName" + } + ] + }, + { + "id": "Patient.name.given", + "path": "Patient.name.given", + "short": "Given names. Includes middle names", + "definition": "Given name.", + "comment": "If only initials are recorded, they may be used in place of the full name parts. Initials may be separated into multiple given names but often aren't due to paractical limitations. This element is not called \"first name\" since given names do not always come first.", + "alias": [ + "first name", + "middle name" + ], + "min": 0, + "max": "*", + "base": { + "path": "HumanName.given", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "string" + } + ], + "orderMeaning": "Given Names appear in the correct order for presenting the name", + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "XPN.2 + XPN.3" + }, + { + "identity": "rim", + "map": "./part[partType = GIV]" + }, + { + "identity": "servd", + "map": "./GivenNames" + } + ] + }, + { + "id": "Patient.name.prefix", + "path": "Patient.name.prefix", + "short": "Parts that come before the name", + "definition": "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.", + "min": 0, + "max": "*", + "base": { + "path": "HumanName.prefix", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "string" + } + ], + "orderMeaning": "Prefixes appear in the correct order for presenting the name", + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "XPN.5" + }, + { + "identity": "rim", + "map": "./part[partType = PFX]" + }, + { + "identity": "servd", + "map": "./TitleCode" + } + ] + }, + { + "id": "Patient.name.suffix", + "path": "Patient.name.suffix", + "short": "Parts that come after the name", + "definition": "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.", + "min": 0, + "max": "*", + "base": { + "path": "HumanName.suffix", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "string" + } + ], + "orderMeaning": "Suffixes appear in the correct order for presenting the name", + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "XPN/4" + }, + { + "identity": "rim", + "map": "./part[partType = SFX]" + } + ] + }, + { + "id": "Patient.name.period", + "path": "Patient.name.period", + "short": "Time period when name was/is in use", + "definition": "Indicates the period of time when this name was valid for the named person.", + "requirements": "Allows names to be placed in historical context.", + "min": 0, + "max": "1", + "base": { + "path": "HumanName.period", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Period" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "XPN.13 + XPN.14" + }, + { + "identity": "rim", + "map": "./usablePeriod[type=\"IVL\"]" + }, + { + "identity": "servd", + "map": "./StartDate and ./EndDate" + } + ] + }, + { + "id": "Patient.telecom", + "path": "Patient.telecom", + "short": "A contact detail for the patient", + "definition": "A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.", + "comment": "A Patient may have multiple ways to be contacted with different uses or applicable periods. May need to have options for contacting the person urgently and also to help with identification. The address might not go directly to the individual, but may reach another party that is able to proxy for the patient (i.e. home phone, or pet owner's phone).", + "requirements": "People have (primary) ways to contact them in some way such as phone, email.", + "min": 0, + "max": "*", + "base": { + "path": "Patient.telecom", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "ContactPoint" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "PID-13, PID-14, PID-40" + }, + { + "identity": "rim", + "map": "telecom" + }, + { + "identity": "interface", + "map": "ParticipantContactable.telecom" + }, + { + "identity": "cda", + "map": ".telecom" + } + ] + }, + { + "id": "Patient.gender", + "path": "Patient.gender", + "short": "Administrative Gender", + "definition": "Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.", + "comment": "The gender might not match the biological sex as determined by genetics or the individual's preferred identification. Note that for both humans and particularly animals, there are other legitimate possibilities than male and female, though the vast majority of systems and contexts only support male and female. Systems providing decision support or enforcing business rules should ideally do this on the basis of Observations dealing with the specific sex or gender aspect of interest (anatomical, chromosomal, social, etc.) However, because these observations are infrequently recorded, defaulting to the administrative gender is common practice. Where such defaulting occurs, rule enforcement should allow for the variation between administrative and biological, chromosomal and other gender aspects. For example, an alert about a hysterectomy on a male should be handled as a warning or overridable error, not a \"hard\" error. See the Patient Gender and Sex section for additional information about communicating patient gender and sex.", + "requirements": "Needed for identification of the individual, in combination with (at least) name and birth date.", + "min": 0, + "max": "1", + "base": { + "path": "Patient.gender", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "code" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "AdministrativeGender" + } + ], + "strength": "required", + "description": "The gender of a person used for administrative purposes.", + "valueSet": "http://hl7.org/fhir/ValueSet/administrative-gender|5.0.0" + }, + "mapping": [ + { + "identity": "v2", + "map": "PID-8" + }, + { + "identity": "rim", + "map": "player[classCode=PSN|ANM and determinerCode=INSTANCE]/administrativeGender" + }, + { + "identity": "interface", + "map": "ParticipantLiving.gender" + }, + { + "identity": "cda", + "map": ".patient.administrativeGenderCode" + } + ] + }, + { + "id": "Patient.birthDate", + "path": "Patient.birthDate", + "short": "The date of birth for the patient", + "definition": "The date of birth for the individual.", + "comment": "Partial dates are allowed if the specific date of birth is unknown. There is a standard extension \"patient-birthTime\" available that should be used where Time is required (such as in maternity/infant care systems).", + "requirements": "Age of the individual drives many clinical processes.", + "min": 1, + "max": "1", + "base": { + "path": "Patient.birthDate", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "date" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "PID-7" + }, + { + "identity": "rim", + "map": "player[classCode=PSN|ANM and determinerCode=INSTANCE]/birthTime" + }, + { + "identity": "interface", + "map": "ParticipantLiving.birthDate" + }, + { + "identity": "cda", + "map": ".patient.birthTime" + }, + { + "identity": "loinc", + "map": "21112-8" + } + ] + }, + { + "id": "Patient.birthDate.id", + "path": "Patient.birthDate.id", + "representation": [ + "xmlAttr" + ], + "short": "xml:id (or equivalent in JSON)", + "definition": "unique id for the element within a resource (for internal references)", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ], + "code": "http://hl7.org/fhirpath/System.String" + } + ], + "isModifier": false, + "isSummary": false + }, + { + "id": "Patient.birthDate.extension", + "path": "Patient.birthDate.extension", + "slicing": { + "discriminator": [ + { + "type": "value", + "path": "url" + } + ], + "ordered": false, + "rules": "open" + }, + "short": "Extension", + "definition": "An Extension", + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false + }, + { + "id": "Patient.birthDate.extension:dob-absent-reason", + "path": "Patient.birthDate.extension", + "sliceName": "dob-absent-reason", + "short": "Reason for not providing the Date of Birth.", + "definition": "Reason for not providing the Date of Birth.", + "min": 0, + "max": "1", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension", + "profile": [ + "http://hl7.org/fhir/StructureDefinition/data-absent-reason" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "ANY.nullFlavor" + } + ] + }, + { + "id": "Patient.birthDate.value", + "path": "Patient.birthDate.value", + "representation": [ + "xmlAttr" + ], + "short": "Primitive value for date", + "definition": "The actual value", + "min": 0, + "max": "1", + "base": { + "path": "date.value", + "min": 0, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "date" + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/regex", + "valueString": "([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1]))?)?" + } + ], + "code": "http://hl7.org/fhirpath/System.Date" + } + ], + "isModifier": false, + "isSummary": false + }, + { + "id": "Patient.deceased[x]", + "path": "Patient.deceased[x]", + "short": "Indicates if the individual is deceased or not", + "definition": "Indicates if the individual is deceased or not.", + "comment": "If there's no value in the instance, it means there is no statement on whether or not the individual is deceased. Most systems will interpret the absence of a value as a sign of the person being alive.", + "requirements": "The fact that a patient is deceased influences the clinical process. Also, in human communication and relation management it is necessary to know whether the person is alive.", + "min": 0, + "max": "1", + "base": { + "path": "Patient.deceased[x]", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "boolean" + }, + { + "code": "dateTime" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": true, + "isModifierReason": "This element is labeled as a modifier because once a patient is marked as deceased, the actions that are appropriate to perform on the patient may be significantly different.", + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "PID-30 (bool) and PID-29 (datetime)" + }, + { + "identity": "rim", + "map": "player[classCode=PSN|ANM and determinerCode=INSTANCE]/deceasedInd, player[classCode=PSN|ANM and determinerCode=INSTANCE]/deceasedTime" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + }, + { + "id": "Patient.address", + "path": "Patient.address", + "short": "An address for the individual", + "definition": "An address for the individual.", + "comment": "Patient may have multiple addresses with different uses or applicable periods.", + "requirements": "May need to keep track of patient addresses for contacting, billing or reporting requirements and also to help with identification.", + "min": 0, + "max": "*", + "base": { + "path": "Patient.address", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Address", + "profile": [ + "http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "PID-11" + }, + { + "identity": "rim", + "map": "addr" + }, + { + "identity": "interface", + "map": "ParticipantContactable.address" + }, + { + "identity": "cda", + "map": ".addr" + } + ] + }, + { + "id": "Patient.maritalStatus", + "path": "Patient.maritalStatus", + "short": "Marital (civil) status of a patient", + "definition": "This field contains a patient's most recent marital (civil) status.", + "requirements": "Most, if not all systems capture it.", + "min": 0, + "max": "1", + "base": { + "path": "Patient.maritalStatus", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "MaritalStatus" + } + ], + "strength": "extensible", + "description": "The domestic partnership status of a person.", + "valueSet": "http://hl7.org/fhir/ValueSet/marital-status" + }, + "mapping": [ + { + "identity": "v2", + "map": "PID-16" + }, + { + "identity": "rim", + "map": "player[classCode=PSN]/maritalStatusCode" + }, + { + "identity": "cda", + "map": ".patient.maritalStatusCode" + } + ] + }, + { + "id": "Patient.multipleBirth[x]", + "path": "Patient.multipleBirth[x]", + "short": "Whether patient is part of a multiple birth", + "definition": "Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).", + "comment": "Where the valueInteger is provided, the number is the birth number in the sequence. E.g. The middle birth in triplets would be valueInteger=2 and the third born would have valueInteger=3 If a boolean value was provided for this triplets example, then all 3 patient records would have valueBoolean=true (the ordering is not indicated).", + "requirements": "For disambiguation of multiple-birth children, especially relevant where the care provider doesn't meet the patient, such as labs.", + "min": 0, + "max": "1", + "base": { + "path": "Patient.multipleBirth[x]", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "boolean" + }, + { + "code": "integer" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "v2", + "map": "PID-24 (bool), PID-25 (integer)" + }, + { + "identity": "rim", + "map": "player[classCode=PSN|ANM and determinerCode=INSTANCE]/multipleBirthInd, player[classCode=PSN|ANM and determinerCode=INSTANCE]/multipleBirthOrderNumber" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + }, + { + "id": "Patient.photo", + "path": "Patient.photo", + "short": "Image of the patient", + "definition": "Image of the patient.", + "comment": "Guidelines:\n* Use id photos, not clinical photos.\n* Limit dimensions to thumbnail.\n* Keep byte count low to ease resource updates.", + "requirements": "Many EHR systems have the capability to capture an image of the patient. Fits with newer social media usage too.", + "min": 0, + "max": "*", + "base": { + "path": "Patient.photo", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Attachment" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "v2", + "map": "OBX-5 - needs a profile" + }, + { + "identity": "rim", + "map": "player[classCode=PSN|ANM and determinerCode=INSTANCE]/desc" + }, + { + "identity": "interface", + "map": "ParticipantLiving.photo" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + }, + { + "id": "Patient.contact", + "path": "Patient.contact", + "short": "A contact party (e.g. guardian, partner, friend) for the patient", + "definition": "A contact party (e.g. guardian, partner, friend) for the patient.", + "comment": "Contact covers all kinds of contact parties: family members, business contacts, guardians, caregivers. Not applicable to register pedigree and family ties beyond use of having contact.", + "requirements": "Need to track people you can contact about the patient.", + "min": 0, + "max": "*", + "base": { + "path": "Patient.contact", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "BackboneElement" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "pat-1", + "severity": "error", + "human": "SHALL at least contain a contact's details or a reference to an organization", + "expression": "name.exists() or telecom.exists() or address.exists() or organization.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Patient" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "player[classCode=PSN|ANM and determinerCode=INSTANCE]/scopedRole[classCode=CON]" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + }, + { + "id": "Patient.contact.id", + "path": "Patient.contact.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ], + "code": "http://hl7.org/fhirpath/System.String" + } + ], + "condition": [ + "ele-1" + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Patient.contact.extension", + "path": "Patient.contact.extension", + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Patient.contact.modifierExtension", + "path": "Patient.contact.modifierExtension", + "short": "Extensions that cannot be ignored even if unrecognized", + "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).", + "alias": [ + "extensions", + "user content", + "modifiers" + ], + "min": 0, + "max": "*", + "base": { + "path": "BackboneElement.modifierExtension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": true, + "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them", + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Patient.contact.relationship", + "path": "Patient.contact.relationship", + "short": "Contact relationship", + "definition": "The nature of the relationship between the patient and the contact person.", + "requirements": "Used to determine which contact person is the most relevant to approach, depending on circumstances.", + "min": 0, + "max": "*", + "base": { + "path": "Patient.contact.relationship", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "ContactRelationship" + } + ], + "strength": "extensible", + "description": "The nature of the relationship between a patient and a contact person for that patient.", + "valueSet": "http://hl7.org/fhir/ValueSet/patient-contactrelationship" + }, + "mapping": [ + { + "identity": "v2", + "map": "NK1-7, NK1-3" + }, + { + "identity": "rim", + "map": "code" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + }, + { + "id": "Patient.contact.name", + "path": "Patient.contact.name", + "short": "Contact name", + "definition": "A name associated with the contact person.", + "requirements": "Contact persons need to be identified by name, but it is uncommon to need details about multiple other names for that contact person.", + "min": 0, + "max": "1", + "base": { + "path": "Patient.contact.name", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "HumanName" + } + ], + "condition": [ + "pat-1" + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "v2", + "map": "NK1-2" + }, + { + "identity": "rim", + "map": "name" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + }, + { + "id": "Patient.contact.telecom", + "path": "Patient.contact.telecom", + "short": "Contact details for the person", + "definition": "A contact detail for the person, e.g. a telephone number or an email address.", + "comment": "Contact may have multiple ways to be contacted with different uses or applicable periods. May need to have options for contacting the person urgently, and also to help with identification.", + "requirements": "People have (primary) ways to contact them in some way such as phone, email.", + "min": 0, + "max": "*", + "base": { + "path": "Patient.contact.telecom", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "ContactPoint" + } + ], + "condition": [ + "pat-1" + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "v2", + "map": "NK1-5, NK1-6, NK1-40" + }, + { + "identity": "rim", + "map": "telecom" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + }, + { + "id": "Patient.contact.address", + "path": "Patient.contact.address", + "short": "Contact person address", + "definition": "Address for the contact person.", + "requirements": "Need to keep track where the contact person can be contacted per postal mail or visited.", + "min": 0, + "max": "1", + "base": { + "path": "Patient.contact.address", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Address", + "profile": [ + "http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu" + ] + } + ], + "condition": [ + "pat-1" + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "v2", + "map": "NK1-4" + }, + { + "identity": "rim", + "map": "addr" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + }, + { + "id": "Patient.contact.gender", + "path": "Patient.contact.gender", + "short": "male | female | other | unknown", + "definition": "Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.", + "requirements": "Needed to address the person correctly.", + "min": 0, + "max": "1", + "base": { + "path": "Patient.contact.gender", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "code" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "AdministrativeGender" + } + ], + "strength": "required", + "description": "The gender of a person used for administrative purposes.", + "valueSet": "http://hl7.org/fhir/ValueSet/administrative-gender|5.0.0" + }, + "mapping": [ + { + "identity": "v2", + "map": "NK1-15" + }, + { + "identity": "rim", + "map": "player[classCode=PSN|ANM and determinerCode=INSTANCE]/administrativeGender" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + }, + { + "id": "Patient.contact.organization", + "path": "Patient.contact.organization", + "short": "Organization that is associated with the contact", + "definition": "Organization on behalf of which the contact is acting or for which the contact is working.", + "requirements": "For guardians or business related contacts, the organization is relevant.", + "min": 0, + "max": "1", + "base": { + "path": "Patient.contact.organization", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Organization" + ] + } + ], + "condition": [ + "pat-1" + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "v2", + "map": "NK1-13, NK1-30, NK1-31, NK1-32, NK1-41" + }, + { + "identity": "rim", + "map": "scoper" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + }, + { + "id": "Patient.contact.period", + "path": "Patient.contact.period", + "short": "The period during which this contact person or organization is valid to be contacted relating to this patient", + "definition": "The period during which this contact person or organization is valid to be contacted relating to this patient.", + "min": 0, + "max": "1", + "base": { + "path": "Patient.contact.period", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Period" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "effectiveTime" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + }, + { + "id": "Patient.communication", + "path": "Patient.communication", + "short": "A language which may be used to communicate with the patient about his or her health", + "definition": "A language which may be used to communicate with the patient about his or her health.", + "comment": "If no language is specified, this *implies* that the default local language is spoken. If you need to convey proficiency for multiple modes, then you need multiple Patient.Communication associations. For animals, language is not a relevant field, and should be absent from the instance. If the Patient does not speak the default local language, then the Interpreter Required Standard can be used to explicitly declare that an interpreter is required.", + "requirements": "If a patient does not speak the local language, interpreters may be required, so languages spoken and proficiency are important things to keep track of both for patient and other persons of interest.", + "min": 0, + "max": "*", + "base": { + "path": "Patient.communication", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "BackboneElement" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "LanguageCommunication" + }, + { + "identity": "interface", + "map": "ParticipantLiving.communication" + }, + { + "identity": "cda", + "map": "patient.languageCommunication" + } + ] + }, + { + "id": "Patient.communication.id", + "path": "Patient.communication.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ], + "code": "http://hl7.org/fhirpath/System.String" + } + ], + "condition": [ + "ele-1" + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Patient.communication.extension", + "path": "Patient.communication.extension", + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Patient.communication.modifierExtension", + "path": "Patient.communication.modifierExtension", + "short": "Extensions that cannot be ignored even if unrecognized", + "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).", + "alias": [ + "extensions", + "user content", + "modifiers" + ], + "min": 0, + "max": "*", + "base": { + "path": "BackboneElement.modifierExtension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": true, + "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them", + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Patient.communication.language", + "path": "Patient.communication.language", + "short": "Communication language", + "definition": "The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-AU\" for Australian English.", + "comment": "The structure aa-BB with this exact casing is one the most widely used notations for locale. However not all systems actually code this but instead have it as free text. Hence CodeableConcept instead of code as the data type.", + "requirements": "Most systems in multilingual countries will want to convey language. Not all systems actually need the regional dialect.", + "min": 1, + "max": "1", + "base": { + "path": "Patient.communication.language", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "Language" + } + ], + "strength": "required", + "description": "IETF language tag for a human language", + "valueSet": "http://hl7.org/fhir/ValueSet/all-languages|5.0.0", + "additional": [ + { + "purpose": "starter", + "valueSet": "http://hl7.org/fhir/ValueSet/languages" + } + ] + }, + "mapping": [ + { + "identity": "v2", + "map": "PID-15, LAN-2" + }, + { + "identity": "rim", + "map": "player[classCode=PSN|ANM and determinerCode=INSTANCE]/languageCommunication/code" + }, + { + "identity": "cda", + "map": ".languageCode" + } + ] + }, + { + "id": "Patient.communication.preferred", + "path": "Patient.communication.preferred", + "short": "Language preference indicator", + "definition": "Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).", + "comment": "This language is specifically identified for communicating healthcare information.", + "requirements": "People that master multiple languages up to certain level may prefer one or more, i.e. feel more confident in communicating in a particular language making other languages sort of a fall back method.", + "min": 0, + "max": "1", + "base": { + "path": "Patient.communication.preferred", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "boolean" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "v2", + "map": "PID-15" + }, + { + "identity": "rim", + "map": "preferenceInd" + }, + { + "identity": "cda", + "map": ".preferenceInd" + } + ] + }, + { + "id": "Patient.generalPractitioner", + "path": "Patient.generalPractitioner", + "short": "Patient's nominated primary care provider.", + "definition": "Patient's nominated care provider.", + "comment": "This may be the primary care provider (in a GP context), or it may be a patient nominated care manager in a community/disability setting, or even organization that will provide people to perform the care provider roles. It is not to be used to record Care Teams, these should be in a CareTeam resource that may be linked to the CarePlan or EpisodeOfCare resources.\nMultiple GPs may be recorded against the patient for various reasons, such as a student that has his home GP listed along with the GP at university during the school semesters, or a \"fly-in/fly-out\" worker that has the onsite GP also included with his home GP to remain aware of medical issues.\n\nJurisdictions may decide that they can profile this down to 1 if desired, or 1 per type.", + "alias": [ + "careProvider" + ], + "min": 0, + "max": "*", + "base": { + "path": "Patient.generalPractitioner", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu", + "http://hl7.eu/fhir/base-r5/StructureDefinition/practitionerRole-eu", + "http://hl7.eu/fhir/base-r5/StructureDefinition/practitioner-eu" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "v2", + "map": "PD1-4" + }, + { + "identity": "rim", + "map": "subjectOf.CareEvent.performer.AssignedEntity" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + }, + { + "id": "Patient.managingOrganization", + "path": "Patient.managingOrganization", + "short": "Organization that is the custodian of the patient record", + "definition": "Organization that is the custodian of the patient record.", + "comment": "There is only one managing organization for a specific patient record. Other organizations will have their own Patient record, and may use the Link property to join the records together (or a Person resource which can include confidence ratings for the association).", + "requirements": "Need to know who recognizes this patient record, manages and updates it.", + "min": 0, + "max": "1", + "base": { + "path": "Patient.managingOrganization", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Organization" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": "scoper" + }, + { + "identity": "cda", + "map": ".providerOrganization" + } + ] + }, + { + "id": "Patient.link", + "path": "Patient.link", + "short": "Link to a Patient or RelatedPerson resource that concerns the same actual individual", + "definition": "Link to a Patient or RelatedPerson resource that concerns the same actual individual.", + "comment": "There is no assumption that linked patient records have mutual links.", + "requirements": "There are multiple use cases: \n\n* Duplicate patient records due to the clerical errors associated with the difficulties of identifying humans consistently, and \n* Distribution of patient information across multiple servers.", + "min": 0, + "max": "*", + "base": { + "path": "Patient.link", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "BackboneElement" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": true, + "isModifierReason": "This element is labeled as a modifier because it might not be the main Patient resource, and the referenced patient should be used instead of this Patient record. This is when the link.type value is 'replaced-by'", + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": "outboundLink" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + }, + { + "id": "Patient.link.id", + "path": "Patient.link.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ], + "code": "http://hl7.org/fhirpath/System.String" + } + ], + "condition": [ + "ele-1" + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Patient.link.extension", + "path": "Patient.link.extension", + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Patient.link.modifierExtension", + "path": "Patient.link.modifierExtension", + "short": "Extensions that cannot be ignored even if unrecognized", + "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).", + "alias": [ + "extensions", + "user content", + "modifiers" + ], + "min": 0, + "max": "*", + "base": { + "path": "BackboneElement.modifierExtension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": true, + "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them", + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Patient.link.other", + "path": "Patient.link.other", + "short": "The other patient or related person resource that the link refers to", + "definition": "Link to a Patient or RelatedPerson resource that concerns the same actual individual.", + "comment": "Referencing a RelatedPerson here removes the need to use a Person record to associate a Patient and RelatedPerson as the same individual.", + "min": 1, + "max": "1", + "base": { + "path": "Patient.link.other", + "min": 1, + "max": "1" + }, + "type": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy", + "valueBoolean": false + } + ], + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Patient", + "http://hl7.org/fhir/StructureDefinition/RelatedPerson" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "PID-3, MRG-1" + }, + { + "identity": "rim", + "map": "id" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + }, + { + "id": "Patient.link.type", + "path": "Patient.link.type", + "short": "replaced-by | replaces | refer | seealso", + "definition": "The type of link between this patient resource and another patient resource.", + "min": 1, + "max": "1", + "base": { + "path": "Patient.link.type", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "code" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "mustSupport": false, + "isModifier": false, + "isSummary": true, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "LinkType" + } + ], + "strength": "required", + "description": "The type of link between this patient resource and another Patient resource, or Patient/RelatedPerson when using the `seealso` code", + "valueSet": "http://hl7.org/fhir/ValueSet/link-type|5.0.0" + }, + "mapping": [ + { + "identity": "rim", + "map": "typeCode" + }, + { + "identity": "cda", + "map": "n/a" + } + ] + } + ] + }, + "differential": { + "element": [ + { + "id": "Patient", + "path": "Patient" + }, + { + "id": "Patient.name", + "path": "Patient.name", + "min": 1, + "constraint": [ + { + "key": "eu-pat-1", + "severity": "error", + "human": "given, family, text or a data-absent-reason extension SHALL be present", + "expression": "family.exists() or given.exists() or text.exists() or extension('http://hl7.org/fhir/StructureDefinition/data-absent-reason').exists()", + "source": "http://hl7.eu/fhir/base-r5/StructureDefinition/patient-eu-core" + } + ] + }, + { + "id": "Patient.birthDate", + "path": "Patient.birthDate", + "min": 1 + }, + { + "id": "Patient.birthDate.extension", + "path": "Patient.birthDate.extension", + "slicing": { + "discriminator": [ + { + "type": "value", + "path": "url" + } + ], + "ordered": false, + "rules": "open" + } + }, + { + "id": "Patient.birthDate.extension:dob-absent-reason", + "path": "Patient.birthDate.extension", + "sliceName": "dob-absent-reason", + "short": "Reason for not providing the Date of Birth.", + "definition": "Reason for not providing the Date of Birth.", + "min": 0, + "max": "1", + "type": [ + { + "code": "Extension", + "profile": [ + "http://hl7.org/fhir/StructureDefinition/data-absent-reason" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-patient-eu.json b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-patient-eu.json new file mode 100644 index 00000000..d860226a --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-patient-eu.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"patient-eu","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition patient-eu

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Patient 0..*PatientInformation about an individual or animal receiving health care services
\".\"\".\"\".\" Slices for extension 0..*ExtensionExtension
Slice: Unordered, Open by value:url
\".\"\".\"\".\"\".\" extension:birthPlace 0..1(Complex)Place of Birth for patient
URL: http://hl7.org/fhir/StructureDefinition/patient-birthPlace
\".\"\".\"\".\"\".\"\".\" value[x] 1..1AddressEuValue of extension
\".\"\".\"\".\"\".\" extension:sex-for-clinical-use 0..*(Complex)Sex for clinical use
URL: http://hl7.org/fhir/StructureDefinition/patient-sexParameterForClinicalUse
\".\"\".\"\".\"\".\" extension:patient-citizenship 0..*(Complex)Citizenship
URL: http://hl7.org/fhir/StructureDefinition/patient-citizenship
\".\"\".\"\".\"\".\" extension:patient-nationality 0..*(Complex)Nationality
URL: http://hl7.org/fhir/StructureDefinition/patient-nationality
\".\"\".\"\".\" identifier 0..*IdentifierPatient identifiers
\".\"\".\"\".\" name 0..*HumanNameA name associated with the patient
\".\"\".\"\".\"\".\" Slices for extension Content/Rules for all slices
\".\"\".\"\".\"\".\"\".\" extension:name-absent-reason 0..*codeReason for not providing the name.
URL: http://hl7.org/fhir/StructureDefinition/data-absent-reason
Binding: DataAbsentReason (required)
\".\"\".\"\".\"\".\" text 0..1stringText representation of the full name.
\".\"\".\"\".\"\".\" family 0..1stringFamily name.
Example spanish: Valero Iglesias
\".\"\".\"\".\"\".\" given 0..*stringGiven names. Includes middle names
\".\"\".\"\".\" telecom 0..*ContactPointA contact detail for the patient
\".\"\".\"\".\" gender 0..1codeAdministrative Gender
\".\"\".\"\".\" birthDate 0..1dateThe date of birth for the patient
\".\"\".\"\".\" address 0..*AddressEuAn address for the individual
\".\"\".\"\".\" contact
\".\"\".\"\".\"\".\" relationship 0..*CodeableConceptContact relationship
\".\"\".\"\".\"\".\" name 0..1HumanNameContact name
\".\"\".\"\".\"\".\" telecom 0..*ContactPointContact details for the person
\".\"\".\"\".\"\".\" address 0..1AddressEuContact person address
\".\"\".\"\".\" communication
\".\"\".\"\".\"\".\" language 1..1CodeableConceptCommunication language
\".\"\".\"\".\" generalPractitioner 0..*Reference(Organization (EU base) | PractitionerRole (EU base) | Practitioner (EU base))Patient's nominated primary care provider.

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.eu/fhir/base-r5/StructureDefinition/patient-eu","version":"0.1.0-ballot","name":"PatientEu","title":"Patient (EU base)","status":"draft","date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"This profile specifies how the HL7 FHIR Patient resource should be used for conveying commonly used concepts in the European context.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","fhirVersion":"5.0.0","mapping":[{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"interface","uri":"http://hl7.org/fhir/interface","name":"Interface Pattern"},{"identity":"cda","uri":"http://hl7.org/v3/cda","name":"CDA (R2)"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 V2 Mapping"},{"identity":"loinc","uri":"http://loinc.org","name":"LOINC code for the element"}],"kind":"resource","abstract":false,"type":"Patient","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Patient","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"5.0.0"}],"element":[{"id":"Patient","path":"Patient","short":"Information about an individual or animal receiving health care services","definition":"Demographics and other administrative information about an individual or animal receiving care or other health-related services.","alias":["SubjectOfCare Client Resident"],"min":0,"max":"*","base":{"path":"Patient","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity, Role, or Act,Patient[classCode=PAT]"},{"identity":"w5","map":"administrative.individual"},{"identity":"interface","map":"ParticipantLiving"},{"identity":"cda","map":"ClinicalDocument.recordTarget.patientRole"}]},{"id":"Patient.id","path":"Patient.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Patient.meta","path":"Patient.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Patient.implicitRules","path":"Patient.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of its narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies its meaning or interpretation","isSummary":true},{"id":"Patient.language","path":"Patient.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]}},{"id":"Patient.text","path":"Patient.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have a narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"condition":["dom-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Patient.contained","path":"Patient.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags in their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"condition":["dom-2","dom-4","dom-3","dom-5"],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.extension","path":"Patient.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"ordered":false,"rules":"open"},"short":"Extension","definition":"An Extension","min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false},{"id":"Patient.extension:birthPlace","path":"Patient.extension","sliceName":"birthPlace","short":"Place of Birth for patient","definition":"The registered place of birth of the patient. A sytem may use the address.text if they don't store the birthPlace address in discrete elements.","min":0,"max":"1","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/patient-birthPlace"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false},{"id":"Patient.extension:birthPlace.id","path":"Patient.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.extension:birthPlace.extension","path":"Patient.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Extension","definition":"An Extension","min":0,"max":"0","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false},{"id":"Patient.extension:birthPlace.url","path":"Patient.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"uri"}],"code":"http://hl7.org/fhirpath/System.String"}],"fixedUri":"http://hl7.org/fhir/StructureDefinition/patient-birthPlace","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.extension:birthPlace.value[x]","path":"Patient.extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R5/extensibility.html) for a list).","min":1,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"Address","profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu"]}],"condition":["ext-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.extension:sex-for-clinical-use","path":"Patient.extension","sliceName":"sex-for-clinical-use","short":"Sex for clinical use","definition":"A parameter that provides guidance on how a recipient should apply settings or reference ranges that are derived from observable information such as an organ inventory, recent hormone lab tests, genetic testing, menstrual status, obstetric history, etc..","min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/patient-sexParameterForClinicalUse"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false},{"id":"Patient.extension:patient-citizenship","path":"Patient.extension","sliceName":"patient-citizenship","short":"Citizenship","definition":"The patient's legal status as citizen of a country.","min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/patient-citizenship"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false},{"id":"Patient.extension:patient-nationality","path":"Patient.extension","sliceName":"patient-nationality","short":"Nationality","definition":"The nationality of the patient.","min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/patient-nationality"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false},{"id":"Patient.modifierExtension","path":"Patient.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.identifier","path":"Patient.identifier","short":"Patient identifiers","definition":"An identifier for this patient.","requirements":"Patients are almost always assigned specific numerical identifiers.","min":0,"max":"*","base":{"path":"Patient.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"PID-3"},{"identity":"rim","map":"id"},{"identity":"interface","map":"Participant.identifier"},{"identity":"cda","map":".id"}]},{"id":"Patient.active","path":"Patient.active","short":"Whether this patient's record is in active use","definition":"Whether this patient record is in active use. \nMany systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules.\n\nIt is often used to filter patient lists to exclude inactive patients\n\nDeceased patients may also be marked as inactive for the same reasons, but may be active for some time after death.","comment":"If a record is inactive, and linked to an active record, then future patient/record updates should occur on the other patient.","requirements":"Need to be able to mark a patient record as not to be used because it was created in error.","min":0,"max":"1","base":{"path":"Patient.active","min":0,"max":"1"},"type":[{"code":"boolean"}],"meaningWhenMissing":"This resource is generally assumed to be active if no value is provided for the active element","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that can indicate that a record should not be treated as valid","isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":"statusCode"},{"identity":"interface","map":"Participant.active"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.name","path":"Patient.name","short":"A name associated with the patient","definition":"A name associated with the individual.","comment":"A patient may have multiple names with different uses or applicable periods. For animals, the name is a \"HumanName\" in the sense that is assigned and used by humans and has the same patterns. Animal names may be communicated as given names, and optionally may include a family name.","requirements":"Need to be able to track the patient by multiple names. Examples are your official name and a partner name.\r\nThe Alphabetic representation of the name SHALL be always provided","min":0,"max":"*","base":{"path":"Patient.name","min":0,"max":"*"},"type":[{"code":"HumanName"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-5, PID-9"},{"identity":"rim","map":"name"},{"identity":"interface","map":"Participant.name"},{"identity":"cda","map":".patient.name"}]},{"id":"Patient.name.id","path":"Patient.name.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.name.extension","path":"Patient.name.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.name.extension:name-absent-reason","path":"Patient.name.extension","sliceName":"name-absent-reason","short":"Reason for not providing the name.","definition":"Reason for not providing the name.","min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/data-absent-reason"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"ANY.nullFlavor"}]},{"id":"Patient.name.use","path":"Patient.name.use","short":"usual | official | temp | nickname | anonymous | old | maiden","definition":"Identifies the purpose for this name.","comment":"Applications can assume that a name is current unless it explicitly says that it is temporary or old.","requirements":"Allows the appropriate name for a particular context of use to be selected from among a set of names.","min":0,"max":"1","base":{"path":"HumanName.use","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because applications should not mistake a temporary or old name etc.for a current/permanent one","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"NameUse"}],"strength":"required","description":"The use of a human name.","valueSet":"http://hl7.org/fhir/ValueSet/name-use|5.0.0"},"mapping":[{"identity":"v2","map":"XPN.7, but often indicated by which field contains the name"},{"identity":"rim","map":"unique(./use)"},{"identity":"servd","map":"./NamePurpose"}]},{"id":"Patient.name.text","path":"Patient.name.text","short":"Text representation of the full name.","definition":"Text representation of the full name. Due to the cultural variance around the world a consuming system may not know how to present the name correctly; moreover not all the parts of the name go in given or family. Creators are therefore strongly encouraged to provide through this element a presented version of the name. Future versions of this guide may require this element.","comment":"Can provide both a text representation and parts. Applications updating a name SHALL ensure that when both text and parts are present, no content is included in the text that isn't found in a part.","requirements":"A renderable, unencoded form.","min":0,"max":"1","base":{"path":"HumanName.text","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"implied by XPN.11"},{"identity":"rim","map":"./formatted"}]},{"id":"Patient.name.family","path":"Patient.name.family","short":"Family name.","definition":"Family name. When more the family is composed by more than one names, this element documents the full composed family name with the proper * name.familyrder. The parts are recorded in the fhater and mother family names extensions.","comment":"Family Name may be decomposed into specific parts using extensions (de, nl, es related cultures).","alias":["surname"],"min":0,"max":"1","base":{"path":"HumanName.family","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"spanish","valueString":"Valero Iglesias"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.1/FN.1"},{"identity":"rim","map":"./part[partType = FAM]"},{"identity":"servd","map":"./FamilyName"}]},{"id":"Patient.name.given","path":"Patient.name.given","short":"Given names. Includes middle names","definition":"Given name.","comment":"If only initials are recorded, they may be used in place of the full name parts. Initials may be separated into multiple given names but often aren't due to paractical limitations. This element is not called \"first name\" since given names do not always come first.","alias":["first name","middle name"],"min":0,"max":"*","base":{"path":"HumanName.given","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"Given Names appear in the correct order for presenting the name","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.2 + XPN.3"},{"identity":"rim","map":"./part[partType = GIV]"},{"identity":"servd","map":"./GivenNames"}]},{"id":"Patient.name.prefix","path":"Patient.name.prefix","short":"Parts that come before the name","definition":"Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.","min":0,"max":"*","base":{"path":"HumanName.prefix","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"Prefixes appear in the correct order for presenting the name","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.5"},{"identity":"rim","map":"./part[partType = PFX]"},{"identity":"servd","map":"./TitleCode"}]},{"id":"Patient.name.suffix","path":"Patient.name.suffix","short":"Parts that come after the name","definition":"Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.","min":0,"max":"*","base":{"path":"HumanName.suffix","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"Suffixes appear in the correct order for presenting the name","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN/4"},{"identity":"rim","map":"./part[partType = SFX]"}]},{"id":"Patient.name.period","path":"Patient.name.period","short":"Time period when name was/is in use","definition":"Indicates the period of time when this name was valid for the named person.","requirements":"Allows names to be placed in historical context.","min":0,"max":"1","base":{"path":"HumanName.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.13 + XPN.14"},{"identity":"rim","map":"./usablePeriod[type=\"IVL\"]"},{"identity":"servd","map":"./StartDate and ./EndDate"}]},{"id":"Patient.telecom","path":"Patient.telecom","short":"A contact detail for the patient","definition":"A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.","comment":"A Patient may have multiple ways to be contacted with different uses or applicable periods. May need to have options for contacting the person urgently and also to help with identification. The address might not go directly to the individual, but may reach another party that is able to proxy for the patient (i.e. home phone, or pet owner's phone).","requirements":"People have (primary) ways to contact them in some way such as phone, email.","min":0,"max":"*","base":{"path":"Patient.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-13, PID-14, PID-40"},{"identity":"rim","map":"telecom"},{"identity":"interface","map":"ParticipantContactable.telecom"},{"identity":"cda","map":".telecom"}]},{"id":"Patient.gender","path":"Patient.gender","short":"Administrative Gender","definition":"Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.","comment":"The gender might not match the biological sex as determined by genetics or the individual's preferred identification. Note that for both humans and particularly animals, there are other legitimate possibilities than male and female, though the vast majority of systems and contexts only support male and female. Systems providing decision support or enforcing business rules should ideally do this on the basis of Observations dealing with the specific sex or gender aspect of interest (anatomical, chromosomal, social, etc.) However, because these observations are infrequently recorded, defaulting to the administrative gender is common practice. Where such defaulting occurs, rule enforcement should allow for the variation between administrative and biological, chromosomal and other gender aspects. For example, an alert about a hysterectomy on a male should be handled as a warning or overridable error, not a \"hard\" error. See the Patient Gender and Sex section for additional information about communicating patient gender and sex.","requirements":"Needed for identification of the individual, in combination with (at least) name and birth date.","min":0,"max":"1","base":{"path":"Patient.gender","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AdministrativeGender"}],"strength":"required","description":"The gender of a person used for administrative purposes.","valueSet":"http://hl7.org/fhir/ValueSet/administrative-gender|5.0.0"},"mapping":[{"identity":"v2","map":"PID-8"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/administrativeGender"},{"identity":"interface","map":"ParticipantLiving.gender"},{"identity":"cda","map":".patient.administrativeGenderCode"}]},{"id":"Patient.birthDate","path":"Patient.birthDate","short":"The date of birth for the patient","definition":"The date of birth for the individual.","comment":"Partial dates are allowed if the specific date of birth is unknown. There is a standard extension \"patient-birthTime\" available that should be used where Time is required (such as in maternity/infant care systems).","requirements":"Age of the individual drives many clinical processes.","min":0,"max":"1","base":{"path":"Patient.birthDate","min":0,"max":"1"},"type":[{"code":"date"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-7"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/birthTime"},{"identity":"interface","map":"ParticipantLiving.birthDate"},{"identity":"cda","map":".patient.birthTime"},{"identity":"loinc","map":"21112-8"}]},{"id":"Patient.deceased[x]","path":"Patient.deceased[x]","short":"Indicates if the individual is deceased or not","definition":"Indicates if the individual is deceased or not.","comment":"If there's no value in the instance, it means there is no statement on whether or not the individual is deceased. Most systems will interpret the absence of a value as a sign of the person being alive.","requirements":"The fact that a patient is deceased influences the clinical process. Also, in human communication and relation management it is necessary to know whether the person is alive.","min":0,"max":"1","base":{"path":"Patient.deceased[x]","min":0,"max":"1"},"type":[{"code":"boolean"},{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because once a patient is marked as deceased, the actions that are appropriate to perform on the patient may be significantly different.","isSummary":true,"mapping":[{"identity":"v2","map":"PID-30 (bool) and PID-29 (datetime)"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/deceasedInd, player[classCode=PSN|ANM and determinerCode=INSTANCE]/deceasedTime"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.address","path":"Patient.address","short":"An address for the individual","definition":"An address for the individual.","comment":"Patient may have multiple addresses with different uses or applicable periods.","requirements":"May need to keep track of patient addresses for contacting, billing or reporting requirements and also to help with identification.","min":0,"max":"*","base":{"path":"Patient.address","min":0,"max":"*"},"type":[{"code":"Address","profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-11"},{"identity":"rim","map":"addr"},{"identity":"interface","map":"ParticipantContactable.address"},{"identity":"cda","map":".addr"}]},{"id":"Patient.maritalStatus","path":"Patient.maritalStatus","short":"Marital (civil) status of a patient","definition":"This field contains a patient's most recent marital (civil) status.","requirements":"Most, if not all systems capture it.","min":0,"max":"1","base":{"path":"Patient.maritalStatus","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MaritalStatus"}],"strength":"extensible","description":"The domestic partnership status of a person.","valueSet":"http://hl7.org/fhir/ValueSet/marital-status"},"mapping":[{"identity":"v2","map":"PID-16"},{"identity":"rim","map":"player[classCode=PSN]/maritalStatusCode"},{"identity":"cda","map":".patient.maritalStatusCode"}]},{"id":"Patient.multipleBirth[x]","path":"Patient.multipleBirth[x]","short":"Whether patient is part of a multiple birth","definition":"Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).","comment":"Where the valueInteger is provided, the number is the birth number in the sequence. E.g. The middle birth in triplets would be valueInteger=2 and the third born would have valueInteger=3 If a boolean value was provided for this triplets example, then all 3 patient records would have valueBoolean=true (the ordering is not indicated).","requirements":"For disambiguation of multiple-birth children, especially relevant where the care provider doesn't meet the patient, such as labs.","min":0,"max":"1","base":{"path":"Patient.multipleBirth[x]","min":0,"max":"1"},"type":[{"code":"boolean"},{"code":"integer"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PID-24 (bool), PID-25 (integer)"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/multipleBirthInd, player[classCode=PSN|ANM and determinerCode=INSTANCE]/multipleBirthOrderNumber"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.photo","path":"Patient.photo","short":"Image of the patient","definition":"Image of the patient.","comment":"Guidelines:\n* Use id photos, not clinical photos.\n* Limit dimensions to thumbnail.\n* Keep byte count low to ease resource updates.","requirements":"Many EHR systems have the capability to capture an image of the patient. Fits with newer social media usage too.","min":0,"max":"*","base":{"path":"Patient.photo","min":0,"max":"*"},"type":[{"code":"Attachment"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-5 - needs a profile"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/desc"},{"identity":"interface","map":"ParticipantLiving.photo"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact","path":"Patient.contact","short":"A contact party (e.g. guardian, partner, friend) for the patient","definition":"A contact party (e.g. guardian, partner, friend) for the patient.","comment":"Contact covers all kinds of contact parties: family members, business contacts, guardians, caregivers. Not applicable to register pedigree and family ties beyond use of having contact.","requirements":"Need to track people you can contact about the patient.","min":0,"max":"*","base":{"path":"Patient.contact","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"pat-1","severity":"error","human":"SHALL at least contain a contact's details or a reference to an organization","expression":"name.exists() or telecom.exists() or address.exists() or organization.exists()","source":"http://hl7.org/fhir/StructureDefinition/Patient"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/scopedRole[classCode=CON]"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.id","path":"Patient.contact.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.contact.extension","path":"Patient.contact.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.contact.modifierExtension","path":"Patient.contact.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.contact.relationship","path":"Patient.contact.relationship","short":"Contact relationship","definition":"The nature of the relationship between the patient and the contact person.","requirements":"Used to determine which contact person is the most relevant to approach, depending on circumstances.","min":0,"max":"*","base":{"path":"Patient.contact.relationship","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ContactRelationship"}],"strength":"extensible","description":"The nature of the relationship between a patient and a contact person for that patient.","valueSet":"http://hl7.org/fhir/ValueSet/patient-contactrelationship"},"mapping":[{"identity":"v2","map":"NK1-7, NK1-3"},{"identity":"rim","map":"code"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.name","path":"Patient.contact.name","short":"Contact name","definition":"A name associated with the contact person.","requirements":"Contact persons need to be identified by name, but it is uncommon to need details about multiple other names for that contact person.","min":0,"max":"1","base":{"path":"Patient.contact.name","min":0,"max":"1"},"type":[{"code":"HumanName"}],"condition":["pat-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-2"},{"identity":"rim","map":"name"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.telecom","path":"Patient.contact.telecom","short":"Contact details for the person","definition":"A contact detail for the person, e.g. a telephone number or an email address.","comment":"Contact may have multiple ways to be contacted with different uses or applicable periods. May need to have options for contacting the person urgently, and also to help with identification.","requirements":"People have (primary) ways to contact them in some way such as phone, email.","min":0,"max":"*","base":{"path":"Patient.contact.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"condition":["pat-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-5, NK1-6, NK1-40"},{"identity":"rim","map":"telecom"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.address","path":"Patient.contact.address","short":"Contact person address","definition":"Address for the contact person.","requirements":"Need to keep track where the contact person can be contacted per postal mail or visited.","min":0,"max":"1","base":{"path":"Patient.contact.address","min":0,"max":"1"},"type":[{"code":"Address","profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu"]}],"condition":["pat-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-4"},{"identity":"rim","map":"addr"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.gender","path":"Patient.contact.gender","short":"male | female | other | unknown","definition":"Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.","requirements":"Needed to address the person correctly.","min":0,"max":"1","base":{"path":"Patient.contact.gender","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AdministrativeGender"}],"strength":"required","description":"The gender of a person used for administrative purposes.","valueSet":"http://hl7.org/fhir/ValueSet/administrative-gender|5.0.0"},"mapping":[{"identity":"v2","map":"NK1-15"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/administrativeGender"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.organization","path":"Patient.contact.organization","short":"Organization that is associated with the contact","definition":"Organization on behalf of which the contact is acting or for which the contact is working.","requirements":"For guardians or business related contacts, the organization is relevant.","min":0,"max":"1","base":{"path":"Patient.contact.organization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"condition":["pat-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-13, NK1-30, NK1-31, NK1-32, NK1-41"},{"identity":"rim","map":"scoper"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.period","path":"Patient.contact.period","short":"The period during which this contact person or organization is valid to be contacted relating to this patient","definition":"The period during which this contact person or organization is valid to be contacted relating to this patient.","min":0,"max":"1","base":{"path":"Patient.contact.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"effectiveTime"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.communication","path":"Patient.communication","short":"A language which may be used to communicate with the patient about his or her health","definition":"A language which may be used to communicate with the patient about his or her health.","comment":"If no language is specified, this *implies* that the default local language is spoken. If you need to convey proficiency for multiple modes, then you need multiple Patient.Communication associations. For animals, language is not a relevant field, and should be absent from the instance. If the Patient does not speak the default local language, then the Interpreter Required Standard can be used to explicitly declare that an interpreter is required.","requirements":"If a patient does not speak the local language, interpreters may be required, so languages spoken and proficiency are important things to keep track of both for patient and other persons of interest.","min":0,"max":"*","base":{"path":"Patient.communication","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"LanguageCommunication"},{"identity":"interface","map":"ParticipantLiving.communication"},{"identity":"cda","map":"patient.languageCommunication"}]},{"id":"Patient.communication.id","path":"Patient.communication.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.communication.extension","path":"Patient.communication.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.communication.modifierExtension","path":"Patient.communication.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.communication.language","path":"Patient.communication.language","short":"Communication language","definition":"The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-AU\" for Australian English.","comment":"The structure aa-BB with this exact casing is one the most widely used notations for locale. However not all systems actually code this but instead have it as free text. Hence CodeableConcept instead of code as the data type.","requirements":"Most systems in multilingual countries will want to convey language. Not all systems actually need the regional dialect.","min":1,"max":"1","base":{"path":"Patient.communication.language","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]},"mapping":[{"identity":"v2","map":"PID-15, LAN-2"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/languageCommunication/code"},{"identity":"cda","map":".languageCode"}]},{"id":"Patient.communication.preferred","path":"Patient.communication.preferred","short":"Language preference indicator","definition":"Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).","comment":"This language is specifically identified for communicating healthcare information.","requirements":"People that master multiple languages up to certain level may prefer one or more, i.e. feel more confident in communicating in a particular language making other languages sort of a fall back method.","min":0,"max":"1","base":{"path":"Patient.communication.preferred","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PID-15"},{"identity":"rim","map":"preferenceInd"},{"identity":"cda","map":".preferenceInd"}]},{"id":"Patient.generalPractitioner","path":"Patient.generalPractitioner","short":"Patient's nominated primary care provider.","definition":"Patient's nominated care provider.","comment":"This may be the primary care provider (in a GP context), or it may be a patient nominated care manager in a community/disability setting, or even organization that will provide people to perform the care provider roles. It is not to be used to record Care Teams, these should be in a CareTeam resource that may be linked to the CarePlan or EpisodeOfCare resources.\nMultiple GPs may be recorded against the patient for various reasons, such as a student that has his home GP listed along with the GP at university during the school semesters, or a \"fly-in/fly-out\" worker that has the onsite GP also included with his home GP to remain aware of medical issues.\n\nJurisdictions may decide that they can profile this down to 1 if desired, or 1 per type.","alias":["careProvider"],"min":0,"max":"*","base":{"path":"Patient.generalPractitioner","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu","http://hl7.eu/fhir/base-r5/StructureDefinition/practitionerRole-eu","http://hl7.eu/fhir/base-r5/StructureDefinition/practitioner-eu"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PD1-4"},{"identity":"rim","map":"subjectOf.CareEvent.performer.AssignedEntity"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.managingOrganization","path":"Patient.managingOrganization","short":"Organization that is the custodian of the patient record","definition":"Organization that is the custodian of the patient record.","comment":"There is only one managing organization for a specific patient record. Other organizations will have their own Patient record, and may use the Link property to join the records together (or a Person resource which can include confidence ratings for the association).","requirements":"Need to know who recognizes this patient record, manages and updates it.","min":0,"max":"1","base":{"path":"Patient.managingOrganization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"scoper"},{"identity":"cda","map":".providerOrganization"}]},{"id":"Patient.link","path":"Patient.link","short":"Link to a Patient or RelatedPerson resource that concerns the same actual individual","definition":"Link to a Patient or RelatedPerson resource that concerns the same actual individual.","comment":"There is no assumption that linked patient records have mutual links.","requirements":"There are multiple use cases: \n\n* Duplicate patient records due to the clerical errors associated with the difficulties of identifying humans consistently, and \n* Distribution of patient information across multiple servers.","min":0,"max":"*","base":{"path":"Patient.link","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because it might not be the main Patient resource, and the referenced patient should be used instead of this Patient record. This is when the link.type value is 'replaced-by'","isSummary":true,"mapping":[{"identity":"rim","map":"outboundLink"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.link.id","path":"Patient.link.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.link.extension","path":"Patient.link.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.link.modifierExtension","path":"Patient.link.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.link.other","path":"Patient.link.other","short":"The other patient or related person resource that the link refers to","definition":"Link to a Patient or RelatedPerson resource that concerns the same actual individual.","comment":"Referencing a RelatedPerson here removes the need to use a Person record to associate a Patient and RelatedPerson as the same individual.","min":1,"max":"1","base":{"path":"Patient.link.other","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy","valueBoolean":false}],"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-3, MRG-1"},{"identity":"rim","map":"id"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.link.type","path":"Patient.link.type","short":"replaced-by | replaces | refer | seealso","definition":"The type of link between this patient resource and another patient resource.","min":1,"max":"1","base":{"path":"Patient.link.type","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"LinkType"}],"strength":"required","description":"The type of link between this patient resource and another Patient resource, or Patient/RelatedPerson when using the `seealso` code","valueSet":"http://hl7.org/fhir/ValueSet/link-type|5.0.0"},"mapping":[{"identity":"rim","map":"typeCode"},{"identity":"cda","map":"n/a"}]}]},"differential":{"element":[{"id":"Patient","path":"Patient"},{"id":"Patient.extension","path":"Patient.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"ordered":false,"rules":"open"}},{"id":"Patient.extension:birthPlace","path":"Patient.extension","sliceName":"birthPlace","min":0,"max":"1","type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/patient-birthPlace"]}]},{"id":"Patient.extension:birthPlace.value[x]","path":"Patient.extension.value[x]","type":[{"code":"Address","profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu"]}]},{"id":"Patient.extension:sex-for-clinical-use","path":"Patient.extension","sliceName":"sex-for-clinical-use","short":"Sex for clinical use","min":0,"max":"*","type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/patient-sexParameterForClinicalUse"]}]},{"id":"Patient.extension:patient-citizenship","path":"Patient.extension","sliceName":"patient-citizenship","short":"Citizenship","min":0,"max":"*","type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/patient-citizenship"]}]},{"id":"Patient.extension:patient-nationality","path":"Patient.extension","sliceName":"patient-nationality","short":"Nationality","min":0,"max":"*","type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/patient-nationality"]}]},{"id":"Patient.identifier","path":"Patient.identifier","short":"Patient identifiers"},{"id":"Patient.name","path":"Patient.name","requirements":"Need to be able to track the patient by multiple names. Examples are your official name and a partner name.\r\nThe Alphabetic representation of the name SHALL be always provided"},{"id":"Patient.name.extension:name-absent-reason","path":"Patient.name.extension","sliceName":"name-absent-reason","short":"Reason for not providing the name.","definition":"Reason for not providing the name.","min":0,"max":"*","type":[{"code":"Extension","profile":["http://hl7.org/fhir/StructureDefinition/data-absent-reason"]}]},{"id":"Patient.name.text","path":"Patient.name.text","short":"Text representation of the full name.","definition":"Text representation of the full name. Due to the cultural variance around the world a consuming system may not know how to present the name correctly; moreover not all the parts of the name go in given or family. Creators are therefore strongly encouraged to provide through this element a presented version of the name. Future versions of this guide may require this element."},{"id":"Patient.name.family","path":"Patient.name.family","short":"Family name.","definition":"Family name. When more the family is composed by more than one names, this element documents the full composed family name with the proper * name.familyrder. The parts are recorded in the fhater and mother family names extensions.","example":[{"label":"spanish","valueString":"Valero Iglesias"}]},{"id":"Patient.name.given","path":"Patient.name.given","short":"Given names. Includes middle names"},{"id":"Patient.telecom","path":"Patient.telecom","short":"A contact detail for the patient"},{"id":"Patient.gender","path":"Patient.gender","short":"Administrative Gender"},{"id":"Patient.birthDate","path":"Patient.birthDate","short":"The date of birth for the patient"},{"id":"Patient.address","path":"Patient.address","type":[{"code":"Address","profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu"]}]},{"id":"Patient.contact.relationship","path":"Patient.contact.relationship","short":"Contact relationship"},{"id":"Patient.contact.name","path":"Patient.contact.name","short":"Contact name"},{"id":"Patient.contact.telecom","path":"Patient.contact.telecom","short":"Contact details for the person"},{"id":"Patient.contact.address","path":"Patient.contact.address","short":"Contact person address","type":[{"code":"Address","profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu"]}]},{"id":"Patient.communication.language","path":"Patient.communication.language","short":"Communication language"},{"id":"Patient.generalPractitioner","path":"Patient.generalPractitioner","short":"Patient's nominated primary care provider.","type":[{"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu","http://hl7.eu/fhir/base-r5/StructureDefinition/practitionerRole-eu","http://hl7.eu/fhir/base-r5/StructureDefinition/practitioner-eu"]}]}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-practitioner-eu-core.json b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-practitioner-eu-core.json new file mode 100644 index 00000000..df6106c4 --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-practitioner-eu-core.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"practitioner-eu-core","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition practitioner-eu-core

\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Practitioner 0..*PractitionerEuA person with a formal responsibility in the provisioning of healthcare or related services
\".\"\".\"\".\" name 1..*HumanNamePractitioner Name

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.eu/fhir/base-r5/StructureDefinition/practitioner-eu-core","version":"0.1.0-ballot","name":"PractitionerEuCore","title":"Practitioner (EU core)","status":"draft","date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"This profile sets minimum expectations for the Practitioner resource common to most of the use cases.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","fhirVersion":"5.0.0","mapping":[{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 V2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"interface","uri":"http://hl7.org/fhir/interface","name":"Interface Pattern"},{"identity":"servd","uri":"http://www.omg.org/spec/ServD/1.0/","name":"ServD"}],"kind":"resource","abstract":false,"type":"Practitioner","baseDefinition":"http://hl7.eu/fhir/base-r5/StructureDefinition/practitioner-eu","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"0.1.0-ballot"}],"element":[{"id":"Practitioner","path":"Practitioner","short":"A person with a formal responsibility in the provisioning of healthcare or related services","definition":"A person who is directly or indirectly involved in the provisioning of healthcare or related services.","min":0,"max":"*","base":{"path":"Practitioner","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"name-or-identier","severity":"error","human":"identifier or name SHALL be present","expression":"identifier.exists() or name.exists()","source":"http://hl7.eu/fhir/base-r5/StructureDefinition/practitioner-eu"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity, Role, or Act,Role"},{"identity":"w5","map":"administrative.individual"},{"identity":"v2","map":"PRD (as one example)"},{"identity":"interface","map":"ParticipantLiving"},{"identity":"servd","map":"Provider"}]},{"id":"Practitioner.id","path":"Practitioner.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Practitioner.meta","path":"Practitioner.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Practitioner.implicitRules","path":"Practitioner.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of its narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies its meaning or interpretation","isSummary":true},{"id":"Practitioner.language","path":"Practitioner.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]}},{"id":"Practitioner.text","path":"Practitioner.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have a narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"condition":["dom-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Practitioner.contained","path":"Practitioner.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags in their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"condition":["dom-2","dom-4","dom-3","dom-5"],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Practitioner.extension","path":"Practitioner.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Practitioner.modifierExtension","path":"Practitioner.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Practitioner.identifier","path":"Practitioner.identifier","short":"Practitioner identifier","definition":"An identifier that applies to this person in this role.","requirements":"Often, specific identities are assigned for the agent.","min":0,"max":"*","base":{"path":"Practitioner.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"PRD-7 (or XCN.1)"},{"identity":"rim","map":"./id"},{"identity":"interface","map":"Participant.identifier"},{"identity":"servd","map":"./Identifiers"}]},{"id":"Practitioner.active","path":"Practitioner.active","short":"Whether this practitioner's record is in active use","definition":"Whether this practitioner's record is in active use.","comment":"If the practitioner is not in use by one organization, then it should mark the period on the PractitonerRole with an end date (even if they are active) as they may be active in another role.","requirements":"Need to be able to mark a practitioner record as not to be used because it was created in error.","min":0,"max":"1","base":{"path":"Practitioner.active","min":0,"max":"1"},"type":[{"code":"boolean"}],"meaningWhenMissing":"This resource is generally assumed to be active if no value is provided for the active element","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that can indicate that a record should not be treated as valid","isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":"./statusCode"},{"identity":"interface","map":"Participant.active"}]},{"id":"Practitioner.name","path":"Practitioner.name","short":"Practitioner Name","definition":"The name(s) associated with the practitioner.","comment":"The selection of the use property should ensure that there is a single usual name specified, and others use the nickname (alias), old, or other values as appropriate. \r\rIn general, select the value to be used in the ResourceReference.display based on this:\r\r1. There is more than 1 name\r2. Use = usual\r3. Period is current to the date of the usage\r4. Use = official\r5. Other order as decided by internal business rules.","requirements":"The name(s) that a Practitioner is known by. Where there are multiple, the name that the practitioner is usually known as should be used in the display.","min":1,"max":"*","base":{"path":"Practitioner.name","min":0,"max":"*"},"type":[{"code":"HumanName"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XCN Components"},{"identity":"rim","map":"./name"},{"identity":"interface","map":"Participant.name"},{"identity":"servd","map":"./PreferredName (GivenNames, FamilyName, TitleCode)"}]},{"id":"Practitioner.telecom","path":"Practitioner.telecom","short":"A contact detail for the practitioner (that apply to all roles)","definition":"A contact detail for the practitioner, e.g. a telephone number or an email address.","comment":"Person may have multiple ways to be contacted with different uses or applicable periods. May need to have options for contacting the person urgently and to help with identification. These typically will have home numbers, or mobile numbers that are not role specific.","requirements":"Need to know how to reach a practitioner independent to any roles the practitioner may have.","min":0,"max":"*","base":{"path":"Practitioner.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PRT-15, STF-10, ROL-12"},{"identity":"rim","map":"./telecom"},{"identity":"interface","map":"ParticipantContactable.telecom"},{"identity":"servd","map":"./ContactPoints"}]},{"id":"Practitioner.gender","path":"Practitioner.gender","short":"male | female | other | unknown","definition":"Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.","requirements":"Needed to address the person correctly.","min":0,"max":"1","base":{"path":"Practitioner.gender","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AdministrativeGender"}],"strength":"required","description":"The gender of a person used for administrative purposes.","valueSet":"http://hl7.org/fhir/ValueSet/administrative-gender|5.0.0"},"mapping":[{"identity":"v2","map":"STF-5"},{"identity":"rim","map":"./administrativeGender"},{"identity":"interface","map":"ParticipantLiving.gender"},{"identity":"servd","map":"./GenderCode"}]},{"id":"Practitioner.birthDate","path":"Practitioner.birthDate","short":"The date on which the practitioner was born","definition":"The date of birth for the practitioner.","requirements":"Needed for identification.","min":0,"max":"1","base":{"path":"Practitioner.birthDate","min":0,"max":"1"},"type":[{"code":"date"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"STF-6"},{"identity":"rim","map":"./birthTime"},{"identity":"interface","map":"ParticipantLiving.birthDate"},{"identity":"servd","map":"(not represented in ServD)"}]},{"id":"Practitioner.deceased[x]","path":"Practitioner.deceased[x]","short":"Indicates if the practitioner is deceased or not","definition":"Indicates if the practitioner is deceased or not.","comment":"If there's no value in the instance, it means there is no statement on whether or not the practitioner is deceased. Most systems will interpret the absence of a value as a sign of the person being alive.","min":0,"max":"1","base":{"path":"Practitioner.deceased[x]","min":0,"max":"1"},"type":[{"code":"boolean"},{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/deceasedInd, player[classCode=PSN|ANM and determinerCode=INSTANCE]/deceasedTime"}]},{"id":"Practitioner.address","path":"Practitioner.address","short":"Address(es) of the practitioner that are not role specific (typically home address)","definition":"Address(es) of the practitioner that are not role specific (typically home address). \rWork addresses are not typically entered in this property as they are usually role dependent.","comment":"The PractitionerRole does not have an address value on it, as it is expected that the location property be used for this purpose (which has an address).","requirements":"The home/mailing address of the practitioner is often required for employee administration purposes, and also for some rostering services where the start point (practitioners home) can be used in calculations.","min":0,"max":"*","base":{"path":"Practitioner.address","min":0,"max":"*"},"type":[{"code":"Address","profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"ORC-24, STF-11, ROL-11, PRT-14"},{"identity":"rim","map":"./addr"},{"identity":"interface","map":"ParticipantContactable.address"},{"identity":"servd","map":"./Addresses"}]},{"id":"Practitioner.photo","path":"Practitioner.photo","short":"Image of the person","definition":"Image of the person.","requirements":"Many EHR systems have the capability to capture an image of patients and personnel. Fits with newer social media usage too.","min":0,"max":"*","base":{"path":"Practitioner.photo","min":0,"max":"*"},"type":[{"code":"Attachment"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"./subjectOf/ObservationEvent[code=\"photo\"]/value"},{"identity":"interface","map":"ParticipantLiving.photo"},{"identity":"servd","map":"./ImageURI (only supports the URI reference)"}]},{"id":"Practitioner.qualification","path":"Practitioner.qualification","short":"Qualifications, certifications, accreditations, licenses, training, etc. pertaining to the provision of care","definition":"The official qualifications, certifications, accreditations, training, licenses (and other types of educations/skills/capabilities) that authorize or otherwise pertain to the provision of care by the practitioner.\r\rFor example, a medical license issued by a medical board of licensure authorizing the practitioner to practice medicine within a certain locality.","comment":"The PractitionerRole.specialty defines the functional role that they are practicing at a given organization or location. Those specialties may or might not require a qualification, and are not defined on the practitioner.","min":0,"max":"*","base":{"path":"Practitioner.qualification","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"CER?"},{"identity":"rim","map":".playingEntity.playingRole[classCode=QUAL].code"},{"identity":"servd","map":"./Qualifications"}]},{"id":"Practitioner.qualification.id","path":"Practitioner.qualification.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Practitioner.qualification.extension","path":"Practitioner.qualification.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Practitioner.qualification.modifierExtension","path":"Practitioner.qualification.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Practitioner.qualification.identifier","path":"Practitioner.qualification.identifier","short":"An identifier for this qualification for the practitioner","definition":"An identifier that applies to this person's qualification.","requirements":"Often, specific identities are assigned for the qualification.","min":0,"max":"*","base":{"path":"Practitioner.qualification.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".playingEntity.playingRole[classCode=QUAL].id"}]},{"id":"Practitioner.qualification.code","path":"Practitioner.qualification.code","short":"Coded representation of the qualification","definition":"Coded representation of the qualification.","min":1,"max":"1","base":{"path":"Practitioner.qualification.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Qualification"}],"strength":"example","description":"Specific qualification the practitioner has to provide a service.","valueSet":"http://terminology.hl7.org/ValueSet/v2-0360"},"mapping":[{"identity":"rim","map":".playingEntity.playingRole[classCode=QUAL].code"},{"identity":"servd","map":"./Qualifications.Value"}]},{"id":"Practitioner.qualification.period","path":"Practitioner.qualification.period","short":"Period during which the qualification is valid","definition":"Period during which the qualification is valid.","requirements":"Qualifications are often for a limited period of time, and can be revoked.","min":0,"max":"1","base":{"path":"Practitioner.qualification.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".playingEntity.playingRole[classCode=QUAL].effectiveTime"},{"identity":"servd","map":"./Qualifications.StartDate and ./Qualifications.EndDate"}]},{"id":"Practitioner.qualification.issuer","path":"Practitioner.qualification.issuer","short":"Organization that regulates and issues the qualification","definition":"Organization that regulates and issues the qualification.","min":0,"max":"1","base":{"path":"Practitioner.qualification.issuer","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".playingEntity.playingRole[classCode=QUAL].scoper"}]},{"id":"Practitioner.communication","path":"Practitioner.communication","short":"A language which may be used to communicate with the practitioner","definition":"A language which may be used to communicate with the practitioner, often for correspondence/administrative purposes.\r\rThe `PractitionerRole.communication` property should be used for publishing the languages that a practitioner is able to communicate with patients (on a per Organization/Role basis).","comment":"If no language is specified, this *implies* that the default local language is spoken. If you need to convey proficiency for multiple modes, then you need multiple Practitioner.Communication associations.\r\rFor animals, language is not a relevant field, and should be absent from the instance.","min":0,"max":"*","base":{"path":"Practitioner.communication","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"LanguageCommunication"}]},{"id":"Practitioner.communication.id","path":"Practitioner.communication.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Practitioner.communication.extension","path":"Practitioner.communication.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Practitioner.communication.modifierExtension","path":"Practitioner.communication.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Practitioner.communication.language","path":"Practitioner.communication.language","short":"The language code used to communicate with the practitioner","definition":"The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-AU\" for Australian English.","comment":"The structure aa-BB with this exact casing is one the most widely used notations for locale. However not all systems actually code this but instead have it as free text. Hence CodeableConcept instead of code as the data type.","requirements":"Most systems in multilingual countries will want to convey language. Not all systems actually need the regional dialect.","min":1,"max":"1","base":{"path":"Practitioner.communication.language","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]},"mapping":[{"identity":"v2","map":"PID-15, LAN-2"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/languageCommunication/code"}]},{"id":"Practitioner.communication.preferred","path":"Practitioner.communication.preferred","short":"Language preference indicator","definition":"Indicates whether or not the person prefers this language (over other languages he masters up a certain level).","comment":"This language is specifically identified for communicating directly with the practitioner (typically un-related to patient communications).","requirements":"People that master multiple languages up to certain level may prefer one or more, i.e. feel more confident in communicating in a particular language making other languages sort of a fall back method.","min":0,"max":"1","base":{"path":"Practitioner.communication.preferred","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"preferenceInd"}]}]},"differential":{"element":[{"id":"Practitioner","path":"Practitioner"},{"id":"Practitioner.name","path":"Practitioner.name","min":1}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-practitioner-eu.json b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-practitioner-eu.json new file mode 100644 index 00000000..18f24d98 --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-practitioner-eu.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"practitioner-eu","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition practitioner-eu

\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Practitioner C0..*PractitionerA person with a formal responsibility in the provisioning of healthcare or related services
name-or-identier: identifier or name SHALL be present
\".\"\".\"\".\" identifier 0..*IdentifierPractitioner identifier
\".\"\".\"\".\" name 0..*HumanNamePractitioner Name
\".\"\".\"\".\" address 0..*AddressEuAddress(es) of the practitioner that are not role specific (typically home address)

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.eu/fhir/base-r5/StructureDefinition/practitioner-eu","version":"0.1.0-ballot","name":"PractitionerEu","title":"Practitioner (EU base)","status":"draft","date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"This profile specifies how the HL7 FHIR Practitioner resource should be used for conveying commonly used concepts in the European context.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","fhirVersion":"5.0.0","mapping":[{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 V2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"interface","uri":"http://hl7.org/fhir/interface","name":"Interface Pattern"},{"identity":"servd","uri":"http://www.omg.org/spec/ServD/1.0/","name":"ServD"}],"kind":"resource","abstract":false,"type":"Practitioner","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Practitioner","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"5.0.0"}],"element":[{"id":"Practitioner","path":"Practitioner","short":"A person with a formal responsibility in the provisioning of healthcare or related services","definition":"A person who is directly or indirectly involved in the provisioning of healthcare or related services.","min":0,"max":"*","base":{"path":"Practitioner","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"name-or-identier","severity":"error","human":"identifier or name SHALL be present","expression":"identifier.exists() or name.exists()","source":"http://hl7.eu/fhir/base-r5/StructureDefinition/practitioner-eu"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity, Role, or Act,Role"},{"identity":"w5","map":"administrative.individual"},{"identity":"v2","map":"PRD (as one example)"},{"identity":"interface","map":"ParticipantLiving"},{"identity":"servd","map":"Provider"}]},{"id":"Practitioner.id","path":"Practitioner.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Practitioner.meta","path":"Practitioner.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"Practitioner.implicitRules","path":"Practitioner.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of its narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies its meaning or interpretation","isSummary":true},{"id":"Practitioner.language","path":"Practitioner.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]}},{"id":"Practitioner.text","path":"Practitioner.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have a narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"condition":["dom-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Practitioner.contained","path":"Practitioner.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags in their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"condition":["dom-2","dom-4","dom-3","dom-5"],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Practitioner.extension","path":"Practitioner.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Practitioner.modifierExtension","path":"Practitioner.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Practitioner.identifier","path":"Practitioner.identifier","short":"Practitioner identifier","definition":"An identifier that applies to this person in this role.","requirements":"Often, specific identities are assigned for the agent.","min":0,"max":"*","base":{"path":"Practitioner.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"PRD-7 (or XCN.1)"},{"identity":"rim","map":"./id"},{"identity":"interface","map":"Participant.identifier"},{"identity":"servd","map":"./Identifiers"}]},{"id":"Practitioner.active","path":"Practitioner.active","short":"Whether this practitioner's record is in active use","definition":"Whether this practitioner's record is in active use.","comment":"If the practitioner is not in use by one organization, then it should mark the period on the PractitonerRole with an end date (even if they are active) as they may be active in another role.","requirements":"Need to be able to mark a practitioner record as not to be used because it was created in error.","min":0,"max":"1","base":{"path":"Practitioner.active","min":0,"max":"1"},"type":[{"code":"boolean"}],"meaningWhenMissing":"This resource is generally assumed to be active if no value is provided for the active element","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that can indicate that a record should not be treated as valid","isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":"./statusCode"},{"identity":"interface","map":"Participant.active"}]},{"id":"Practitioner.name","path":"Practitioner.name","short":"Practitioner Name","definition":"The name(s) associated with the practitioner.","comment":"The selection of the use property should ensure that there is a single usual name specified, and others use the nickname (alias), old, or other values as appropriate. \r\rIn general, select the value to be used in the ResourceReference.display based on this:\r\r1. There is more than 1 name\r2. Use = usual\r3. Period is current to the date of the usage\r4. Use = official\r5. Other order as decided by internal business rules.","requirements":"The name(s) that a Practitioner is known by. Where there are multiple, the name that the practitioner is usually known as should be used in the display.","min":0,"max":"*","base":{"path":"Practitioner.name","min":0,"max":"*"},"type":[{"code":"HumanName"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XCN Components"},{"identity":"rim","map":"./name"},{"identity":"interface","map":"Participant.name"},{"identity":"servd","map":"./PreferredName (GivenNames, FamilyName, TitleCode)"}]},{"id":"Practitioner.telecom","path":"Practitioner.telecom","short":"A contact detail for the practitioner (that apply to all roles)","definition":"A contact detail for the practitioner, e.g. a telephone number or an email address.","comment":"Person may have multiple ways to be contacted with different uses or applicable periods. May need to have options for contacting the person urgently and to help with identification. These typically will have home numbers, or mobile numbers that are not role specific.","requirements":"Need to know how to reach a practitioner independent to any roles the practitioner may have.","min":0,"max":"*","base":{"path":"Practitioner.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PRT-15, STF-10, ROL-12"},{"identity":"rim","map":"./telecom"},{"identity":"interface","map":"ParticipantContactable.telecom"},{"identity":"servd","map":"./ContactPoints"}]},{"id":"Practitioner.gender","path":"Practitioner.gender","short":"male | female | other | unknown","definition":"Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.","requirements":"Needed to address the person correctly.","min":0,"max":"1","base":{"path":"Practitioner.gender","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AdministrativeGender"}],"strength":"required","description":"The gender of a person used for administrative purposes.","valueSet":"http://hl7.org/fhir/ValueSet/administrative-gender|5.0.0"},"mapping":[{"identity":"v2","map":"STF-5"},{"identity":"rim","map":"./administrativeGender"},{"identity":"interface","map":"ParticipantLiving.gender"},{"identity":"servd","map":"./GenderCode"}]},{"id":"Practitioner.birthDate","path":"Practitioner.birthDate","short":"The date on which the practitioner was born","definition":"The date of birth for the practitioner.","requirements":"Needed for identification.","min":0,"max":"1","base":{"path":"Practitioner.birthDate","min":0,"max":"1"},"type":[{"code":"date"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"STF-6"},{"identity":"rim","map":"./birthTime"},{"identity":"interface","map":"ParticipantLiving.birthDate"},{"identity":"servd","map":"(not represented in ServD)"}]},{"id":"Practitioner.deceased[x]","path":"Practitioner.deceased[x]","short":"Indicates if the practitioner is deceased or not","definition":"Indicates if the practitioner is deceased or not.","comment":"If there's no value in the instance, it means there is no statement on whether or not the practitioner is deceased. Most systems will interpret the absence of a value as a sign of the person being alive.","min":0,"max":"1","base":{"path":"Practitioner.deceased[x]","min":0,"max":"1"},"type":[{"code":"boolean"},{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/deceasedInd, player[classCode=PSN|ANM and determinerCode=INSTANCE]/deceasedTime"}]},{"id":"Practitioner.address","path":"Practitioner.address","short":"Address(es) of the practitioner that are not role specific (typically home address)","definition":"Address(es) of the practitioner that are not role specific (typically home address). \rWork addresses are not typically entered in this property as they are usually role dependent.","comment":"The PractitionerRole does not have an address value on it, as it is expected that the location property be used for this purpose (which has an address).","requirements":"The home/mailing address of the practitioner is often required for employee administration purposes, and also for some rostering services where the start point (practitioners home) can be used in calculations.","min":0,"max":"*","base":{"path":"Practitioner.address","min":0,"max":"*"},"type":[{"code":"Address","profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"ORC-24, STF-11, ROL-11, PRT-14"},{"identity":"rim","map":"./addr"},{"identity":"interface","map":"ParticipantContactable.address"},{"identity":"servd","map":"./Addresses"}]},{"id":"Practitioner.photo","path":"Practitioner.photo","short":"Image of the person","definition":"Image of the person.","requirements":"Many EHR systems have the capability to capture an image of patients and personnel. Fits with newer social media usage too.","min":0,"max":"*","base":{"path":"Practitioner.photo","min":0,"max":"*"},"type":[{"code":"Attachment"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"./subjectOf/ObservationEvent[code=\"photo\"]/value"},{"identity":"interface","map":"ParticipantLiving.photo"},{"identity":"servd","map":"./ImageURI (only supports the URI reference)"}]},{"id":"Practitioner.qualification","path":"Practitioner.qualification","short":"Qualifications, certifications, accreditations, licenses, training, etc. pertaining to the provision of care","definition":"The official qualifications, certifications, accreditations, training, licenses (and other types of educations/skills/capabilities) that authorize or otherwise pertain to the provision of care by the practitioner.\r\rFor example, a medical license issued by a medical board of licensure authorizing the practitioner to practice medicine within a certain locality.","comment":"The PractitionerRole.specialty defines the functional role that they are practicing at a given organization or location. Those specialties may or might not require a qualification, and are not defined on the practitioner.","min":0,"max":"*","base":{"path":"Practitioner.qualification","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"CER?"},{"identity":"rim","map":".playingEntity.playingRole[classCode=QUAL].code"},{"identity":"servd","map":"./Qualifications"}]},{"id":"Practitioner.qualification.id","path":"Practitioner.qualification.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Practitioner.qualification.extension","path":"Practitioner.qualification.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Practitioner.qualification.modifierExtension","path":"Practitioner.qualification.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Practitioner.qualification.identifier","path":"Practitioner.qualification.identifier","short":"An identifier for this qualification for the practitioner","definition":"An identifier that applies to this person's qualification.","requirements":"Often, specific identities are assigned for the qualification.","min":0,"max":"*","base":{"path":"Practitioner.qualification.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".playingEntity.playingRole[classCode=QUAL].id"}]},{"id":"Practitioner.qualification.code","path":"Practitioner.qualification.code","short":"Coded representation of the qualification","definition":"Coded representation of the qualification.","min":1,"max":"1","base":{"path":"Practitioner.qualification.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Qualification"}],"strength":"example","description":"Specific qualification the practitioner has to provide a service.","valueSet":"http://terminology.hl7.org/ValueSet/v2-0360"},"mapping":[{"identity":"rim","map":".playingEntity.playingRole[classCode=QUAL].code"},{"identity":"servd","map":"./Qualifications.Value"}]},{"id":"Practitioner.qualification.period","path":"Practitioner.qualification.period","short":"Period during which the qualification is valid","definition":"Period during which the qualification is valid.","requirements":"Qualifications are often for a limited period of time, and can be revoked.","min":0,"max":"1","base":{"path":"Practitioner.qualification.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".playingEntity.playingRole[classCode=QUAL].effectiveTime"},{"identity":"servd","map":"./Qualifications.StartDate and ./Qualifications.EndDate"}]},{"id":"Practitioner.qualification.issuer","path":"Practitioner.qualification.issuer","short":"Organization that regulates and issues the qualification","definition":"Organization that regulates and issues the qualification.","min":0,"max":"1","base":{"path":"Practitioner.qualification.issuer","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".playingEntity.playingRole[classCode=QUAL].scoper"}]},{"id":"Practitioner.communication","path":"Practitioner.communication","short":"A language which may be used to communicate with the practitioner","definition":"A language which may be used to communicate with the practitioner, often for correspondence/administrative purposes.\r\rThe `PractitionerRole.communication` property should be used for publishing the languages that a practitioner is able to communicate with patients (on a per Organization/Role basis).","comment":"If no language is specified, this *implies* that the default local language is spoken. If you need to convey proficiency for multiple modes, then you need multiple Practitioner.Communication associations.\r\rFor animals, language is not a relevant field, and should be absent from the instance.","min":0,"max":"*","base":{"path":"Practitioner.communication","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"LanguageCommunication"}]},{"id":"Practitioner.communication.id","path":"Practitioner.communication.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"condition":["ele-1"],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Practitioner.communication.extension","path":"Practitioner.communication.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Practitioner.communication.modifierExtension","path":"Practitioner.communication.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Practitioner.communication.language","path":"Practitioner.communication.language","short":"The language code used to communicate with the practitioner","definition":"The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-AU\" for Australian English.","comment":"The structure aa-BB with this exact casing is one the most widely used notations for locale. However not all systems actually code this but instead have it as free text. Hence CodeableConcept instead of code as the data type.","requirements":"Most systems in multilingual countries will want to convey language. Not all systems actually need the regional dialect.","min":1,"max":"1","base":{"path":"Practitioner.communication.language","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]},"mapping":[{"identity":"v2","map":"PID-15, LAN-2"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/languageCommunication/code"}]},{"id":"Practitioner.communication.preferred","path":"Practitioner.communication.preferred","short":"Language preference indicator","definition":"Indicates whether or not the person prefers this language (over other languages he masters up a certain level).","comment":"This language is specifically identified for communicating directly with the practitioner (typically un-related to patient communications).","requirements":"People that master multiple languages up to certain level may prefer one or more, i.e. feel more confident in communicating in a particular language making other languages sort of a fall back method.","min":0,"max":"1","base":{"path":"Practitioner.communication.preferred","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"preferenceInd"}]}]},"differential":{"element":[{"id":"Practitioner","path":"Practitioner","constraint":[{"key":"name-or-identier","severity":"error","human":"identifier or name SHALL be present","expression":"identifier.exists() or name.exists()","source":"http://hl7.eu/fhir/base-r5/StructureDefinition/practitioner-eu"}]},{"id":"Practitioner.identifier","path":"Practitioner.identifier","short":"Practitioner identifier"},{"id":"Practitioner.name","path":"Practitioner.name","short":"Practitioner Name"},{"id":"Practitioner.address","path":"Practitioner.address","type":[{"code":"Address","profile":["http://hl7.eu/fhir/base-r5/StructureDefinition/Address-eu"]}]}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-practitionerRole-eu-core.json b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-practitionerRole-eu-core.json new file mode 100644 index 00000000..d33a0713 --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-practitionerRole-eu-core.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"practitionerRole-eu-core","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition practitionerRole-eu-core

\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" PractitionerRole 0..*PractitionerRoleEuRoles/organizations the practitioner is associated with
\".\"\".\"\".\" practitioner 0..1Reference(Practitioner (EU core))Practitioner that provides services for the organization
\".\"\".\"\".\" organization 0..1Reference(Organization (EU core))Organization where the roles are available

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.eu/fhir/base-r5/StructureDefinition/practitionerRole-eu-core","version":"0.1.0-ballot","name":"PractitionerRoleEuCore","title":"PractitionerRole (EU core)","status":"draft","date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"This profile sets minimum expectations for the PractitionerRole resource common to most of the use cases.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","fhirVersion":"5.0.0","mapping":[{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 V2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"interface","uri":"http://hl7.org/fhir/interface","name":"Interface Pattern"},{"identity":"servd","uri":"http://www.omg.org/spec/ServD/1.0/","name":"ServD"}],"kind":"resource","abstract":false,"type":"PractitionerRole","baseDefinition":"http://hl7.eu/fhir/base-r5/StructureDefinition/practitionerRole-eu","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"0.1.0-ballot"}],"element":[{"id":"PractitionerRole","path":"PractitionerRole","short":"Roles/organizations the practitioner is associated with","definition":"A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.","min":0,"max":"*","base":{"path":"PractitionerRole","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity, Role, or Act,Role"},{"identity":"w5","map":"administrative.individual"},{"identity":"v2","map":"PRD (as one example)"},{"identity":"interface","map":"Participant"},{"identity":"servd","map":"ServiceSiteProvider"}]},{"id":"PractitionerRole.id","path":"PractitionerRole.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"PractitionerRole.meta","path":"PractitionerRole.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"PractitionerRole.implicitRules","path":"PractitionerRole.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of its narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies its meaning or interpretation","isSummary":true},{"id":"PractitionerRole.language","path":"PractitionerRole.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]}},{"id":"PractitionerRole.text","path":"PractitionerRole.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have a narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"condition":["dom-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"PractitionerRole.contained","path":"PractitionerRole.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags in their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"condition":["dom-2","dom-4","dom-3","dom-5"],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"PractitionerRole.extension","path":"PractitionerRole.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"PractitionerRole.modifierExtension","path":"PractitionerRole.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"PractitionerRole.identifier","path":"PractitionerRole.identifier","short":"Business identifier","definition":"Business Identifiers that are specific to a role/location.","comment":"A specific identifier value (e.g. Minnesota Registration ID) may appear on multiple PractitionerRole instances which could be for different periods, or different Roles (or other reasons). A specific identifier may be included multiple times in the same PractitionerRole instance with different identifier validity periods.","requirements":"Often, specific identities are assigned for the agent.","min":0,"max":"*","base":{"path":"PractitionerRole.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"PRD-7 (or XCN.1)"},{"identity":"rim","map":".id"},{"identity":"interface","map":"Participant.identifier"},{"identity":"servd","map":"./Identifiers"}]},{"id":"PractitionerRole.active","path":"PractitionerRole.active","short":"Whether this practitioner role record is in active use","definition":" Whether this practitioner role record is in active use. Some systems may use this property to mark non-active practitioners, such as those that are not currently employed.","comment":"If this value is false, you may refer to the period to see when the role was in active use. If there is no period specified, no inference can be made about when it was active.","requirements":"Need to be able to mark a practitioner role record as not to be used because it was created in error, or otherwise no longer in active use.","min":0,"max":"1","base":{"path":"PractitionerRole.active","min":0,"max":"1"},"type":[{"code":"boolean"}],"meaningWhenMissing":"This resource is generally assumed to be active if no value is provided for the active element","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"v2","map":"STF-7"},{"identity":"rim","map":".statusCode"},{"identity":"interface","map":"Participant.active"}]},{"id":"PractitionerRole.period","path":"PractitionerRole.period","short":"The period during which the practitioner is authorized to perform in these role(s)","definition":"The period during which the person is authorized to act as a practitioner in these role(s) for the organization.","comment":"If a practitioner is performing a role within an organization over multiple, non-adjacent periods, there should be a distinct PractitionerRole instance for each period. For example, if a nurse is employed at a hospital, leaves the organization for a period of time due to pandemic related stress, but returns post-pandemic to the same job role, there would be two PractitionerRole instances for the different periods of employment.","requirements":"Even after the agencies is revoked, the fact that it existed must still be recorded.","min":0,"max":"1","base":{"path":"PractitionerRole.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"v2","map":"PRD-8/9 / PRA-5.4"},{"identity":"rim","map":".performance[@typeCode <= 'PPRF'].ActDefinitionOrEvent.effectiveTime"},{"identity":"servd","map":"(ServD maps Practitioners and Organizations via another entity, so this concept is not available)"}]},{"id":"PractitionerRole.practitioner","path":"PractitionerRole.practitioner","short":"Practitioner that provides services for the organization","definition":"Practitioner that is able to provide the defined services for the organization.","min":0,"max":"1","base":{"path":"PractitionerRole.practitioner","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/practitioner-eu-core"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".player"}]},{"id":"PractitionerRole.organization","path":"PractitionerRole.organization","short":"Organization where the roles are available","definition":"The organization where the Practitioner performs the roles associated.","min":0,"max":"1","base":{"path":"PractitionerRole.organization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu-core"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".scoper"}]},{"id":"PractitionerRole.code","path":"PractitionerRole.code","short":"Roles which this practitioner may perform","definition":"Roles which this practitioner is authorized to perform for the organization.","comment":"A person may have more than one role.","requirements":"Need to know what authority the practitioner has - what can they do?","min":0,"max":"*","base":{"path":"PractitionerRole.code","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"PractitionerRole"}],"strength":"example","description":"The role a person plays representing an organization.","valueSet":"http://hl7.org/fhir/ValueSet/practitioner-role"},"mapping":[{"identity":"v2","map":"PRD-1 / STF-18 / PRA-3 / PRT-4 / ROL-3 / ORC-12 / OBR-16 / PV1-7 / PV1-8 / PV1-9 / PV1-17"},{"identity":"rim","map":".code"},{"identity":"interface","map":"Participant.name"},{"identity":"servd","map":"(ServD maps Practitioners and Organizations via another entity, so this concept is not available)"}]},{"id":"PractitionerRole.specialty","path":"PractitionerRole.specialty","short":"Specific specialty of the practitioner","definition":"The specialty of a practitioner that describes the functional role they are practicing at a given organization or location.","comment":"The specialty represents the functional role a practitioner is playing within an organization/location. This role may require the individual have certain qualifications, which would be represented in the Practitioner.qualifications property. Note that qualifications may or might not relate to or be required by the practicing specialty.","min":0,"max":"*","base":{"path":"PractitionerRole.specialty","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"PractitionerSpecialty"}],"strength":"preferred","description":"Specific specialty associated with the agency.","valueSet":"http://hl7.org/fhir/ValueSet/c80-practice-codes"},"mapping":[{"identity":"v2","map":"PRA-5"},{"identity":"rim","map":".player.HealthCareProvider[@classCode = 'PROV'].code"},{"identity":"servd","map":"./Specialty"}]},{"id":"PractitionerRole.location","path":"PractitionerRole.location","short":"Location(s) where the practitioner provides care","definition":"The location(s) at which this practitioner provides care.","min":0,"max":"*","base":{"path":"PractitionerRole.location","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Location"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.where[x]"},{"identity":"rim","map":".performance.ActDefinitionOrEvent.ServiceDeliveryLocation[@classCode = 'SDLOC']"},{"identity":"servd","map":"(ServD maps Practitioners and Organizations via another entity, so this concept is not available)
However these are accessed via the Site.ServiceSite.ServiceSiteProvider record. (The Site has the location)"}]},{"id":"PractitionerRole.healthcareService","path":"PractitionerRole.healthcareService","short":"Healthcare services provided for this role's Organization/Location(s)","definition":"The list of healthcare services that this worker provides for this role's Organization/Location(s).","min":0,"max":"*","base":{"path":"PractitionerRole.healthcareService","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/HealthcareService"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"EDU-2 / AFF-3"},{"identity":"rim","map":".player.QualifiedEntity[@classCode = 'QUAL'].code"}]},{"id":"PractitionerRole.contact","path":"PractitionerRole.contact","short":"Official contact details relating to this PractitionerRole","definition":"The contact details of communication devices available relevant to the specific PractitionerRole. This can include addresses, phone numbers, fax numbers, mobile numbers, email addresses and web sites.","requirements":"Often practitioners have a dedicated line for each location (or service) that they work at, and need to be able to define separate contact details for each of these. Sometimes these also include a named person/organization that handles contact for specific purposes, such as a receptionist, or accounts clerk etc.","min":0,"max":"*","base":{"path":"PractitionerRole.contact","min":0,"max":"*"},"type":[{"code":"ExtendedContactDetail"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false},{"id":"PractitionerRole.characteristic","path":"PractitionerRole.characteristic","short":"Collection of characteristics (attributes)","definition":"Collection of characteristics (attributes).","comment":"These could be such things as is the service mode used by this role.","min":0,"max":"*","base":{"path":"PractitionerRole.characteristic","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ServiceCharacteristic"}],"strength":"example","description":"A custom attribute that could be provided at a service (e.g. Wheelchair accessibility).","valueSet":"http://hl7.org/fhir/ValueSet/service-mode"},"mapping":[{"identity":"rim","map":".actrelationship[typeCode=PERT].observation"}]},{"id":"PractitionerRole.communication","path":"PractitionerRole.communication","short":"A language the practitioner (in this role) can use in patient communication","definition":"A language the practitioner can use in patient communication. The practitioner may know several languages (listed in practitioner.communication), however these are the languages that could be advertised in a directory for a patient to search.","comment":"The structure aa-BB with this exact casing is one the most widely used notations for locale. However not all systems code this but instead have it as free text. Hence CodeableConcept instead of code as the data type.\r\rNote that for non-patient oriented communication, see Practitioner.communication. Note that all 'person' type resources (Person, RelatedPerson, Patient, Practitioner) have a communication structure that includes preferences. Role or service oriented resources such as HealthcareService and PractitionerRole only include languages that are available for interacting with patients.","requirements":"Knowing which language a practitioner speaks can help in facilitating patients to locate practitioners that speak their language.","min":0,"max":"*","base":{"path":"PractitionerRole.communication","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]},"mapping":[{"identity":"rim","map":"./languageCommunication"}]},{"id":"PractitionerRole.availability","path":"PractitionerRole.availability","short":"Times the Practitioner is available at this location and/or healthcare service (including exceptions)","definition":"A collection of times the practitioner is available or performing this role at the location and/or healthcareservice.","comment":"More detailed availability information may be provided in associated Schedule/Slot resources.\n\nSystems may choose to render availability differently than it is exchanged on the interface. For example, rather than \"Mon, Tue, Wed, Thur, Fri from 9am-12am; Mon, Tue, Wed, Thur, Fri from 1pm-5pm\" as would be implied by two availableTime repetitions, an application could render this information as \"Mon-Fri 9-12am and 1-5pm\".\r\rThe NotAvailableTime(s) included indicate the general days/periods where the practitioner is not available (for things such as vacation time, or public holidays).","min":0,"max":"*","base":{"path":"PractitionerRole.availability","min":0,"max":"*"},"type":[{"code":"Availability"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"PractitionerRole.endpoint","path":"PractitionerRole.endpoint","short":"Endpoints for interacting with the practitioner in this role","definition":" Technical endpoints providing access to services operated for the practitioner with this role. Commonly used for locating scheduling services, or identifying where to send referrals electronically.","requirements":"Organizations have multiple systems that provide various services and may also be different for practitioners too.\n\nSo the endpoint satisfies the need to be able to define the technical connection details for how to connect to them, and for what purpose.","min":0,"max":"*","base":{"path":"PractitionerRole.endpoint","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Endpoint"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]}]},"differential":{"element":[{"id":"PractitionerRole","path":"PractitionerRole"},{"id":"PractitionerRole.practitioner","path":"PractitionerRole.practitioner","type":[{"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/practitioner-eu-core"]}]},{"id":"PractitionerRole.organization","path":"PractitionerRole.organization","type":[{"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu-core"]}]}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-practitionerRole-eu.json b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-practitionerRole-eu.json new file mode 100644 index 00000000..17500420 --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/StructureDefinition-practitionerRole-eu.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"practitionerRole-eu","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition practitionerRole-eu

\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" PractitionerRole PractitionerRole
\".\"\".\"\".\" identifier 0..*IdentifierBusiness identifier
\".\"\".\"\".\" practitioner 0..1Reference(Practitioner (EU base))Practitioner that provides services for the organization
\".\"\".\"\".\" organization 0..1Reference(Organization (EU base))Organization where the roles are available

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.eu/fhir/base-r5/StructureDefinition/practitionerRole-eu","version":"0.1.0-ballot","name":"PractitionerRoleEu","title":"PractitionerRole (EU base)","status":"draft","date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"This profile specifies how the HL7 FHIR PractitionerRole resource should be used for conveying commonly used concepts in the European context.","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","fhirVersion":"5.0.0","mapping":[{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 V2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"interface","uri":"http://hl7.org/fhir/interface","name":"Interface Pattern"},{"identity":"servd","uri":"http://www.omg.org/spec/ServD/1.0/","name":"ServD"}],"kind":"resource","abstract":false,"type":"PractitionerRole","baseDefinition":"http://hl7.org/fhir/StructureDefinition/PractitionerRole","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"5.0.0"}],"element":[{"id":"PractitionerRole","path":"PractitionerRole","short":"Roles/organizations the practitioner is associated with","definition":"A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.","min":0,"max":"*","base":{"path":"PractitionerRole","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity, Role, or Act,Role"},{"identity":"w5","map":"administrative.individual"},{"identity":"v2","map":"PRD (as one example)"},{"identity":"interface","map":"Participant"},{"identity":"servd","map":"ServiceSiteProvider"}]},{"id":"PractitionerRole.id","path":"PractitionerRole.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"id"}],"code":"http://hl7.org/fhirpath/System.String"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"PractitionerRole.meta","path":"PractitionerRole.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true},{"id":"PractitionerRole.implicitRules","path":"PractitionerRole.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of its narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies its meaning or interpretation","isSummary":true},{"id":"PractitionerRole.language","path":"PractitionerRole.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]}},{"id":"PractitionerRole.text","path":"PractitionerRole.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have a narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"condition":["dom-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"PractitionerRole.contained","path":"PractitionerRole.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags in their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"condition":["dom-2","dom-4","dom-3","dom-5"],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"PractitionerRole.extension","path":"PractitionerRole.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"PractitionerRole.modifierExtension","path":"PractitionerRole.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R5/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":false,"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"PractitionerRole.identifier","path":"PractitionerRole.identifier","short":"Business identifier","definition":"Business Identifiers that are specific to a role/location.","comment":"A specific identifier value (e.g. Minnesota Registration ID) may appear on multiple PractitionerRole instances which could be for different periods, or different Roles (or other reasons). A specific identifier may be included multiple times in the same PractitionerRole instance with different identifier validity periods.","requirements":"Often, specific identities are assigned for the agent.","min":0,"max":"*","base":{"path":"PractitionerRole.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"PRD-7 (or XCN.1)"},{"identity":"rim","map":".id"},{"identity":"interface","map":"Participant.identifier"},{"identity":"servd","map":"./Identifiers"}]},{"id":"PractitionerRole.active","path":"PractitionerRole.active","short":"Whether this practitioner role record is in active use","definition":" Whether this practitioner role record is in active use. Some systems may use this property to mark non-active practitioners, such as those that are not currently employed.","comment":"If this value is false, you may refer to the period to see when the role was in active use. If there is no period specified, no inference can be made about when it was active.","requirements":"Need to be able to mark a practitioner role record as not to be used because it was created in error, or otherwise no longer in active use.","min":0,"max":"1","base":{"path":"PractitionerRole.active","min":0,"max":"1"},"type":[{"code":"boolean"}],"meaningWhenMissing":"This resource is generally assumed to be active if no value is provided for the active element","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"v2","map":"STF-7"},{"identity":"rim","map":".statusCode"},{"identity":"interface","map":"Participant.active"}]},{"id":"PractitionerRole.period","path":"PractitionerRole.period","short":"The period during which the practitioner is authorized to perform in these role(s)","definition":"The period during which the person is authorized to act as a practitioner in these role(s) for the organization.","comment":"If a practitioner is performing a role within an organization over multiple, non-adjacent periods, there should be a distinct PractitionerRole instance for each period. For example, if a nurse is employed at a hospital, leaves the organization for a period of time due to pandemic related stress, but returns post-pandemic to the same job role, there would be two PractitionerRole instances for the different periods of employment.","requirements":"Even after the agencies is revoked, the fact that it existed must still be recorded.","min":0,"max":"1","base":{"path":"PractitionerRole.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"v2","map":"PRD-8/9 / PRA-5.4"},{"identity":"rim","map":".performance[@typeCode <= 'PPRF'].ActDefinitionOrEvent.effectiveTime"},{"identity":"servd","map":"(ServD maps Practitioners and Organizations via another entity, so this concept is not available)"}]},{"id":"PractitionerRole.practitioner","path":"PractitionerRole.practitioner","short":"Practitioner that provides services for the organization","definition":"Practitioner that is able to provide the defined services for the organization.","min":0,"max":"1","base":{"path":"PractitionerRole.practitioner","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/practitioner-eu"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".player"}]},{"id":"PractitionerRole.organization","path":"PractitionerRole.organization","short":"Organization where the roles are available","definition":"The organization where the Practitioner performs the roles associated.","min":0,"max":"1","base":{"path":"PractitionerRole.organization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".scoper"}]},{"id":"PractitionerRole.code","path":"PractitionerRole.code","short":"Roles which this practitioner may perform","definition":"Roles which this practitioner is authorized to perform for the organization.","comment":"A person may have more than one role.","requirements":"Need to know what authority the practitioner has - what can they do?","min":0,"max":"*","base":{"path":"PractitionerRole.code","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"PractitionerRole"}],"strength":"example","description":"The role a person plays representing an organization.","valueSet":"http://hl7.org/fhir/ValueSet/practitioner-role"},"mapping":[{"identity":"v2","map":"PRD-1 / STF-18 / PRA-3 / PRT-4 / ROL-3 / ORC-12 / OBR-16 / PV1-7 / PV1-8 / PV1-9 / PV1-17"},{"identity":"rim","map":".code"},{"identity":"interface","map":"Participant.name"},{"identity":"servd","map":"(ServD maps Practitioners and Organizations via another entity, so this concept is not available)"}]},{"id":"PractitionerRole.specialty","path":"PractitionerRole.specialty","short":"Specific specialty of the practitioner","definition":"The specialty of a practitioner that describes the functional role they are practicing at a given organization or location.","comment":"The specialty represents the functional role a practitioner is playing within an organization/location. This role may require the individual have certain qualifications, which would be represented in the Practitioner.qualifications property. Note that qualifications may or might not relate to or be required by the practicing specialty.","min":0,"max":"*","base":{"path":"PractitionerRole.specialty","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"PractitionerSpecialty"}],"strength":"preferred","description":"Specific specialty associated with the agency.","valueSet":"http://hl7.org/fhir/ValueSet/c80-practice-codes"},"mapping":[{"identity":"v2","map":"PRA-5"},{"identity":"rim","map":".player.HealthCareProvider[@classCode = 'PROV'].code"},{"identity":"servd","map":"./Specialty"}]},{"id":"PractitionerRole.location","path":"PractitionerRole.location","short":"Location(s) where the practitioner provides care","definition":"The location(s) at which this practitioner provides care.","min":0,"max":"*","base":{"path":"PractitionerRole.location","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Location"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.where[x]"},{"identity":"rim","map":".performance.ActDefinitionOrEvent.ServiceDeliveryLocation[@classCode = 'SDLOC']"},{"identity":"servd","map":"(ServD maps Practitioners and Organizations via another entity, so this concept is not available)
However these are accessed via the Site.ServiceSite.ServiceSiteProvider record. (The Site has the location)"}]},{"id":"PractitionerRole.healthcareService","path":"PractitionerRole.healthcareService","short":"Healthcare services provided for this role's Organization/Location(s)","definition":"The list of healthcare services that this worker provides for this role's Organization/Location(s).","min":0,"max":"*","base":{"path":"PractitionerRole.healthcareService","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/HealthcareService"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"EDU-2 / AFF-3"},{"identity":"rim","map":".player.QualifiedEntity[@classCode = 'QUAL'].code"}]},{"id":"PractitionerRole.contact","path":"PractitionerRole.contact","short":"Official contact details relating to this PractitionerRole","definition":"The contact details of communication devices available relevant to the specific PractitionerRole. This can include addresses, phone numbers, fax numbers, mobile numbers, email addresses and web sites.","requirements":"Often practitioners have a dedicated line for each location (or service) that they work at, and need to be able to define separate contact details for each of these. Sometimes these also include a named person/organization that handles contact for specific purposes, such as a receptionist, or accounts clerk etc.","min":0,"max":"*","base":{"path":"PractitionerRole.contact","min":0,"max":"*"},"type":[{"code":"ExtendedContactDetail"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false},{"id":"PractitionerRole.characteristic","path":"PractitionerRole.characteristic","short":"Collection of characteristics (attributes)","definition":"Collection of characteristics (attributes).","comment":"These could be such things as is the service mode used by this role.","min":0,"max":"*","base":{"path":"PractitionerRole.characteristic","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ServiceCharacteristic"}],"strength":"example","description":"A custom attribute that could be provided at a service (e.g. Wheelchair accessibility).","valueSet":"http://hl7.org/fhir/ValueSet/service-mode"},"mapping":[{"identity":"rim","map":".actrelationship[typeCode=PERT].observation"}]},{"id":"PractitionerRole.communication","path":"PractitionerRole.communication","short":"A language the practitioner (in this role) can use in patient communication","definition":"A language the practitioner can use in patient communication. The practitioner may know several languages (listed in practitioner.communication), however these are the languages that could be advertised in a directory for a patient to search.","comment":"The structure aa-BB with this exact casing is one the most widely used notations for locale. However not all systems code this but instead have it as free text. Hence CodeableConcept instead of code as the data type.\r\rNote that for non-patient oriented communication, see Practitioner.communication. Note that all 'person' type resources (Person, RelatedPerson, Patient, Practitioner) have a communication structure that includes preferences. Role or service oriented resources such as HealthcareService and PractitionerRole only include languages that are available for interacting with patients.","requirements":"Knowing which language a practitioner speaks can help in facilitating patients to locate practitioners that speak their language.","min":0,"max":"*","base":{"path":"PractitionerRole.communication","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"}],"strength":"required","description":"IETF language tag for a human language","valueSet":"http://hl7.org/fhir/ValueSet/all-languages|5.0.0","additional":[{"purpose":"starter","valueSet":"http://hl7.org/fhir/ValueSet/languages"}]},"mapping":[{"identity":"rim","map":"./languageCommunication"}]},{"id":"PractitionerRole.availability","path":"PractitionerRole.availability","short":"Times the Practitioner is available at this location and/or healthcare service (including exceptions)","definition":"A collection of times the practitioner is available or performing this role at the location and/or healthcareservice.","comment":"More detailed availability information may be provided in associated Schedule/Slot resources.\n\nSystems may choose to render availability differently than it is exchanged on the interface. For example, rather than \"Mon, Tue, Wed, Thur, Fri from 9am-12am; Mon, Tue, Wed, Thur, Fri from 1pm-5pm\" as would be implied by two availableTime repetitions, an application could render this information as \"Mon-Fri 9-12am and 1-5pm\".\r\rThe NotAvailableTime(s) included indicate the general days/periods where the practitioner is not available (for things such as vacation time, or public holidays).","min":0,"max":"*","base":{"path":"PractitionerRole.availability","min":0,"max":"*"},"type":[{"code":"Availability"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"PractitionerRole.endpoint","path":"PractitionerRole.endpoint","short":"Endpoints for interacting with the practitioner in this role","definition":" Technical endpoints providing access to services operated for the practitioner with this role. Commonly used for locating scheduling services, or identifying where to send referrals electronically.","requirements":"Organizations have multiple systems that provide various services and may also be different for practitioners too.\n\nSo the endpoint satisfies the need to be able to define the technical connection details for how to connect to them, and for what purpose.","min":0,"max":"*","base":{"path":"PractitionerRole.endpoint","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Endpoint"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]}]},"differential":{"element":[{"id":"PractitionerRole.identifier","path":"PractitionerRole.identifier","short":"Business identifier"},{"id":"PractitionerRole.practitioner","path":"PractitionerRole.practitioner","type":[{"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/practitioner-eu"]}]},{"id":"PractitionerRole.organization","path":"PractitionerRole.organization","type":[{"code":"Reference","targetProfile":["http://hl7.eu/fhir/base-r5/StructureDefinition/organization-eu"]}]}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-iso-ehicCountryCode.json b/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-iso-ehicCountryCode.json new file mode 100644 index 00000000..889efc40 --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-iso-ehicCountryCode.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"iso-ehicCountryCode","text":{"status":"generated","div":"

Generated Narrative: ValueSet iso-ehicCountryCode

  • Include these codes as defined in urn:iso:std:iso:3166
    CodeDisplay
    ATAustria
    BEBelgium
    BGBulgaria
    HRCroatia
    CYCyprus
    CZCzech Republic
    DKDenmark
    EEEstonia
    FIFinland
    FRFrance
    GRGreece
    DEGermany
    HUHungary
    IEIreland
    ITItaly
    LVLatvia
    LTLithuania
    LULuxembourg
    MTMalta
    NLNetherlands
    PLPoland
    PTPortugal
    RORomania
    SKSlovakia
    SISlovenia
    ESSpain
    SESweden
    ISIceland
    LILiechtenstein
    NONorway
    CHSwitzerland
"},"url":"http://hl7.eu/fhir/base-r5/ValueSet/iso-ehicCountryCode","version":"0.1.0-ballot","name":"VsEHICCountryCodes","title":"ISO 3166 - EHIC Country Codes","status":"draft","experimental":false,"date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"ISO 3166 - Country Codes used by the European Healthcare Insurance Card","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","compose":{"include":[{"system":"urn:iso:std:iso:3166","concept":[{"code":"AT","display":"Austria"},{"code":"BE","display":"Belgium"},{"code":"BG","display":"Bulgaria"},{"code":"HR","display":"Croatia"},{"code":"CY","display":"Cyprus"},{"code":"CZ","display":"Czech Republic"},{"code":"DK","display":"Denmark"},{"code":"EE","display":"Estonia"},{"code":"FI","display":"Finland"},{"code":"FR","display":"France"},{"code":"GR","display":"Greece"},{"code":"DE","display":"Germany"},{"code":"HU","display":"Hungary"},{"code":"IE","display":"Ireland"},{"code":"IT","display":"Italy"},{"code":"LV","display":"Latvia"},{"code":"LT","display":"Lithuania"},{"code":"LU","display":"Luxembourg"},{"code":"MT","display":"Malta"},{"code":"NL","display":"Netherlands"},{"code":"PL","display":"Poland"},{"code":"PT","display":"Portugal"},{"code":"RO","display":"Romania"},{"code":"SK","display":"Slovakia"},{"code":"SI","display":"Slovenia"},{"code":"ES","display":"Spain"},{"code":"SE","display":"Sweden"},{"code":"IS","display":"Iceland"},{"code":"LI","display":"Liechtenstein"},{"code":"NO","display":"Norway"},{"code":"CH","display":"Switzerland"}]}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-oid-ehicPersonalId.json b/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-oid-ehicPersonalId.json new file mode 100644 index 00000000..1eb3f2ad --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-oid-ehicPersonalId.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"oid-ehicPersonalId","text":{"status":"generated","div":"

Generated Narrative: ValueSet oid-ehicPersonalId

  • Include these codes as defined in urn:ietf:rfc:1155
    CodeDisplay
    2.16.840.1.113883.2.4.6.3Burgerservicenummer
    2.16.840.1.113883.2.9.4.3.2Italian Fiscal Code
"},"url":"http://hl7.eu/fhir/base-r5/ValueSet/oid-ehicPersonalId","version":"0.1.0-ballot","name":"VsEHICPersonalIdOid","title":"EHIC Personal ID (system IDs - oid)","status":"draft","experimental":false,"date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"System identifiers (oid) used for the EHIC#6 Personal Identification Number","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","compose":{"include":[{"system":"urn:ietf:rfc:1155","concept":[{"code":"2.16.840.1.113883.2.4.6.3","display":"Burgerservicenummer"},{"code":"2.16.840.1.113883.2.9.4.3.2","display":"Italian Fiscal Code"}]}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-siteLaterality-eu.json b/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-siteLaterality-eu.json new file mode 100644 index 00000000..8e6ccff2 --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-siteLaterality-eu.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"siteLaterality-eu","text":{"status":"generated","div":"

Generated Narrative: ValueSet siteLaterality-eu

"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.eu/fhir/base-r5/ValueSet/siteLaterality-eu","version":"0.1.0-ballot","name":"SiteLateralityEuVs","title":"Body Structure Laterality","status":"draft","experimental":false,"date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"Body Structure site laterality qualifier. It indicates - for example - the body site laterality from which a laboratory specimen is collected. (based on SNOMED CT)","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement","compose":{"include":[{"system":"http://snomed.info/sct","concept":[{"code":"7771000","display":"Left (qualifier value)"},{"code":"24028007","display":"Right (qualifier value)"},{"code":"51440002","display":"Right and left = bilateral (qualifier value)"}]}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-siteQualifier-eu.json b/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-siteQualifier-eu.json new file mode 100644 index 00000000..e5d66962 --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-siteQualifier-eu.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"siteQualifier-eu","text":{"status":"generated","div":"

Generated Narrative: ValueSet siteQualifier-eu

"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.eu/fhir/base-r5/ValueSet/siteQualifier-eu","version":"0.1.0-ballot","name":"SiteQualifierEuVs","title":"Body Structure Qualifier","status":"draft","experimental":false,"date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"Body Structure site qualifier. It indicates - for example - the body site qualifier from which a laboratory specimen is collected. (based on SNOMED CT)","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement","compose":{"include":[{"system":"http://snomed.info/sct","concept":[{"code":"7771000","display":"Left"},{"code":"24028007","display":"Right"},{"code":"51440002","display":"Bilateral"},{"code":"46053002","display":"Distal"},{"code":"255554000","display":"Dorsal"},{"code":"261183002","display":"Upper"},{"code":"261122009","display":"Lower"},{"code":"255561001","display":"Medial"},{"code":"49370004","display":"Lateral"},{"code":"264217000","display":"Superior"},{"code":"261089000","display":"Inferior"},{"code":"255551008","display":"Posterior"},{"code":"351726001","display":"Below"},{"code":"352730000","display":"Above"},{"code":"40415009","display":"Proximal (qualifier value)"},{"code":"255549009","display":"Anterior (qualifier value)"},{"code":"26283006","display":"Superficial (qualifier value)"},{"code":"795002","display":"Deep (qualifier value)"},{"code":"57195005","display":"Basal (qualifier value)"},{"code":"3583002","display":"Caudal (qualifier value)"},{"code":"66787007","display":"Cephalic (qualifier value)"},{"code":"255481003","display":"Left upper quadrant (qualifier value)"},{"code":"255497008","display":"Right upper quadrant (qualifier value)"},{"code":"255480002","display":"Left lower quadrant (qualifier value)"},{"code":"255495000","display":"Right lower quadrant (qualifier value)"}]}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-speciesType-eu.json b/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-speciesType-eu.json new file mode 100644 index 00000000..4d7a9020 --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-speciesType-eu.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"speciesType-eu","text":{"status":"generated","div":"

Generated Narrative: ValueSet speciesType-eu

"},"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":2},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"draft"}],"url":"http://hl7.eu/fhir/base-r5/ValueSet/speciesType-eu","version":"0.1.0-ballot","name":"SpeciesTypesEuVs","title":"Types of species","status":"draft","experimental":false,"date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"Types of animal species for non-human subjects","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement","compose":{"include":[{"system":"http://snomed.info/sct","concept":[{"code":"125097000","display":"Domestic goat"},{"code":"125099002","display":"Sheep"},{"code":"34618005","display":"Cow"},{"code":"425134008","display":"Turkey"},{"code":"47290002","display":"Chicken"},{"code":"15778005","display":"Anser"},{"code":"396620009","display":"Duck"},{"code":"35354009","display":"Horse"},{"code":"85626006","display":"Donkey"},{"code":"132950000","display":"Mule"},{"code":"448771007","display":"Domestic dog"},{"code":"448169003","display":"Domestic cat"}]}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-uri-ehicPersonalId.json b/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-uri-ehicPersonalId.json new file mode 100644 index 00000000..f80e372a --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/ValueSet-uri-ehicPersonalId.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"uri-ehicPersonalId","text":{"status":"generated","div":"

Generated Narrative: ValueSet uri-ehicPersonalId

  • Include these codes as defined in urn:ietf:rfc:3986
    CodeDisplay
    http://fhir.nl/fhir/NamingSystem/bsnBurgerservicenummer
    http://hl7.it/sid/codiceFiscaleCodice Fiscale
"},"url":"http://hl7.eu/fhir/base-r5/ValueSet/uri-ehicPersonalId","version":"0.1.0-ballot","name":"VsEHICPersonalIdUri","title":"EHIC Personal ID (system IDs - uri)","status":"draft","experimental":false,"date":"2025-05-06T08:06:03+02:00","publisher":"HL7 Europe","contact":[{"name":"HL7 Europe","telecom":[{"system":"url","value":"http://hl7.eu"}]}],"description":"System identifiers (uri) used for the EHIC#6 Personal Identification Number","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"150","display":"Europe"}]}],"copyright":"Used by permission of HL7 Europe, all rights reserved Creative Commons License","compose":{"include":[{"system":"urn:ietf:rfc:3986","concept":[{"code":"http://fhir.nl/fhir/NamingSystem/bsn","display":"Burgerservicenummer"},{"code":"http://hl7.it/sid/codiceFiscale","display":"Codice Fiscale"}]}]}} \ No newline at end of file diff --git a/native/health-cli/src/test/resources/profiles.EuropeBase/package.json b/native/health-cli/src/test/resources/profiles.EuropeBase/package.json new file mode 100644 index 00000000..3ae9b76f --- /dev/null +++ b/native/health-cli/src/test/resources/profiles.EuropeBase/package.json @@ -0,0 +1,30 @@ +{ + "name" : "hl7.fhir.eu.base-r5", + "version" : "0.1.0-ballot", + "tools-version" : 3, + "type" : "IG", + "date" : "20250506080603", + "license" : "CC0-1.0", + "canonical" : "http://hl7.eu/fhir/base-r5", + "url" : "http://hl7.eu/fhir/base-r5/0.1.0-ballot", + "title" : "HL7 Europe Base and Core FHIR IG", + "description" : "This guide collects base and core profiles to be used in the European context. It also includes common artifacts, such as the profiles describing the European Health Insurance Card. (built Tue, May 6, 2025 08:06+0200+02:00)", + "fhirVersions" : ["5.0.0"], + "dependencies" : { + "hl7.terminology.r5" : "6.3.0", + "hl7.fhir.uv.extensions.r5" : "5.2.0", + "hl7.fhir.eu.extensions.r5" : "0.1.1-ballot" + }, + "author" : "HL7 Europe", + "maintainers" : [ + { + "name" : "HL7 Europe", + "url" : "http://hl7.eu" + } + ], + "directories" : { + "lib" : "package", + "example" : "example" + }, + "jurisdiction" : "http://unstats.un.org/unsd/methods/m49/m49.htm#150" +} diff --git a/pom.xml b/pom.xml index 7dc8b7b1..301a66a5 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ 21 21 UTF-8 - 1.2.3 + 2.0.0 2201.12.3 3.1.0 3.8.1 @@ -97,6 +97,11 @@ hapi-fhir-structures-r4 ${hapi.version} + + ca.uhn.hapi.fhir + hapi-fhir-structures-r5 + ${hapi.version} + org.apache.velocity velocity-engine-core