Skip to content
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

Fix duplicate patients with multiple visits in CSV upload #212

Merged
merged 4 commits into from
Jul 24, 2024
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
7 changes: 6 additions & 1 deletion project/npda/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.contrib import admin

from .models import NPDAUser, OrganisationEmployer, Patient, Site, Visit, VisitActivity
from .models import NPDAUser, OrganisationEmployer, Patient, Site, Visit, VisitActivity, AuditCohort
from django.contrib.sessions.models import Session


Expand Down Expand Up @@ -33,6 +33,11 @@ class VisitAdmin(admin.ModelAdmin):
class VisitActivityAdmin(admin.ModelAdmin):
search_fields = ("activity_datetime", "pk", "ip_address")

@admin.register(AuditCohort)
class AuditCohortAdmin(admin.ModelAdmin):
search_fields = ["pk"]


@admin.register(Session)
class SessionAdmin(admin.ModelAdmin):

Expand Down
3 changes: 2 additions & 1 deletion project/npda/dummy_sheets/dummy_sheet.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
NHS Number,Date of Birth,Postcode of usual address,Stated gender,Ethnic Category,Diabetes Type,Date of Diabetes Diagnosis,Date of leaving service,Reason for leaving service,Death Date,GP Practice Code,PDU Number,Visit/Appointment Date,Patient Height (cm),Patient Weight (kg),Observation Date (Height and weight),Hba1c Value,HbA1c result format,Observation Date: Hba1c Value,Diabetes Treatment at time of Hba1c measurement,"If treatment included insulin pump therapy (i.e. option 3 or 6 selected), was this part of a closed loop system?","At the time of HbA1c measurement, in addition to standard blood glucose monitoring (SBGM), was the patient using any other method of glucose monitoring?",Systolic Blood Pressure,Diastolic Blood pressure,Observation Date (Blood Pressure),Foot Assessment / Examination Date,Retinal Screening date,Retinal Screening Result,Urinary Albumin Level (ACR),Observation Date: Urinary Albumin Level,Albuminuria Stage,Total Cholesterol Level (mmol/l),Observation Date: Total Cholesterol Level,Observation Date: Thyroid Function,"At time of, or following measurement of thyroid function, was the patient prescribed any thyroid treatment?",Observation Date: Coeliac Disease Screening,Has the patient been recommended a Gluten-free diet?,Observation Date - Psychological Screening Assessment,Was the patient assessed as requiring additional psychological/CAMHS support outside of MDT clinics?,Does the patient smoke?,Date of offer of referral to smoking cessation service (if patient is a current smoker),Date of Level 3 carbohydrate counting education received,Was the patient offered an additional appointment with a paediatric dietitian?,Date of additional appointment with dietitian,Was the patient using (or trained to use) blood ketone testing equipment at time of visit?,Date that influenza immunisation was recommended,Date of provision of advice ('sick-day rules') about managing diabetes during intercurrent illness or episodes of hyperglycaemia,Start date (Hospital Provider Spell),Discharge date (Hospital provider spell),Reason for admission,Only complete if DKA selected in previous question: During this DKA admission did the patient receive any of the following therapies?,Only complete if OTHER selected: Reason for admission (free text)
719 573 0220,26/10/2020,S43 1BN,1,N,1,01/05/2021,,,,G7103993,PZ041,22/11/2022,158,58,22/11/2022,50,1,22/11/2022,7,,2,111,83,22/11/2022,22/11/2022,14/06/2022,2,0,22/11/2022,1,4.9,22/11/2022,22/11/2022,1,22/11/2022,2,16/10/2021,1,1,,02/06/2023,1,13/07/2023,2,03/03/2023,03/03/2023,,,3,2,
719 573 0220,26/10/2020,S43 1BN,1,N,1,01/05/2021,,,,G7103993,PZ041,22/11/2022,158,58,22/11/2022,50,1,22/11/2022,7,,2,111,83,22/11/2022,22/11/2022,14/06/2022,2,0,22/11/2022,1,4.9,22/11/2022,22/11/2022,1,22/11/2022,2,16/10/2021,1,1,,02/06/2023,1,13/07/2023,2,03/03/2023,03/03/2023,,,,2,
719 573 0220,26/10/2020,S43 1BN,1,N,1,01/05/2021,,,,G7103993,PZ041,24/11/2022,158,58,24/11/2022,50,1,24/11/2022,7,,2,111,83,24/11/2022,24/11/2022,14/06/2022,2,0,24/11/2022,1,4.9,24/11/2022,,,,,,,,,,,,,03/03/2023,03/03/2023,,,,2,
653 765 1948,03/10/2015,BS10 5AH,1,L,1,08/12/2015,,,,G7103993,PZ041,06/07/2016,144,40,06/07/2016,59,1,06/07/2016,3,1,1,103,47,06/07/2016,,13/04/2017,2,0,06/07/2016,1,4.9,06/07/2016,,,,1,13/09/2018,1,2,01/09/2022,10/02/2019,1,10/07/2023,2,09/01/2017,09/01/2017,05/11/2016,09/11/2016,1,3,
758 447 7372,06/12/2016,IV15 9NZ,1,P,1,26/08/2019,,,,G7103993,PZ041,01/01/2023,160,13,01/01/2023,48,1,01/01/2023,8,,3,91,57,01/01/2023,,01/10/2019,1,0,01/01/2023,99,5.7,01/01/2023,01/01/2023,2,01/01/2023,2,25/11/2022,2,2,11/11/2020,21/07/2022,2,,2,09/08/2022,09/08/2022,,,6,3,
385 576 6320,18/07/2015,BL8 9RU,1,G,1,13/03/2022,,,,G7103993,PZ041,25/04/2022,125,19,25/04/2022,103,1,25/04/2022,3,2,4,99,47,25/04/2022,25/04/2022,25/09/2023,2,0,25/04/2022,1,4.9,25/04/2022,,,,2,30/10/2022,2,2,03/06/2022,23/11/2022,2,,2,12/05/2022,12/05/2022,11/08/2022,15/08/2022,4,4,
Expand Down
Loading