Skip to content

Commit

Permalink
Merge pull request #332 from statisticsnorway/vst_bugfix
Browse files Browse the repository at this point in the history
Vst bugfix
  • Loading branch information
roarv2 authored Mar 18, 2024
2 parents 78a13b1 + 3cc14fa commit e2a7c38
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/altinn/flatten.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def _make_angiver_row_df(file_path: str) -> pd.DataFrame:
"VERSION_NR": _extract_angiver_id(file_path),
"DELREG_NR": xml_dict[root_element]["InternInfo"]["delregNr"],
"ENHETS_TYPE": xml_dict[root_element]["InternInfo"]["enhetsType"],
"SKJEMA_ID": xml_dict[root_element]["InternInfo"]["raNummer"],
"SKJEMA_ID": xml_dict[root_element]["InternInfo"]["raNummer"] + "A3",
}

return pd.DataFrame([angiver_id_row])
Expand Down Expand Up @@ -272,7 +272,9 @@ def isee_transform(
final_df["VERSION_NR"] = _extract_angiver_id(file_path)
final_df["DELREG_NR"] = xml_dict[root_element]["InternInfo"]["delregNr"]
final_df["ENHETS_TYPE"] = xml_dict[root_element]["InternInfo"]["enhetsType"]
final_df["SKJEMA_ID"] = xml_dict[root_element]["InternInfo"]["raNummer"]
final_df["SKJEMA_ID"] = (
xml_dict[root_element]["InternInfo"]["raNummer"] + "A3"
)

final_df = final_df[~final_df["FELTNAVN"].str.contains("@xsi:nil")]

Expand All @@ -286,6 +288,8 @@ def isee_transform(
r"£.*?\$", "", regex=True
)

final_df["FELTVERDI"] = final_df["FELTVERDI"].str.replace("\n", " ")

final_df["LEVELS"] = final_df.apply(_create_levels_col, axis=1)

if mapping is not None:
Expand Down

0 comments on commit e2a7c38

Please sign in to comment.