Skip to content

Commit

Permalink
export rct data (#136)
Browse files Browse the repository at this point in the history
* export rct data

* small notebook change
  • Loading branch information
rubenpeters91 authored Oct 22, 2024
1 parent 90e70cb commit 3fe46a7
Show file tree
Hide file tree
Showing 4 changed files with 410 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.4.4] - 2024-10-21

### Changed
- Added SQL query for RCT export and notebook to export total dataset and small initial analysis

## [1.4.3] - 2024-10-17

### Fixed
Expand Down
90 changes: 90 additions & 0 deletions data/sql/data_rct_export.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
SELECT APP.identifier_value AS APP_ID
,HOOFDAGENDA.[name] AS hoofdagenda
,SUBAGENDA.specialty_code
,SUBAGENDA.name
,ENC.type1_display AS soort_consult
,ENC.type1_code AS afspraak_code
,APP.[start]
,APP.[end]
,APP.[status]
,APP.[status_code_original]
,APP.[cancelationReason_code]
,APP.[cancelationReason_display]
FROM [DWH].[models].[HealthcareService] SUBAGENDA JOIN [DWH].[models].[HealthcareService] HOOFDAGENDA
ON SUBAGENDA.partOf_HealthcareService_value = HOOFDAGENDA.identifier_value AND SUBAGENDA.partOf_HealthcareService_system = HOOFDAGENDA.identifier_system
JOIN [DWH].[models].[Appointment] APP
ON APP.participant_actor_HealthcareService_value = SUBAGENDA.identifier_value AND APP.participant_actor_HealthcareService_system = SUBAGENDA.identifier_system
JOIN [DWH].[models].Encounter ENC
ON ENC.appointment_Appointment_system = APP.identifier_system AND ENC.appointment_Appointment_value = APP.identifier_value
WHERE 1=1
AND SUBAGENDA.identifier_system = 'https://metadata.umcutrecht.nl/ids/HixSubAgenda'
AND HOOFDAGENDA.identifier_system = 'https://metadata.umcutrecht.nl/ids/HixAgenda'
AND (
HOOFDAGENDA.identifier_value IN (
-- Poli blauw
'ZH0156', -- Kind-Nefrologie
'ZH0139', -- Kind-Endocrinologie
'ZH0138', -- Kind-Dermatologie
'ZH0129', -- Kind-Algemene Pediatrie
-- Longziekten
'ZH0183', -- Longziekten
'ZH0034', -- Centrum voor Thuisbeademing
-- Cardiologie
'ZH0017' -- cardiologie
) OR
(
HOOFDAGENDA.identifier_value IN (
-- Revalidatie en sport
'ZH0307', -- RF&S Revalidatiegeneeskunde
'ZH0435' -- RF&S Sportgeneeskunde
) AND ENC.type1_code IN(
'CF15',
'CF30',
'CF45',
'CF60',
'CFCRE',
'CFMYDY',
'CFNOIC',
'CFOIMD',
'CFOIMV',
'CFORT',
'CFPRB',
'CFPRBSAB',
'NFALS',
'NFCVA',
'NFCWP',
'NFMYDY',
'NFNAH',
'NFNMZ',
'NFNONC',
'NFPRB',
'NFREV',
'NFREVK',
'NFRONC',
'NFSARC',
'NFSD',
'NFSPAS',
'NFTRAUMA',
'NFVCI',
'NF',
'NFSO',
'VBSOARTS',
'VBSOHART',
'VBSOHINS',
'VBSOINSP',
'VGSO+ART',
'VGSO+INS',
'VGSOARTS',
'VGSOINSP',
'VMITCHAR',
'VMITHARC',
'VMITHART',
'VMITHINS'
)
)
)
AND APP.identifier_system = 'https://metadata.umcutrecht.nl/ids/HixAgendaAfspraak'
AND APP.start >= '2024-06-18'
AND APP.start <= '2024-10-17'
AND ENC.identifier_system = 'https://metadata.umcutrecht.nl/ids/HixAgendaAfspraak'
ORDER BY HOOFDAGENDA.name, SUBAGENDA.name, APP.start
Loading

0 comments on commit 3fe46a7

Please sign in to comment.