Repository: statisticsnorway/microdata-tools
Pull request #73: added_new_unit_type_hkdir: added defintiion, updated model and enums
Author: login: DanielElisenberg
Created: 2025-03-10T14:39:27Z | Merged: 2025-03-11T10:44:25Z



Diff:
diff --git a/microdata_tools/validation/components/unit_id_types.py b/microdata_tools/validation/components/unit_id_types.py
index e0e7efc..5774dd8 100644
--- a/microdata_tools/validation/components/unit_id_types.py
+++ b/microdata_tools/validation/components/unit_id_types.py
@@ -20,6 +20,7 @@
     UnitType.NPR_EPISODE: UnitIdType.NPR_EPISODE_ID,
     UnitType.NPR_SYKEHUSOPPHOLD: UnitIdType.NPR_SYKEHUSOPPHOLD_ID,
     UnitType.HKDIR_STUDIESOKNAD: UnitIdType.HKDIR_STUDIESOKNAD_ID,
+    UnitType.HKDIR_HYU_OPPMELDING: UnitIdType.HKDIR_HYU_OPPMELDING_ID,
     UnitType.SOSTIL: UnitIdType.SOSTIL_ID,
     UnitType.TRAFIKKULYKKE: UnitIdType.TRAFIKKULYKKE_ID,
     UnitType.TRAFIKKULYKKE_PERSON: UnitIdType.TRAFIKKULYKKE_PERSON_ID,
diff --git a/microdata_tools/validation/components/unit_type_variables/HKDIR_HYU_OPPMELDING.json b/microdata_tools/validation/components/unit_type_variables/HKDIR_HYU_OPPMELDING.json
new file mode 100644
index 0000000..d3ea7d1
--- /dev/null
+++ b/microdata_tools/validation/components/unit_type_variables/HKDIR_HYU_OPPMELDING.json
@@ -0,0 +1,61 @@
+{
+    "shortName": "HKDIR_HYU_OPPMELDING_ID",
+    "name": [
+      {
+        "languageCode": "no",
+        "value": "Identifikator for oppmelding til høyere yrkesfaglig utdanning"
+      },
+      {
+        "languageCode": "en",
+        "value": "Identifier for admission in tertiary vocational education"
+      }
+    ],
+    "description": [
+      {
+        "languageCode": "no",
+        "value": "Angir den enkelte studentens opptaksgrunnlag"
+      },
+      {
+        "languageCode": "en",
+        "value": "Specifies the individual student's admission criteria"
+      }
+    ],
+    "dataType": "LONG",
+    "unitType": {
+      "shortName": "HKDIR_HYU_OPPMELDING",
+      "requiresPseudonymization": true,
+      "name": [
+        {
+          "languageCode": "no",
+          "value": "Oppmelding til høyere yrkesfaglig utdanning"
+        },
+        {
+          "languageCode": "en",
+          "value": "Admission for Higher Vocational College"
+        }
+      ],
+      "description": [
+        {
+          "languageCode": "no",
+          "value": "Identifikator for oppmelding til høyere yrkesfaglig utdanning."
+        },
+        {
+          "languageCode": "en",
+          "value": "Identifier for admission in tertiary vocational education."
+        }
+      ]
+    },
+    "valueDomain": {
+      "description": [
+        {
+          "languageCode": "no",
+          "value": "Pseudonymisert identifikator for oppmelding til høyere yrkesfaglig utdanning"
+        },
+        {
+          "languageCode": "en",
+          "value": "Pseudonymized identifier for admission in tertiary vocational education"
+        }
+      ]
+    }
+  }
+ 
diff --git a/microdata_tools/validation/components/unit_type_variables/__init__.py b/microdata_tools/validation/components/unit_type_variables/__init__.py
index 610516f..f3e8e6d 100644
--- a/microdata_tools/validation/components/unit_type_variables/__init__.py
+++ b/microdata_tools/validation/components/unit_type_variables/__init__.py
@@ -23,6 +23,9 @@
     "BK_HELSESTASJONSKONSULTASJON": load_json(
         UNIT_TYPE_VARIABLES_DIR / "BK_HELSESTASJONSKONSULTASJON.json"
     ),
