Skip to content

Commit

Permalink
✨ Feat: Improve StructureDefinition parser to parse the schema descri…
Browse files Browse the repository at this point in the history
…ptions as well.
  • Loading branch information
sinaci committed Aug 22, 2024
1 parent 09bddd5 commit 6eaeaf4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ case class ConstraintFailure(errorOrWarningMessage: String, isWarning: Boolean =
* @param baseUrl Base profile that this extends if exist
* @param resourceType Resource type for the StructureDefinition
* @param resourceName Given name of the StructureDefinition resource
* @param resourceDescription Description of the StructureDefinition resource
* @param elementRestrictions Defined restrictions on elements with path as key e.g. component.value[x] -> ...
* @param summaryElements Paths of the elements that are defined as summary element
* @param constraints Root constraints defined for the content
Expand All @@ -43,6 +44,7 @@ case class ProfileRestrictions(url: String,
baseUrl: Option[String],
resourceType: String,
resourceName: Option[String],
resourceDescription: Option[String],
elementRestrictions: Seq[(String, ElementRestrictions)],
summaryElements: Set[String],
constraints: Option[FhirRestriction] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class StructureDefinitionParser(fhirComplexTypes: Set[String], fhirPrimitiveType
baseUrl = None,
resourceType = rtype,
resourceName = FHIRUtil.extractValueOption[String](structureDef, "name"),
resourceDescription = FHIRUtil.extractValueOption[String](structureDef, "description"),
elementRestrictions = Nil,
summaryElements = Set.empty[String],
constraints = None,
Expand Down Expand Up @@ -64,6 +65,7 @@ class StructureDefinitionParser(fhirComplexTypes: Set[String], fhirPrimitiveType
baseUrl = FHIRUtil.extractValueOption[String](structureDef, "baseDefinition"),
resourceType = rtype,
resourceName = FHIRUtil.extractValueOption[String](structureDef, "name"),
resourceDescription = FHIRUtil.extractValueOption[String](structureDef, "description"),
elementRestrictions = elemDefs.map(e => e._1.path -> e._1),
summaryElements = getSummaryElements(elemDefs), //elemDefs.filter(_._2).map(e => e._1.path).toSet,
constraints =
Expand Down

0 comments on commit 6eaeaf4

Please sign in to comment.