Skip to content

Commit 499e718

Browse files
fix: add postcode type to model gen (#69)
* fix: add postcode type to model gen * test: fix issue with demographics test post postcode change
1 parent 8beae5c commit 499e718

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/dve/metadata_parser/model_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def constr(
6565
"conint": pyd.validate_arguments(pyd.conint),
6666
"condate": pyd.validate_arguments(pyd.condate),
6767
"condecimal": pyd.validate_arguments(pyd.condecimal),
68-
"postcode": domain_types.Postcode,
68+
"postcode": domain_types.postcode,
6969
"nhsnumber": domain_types.NHSNumber,
7070
"permissivenhsno": domain_types.permissive_nhs_number(),
7171
"alphanumeric": domain_types.alphanumeric,

tests/testdata/demographics/basic_demographics.dischema.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"Forename": "str",
1010
"Surname": "str",
1111
"Date_Of_Birth": "date",
12-
"Postcode": "postcode",
12+
"Postcode": {
13+
"callable": "postcode"
14+
},
1315
"Postcode_Country": "str",
1416
"Postcode_Format_Valid": "str",
1517
"Postcode_Valid": "str"

tests/testdata/demographics/basic_demographics_ddb.dischema.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"Forename": "str",
1010
"Surname": "str",
1111
"Date_Of_Birth": "date",
12-
"Postcode": "postcode",
12+
"Postcode": {
13+
"callable": "postcode"
14+
},
1315
"Postcode_Country": "str",
1416
"Postcode_Format_Valid": "str",
1517
"Postcode_Valid": "str"

0 commit comments

Comments
 (0)