Skip to content

Commit 3fba960

Browse files
Rebuild documentation.
1 parent 3e6fb86 commit 3fba960

File tree

69 files changed

+2694
-1948
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2694
-1948
lines changed

docs/transformation-documentation/CdsVisitDetail.json

Lines changed: 24 additions & 24 deletions
Large diffs are not rendered by default.

docs/transformation-documentation/CdsVisitDetail.svg

Lines changed: 85 additions & 85 deletions
Loading

docs/transformation-documentation/CdsVisitOccurrenceWithSpell.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@
191191
"lookup_table_markdown": null
192192
},
193193
{
194-
"name": "admitted_from_concept_id",
195-
"operation_description": "Lookup admission source concept.",
194+
"name": "admitted_from_source_value",
195+
"operation_description": "Value copied from `SourceofAdmissionCode`",
196196
"dataSource": [
197197
{
198198
"name": "SourceofAdmissionCode",
@@ -206,11 +206,11 @@
206206
}
207207
],
208208
"query": "\nselect\n\tl1.NHSNumber,\n\tl5.HospitalProviderSpellNumber,\n\tmin (l5.EpisodeStartDate) as EpisodeStartDate,\n\tcoalesce \n\t(\n\t\tmin (l5.EpisodeStartTime), \n\t\t'000000'\n\t) as EpisodeStartTime,\n\tcoalesce \n\t(\n\t\tmax (l5.EpisodeEndDate), \n\t\tmax (l1.CDSActivityDate)\n\t) as EpisodeEndDate,\n\tcoalesce \n\t(\n\t\tmax (l5.EpisodeEndTime), \n\t\t'000000'\n\t) as EpisodeEndTime,\n\tcase \n\t\twhen max(l5.AdmissionMethodCode) in ('21','24') and max(l5.PatientClassification) = 1 then 262\n when max(l5.AdmissionMethodCode) in ('21','24') then 9203\n when max(l5.PatientClassification) in (1) then 9201\n when max(l4.LocationClass) in ('02') then 581476\n\t\telse 9202\n\tend as VisitOccurrenceConceptId, -- \"visit_concept_id\"\n\tcase \n\t\twhen max(l5.EpisodeEndDate) is null and max(l5.DischargeDateHospitalProviderSpell) is null then 32220\n else 32818\n\tend as VisitTypeConceptId,\n\tmax (l5.SourceofAdmissionCode) as SourceofAdmissionCode,\n\tmax (l5.DischargeDestinationCode) as DischargeDestinationCode\nfrom omop_staging.cds_line01 l1\n\tleft join omop_staging.cds_line04 l4 \n\t\ton l1.MessageId = l4.MessageId -- Location Details \n\tleft join omop_staging.cds_line05 l5 \n\t\ton l1.MessageId = l5.MessageId -- Hospital Provider Spell\n\tinner join dbo.Code c \n\t\ton c.Code = l1.ActivityTreatmentFunctionCode\nwhere l1.CDSUpdateType = 9 -- New/Modification (1 = Delete)\n\tand l1.NHSNumber is not null\n\tand c.CodeTypeId = 2 -- activity_treatment_function_code\n\tand l5.HospitalProviderSpellNumber is not null\ngroup by \n\tl1.NHSNumber, \n\tl5.HospitalProviderSpellNumber;\n\t",
209-
"lookup_table_markdown": "\r\n\r\n|SourceofAdmissionCode|admitted_from_concept_id|notes|\r\n|------|-----|-----|\r\n|19|581476|Home Visit|\r\n|29|8602|Temporary Lodging|\r\n|37|38003619|Prison / Correctional Facility|\r\n|40|38003619|Prison / Correctional Facility|\r\n|42|38003619|Prison / Correctional Facility|\r\n|49|38004284|Psychiatric Hospital|\r\n|51|8717|Inpatient Hospital|\r\n|52|8650|Birthing Center|\r\n|53|8976|Psychiatric Residential Treatment Center|\r\n|55|8863|Skilled Nursing Facility|\r\n|56|38004306|Custodial Care Facility|\r\n|66|38004205|Foster Care Agency|\r\n|79|8650|Birthing Center|\r\n|87|8717|Inpatient Hospital|\r\n|88|8546|Hospice|\r\n|98||No mapping possible|\r\n|99||No mapping possible|\r\n\r\nNotes\r\n* [Admission Source](https://www.datadictionary.nhs.uk/data_elements/admission_source__hospital_provider_spell_.html)\r\n"
209+
"lookup_table_markdown": null
210210
},
211211
{
212-
"name": "admitted_from_source_value",
213-
"operation_description": "Value copied from `SourceofAdmissionCode`",
212+
"name": "admitted_from_concept_id",
213+
"operation_description": "Lookup admission source concept.",
214214
"dataSource": [
215215
{
216216
"name": "SourceofAdmissionCode",
@@ -224,7 +224,7 @@
224224
}
225225
],
226226
"query": "\nselect\n\tl1.NHSNumber,\n\tl5.HospitalProviderSpellNumber,\n\tmin (l5.EpisodeStartDate) as EpisodeStartDate,\n\tcoalesce \n\t(\n\t\tmin (l5.EpisodeStartTime), \n\t\t'000000'\n\t) as EpisodeStartTime,\n\tcoalesce \n\t(\n\t\tmax (l5.EpisodeEndDate), \n\t\tmax (l1.CDSActivityDate)\n\t) as EpisodeEndDate,\n\tcoalesce \n\t(\n\t\tmax (l5.EpisodeEndTime), \n\t\t'000000'\n\t) as EpisodeEndTime,\n\tcase \n\t\twhen max(l5.AdmissionMethodCode) in ('21','24') and max(l5.PatientClassification) = 1 then 262\n when max(l5.AdmissionMethodCode) in ('21','24') then 9203\n when max(l5.PatientClassification) in (1) then 9201\n when max(l4.LocationClass) in ('02') then 581476\n\t\telse 9202\n\tend as VisitOccurrenceConceptId, -- \"visit_concept_id\"\n\tcase \n\t\twhen max(l5.EpisodeEndDate) is null and max(l5.DischargeDateHospitalProviderSpell) is null then 32220\n else 32818\n\tend as VisitTypeConceptId,\n\tmax (l5.SourceofAdmissionCode) as SourceofAdmissionCode,\n\tmax (l5.DischargeDestinationCode) as DischargeDestinationCode\nfrom omop_staging.cds_line01 l1\n\tleft join omop_staging.cds_line04 l4 \n\t\ton l1.MessageId = l4.MessageId -- Location Details \n\tleft join omop_staging.cds_line05 l5 \n\t\ton l1.MessageId = l5.MessageId -- Hospital Provider Spell\n\tinner join dbo.Code c \n\t\ton c.Code = l1.ActivityTreatmentFunctionCode\nwhere l1.CDSUpdateType = 9 -- New/Modification (1 = Delete)\n\tand l1.NHSNumber is not null\n\tand c.CodeTypeId = 2 -- activity_treatment_function_code\n\tand l5.HospitalProviderSpellNumber is not null\ngroup by \n\tl1.NHSNumber, \n\tl5.HospitalProviderSpellNumber;\n\t",
227-
"lookup_table_markdown": null
227+
"lookup_table_markdown": "\r\n\r\n|SourceofAdmissionCode|admitted_from_concept_id|notes|\r\n|------|-----|-----|\r\n|19|581476|Home Visit|\r\n|29|8602|Temporary Lodging|\r\n|37|38003619|Prison / Correctional Facility|\r\n|40|38003619|Prison / Correctional Facility|\r\n|42|38003619|Prison / Correctional Facility|\r\n|49|38004284|Psychiatric Hospital|\r\n|51|8717|Inpatient Hospital|\r\n|52|8650|Birthing Center|\r\n|53|8976|Psychiatric Residential Treatment Center|\r\n|55|8863|Skilled Nursing Facility|\r\n|56|38004306|Custodial Care Facility|\r\n|66|38004205|Foster Care Agency|\r\n|79|8650|Birthing Center|\r\n|87|8717|Inpatient Hospital|\r\n|88|8546|Hospice|\r\n|98||No mapping possible|\r\n|99||No mapping possible|\r\n\r\nNotes\r\n* [Admission Source](https://www.datadictionary.nhs.uk/data_elements/admission_source__hospital_provider_spell_.html)\r\n"
228228
},
229229
{
230230
"name": "discharged_to_concept_id",

docs/transformation-documentation/CdsVisitOccurrenceWithSpell.svg

Lines changed: 4 additions & 4 deletions
Loading

0 commit comments

Comments
 (0)