+    "HKDIR_HYU_OPPMELDING": load_json(
+        UNIT_TYPE_VARIABLES_DIR / "HKDIR_HYU_OPPMELDING.json"
+    ),
     "HKDIR_STUDIESOKNAD": load_json(
         UNIT_TYPE_VARIABLES_DIR / "HKDIR_STUDIESOKNAD.json"
     ),
diff --git a/microdata_tools/validation/model/metadata.py b/microdata_tools/validation/model/metadata.py
index 96e55cd..32d5200 100644
--- a/microdata_tools/validation/model/metadata.py
+++ b/microdata_tools/validation/model/metadata.py
@@ -46,6 +46,7 @@ class UnitType(str, Enum):
     BK_HELSESTASJONSKONSULTASJON = "BK_HELSESTASJONSKONSULTASJON"
     NPR_EPISODE = "NPR_EPISODE"
     NPR_SYKEHUSOPPHOLD = "NPR_SYKEHUSOPPHOLD"
+    HKDIR_HYU_OPPMELDING = "HKDIR_HYU_OPPMELDING"
     HKDIR_STUDIESOKNAD = "HKDIR_STUDIESOKNAD"
     SOSTIL = "SOSTIL"
     TRAFIKKULYKKE = "TRAFIKKULYKKE"
@@ -62,6 +63,7 @@ class UnitIdType(str, Enum):
     ORGNR = "ORGNR"
     KURSID = "KURSID"
     BK_STASJONS_BESOKS_ID = "BK_STASJONS_BESOKS_ID"
+    HKDIR_HYU_OPPMELDING_ID = "HKDIR_HYU_OPPMELDING_ID"
     HKDIR_STUDIESOKNAD_ID = "HKDIR_STUDIESOKNAD_ID"
     NPR_EPISODE_ID = "NPR_EPISODE_ID"
     NPR_SYKEHUSOPPHOLD_ID = "NPR_SYKEHUSOPPHOLD_ID"
diff --git a/pyproject.toml b/pyproject.toml
index 2a9d887..ad73def 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "microdata-tools"
-version = "1.3.0"
+version = "1.4.0"
 description = "Tools for the microdata.no platform"
 authors = ["microdata-developers"]
 license = "MIT License"


Reviews:
user: login: linnbjornerud
body: I think you also forgot to add HKDIR_HYU_OPPMELDING_ID to the UNIT_ID_TYPE_FOR_UNIT_TYPE in unit_id_types.py ?
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T07:37:29Z
user: login: linnbjornerud
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T09:27:25Z
user: login: linnbjornerud
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T09:31:56Z
user: login: linnbjornerud
body: LGTM 💯 
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T10:40:49Z

