Skip to content

feat: re-add type of row to ahbesser view #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/fundamend/sqlmodels/ahbtabellen_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class AhbTabellenLine(SQLModel, table=True):
qualifier: str | None = Field()
line_ahb_status: str | None = Field()
line_name: str | None = Field()
line_type: str | None = Field() # 'code' or 'dataelement' or 'segment' or 'segmentgroup' or 'dataelementgroup'
bedingung: str | None = Field()
bedingungsfehler: str | None = Field()
sort_path: str = Field()
Expand Down
4 changes: 3 additions & 1 deletion src/fundamend/sqlmodels/create_ahbtabellen_view.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ WITH consolidated_ahm AS (SELECT id,
trim(coalesce(code_ahb_status, coalesce(dataelement_ahb_status,
coalesce(segment_ahb_status, segmentgroup_ahb_status)))) AS line_ahb_status,
coalesce(code_name, coalesce(dataelement_name, coalesce(dataelementgroup_name,
coalesce(segment_name, segmentgroup_name)))) AS line_name
coalesce(segment_name, segmentgroup_name)))) AS line_name,
type as line_type
FROM ahb_hierarchy_materialized ahm
WHERE ahm.TYPE != 'dataelementgroup'
AND (ahm.TYPE != 'dataelement' OR ahm.dataelement_ahb_status IS NOT NULL))
Expand All @@ -44,6 +45,7 @@ SELECT c.id as id,
c.code_value as qualifier,
c.line_ahb_status as line_ahb_status, -- e.g. 'Muss [28] ∧ [64]'
c.line_name as line_name, -- e.g. 'Datums- oder Uhrzeit- oder Zeitspannen-Format, Code' or 'Produkt-Daten für Lieferant relevant'
c.line_type as line_type,
c.sort_path as sort_path,
NULLIF(ahe.node_texts, '') as bedingung,
NULLIF(ahe.ahbicht_error_message, '') as bedingungsfehler
Expand Down
Loading