Skip to content

Commit

Permalink
real close now
Browse files Browse the repository at this point in the history
  • Loading branch information
dcarbone committed Jan 31, 2025
1 parent fae0a6b commit f726a75
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/Utils/XMLValueLocationUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,19 @@ class XMLValueLocationUtils
public static function determineDefaultLocation(Type $type, Property $property, bool $withClass): string
{
$propType = $property->getValueFHIRType();
if ($property->isValueProperty()) {
if ($propType->isPrimitiveOrListType() || $propType->hasPrimitiveOrListParent()) {
$case = match (true) {
$type->isQuantity() || $type->hasQuantityParent() => 'CONTAINER_VALUE',
$type->isValueContainer() || $type->hasValueContainerParent() => 'CONTAINER_ATTRIBUTE',
default => 'ELEMENT_ATTRIBUTE'
$type->isPrimitiveContainer() || $type->hasPrimitiveContainerParent() => 'CONTAINER_ATTRIBUTE',
default => 'PARENT_ATTRIBUTE',
};
} else if ($propType->isPrimitiveOrListType() || $propType->hasPrimitiveOrListParent()) {
} else if ($property->isValueProperty()) {
$case = match (true) {
$type->isPrimitiveContainer() || $type->hasPrimitiveContainerParent() => 'CONTAINER_ATTRIBUTE',
default => 'ELEMENT_ATTRIBUTE',
$type->isQuantity() || $type->hasQuantityParent() => 'CONTAINER_ATTRIBUTE',
$type->isValueContainer() || $type->hasValueContainerParent() => 'CONTAINER_ATTRIBUTE',
default => 'ELEMENT_ATTRIBUTE'
};
} else {
$case = match (true) {
$type->isQuantity() || $type->hasQuantityParent() => 'CONTAINER_VALUE',
$propType->isValueContainer() || $propType->hasValueContainerParent() => 'CONTAINER_ATTRIBUTE',
default => 'ELEMENT_ATTRIBUTE',
};
Expand Down

0 comments on commit f726a75

Please sign in to comment.