Review comments:
diff_hunk: @@ -0,0 +1,61 @@
+{
+    "shortName": "HKDIR_HYU_OPPMELDINGID",
+    "name": [
+      {
+        "languageCode": "no",
+        "value": "Identifikator for oppmelding til høyere yrkesfaglig utdanning"
+      },
+      {
+        "languageCode": "en",
+        "value": "Identifier for admission in tertiary vocational education"
+      }
+    ],
+    "description": [
+      {
+        "languageCode": "no",
+        "value": "Angir den enkelte studentens opptaksgrunnlag"
+      },
+      {
+        "languageCode": "en",
+        "value": "Specifies the individual student's admission criteria"
+      }
+    ],
+    "dataType": "LONG",
+    "unitType": {
+      "shortName": "HKDIR_HYU_OPPMELDING",
+      "requiresPseudonymization": false,
+      "name": [
+        {
+          "languageCode": "no",
+          "value": "Oppmelding til høyere yrkesfaglig utdanning"
+        },
+        {
+          "languageCode": "en",
+          "value": "Admission for Higher Vocational College"
+        }
+      ],
+      "description": [
+        {
+          "languageCode": "no",
+          "value": "En helsestasjonskonsultasjon er en enkeltkonsultasjon på helsestasjon."
+        },
+        {
+          "languageCode": "en",
+          "value": "A health center visit is a distinct visit to a health center."
path: microdata_tools/validation/components/unit_type_variables/HKDIR_HYU_OPPMELDING.json
user: login: linnbjornerud
body: Did you forget to update the description here?
created_at: 2025-03-11T07:33:54Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,61 @@
+{
+    "shortName": "HKDIR_HYU_OPPMELDINGID",
path: microdata_tools/validation/components/unit_type_variables/HKDIR_HYU_OPPMELDING.json
user: login: linnbjornerud
body: Should this be HKDIR_HYU_OPPMELDING_ID?
created_at: 2025-03-11T07:37:16Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,61 @@
+{
+    "shortName": "HKDIR_HYU_OPPMELDING_ID",
+    "name": [
+      {
+        "languageCode": "no",
+        "value": "Identifikator for oppmelding til høyere yrkesfaglig utdanning"
+      },
+      {
+        "languageCode": "en",
+        "value": "Identifier for admission in tertiary vocational education"
+      }
+    ],
+    "description": [
+      {
+        "languageCode": "no",
+        "value": "Angir den enkelte studentens opptaksgrunnlag"
+      },
+      {
+        "languageCode": "en",
+        "value": "Specifies the individual student's admission criteria"
+      }
+    ],
+    "dataType": "LONG",
+    "unitType": {
+      "shortName": "HKDIR_HYU_OPPMELDING",
+      "requiresPseudonymization": false,
path: microdata_tools/validation/components/unit_type_variables/HKDIR_HYU_OPPMELDING.json
user: login: linnbjornerud
body: Should this be set to "true", since the value domain is a pseudonymized identifier?
created_at: 2025-03-11T09:27:15Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,61 @@
+{
+    "shortName": "HKDIR_HYU_OPPMELDINGID",
+    "name": [
+      {
+        "languageCode": "no",
+        "value": "Identifikator for oppmelding til høyere yrkesfaglig utdanning"
+      },
+      {
+        "languageCode": "en",
+        "value": "Identifier for admission in tertiary vocational education"
+      }
+    ],
+    "description": [
+      {
+        "languageCode": "no",
+        "value": "Angir den enkelte studentens opptaksgrunnlag"
+      },
+      {
+        "languageCode": "en",
+        "value": "Specifies the individual student's admission criteria"
+      }
+    ],
+    "dataType": "LONG",
+    "unitType": {
+      "shortName": "HKDIR_HYU_OPPMELDING",
+      "requiresPseudonymization": false,
+      "name": [
+        {
+          "languageCode": "no",
+          "value": "Oppmelding til høyere yrkesfaglig utdanning"
+        },
+        {
+          "languageCode": "en",
+          "value": "Admission for Higher Vocational College"
+        }
+      ],
+      "description": [
+        {
+          "languageCode": "no",
+          "value": "En helsestasjonskonsultasjon er en enkeltkonsultasjon på helsestasjon."
+        },
+        {
+          "languageCode": "en",
+          "value": "A health center visit is a distinct visit to a health center."
path: microdata_tools/validation/components/unit_type_variables/HKDIR_HYU_OPPMELDING.json
user: login: linnbjornerud
body: The descriptions here are still wrong? 
 "description": [
        {
          "languageCode": "no",
          "value": "En helsestasjonskonsultasjon er en enkeltkonsultasjon på helsestasjon."
        },
        {
          "languageCode": "en",
          "value": "A health center visit is a distinct visit to a health center."
created_at: 2025-03-11T09:31:56Z
author_association: CONTRIBUTOR

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-03-11T10:37:29Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=statisticsnorway_microdata-tools&pullRequest=73) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=statisticsnorway_microdata-tools&pullRequest=73&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=statisticsnorway_microdata-tools&pullRequest=73&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=statisticsnorway_microdata-tools&pullRequest=73&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=statisticsnorway_microdata-tools&pullRequest=73&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=statisticsnorway_microdata-tools&pullRequest=73&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=statisticsnorway_microdata-tools&pullRequest=73)


author_association: NONE