Skip to content

Commit

Permalink
Merge pull request #898 from Health-Informatics-UoN/feat/696/change-DB
Browse files Browse the repository at this point in the history
Update database to support Splitting Status field of a ScanReport
  • Loading branch information
AndrewThien authored Oct 15, 2024
2 parents fa0d354 + 57cfb2e commit 0375fb5
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 0 deletions.
32 changes: 32 additions & 0 deletions app/shared/shared/mapping/fixtures/mapping_status.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
{
"model": "mapping.mappingstatus",
"pk": 1,
"fields": { "value": "PENDING", "display_name": "Pending Mapping" }
},
{
"model": "mapping.mappingstatus",
"pk": 2,
"fields": { "value": "MAPPING_25PERCENT", "display_name": "Mapping 25%" }
},
{
"model": "mapping.mappingstatus",
"pk": 3,
"fields": { "value": "MAPPING_50PERCENT", "display_name": "Mapping 50%" }
},
{
"model": "mapping.mappingstatus",
"pk": 4,
"fields": { "value": "MAPPING_75PERCENT", "display_name": "Mapping 75%" }
},
{
"model": "mapping.mappingstatus",
"pk": 5,
"fields": { "value": "COMPLETE", "display_name": "Mapping Complete" }
},
{
"model": "mapping.mappingstatus",
"pk": 6,
"fields": { "value": "BLOCKED", "display_name": "Blocked" }
}
]
17 changes: 17 additions & 0 deletions app/shared/shared/mapping/fixtures/upload_status.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"model": "mapping.uploadstatus",
"pk": 1,
"fields": { "value": "IN_PROGRESS", "display_name": "Upload in Progress" }
},
{
"model": "mapping.uploadstatus",
"pk": 2,
"fields": { "value": "COMPLETE", "display_name": "Upload Complete" }
},
{
"model": "mapping.uploadstatus",
"pk": 3,
"fields": { "value": "FAILED", "display_name": "Upload Failed" }
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Generated by Django 4.2.13 on 2024-10-15 08:51

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("mapping", "0003_handmade_20220428_1503"),
]

operations = [
migrations.CreateModel(
name="MappingStatus",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("value", models.CharField(max_length=64)),
("display_name", models.CharField(max_length=64)),
],
),
migrations.CreateModel(
name="UploadStatus",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("value", models.CharField(max_length=64)),
("display_name", models.CharField(max_length=64)),
],
),
]
10 changes: 10 additions & 0 deletions app/shared/shared/mapping/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ class Meta:
abstract = True


class UploadStatus(models.Model):
value = models.CharField(max_length=64)
display_name = models.CharField(max_length=64)


class MappingStatus(models.Model):
value = models.CharField(max_length=64)
display_name = models.CharField(max_length=64)


class ClassificationSystem(BaseModel):
"""
Class for 'classification system', i.e. SNOMED or ICD-10 etc.
Expand Down

0 comments on commit 0375fb5

Please sign in to comment.